@cardenelabs/dragon 0.46.0 → 0.46.3
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.ja.md +331 -0
- package/README.md +200 -188
- package/dist/cli.cjs +61 -15
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +61 -15
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +57 -12
- package/dist/export.cjs.map +1 -1
- package/dist/export.js +57 -12
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +54 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +54 -8
- package/dist/index.js.map +1 -1
- package/dist/light/index.cjs +52 -6
- package/dist/light/index.cjs.map +1 -1
- package/dist/light/index.js +52 -6
- package/dist/light/index.js.map +1 -1
- package/dist/node.cjs +90 -3
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +90 -3
- package/dist/node.js.map +1 -1
- package/dist/player.global.js +3 -3
- package/package.json +2 -2
- package/src/field-messages.ts +4 -0
- package/src/messages.ts +10 -3
- package/src/nearest.ts +37 -0
- package/src/parser.ts +1 -1
- package/src/schema.ts +21 -3
package/dist/player.global.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var DragonPlayer=(()=>{var jn=Object.defineProperty;var Ar=Object.getOwnPropertyDescriptor;var jr=Object.getOwnPropertyNames;var Rr=Object.prototype.hasOwnProperty;var Tt=(t,n)=>{for(var a in n)jn(t,a,{get:n[a],enumerable:!0})},Dr=(t,n,a,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of jr(n))!Rr.call(t,l)&&l!==a&&jn(t,l,{get:()=>n[l],enumerable:!(p=Ar(n,l))||p.enumerable});return t};var Ir=t=>Dr(jn({},"__esModule",{value:!0}),t);var jo={};Tt(jo,{mountDiagram:()=>Lr});var Xn={};Tt(Xn,{drawGit:()=>Ws,layoutGit:()=>Ts});var us={clear:{name:"\u6F84\u3093\u3060\u8272",note:"\u767D\u3044\u5730\u306B\u3001\u4E2D\u304F\u3089\u3044\u306E\u660E\u308B\u3055\u306E\u9BAE\u3084\u304B\u306A 6 \u8272\u3002\u4ECA\u306E\u898B\u672C\u5E33\u306E\u8272",light:{page:"#f3f4f7",bg:"#ffffff",surf:"#ffffff",sunk:"#f5f6f8",ink:"#12141a",ink2:"#3f4451",mute:"#6b7180",hair:"#12141a1c",line:"#12141a40",sh:"#101828","on-c":"#ffffff","c-blue":"#467deb","t-blue":"#2e62ce","c-amber":"#d28008","t-amber":"#975b04","c-green":"#0ea886","t-green":"#07775e","c-violet":"#6c3bb2","t-violet":"#6c3bb2","c-rose":"#ba3e40","t-rose":"#b83c3f","c-slate":"#5d6677","t-slate":"#5d6677",coin:"#e9b114",coint:"#856300",coinin:"#a8740c",tint:"5%",edge:"20%",shA:".05",shB:".08",carry:"#65686f"},dark:{page:"#08090c",bg:"#0d0e12",surf:"#17191f",sunk:"#121419",ink:"#eceef3",ink2:"#c4c8d2",mute:"#9198a6",hair:"#eceef31f",line:"#eceef340",sh:"#000000","on-c":"#0d0e12","c-blue":"#7e7ef6","t-blue":"#989cfd","c-amber":"#c78135","t-amber":"#dd954b","c-green":"#20ac7a","t-green":"#35b986","c-violet":"#695b9f","t-violet":"#a79ae3","c-rose":"#bc434b","t-rose":"#fd7d81","c-slate":"#9ba3b2","t-slate":"#9da5b4",coin:"#f0c040",coint:"#f0c040",coinin:"#9a6a0c",tint:"6%",edge:"19%",shA:".45",shB:".35"}},paper:{name:"\u7D19\u3068\u58A8",note:"\u751F\u6210\u308A\u306E\u7D19\u306E\u5730\u306B\u3001\u85CD / \u9EC4\u571F / \u82D4 / \u8461\u8404 / \u6731 / \u920D\u306E\u304F\u3059\u3093\u3060 6 \u8272",light:{page:"#ece7dd",bg:"#f9f6f0",surf:"#fffcf6",sunk:"#f2ede4",ink:"#221e18",ink2:"#4b453b",mute:"#7b7366",hair:"#221e181f",line:"#221e1847",sh:"#3a2a10","on-c":"#fffcf6","c-blue":"#487dd5","t-blue":"#2d60b5","c-amber":"#c38405","t-amber":"#885a01","c-green":"#57a271","t-green":"#237143","c-violet":"#904698","t-violet":"#904698","c-rose":"#a9513e","t-rose":"#9f4836","c-slate":"#6a645a","t-slate":"#696359",coin:"#d4a52a",coint:"#7d5e05",coinin:"#9a7016",tint:"6%",edge:"22%",shA:".06",shB:".07",carry:"#68635c"},dark:{page:"#0e0d0b",bg:"#15130f",surf:"#1e1b17",sunk:"#191612",ink:"#ede6d8",ink2:"#cbc2b1",mute:"#9c9283",hair:"#ede6d81f",line:"#ede6d842",sh:"#000000","on-c":"#15130f","c-blue":"#5785d5","t-blue":"#76a6f9","c-amber":"#be8802","t-amber":"#d59e2f","c-green":"#52aa71","t-green":"#61b87e","c-violet":"#90529b","t-violet":"#d08edb","c-rose":"#bb4e3d","t-rose":"#f98672","c-slate":"#a9a295","t-slate":"#aca598",coin:"#dcb24e",coint:"#dcb24e",coinin:"#8a6a14",tint:"6%",edge:"19%",shA:".45",shB:".35"}},night:{name:"\u591C\u306E\u8A08\u5668",note:"\u9752\u307F\u306E\u9ED2\u306E\u5730\u306B\u3001\u5149\u308B\u6C34\u8272 / \u7425\u73C0 / \u82E5\u7DD1 / \u83EB / \u6843 \u306E 6 \u8272\u3002\u660E\u308B\u3044\u5074\u306F\u9752\u7070\u306E\u5730",light:{page:"#e9eef5",bg:"#f6f9fc",surf:"#ffffff",sunk:"#eef3f8",ink:"#0b1424",ink2:"#34425a",mute:"#64748b",hair:"#0b14241c",line:"#0b142440",sh:"#0b1424","on-c":"#ffffff","c-blue":"#0385cd","t-blue":"#086aa3","c-amber":"#ba8e0f","t-amber":"#7f5f04","c-green":"#0a8857","t-green":"#027449","c-violet":"#5839ba","t-violet":"#5839ba","c-rose":"#dd4a94","t-rose":"#b82375","c-slate":"#64748b","t-slate":"#56667c",coin:"#eab308",coint:"#7e6005",coinin:"#a16207",tint:"5%",edge:"22%",shA:".06",shB:".09",carry:"#596579"},dark:{page:"#060a12",bg:"#0a101c",surf:"#111a2a",sunk:"#0d1522",ink:"#e6edf7",ink2:"#b8c4d6",mute:"#8090a8",hair:"#e6edf71c",line:"#9fb3d145",sh:"#000000","on-c":"#0a101c","c-blue":"#3884b6","t-blue":"#62ace1","c-amber":"#be8533","t-amber":"#d59b4b","c-green":"#3ba774","t-green":"#4fb884","c-violet":"#7d4ecd","t-violet":"#b494fd","c-rose":"#bc3a74","t-rose":"#ff77ad","c-slate":"#96a3b5","t-slate":"#99a6b8",coin:"#facc15",coint:"#facc15",coinin:"#a16207",tint:"6%",edge:"19%",shA:".5",shB:".4"}}};var It={sans:"Noto Sans JP Variable",mono:"JetBrains Mono Variable"},Fr={0:590,1:590,2:590,3:590,4:590,5:590,6:590,7:590,8:590,9:590," ":228,"!":371,'"':575,"#":590,$:590,"%":963,"&":740,"'":325,"(":378,")":378,"*":507,"+":590,",":325,"-":371,".":325,"/":390,":":325,";":325,"<":590,"=":590,">":590,"?":514,"@":1007,A:642,B:682,C:657,D:715,E:616,F:586,G:718,H:758,I:330,J:568,K:686,L:579,M:854,N:750,O:771,P:668,Q:771,R:682,S:624,T:626,U:748,V:619,W:915,X:627,Y:581,Z:614,"[":378,"\\":390,"]":378,"^":590,_:568,"`":626,a:591,b:644,c:528,d:645,e:581,f:372,g:598,h:640,i:305,j:306,k:605,l:315,m:964,n:641,o:626,p:645,q:645,r:437,s:495,t:421,u:638,v:576,w:863,x:562,y:575,z:512,"{":378,"|":297,"}":378,"~":590,"\u2026":1e3,"\u2212":590,"\xD7":1e3,"\u2192":1e3,"\u2190":1e3,"\u2191":1e3,"\u2193":1e3,"\u2013":545,"\u2014":908,"\u2018":325,"\u2019":325,"\u201C":575,"\u201D":575,"\xB0":404,"\xB1":1e3,"\xB7":593,"\u2022":379},_r=600,Br=11904,Yt=1e3;function hs(t,n){return(t.codePointAt(0)??0)>=Br?Yt:n==="mono"?_r:Fr[t]??Yt}var Gr="paper",Rn=Object.fromEntries(Object.entries(us).map(([t,n])=>[t,{id:t,...n}]));function gs(t){return(t!==void 0&&Object.hasOwn(Rn,t)?Rn[t]:void 0)??Rn[Gr]}var Yr=["page","bg","surf","sunk","ink","ink2","mute","hair","line","sh","on-c","c-blue","t-blue","c-amber","t-amber","c-green","t-green","c-violet","t-violet","c-rose","t-rose","c-slate","t-slate","coin","coint","coinin","tint","edge","shA","shB","carry"],Vr=new Set(Yr),ys=t=>Vr.has(t);function bs(t){if(typeof t!="string"||!/^[\w\s#%.,()/+-]+$/u.test(t)||/url\(/iu.test(t))return!1;let n=0;for(let a of t)if(n+=a==="("?1:a===")"?-1:0,n<0)return!1;return n===0}function Vt(t,n){return Object.entries(t[n]).map(([a,p])=>`--${a}:${p}`).join(";")}var Kt=`--sans:"${It.sans}";--mono:"${It.mono}"`,bt=["blue","amber","green","violet","rose"],Pe=(t,n,a="sans")=>({size:t,weight:n,family:a}),A={boxName:Pe(13,650),boxSub:Pe(11,500),boxSubStrong:Pe(11,700),regionName:Pe(12.5,700),regionNote:Pe(11,500),label:Pe(11,600,"mono"),labelJa:Pe(11,650),action:Pe(11,650),badge:Pe(10.5,700,"mono"),carrier:Pe(10.5,700,"mono"),carrierJa:Pe(10.5,700),stripTitle:Pe(12.5,700),fieldName:Pe(10.5,600),fieldValue:Pe(12,600,"mono"),fieldValueJa:Pe(12,600),tag:Pe(10.5,700),miniTitle:Pe(10.5,700),stepTitle:Pe(15,700),stepBody:Pe(13.5,500),stepNo:Pe(13,700,"mono"),button:Pe(14,700),gitId:Pe(11,700),gitHash:Pe(10.5,600,"mono"),gitNote:Pe(10.5,650),treeHash:Pe(13.5,700,"mono"),treeName:Pe(10.5,600),rootHash:Pe(15,700,"mono"),rootName:Pe(11,700),treeCard:Pe(11.5,650),chip:Pe(10.5,700,"mono"),stamp:Pe(11,700),timeHead:Pe(11,650,"mono"),timeRow:Pe(11,600),timeTick:Pe(10.5,600,"mono"),timePeriod:Pe(11.5,650),timeRange:Pe(10.5,500,"mono"),pointName:Pe(11,700,"mono"),pointState:Pe(11.5,700),spanText:Pe(11,650),emptyText:Pe(11,700),meterLine:Pe(10.5,700,"mono")},w={gap:10,margin:14,box:{h:72,minW:92,padX:12,radius:12,icon:24,iconRadius:7,iconY:-16,iconScale:.74,nameY:12,nameMid:5,subY:27,subMid:20},region:{pad:18,gap:10,radius:14,inset:14,icon:24,iconRadius:7,iconScale:.68,nameY:58,line:16,minH:108},architecture:{columns:4,columnGap:56,maxColumnGap:160,rowGap:44,labelRoom:16},sequence:{columnGap:40,labelRoom:16,labelOffset:16,firstRow:10,rowGap:6,stepGap:6,minPitch:32,tail:10,selfW:34,selfH:18},state:{columns:4,columnGap:64,rowGap:108,labelRoom:16,start:7,end:{r:9,inner:5},drop:56,below:64,beside:38,text:16,loop:{w:24,h:34,samples:12,badgeAt:.6},side:{pad:16,gap:76,lane:30,entry:28},ghost:{h:52,pad:12,gap:10,nameY:-2,subY:14},done:{r:6.5,inset:13},pastLabel:.85},git:{x0:120,pitch:90,textGap:12,r:12,orphan:13.5,topLine:120,line:90,topBelow:30,below:82,bare:62,above:18,under:27,lineStep:13,tagTop:58,tag:30,row:22,turn:60,samples:12,boxGap:24,labelUnder:50,colors:["blue","violet","green","amber","rose"]},tree:{w:74,h:44,padX:10,radius:10,root:{w:112,h:54,radius:13,iconX:10,textX:46,padR:14,nameY:-4,hashY:14},hashY:-1,nameY:14,oneY:4.5,slotGap:12,top:16,row:102,card:{drop:78,h:30,minW:70,padX:10,icon:12,gap:6,glyph:.62,radius:9},boxGap:24,badgeAlong:22,faint:.42,color:"violet",rootColor:"green"},lineup:{padX:12,h:61,radius:10,textY:20,trackY:33,textGap:10,faint:.35,chip:{w:25,h:18,gap:4,radius:4,padX:3},seal:{over:3,radius:5,stripe:7},stamp:{h:22,padX:8,radius:5,tilt:-4,color:"green"}},time:{width:728,axisX:118,right:16,gutterGap:12,head:22,boxTop:34,boxGap:36,zoomBottom:14,sep:12,zoomGap:12,rowsTop:24,row:20,rowGap:6,markRatio:.5,markMin:1.5,markMax:18,markRadius:1.5,shade:8,frame:2.5,emptyR:1.7,point:{drop:40,r:9,text:15,nameY:-2,stateY:12,link:10,end:6,room:30,plain:12,glyph:.62},bracket:{gap:12,tick:6,text:16,lane:34},box:{pad:6,tagX:12,tagH:16,tagPadX:7},axisGap:18,major:12,minor:6,minorPx:40,tickY:18,rangeY:14,nameGap:8,ticks:6,bottom:12,needle:{over:8,head:6,dot:3.5},meter:{w:150,h:6,y:36,mark:5,textY:59,color:"amber"}},edge:{inset:3,arrow:6,arrowHalf:3.5,parallel:5,ghostDash:5,flowDash:9,bend:12},label:{h:20,padX:9,radius:10,offset:22,side:14,search:4,searchMax:400,soft:6,touch:2},action:{h:22,padX:10,radius:11},badge:{r:9.5,ring:9,inset:4,along:14,short:44},carrier:{envW:24,envH:17,coinR:6.5,coinIn:3.8,tagH:18,tagPadX:8,samples:16},slot:{gap:6,pad:3,spread:4,h:24,radius:7,clear:2,lifeline:5,mark:4},mark:{pad:3,radius:5,dash:4,gap:3},strip:{h:72,line:44,titleRow:40,pad:12,icon:24,titleX:44,fieldGap:22,sepInset:14,tagGap:6,tagH:15,tagPadX:7,nameY:22,valueY:43,trail:{r:5.4,step:16},now:{r:3,gap:7}},stroke:{git:2.25,gitOrphan:1.5,mark:1.6,slot:1.2,hair:1,edge:1.7,edgeOn:2.25,arrow:1.5,flow:1.3,halo:7,on:1.75,glyph:2,lifeline:1.2,envelope:1.5,badgeRing:1.5,path:1.6,end:1.6,done:1.2,trail:1.2,timeSlot:.6,timeFrame:1.25,timeAxis:1,timeSpan:1.5,timeDrop:1.4,timePoint:1.75,timeFlag:1.8,timeNeedle:1.25,timeMeter:1.25,tree:1.5,treeTrail:2.6,treeCon:1.3,stamp:2},shadow:{near:.8,far:4,nearY:1,farY:3},mini:{w:168,pad:8,title:14,inset:12,radius:10},follow:{aspect:.75,minH:320,fitMinH:160,ease:.6,narrow:440,badgeRoom:8,headRoom:10,head:{pad:8,h:40,nameY:17,subY:31}},mix:{slot:45,icon:14,regionIcon:16,regionIconEdge:34,cap:12,capEdge:42,badgePast:14,badgePastEdge:70,mini:62,miniBand:16,miniBandEdge:36,view:6,side:4,sideEdge:36,ghostEdge:60,path:55,past:72,timeShade:3.5,timeSpan:6,timeEmpty:8,timeGuide:50,chipPlain:34,sealDark:60,sealLight:34},baseline:{label:3.8,badge:3.5,carrier:3.7,stripTitle:4.5,tag:3.6,action:3.8,mark:4},rise:5,popFrom:.4,player:{gap:10,radius:12,button:36,touch:44,hidden:1,focus:2,narrow:440}},oe={intro:1.4,outro:4.6,tail:.6,stepBase:1.2,perChar:.025,stepMin:2.2,stepMax:5,dwell:1.2,edgeAt:.1,stagger:.5,draw:.55,drawCarry:.9,action:.9,change:.12,minShow:.8,labelDelay:.15,fade:.3,popFade:.4,untilFade:.2,still:.45,done:.3,time:{axis:11.5,unitMin:.12,unitMax:.4,wait:.15,after:.15,reset:.05},lineup:{slide:.7,seal:.6,stagger:.2,cut:.01}},xs=10.5,fe={inOut:"cubic-bezier(.65,0,.35,1)",out:"cubic-bezier(.22,1,.36,1)",pop:"cubic-bezier(.34,1.56,.64,1)"};var Wt=t=>Object.keys(t),Bo=Wt({sequence:!0,architecture:!0,state:!0,git:!0,time:!0,tree:!0,lineup:!0}),Nt=["start","finish"],Kr=["scale","period","row","point","zoom","mark","span"];var Wr=["leaf","node"],Hr=["item","line","seal","open","pick","stamp"],Dn=12;var Go=["group","end","box","strip","step","say","code","source","act","note","set","branch","commit",...Kr,...Wr,...Hr];var xt="HEAD";var Yo=Wt({coin:!0,none:!0}),Vo=Wt({fixed:!0,follow:!0}),Ko=Wt({above:!0,below:!0,left:!0,right:!0});var Ie=t=>[...t].some(n=>(n.codePointAt(0)??0)>=11904);function Xr(t,n){return n==="mono"&&Ie(t)?"sans":n}function pe(t,n){let a=Xr(t,n.family),p=0;for(let l of t)p+=hs(l,a);return p*n.size/Yt}function Ge(t,n,a,p,l="start"){let e=pe(t,p);return{x:l==="middle"?n-e/2:n,y:a-p.size*.8,w:e,h:p.size}}function $t(t){return t.steps.flatMap((n,a)=>n.events.flatMap((p,l)=>p.type==="edge"?[{step:a,event:l,edge:p}]:[]))}function He(t){let n=Cn(t),a=new Map;return t.boxes.forEach((p,l)=>{let e=p.region===void 0?void 0:n.get(p.region);a.set(p.id,p.color??e??bt[l%bt.length])}),a}function Cn(t){let n=new Map;return(t.regions??[]).forEach((a,p)=>n.set(a.id,a.color??bt[p%bt.length])),n}var at=(t,n)=>t.carry.kind==="coin"?"coin":n.get(t.from)??"slate";function tt(t,n,a){let p=t.boxes.find(e=>e.id===n);if(!p)return w.box.minW;let l=[pe(p.name,A.boxName),pe(p.sub??"",A.boxSub)];for(let e of t.steps)for(let s of e.events)s.type==="swap"&&s.box===n&&l.push(pe(s.text,A.boxSubStrong)),a&&s.type==="action"&&s.box===n&&l.push(pe(s.label,A.boxSubStrong));return Math.max(w.box.minW,Math.max(...l)+w.box.padX*2)}function lt(t){let n=w.carrier;return t.kind==="tag"?[(pe(t.text,Ie(t.text)?A.carrierJa:A.carrier)+n.tagPadX*2)/2,n.tagH/2]:t.kind==="coin"?[n.coinR,n.coinR]:[n.envW/2,n.envH/2]}var ws=t=>t.main+t.coin+(t.main>0&&t.coin>0?w.slot.spread:0);function kt(t){let n=new Map,a=new Set(t.boxes.map(p=>p.id));for(let p of t.steps)for(let l of p.events){if(l.type!=="edge"||l.carry.kind==="none")continue;let e=l.carry.kind==="coin"?"coin":"main",s=lt(l.carry)[0]*2;for(let r of[l.from,l.to]){if(!a.has(r))continue;let o=n.get(r)??{main:0,coin:0};o[e]=Math.max(o[e],s),n.set(r,o)}}return n}function vt(t,n,a){return t?(n?w.box.icon+w.slot.gap:0)+ws(t)+w.slot.pad*2+w.box.padX+a:0}function Pt(t,n,a=w.box.padX){if(!n)return;let p=w.box,l=w.slot,e=ws(n)+l.pad*2,s=t.icon?p.icon+l.gap:0,r=Math.max(t.x+p.padX,Math.min(t.cx-(s+e)/2,t.x+t.w-a-(s+e)));t.icon&&(t.iconX=r+p.icon/2),t.slot={x:r+s,y:t.cy+p.iconY-l.h/2,w:e,h:l.h}}function ft(t,n,a){let p=w.slot,l=(e,s)=>{let r=n.get(e),o=a.get(e);if(!r?.slot||!o)return;let i=r.slot.x+p.pad,c=r.slot.y+r.slot.h/2;return o.main>0&&o.coin>0?s.kind==="coin"?[i+o.main+p.spread+o.coin/2,c]:[i+o.main/2,c]:[r.slot.x+r.slot.w/2,c]};for(let e of t){if(e.carry.kind==="none")continue;let s=l(e.to,e.carry),r=l(e.from,e.carry);s&&(e.settle=s),r&&(e.wait=r)}}function wt(t,n){let a=Math.max(n.x-(t.x+t.w),t.x-(n.x+n.w)),p=Math.max(n.y-(t.y+t.h),t.y-(n.y+n.h));return Math.max(a,p)}function Ht(t,n,a=0){let p=n.x+a,l=n.y+a,e=n.x+n.w-a,s=n.y+n.h-a;if(e<=p||s<=l)return!1;for(let r=1;r<t.length;r++){let[o,i]=t[r-1],[c,m]=t[r],f=c-o,d=m-i,u=0,M=1,x=(h,g)=>{if(h===0)return g>0;let L=g/h;return h<0?u=Math.max(u,L):M=Math.min(M,L),u<M};if(x(-f,o-p)&&x(f,e-o)&&x(-d,i-l)&&x(d,s-i))return!0}return!1}function zr(t){let n={a:t[0],b:t[1]??t[0],length:-1};for(let a=1;a<t.length;a++){let p=t[a-1],l=t[a],e=Math.hypot(l[0]-p[0],l[1]-p[1]);e>n.length&&(n={a:p,b:l,length:e})}return{a:n.a,b:n.b,vertical:Math.abs(n.b[0]-n.a[0])<Math.abs(n.b[1]-n.a[1])}}function et(t,n){let a=n;for(let p=1;p<t.length;p++){let l=t[p-1],e=t[p],s=Math.hypot(e[0]-l[0],e[1]-l[1]);if(a<=s&&s>0)return[l[0]+(e[0]-l[0])*a/s,l[1]+(e[1]-l[1])*a/s];a-=s}return t[t.length-1]}function ut(t){let n=0;for(let a=1;a<t.length;a++){let p=t[a-1],l=t[a];n+=Math.hypot(l[0]-p[0],l[1]-p[1])}return n}function Et(t){let{w:n,h:a,samples:p}=w.state.loop,l=t.y+t.h,e=[t.cx+n/2,l],s=[t.cx+n*3/4,l+a*4/3],r=[t.cx-n*3/4,l+a*4/3],o=[t.cx-n/2,l+w.edge.inset];return Array.from({length:p+1},(i,c)=>{let m=c/p,f=1-m,d=u=>f*f*f*e[u]+3*f*f*m*s[u]+3*f*m*m*r[u]+m*m*m*o[u];return[d(0),d(1)]})}function Xt(t){let n=Math.max(...t.map(([l])=>l)),a=t[0][1],p=Math.max(...t.map(([,l])=>l));return[n+w.badge.r+w.badge.inset,a+(p-a)*w.state.loop.badgeAt]}function zt(t,n){return{x:(t[0]?.[0]??0)-w.state.loop.w/2-n/2,y:Math.max(...t.map(([,a])=>a))+w.label.soft}}var Fn=w.state.loop.h+w.label.soft*2+w.label.h;function st(t,n=[],a=[]){let p=ut(t),l=p<w.badge.short?Math.min(w.badge.r+1,p/2):w.badge.along,e=w.badge.r*2+w.badge.inset;for(let s=l;s<=p;s+=1){let r=et(t,s);if(n.every(([o,i])=>Math.hypot(r[0]-o,r[1]-i)>=e))return r}return Ur(t,l,n,a)??et(t,l)}function Ur(t,n,a,p){let l=ut(t),[e,s]=et(t,n),[r,o]=et(t,Math.max(0,n-1)),[i,c]=et(t,Math.min(l,n+1)),m=Math.hypot(i-r,c-o);if(m===0)return;let[f,d]=[-(c-o)/m,(i-r)/m],u=w.badge.r*2;for(let M of[w.edge.arrowHalf,0])for(let x=1;x<=u+w.badge.inset;x++)for(let h of[1,-1]){let g=[e+f*x*h,s+d*x*h];if(a.every(([O,_])=>Math.max(Math.abs(g[0]-O),Math.abs(g[1]-_))>=u+1)&&p.every(O=>!Ht(O,Ye(g),-M)))return g}}var Ct=t=>t.points.map(([n,a])=>`${Math.round(n*10)},${Math.round(a*10)}`).join(" ");function ht(t,n,a=(p,l,e)=>st(p.points,l,e)){let p=new Map,l=[],e=new Map;for(let s=0;s<n;s++){let r=t.find(f=>f.step===s&&f.points.length>0);if(!r)continue;let o=Ct(r),i=e.get(o);if(i){p.set(s,{point:i,edge:r});continue}let c=t.filter(f=>f.points.length>1&&Ct(f)!==o).map(f=>f.points),m=a(r,l,c);l.push(m),e.set(o,m),p.set(s,{point:m,edge:r})}return p}function Xe(t){let n=(a,p)=>Math.hypot(a.x-p.x,a.y-p.y)<=.5;return t.map(a=>{let p=t.filter(l=>l.step>a.step&&n(l,a)).sort((l,e)=>l.step-e.step)[0];return p?{...a,until:p.step}:a})}var Ye=([t,n])=>({x:t-w.badge.r,y:n-w.badge.r,w:w.badge.r*2,h:w.badge.r*2}),Ut=t=>[t.x+w.state.text,t.y+w.baseline.mark],We=t=>Ie(t)?A.labelJa:A.label,Jr={above:"below",below:"above",left:"right",right:"left"};function Ze(t,n){let a=pe(t.text,We(t.text))+w.label.padX*2,p=w.label.h,l=zr(t.points),e=(l.a[0]+l.b[0])/2,s=(l.a[1]+l.b[1])/2,r=t.side??(l.vertical?"right":"above"),{side:o}=w.label,i=t.offset??w.label.offset,c=x=>x==="above"?{x:e-a/2,y:s-i-p/2,w:a,h:p}:x==="below"?{x:e-a/2,y:s+i-p/2,w:a,h:p}:x==="left"?{x:e-o-a,y:s-p/2,w:a,h:p}:{x:e+o,y:s-p/2,w:a,h:p},m=t.base?{...t.base,w:a,h:p}:c(r),f=t.flip?[r,Jr[r]]:[r],d=x=>n.hard.every(h=>wt(x,h)>=w.gap)&&n.soft.every(h=>wt(x,h)>=w.label.soft)&&(n.touch??[]).every(h=>wt(x,h)>=w.label.touch)&&(n.lines??[]).every(h=>!Ht(h,x,-w.label.touch)),{search:u,searchMax:M}=w.label;for(let x=0;x<=M;x+=u)for(let h of f){let g=h===r?m:c(h),L=h==="above"?[0,-1]:h==="below"?[0,1]:h==="left"?[-1,0]:[1,0],O=[Math.abs(L[1]),Math.abs(L[0])],_=t.slide??(h==="above"||h==="below"?a:p*4);for(let P=0;P<=_;P+=u)for(let j of P===0?[1]:[1,-1]){let $={x:g.x+L[0]*x+O[0]*P*j,y:g.y+L[1]*x+O[1]*P*j,w:a,h:p};if(d($))return{...$,step:t.step,event:t.event,text:t.text,family:We(t.text).family,color:t.color}}}return{...m,step:t.step,event:t.event,text:t.text,family:We(t.text).family,color:t.color}}function _n(t){let n=/^([0-9]+(?:\.[0-9]+)?)%$/u.exec(t.trim());if(n)return Math.min(1,Math.max(0,Number(n[1])/100));let a=/^([0-9]+)\/([0-9]+)$/u.exec(t.trim());if(a&&Number(a[2])>0)return Math.min(1,Math.max(0,Number(a[1])/Number(a[2])))}var $s=(t,n)=>t.strip?.meters?.find(a=>a.field===n);function ks(t,n){if($s(t,n))return Math.max(pe(n,A.fieldName),w.time.meter.w);let a=0,p=0;for(let e of t.steps)for(let s of e.events)s.type!=="strip"||s.field!==n||(s.value!==void 0&&(a=Math.max(a,pe(s.value,Ie(s.value)?A.fieldValueJa:A.fieldValue))),s.tag!==void 0&&(p=Math.max(p,pe(s.tag,A.tag)+w.strip.tagPadX*2)));let l=a+(p>0?(a>0?w.strip.tagGap:0)+p:0);return Math.max(pe(n,A.fieldName),l)}var In=t=>Math.max(pe(t.title,A.fieldName),t.states.length*w.strip.trail.step);function ze(t,n){return t.strip?vs(t.strip.title,[...t.strip.fields.map(a=>ks(t,a)),...n?[In(n)]:[]]):0}function vs(t,n){let{fieldGap:a,pad:p}=w.strip;return Bn(t)+n.reduce((l,e)=>l+e+a,0)-a+p}function Bn(t){return w.strip.titleX+pe(t,A.stripTitle)+w.strip.fieldGap}function Ps(t,n){let{fieldGap:a,pad:p}=w.strip,l=t,e=0;return{place(s){l>t&&l+s>n-p&&(l=t,e++);let r={x:l,row:e};return l+=s+a,r},rows:()=>e}}function Ue(t,n,a,p,l){if(!t.strip)return;let{line:e,h:s}=w.strip,r=[],o=Ps(Bn(t.strip.title),p),i=m=>{let f=o.place(m);return{x:n+f.x,y:a+f.row*e}};for(let m of t.strip.fields){let f=ks(t,m),d=i(f),u=$s(t,m),M=u?_n(u.line):void 0;r.push({name:m,...d,w:f,...u&&M!==void 0?{meter:{line:M,text:u.line,x:d.x,w:w.time.meter.w}}:{}})}let c=l?{...l,...i(In(l)),w:In(l)}:void 0;return{x:n,y:a,w:p,h:s+o.rows()*e,title:t.strip.title,fields:r,...c?{trail:c}:{}}}function Gn(t,n,a,p){let{line:l,h:e,pad:s,titleRow:r}=w.strip,o=vs(t.title,[...t.fields.map(u=>u.w),...t.trail?[t.trail.w]:[]])>p,i=o?r:0,c=Ps(o?s:Bn(t.title),p),m=u=>{let M=c.place(u);return{x:n+M.x,y:a+i+M.row*l}},f=t.fields.map(u=>{let M=m(u.w);return{...u,...M,...u.meter?{meter:{...u.meter,x:M.x}}:{}}}),d=t.trail?{...t.trail,...m(t.trail.w)}:void 0;return{...t,x:n,y:a,w:p,h:e+c.rows()*l+i,fields:f,...d?{trail:d}:{}}}function Lt(t,n,a){let p=l=>{l.x+=n,l.y+=a};for(let l of t.boxes)p(l),l.cx+=n,l.cy+=a,l.slot&&p(l.slot),l.iconX!==void 0&&(l.iconX+=n);for(let l of t.regions)l.y+=a,p(l.header);for(let l of t.lifelines)l.x+=n,l.y1+=a,l.y2+=a;for(let l of t.edges)l.points=l.points.map(([e,s])=>[e+n,s+a]),l.settle&&(l.settle=[l.settle[0]+n,l.settle[1]+a]),l.wait&&(l.wait=[l.wait[0]+n,l.wait[1]+a]);for(let l of t.labels)p(l);for(let l of t.paths)l.points=l.points.map(([e,s])=>[e+n,s+a]),l.label&&p(l.label);for(let l of t.ends)l.x+=n,l.y+=a;t.side&&p(t.side);for(let l of t.actions)p(l);for(let l of t.badges)l.x+=n,l.y+=a;if(t.strip){t.strip.y+=a;for(let l of t.strip.fields)l.x+=n,l.y+=a,l.meter&&(l.meter.x+=n);t.strip.trail&&(t.strip.trail.x+=n,t.strip.trail.y+=a)}}function qt(t,n,a){let{inset:p}=w.badge;for(let e of t){let s=e.type==="swap"||e.type==="action"?e.box:void 0,r=a.boxes.find(o=>o.id===s);if(r)return{step:n,x:r.x,y:r.y,color:r.color}}if(a.strip&&t.some(e=>e.type==="strip"))return{step:n,x:a.strip.x+p,y:a.strip.y+p,color:"slate"};let l=a.boxes[0];return{step:n,x:l.x,y:l.y,color:l.color}}function Zr(t){let n=(t.git?.branches??[]).map($=>$.id),a=$=>{n.includes($)||n.push($)};for(let $ of t.steps)for(let S of $.events)(S.type==="commit"||S.type==="branch")&&a(S.branch);let p=new Map(n.map($=>[$,null])),l=null,e=null,s=[],r=new Map,o=[],i=[],c=[],m=new Map,f=new Map,d=new Map,u=[...n,xt],M=new Map(u.map($=>[$,[]])),x=[],h=$=>$===xt?e===null?l:null:p.get($)??null,g=$=>{let S=m.get($)??[],y=S.indexOf(null);return y<0?S.length:y},L=($,S,y,F)=>{let C=new Map(u.map(B=>[B,h(B)])),X=l;y();let Q=u.filter(B=>C.get(B)!==h(B)).map(B=>{let v=d.get(B);return v&&(m.get(v.commit)[v.row]=null,d.delete(B)),{ref:B,slot:v}});for(let{ref:B,slot:v}of Q){let D=v??(B===xt&&X!==null?{commit:X,row:g(X)}:void 0),R=h(B),W;if(R!==null){W={commit:R,row:g(R)};let J=m.get(R)??[];J[W.row]=B,m.set(R,J),f.set(R,Math.max(f.get(R)??0,J.filter(Z=>Z!==null).length)),d.set(B,W)}i.push({ref:B,step:$,event:S,...D?{from:D}:{},...W?{to:W}:{},line:B===F})}},O=($,S)=>{let y=new Set,F=[...p.values(),l].filter(C=>C!==null);for(;F.length>0;){let C=F.pop();y.has(C)||(y.add(C),F.push(...r.get(C)?.parents??[]))}for(let C of s)!y.has(C.id)&&C.orphan===void 0&&(C.orphan={step:$,event:S})};t.steps.forEach(($,S)=>{$.events.forEach((y,F)=>{if(y.type==="commit")P(y,S,F);else if(y.type==="branch"){if(!r.has(y.from))return;_(y.from)!==y.branch&&o.push({kind:"branch",from:y.from,to:y.branch,step:S,event:F}),L(S,F,()=>{p.set(y.branch,y.from),e=y.branch,l=y.from})}else if(y.type==="edge"){let C=y.from;if(C!==xt&&!p.has(C)||!r.has(y.to))return;L(S,F,()=>{if(C===xt){e=null,l=y.to;return}p.set(C,y.to),e===C?l=y.to:e===null&&l===y.to&&(e=C)},C)}else return;O(S,F)});for(let y of u)M.get(y)?.push(y===xt?l:p.get(y)??null);x.push(e);for(let y of u){let F=d.get(y);F&&c.push({ref:y,step:S,slot:F})}});function _($){return r.get($)?.branch}function P($,S,y){if(r.has($.id))return;let F=$.copy!==void 0&&r.has($.copy)?$.copy:void 0,C=F!==void 0&&e===null&&l!==null?l:p.get($.branch)??null,X=$.merge!==void 0&&$.merge!==$.branch?p.get($.merge)??void 0:void 0,z=[...new Set([C,X].filter(v=>v!=null))],Q={id:$.id,branch:$.branch,parents:z,...X!==void 0&&X!==C?{joined:X}:{},...F!==void 0?{copy:F}:{},...$.hash!==void 0?{hash:$.hash}:{},...$.note!==void 0?{note:$.note}:{},step:S,event:y};s.push(Q),r.set(Q.id,Q);for(let v of z)o.push({kind:"parent",from:v,to:Q.id,step:S,event:y});F!==void 0&&o.push({kind:"copy",from:F,to:Q.id,step:S,event:y});let B=e===null&&l===null;L(S,y,()=>{F===void 0?(p.set($.branch,Q.id),e===$.branch&&(l=Q.id)):e===null&&(l=Q.id),B&&(e=$.branch,l=Q.id)})}let j=u.map($=>({name:$,at:M.get($)??[],...$===xt?{attached:x}:{}}));return{branches:n,made:s,links:o,moves:i,refs:j,tags:c,rows:f}}function Jt(t,n,a,p){let l=w.git.samples;return Array.from({length:l},(e,s)=>{let r=(s+1)/l,o=1-r,i=c=>o*o*o*t[c]+3*o*o*r*n[c]+3*o*r*r*a[c]+r*r*r*p[c];return[i(0),i(1)]})}function Qr(t,n){return Math.abs(t[1]-n[1])<.5?[t,n]:t[1]>n[1]?[t,[t[0],n[1]],n]:[t,[n[0],t[1]],n]}function Ss(t,n,a){let p=a>t.cy?1:-1,l=[t.cx,t.cy+p*t.r],e=Math.max(0,Math.min(w.git.turn,n-t.cx)),s=[t.cx+e,a],r=Jt(l,[l[0],l[1]+(a-l[1])*.7],[t.cx+e*.2,a],s);return[l,...r,...n>s[0]?[[n,a]]:[]]}function ei(t,n){let a=n.cy<t.cy?1:-1,p=[t.cx+t.r,t.cy],l=[n.cx,n.cy+a*n.r],e=Math.max(0,Math.min(w.git.turn,n.cx-p[0])),s=[n.cx-e,t.cy],r=Jt(s,[n.cx-e*.2,t.cy],[n.cx,l[1]+(t.cy-l[1])*.7],l);return[p,...s[0]>p[0]?[s]:[],...r]}function ti(t,n){if(Math.abs(t.cy-n.cy)<.5){let s=t.cy-t.r,r=w.git.turn*.7;return[[t.cx,s],...Jt([t.cx,s],[t.cx,s-r],[n.cx,s-r],[n.cx,s])]}let a=n.cy<t.cy?-1:1,p=[t.cx,t.cy+a*t.r],l=[n.cx,n.cy-a*n.r],e=(l[1]-p[1])*.5;return[p,...Jt(p,[p[0],p[1]+e],[l[0],l[1]-e],l)]}function Ts(t){let{margin:n,gap:a,box:p,region:l,git:e,carrier:s}=w,r=Zr(t),o=new Map((t.git?.branches??[]).map(E=>[E.id,E.note])),i=new Map(r.branches.map((E,N)=>[E,N])),c=E=>e.colors[(i.get(E)??0)%e.colors.length],m=new Map,f=new Map;for(let E of r.made){let N=Math.max(0,...E.parents.map(se=>(m.get(se)??-1)+1),(f.get(E.branch)??-1)+1);m.set(E.id,N),f.set(E.branch,N)}let d=E=>[...E.hash!==void 0?[{text:E.hash,style:A.gitHash}]:[],...E.note!==void 0?[{text:E.note,style:A.gitNote}]:[]],u=E=>Math.max(0,...d(E).map(N=>pe(N.text,N.style))),M=E=>pe(E,Ie(E)?A.carrierJa:A.carrier)+s.tagPadX*2,x=Math.max(0,...r.refs.map(E=>M(E.name))),h=Math.max(e.pitch,...r.made.map(E=>u(E)+e.textGap),x+e.textGap),g=r.branches.map(E=>({w:Math.max(l.icon,pe(E,A.regionName),pe(o.get(E)??"",A.regionNote))})),L=n+l.inset+Math.max(0,...g.map(E=>E.w)),O=Math.max(e.r,...r.made.filter(E=>m.get(E.id)===0&&i.get(E.branch)===0).map(E=>u(E)/2),x/2),_=Math.max(e.x0,L+a+O),P=new Set(r.moves.flatMap(E=>{let N=t.steps[E.step]?.events[E.event];return E.line&&E.to&&N?.type==="edge"&&N.label!==void 0?[r.made.find(se=>se.id===E.to?.commit)?.branch??""]:[]})),j=E=>Math.max(0,...r.made.filter(N=>N.branch===E).map(N=>(r.rows.get(N.id)??0)-2))*e.row,$=r.made.some(E=>i.get(E.branch)===0&&d(E).length>0),S=[],y=n;r.branches.forEach((E,N)=>{let se=N===0,T=se&&$?e.tagTop:e.tag,ee=y+(se?e.topLine-(e.tagTop-T):e.line)+j(E),b=ee-y+(se?e.topBelow:P.has(E)?e.below:e.bare);S.push({id:E,x:n,y,w:0,h:b,line:ee,color:c(E),tagBase:T}),y+=b+l.gap});let F=y-l.gap,C=new Map(S.map(E=>[E.id,E])),X=r.made.map(E=>{let N=C.get(E.branch),se=i.get(E.branch)===0,T=_+h*(m.get(E.id)??0)+(se?0:h/2),ee=N.line,b=d(E),G=b.map((K,H)=>se?ee-e.above-(b.length-1-H)*e.lineStep:ee+e.under+H*e.lineStep),q=b.map((K,H)=>Ge(K.text,T,G[H],K.style,"middle")),Y=q.length===0?void 0:{...ni(q),lines:b.map(K=>K.text),baselines:G},U=E.copy!==void 0?c(r.made.find(K=>K.id===E.copy)?.branch??E.branch):c(E.branch);return{id:E.id,branch:E.branch,color:U,cx:T,cy:ee,r:e.r,step:E.step,event:E.event,parents:E.parents,...E.copy!==void 0?{copy:E.copy}:{},...E.hash!==void 0?{hash:E.hash}:{},...E.note!==void 0?{note:E.note}:{},...Y?{text:Y}:{},...E.orphan?{orphan:E.orphan.step,orphanEvent:E.orphan.event}:{}}}),z=new Map(X.map(E=>[E.id,E])),Q=r.links.flatMap(E=>{let N=z.get(E.from);if(!N)return[];if(E.kind==="branch"){if(!r.made.some(G=>G.branch===E.to))return[];let b=C.get(E.to);return[{...E,points:Ss(N,N.cx+e.turn,b.line),color:c(E.to)}]}let se=z.get(E.to),T=r.made.find(b=>b.id===E.to),ee;return E.kind==="copy"?ee=ti(N,se):Math.abs(N.cy-se.cy)<.5?ee=[[N.cx+N.r,N.cy],[se.cx-se.r,se.cy]]:T?.joined===E.from?ee=ei(N,se):ee=Ss(N,se.cx-se.r,se.cy),[{...E,points:ee,color:se.color}]}),B=(E,N)=>{let se=z.get(N.commit),T=C.get(se.branch)?.tagBase??e.tag,ee=M(E);return{x:se.cx-ee/2,y:se.cy-T-N.row*e.row-s.tagH/2,w:ee,h:s.tagH}},v=E=>[E.x+E.w/2,E.y+E.h/2],D=r.moves.map(E=>{let N=E.from?B(E.ref,E.from):void 0,se=E.to?B(E.ref,E.to):void 0,T=t.steps[E.step]?.events[E.event],ee=E.line&&T?.type==="edge"&&T.carry.kind!=="none"&&!(T.carry.kind==="tag"&&T.carry.text===T.from);return{ref:E.ref,step:E.step,event:E.event,...N?{from:N}:{},...se?{to:se}:{},...E.to?{target:E.to.commit}:{},...ee?{carried:!0}:{},...E.line&&N&&se?{line:Qr(v(N),v(se))}:{},color:"slate"}}),R=r.tags.map(E=>({...B(E.ref,E.slot),ref:E.ref,step:E.step})),W=He(t),J=Math.max(_,...X.flatMap(E=>[E.cx+E.r,...E.text?[E.text.x+E.text.w]:[]]),...R.map(E=>E.x+E.w),...D.flatMap(E=>[E.from,E.to].flatMap(N=>N?[N.x+N.w]:[]))),Z=J+e.boxGap,ie=(S[1]??S[0])?.line??n+p.h/2,de=t.boxes.map((E,N)=>{let se=tt(t,E.id,!0),T=ie+N*(p.h+a);return{id:E.id,name:E.name,...E.sub!==void 0?{sub:E.sub}:{},...E.icon!==void 0?{icon:E.icon}:{},color:W.get(E.id)??"slate",x:Z,y:T-p.h/2,w:se,h:p.h,cx:Z+se/2,cy:T}}),ue=S.map((E,N)=>{let se=o.get(E.id);return{id:E.id,lines:[E.id],...se!==void 0?{note:se}:{},icon:"branch",color:E.color,x:E.x,y:E.y,w:0,h:E.h,header:{x:E.x+l.inset,y:E.y+l.inset,w:g[N]?.w??0,h:l.nameY-l.inset+(se!==void 0?l.line:0)+a/2}}}),I={kind:"git",width:0,height:0,regions:ue,boxes:de,lifelines:[],edges:[],labels:[],actions:[],badges:[],paths:[],ends:[],lanes:S,commits:X,links:Q,tags:R,refs:r.refs,moves:D};I.badges=Os(t,I),I.labels=ii(t,I);let me=Math.max(J,...de.map(E=>E.x+E.w),...I.labels.map(E=>E.x+E.w))+l.pad,ae=Math.max(me+n,ze(t)+n*2);for(let E of ue)E.w=ae-n*2;for(let E of S)E.w=ae-n*2;let ye=Math.max(F,...de.map(E=>E.y+E.h),...I.labels.map(E=>E.y+E.h)),we=Ue(t,n,ye+a,ae-n*2);return I.width=ae,I.height=(we?we.y+we.h:ye)+n,we&&(I.strip=we),I.badges=Os(t,I),I}function ni(t){let n=Math.min(...t.map(p=>p.x)),a=Math.min(...t.map(p=>p.y));return{x:n,y:a,w:Math.max(...t.map(p=>p.x+p.w))-n,h:Math.max(...t.map(p=>p.y+p.h))-a}}function si(t,n){return[...t.links.filter(p=>p.step===n&&p.kind!=="copy").map(p=>({event:p.event,points:p.points,color:p.color})),...t.moves.flatMap(p=>{let l=t.commits.find(e=>e.id===p.target);return p.step===n&&p.line&&l?[{event:p.event,target:l,color:l.color}]:[]})].sort((p,l)=>p.event-l.event)[0]}function Ms(t,n,a){let{r:p,inset:l}=w.badge,e=t.r+l+p,s=p*2+l;return[[t.cx+e,t.cy],[t.cx,t.cy+e],[t.cx-e,t.cy],[t.cx,t.cy-e]].find(o=>n.every(([i,c])=>Math.hypot(o[0]-i,o[1]-c)>=s)&&a.every(i=>wt(Ye(o),i)>=w.label.touch))}function ri(t,n,a){let{r:p,inset:l,along:e,short:s}=w.badge,r=ut(t),o=r<s?Math.min(p+1,r/2):e,i=p*2+l;for(let c=o;c<=r;c+=1){let m=et(t,c),f=Ye(m);if(n.every(([d,u])=>Math.hypot(m[0]-d,m[1]-u)>=i)&&a.every(d=>wt(f,d)>=w.label.touch))return m}}function Os(t,n){let{inset:a}=w.badge,p=[],l=[...n.links.map(r=>r.points),...n.moves.flatMap(r=>r.line?[r.line]:[])],e=[],s=[...n.tags,...n.commits.flatMap(r=>[{x:r.cx-r.r,y:r.cy-r.r,w:r.r*2,h:r.r*2},...r.text?[r.text]:[]])];return t.steps.forEach((r,o)=>{let i=si(n,o),c=i?.target?Ms(i.target,p,s):void 0;if(i&&(i.points||c)){let x=i.points,h=c??(x?ri(x,p,s)??st(x,p,l.filter(g=>g!==x)):[0,0]);p.push(h),e.push({step:o,x:h[0],y:h[1],color:i.color});return}let m=r.events.flatMap(x=>x.type==="swap"||x.type==="action"?[x.box]:[]).map(x=>n.boxes.find(h=>h.id===x))[0];if(m){e.push({step:o,x:m.x,y:m.y,color:m.color});return}if(n.strip&&r.events.some(x=>x.type==="strip")){e.push({step:o,x:n.strip.x+a,y:n.strip.y+a,color:"slate"});return}let f=n.commits.find(x=>x.id===n.refs[0]?.at[o]),d=f?Ms(f,p,s):void 0;if(f&&d){p.push(d),e.push({step:o,x:d[0],y:d[1],color:f.color});return}let u=e[e.length-1],M=n.lanes[0];e.push(u?{...u,step:o}:{step:o,x:(M?.x??0)+(M?.w??0)-a-w.badge.r,y:(M?.y??0)+a+w.badge.r,color:M?.color??"slate"})}),Xe(e)}function ii(t,n){let a=w.git,p=[],l=n.commits.map(r=>({x:r.cx-r.r,y:r.cy-r.r,w:r.r*2,h:r.r*2})),e=n.commits.flatMap(r=>r.text?[r.text]:[]),s=n.regions.map(r=>r.header);for(let r of n.moves){let o=t.steps[r.step]?.events[r.event];if(o?.type!=="edge"||o.label===void 0||!r.line)continue;let i=n.commits.find(g=>g.id===o.to);if(!i)continue;let c=n.lanes[0]?.id===i.branch,m=pe(o.label,Ie(o.label)?A.labelJa:A.label)+w.label.padX*2,[f]=r.line.reduce((g,L)=>[g[0]+L[0]/r.line.length,0],[0,0]),d=Math.max(0,...n.tags.filter(g=>g.step===r.step&&Math.abs(g.x+g.w/2-i.cx)<.5).map(g=>i.cy-g.y)),u=o.labelSide??(c?"above":"below"),M=o.labelSide!==void 0?void 0:c?{x:f-m/2,y:i.cy-Math.max(d,(n.lanes[0]?.tagBase??a.tag)+w.carrier.tagH/2)-w.label.soft-w.label.h}:{x:f-m/2,y:i.cy+a.labelUnder},x=n.badges.filter(g=>g.step<=r.step).map(g=>Ye([g.x,g.y])),h=n.tags.filter(g=>g.step===r.step);p.push(Ze({step:r.step,event:r.event,text:o.label,points:r.line,color:r.color,side:u,...M?{base:M}:{}},{hard:[...l,...n.boxes],soft:[...e,...h,...s,...p.filter(g=>g.step===r.step)],touch:x}))}return p}var Ft={app:"M -9 -7 h18 a2 2 0 0 1 2 2 v10 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-10 a2 2 0 0 1 2 -2 z M -11 -2 h22",router:"M -9 -4 h16 M 3 -8 l4 4 l-4 4 M 9 5 h-16 M -3 1 l-4 4 l4 4",on:"M -7 7 L 7 -7 M -1 -7 h8 v8",off:"M -7 -7 L 7 7 M 7 -1 v8 h-8",pool:"M -9 -5 a9 3.5 0 1 0 18 0 a9 3.5 0 1 0 -18 0 M -9 -5 v10 a9 3.5 0 0 0 18 0 v-10 M -9 0 a9 3.5 0 0 0 18 0",db:"M -9 -5 a9 3.5 0 1 0 18 0 a9 3.5 0 1 0 -18 0 M -9 -5 v10 a9 3.5 0 0 0 18 0 v-10 M -9 0 a9 3.5 0 0 0 18 0",exe:"M -5 -8 L 7 0 L -5 8 Z",idx:"M -9 -7 h18 M -9 -2 h18 M -9 3 h18 M -9 8 h11",sign:"M -9 4 c 3 -9 5 -9 6 0 s 3 7 6 -2 s 3 -6 6 0",env:"M -8 -5.5 h16 v11 h-16 z M -8 -5.5 l8 6 l8 -6",lock:"M -5.5 -1 h11 v8 h-11 z M -3.5 -1 v-3 a3.5 3.5 0 0 1 7 0 v3",check:"M -5 0 l3.5 3.5 l6.5 -7",flag:"M -4 8 V -8 M -4 -7 H 6 L 3.5 -3.5 L 6 0 H -4",x:"M -5 -5 l10 10 M 5 -5 l-10 10",chain:"M -1.5 4.5 l-2 2 a3.5 3.5 0 0 1 -5 -5 l3 -3 a3.5 3.5 0 0 1 5 0 M 1.5 -4.5 l2 -2 a3.5 3.5 0 0 1 5 5 l-3 3 a3.5 3.5 0 0 1 -5 0 M -2.5 2.5 l5 -5",net:"M -1.3 -4.6 L -5.8 3 M 1.3 -4.6 L 5.8 3 M -4.3 5.5 H 4.3 M -2.2 -7 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0 M -9.2 5.5 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0 M 4.8 5.5 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0",user:"M -4 -4.5 a4 4 0 1 0 8 0 a4 4 0 1 0 -8 0 M -8 9 c0 -5 3.6 -7.5 8 -7.5 s8 2.5 8 7.5",server:"M -9 -8 h18 v7 h-18 z M -9 1 h18 v7 h-18 z M -5 -4.5 h0.01 M -5 4.5 h0.01",key:"M -9 0 a3.5 3.5 0 1 0 7 0 a3.5 3.5 0 1 0 -7 0 M -2 0 h10 M 5 0 v3.5 M 8 0 v2.5",shield:"M 0 -9 l8 3 v5 c0 5 -3.5 8 -8 10 c-4.5 -2 -8 -5 -8 -10 v-5 z",globe:"M -9 0 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0 M -9 0 h18 M 0 -9 c-4.5 4 -4.5 14 0 18 M 0 -9 c4.5 4 4.5 14 0 18",bolt:"M 2 -9 L -5 1 h5 l-2 8 l7 -10 h-5 z",doc:"M -6 -9 h8 l5 5 v13 h-13 z M 2 -9 v5 h5 M -3 1 h7 M -3 5 h5",box:"M -9 -4.5 l9 -4.5 l9 4.5 v9 l-9 4.5 l-9 -4.5 z M -9 -4.5 l9 4.5 l9 -4.5 M 0 0 v9",truck:"M -10 -6 h11 v10 h-11 z M 1 -2 h5 l3.5 3.5 v2.5 h-8.5 M -7.5 6.5 a1.8 1.8 0 1 0 3.6 0 a1.8 1.8 0 1 0 -3.6 0 M 3 6.5 a1.8 1.8 0 1 0 3.6 0 a1.8 1.8 0 1 0 -3.6 0",card:"M -9 -6.5 h18 a2 2 0 0 1 2 2 v9 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-9 a2 2 0 0 1 2 -2 z M -11 -2 h22 M -7 3 h5",cart:"M -10 -8 h3 l3 11 h11 l2.5 -8 h-15.5 M -4.5 7.5 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0 M 5 7.5 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0",clock:"M -9 0 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0 M 0 -5 v5 l3.5 2.5",branch:"M -4 -4.5 v9 M 5 0.5 c0 4 -9 3 -9 6.5 M -6.2 -7 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0 M -6.2 7 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0 M 2.8 -2 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0",cloud:"M -7 6 h13 a4.5 4.5 0 0 0 0.5 -9 a6 6 0 0 0 -11.5 -1 a4.5 4.5 0 0 0 -2 10 z",refresh:"M 7 -3 a7.5 7.5 0 1 0 0.5 5 M 7.5 -8 v5 h-5",undo:"M -7 -2 h10 a5 5 0 0 1 0 10 h-6 M -3 -6 l-4 4 l4 4",yen:"M -6 -8 l6 7 l6 -7 M 0 -1 v9 M -5 1.5 h10 M -5 5 h10",layers:"M 0 -8 l9 4.5 l-9 4.5 l-9 -4.5 z M -9 2.5 l9 4.5 l9 -4.5",code:"M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",paint:"M -8 8 c 0 -3 2 -5 4.5 -5 l 9 -9 l 3.5 3.5 l -9 9 c 0 2.5 -2 4.5 -5 4.5 z",tree:"M 0 -5 v4 M -6 -1 h12 M -6 -1 v3 M 6 -1 v3 M -9 2 h6 v6 h-6 z M 3 2 h6 v6 h-6 z M -3 -10 h6 v5 h-6 z",block:"M -9 -7 h18 a2 2 0 0 1 2 2 v10 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-10 a2 2 0 0 1 2 -2 z M -11 -2.5 h22 M -6 2.5 h8"};var Yn=t=>/[0-9A-Za-z]$/u.test(t)?`${t} `:t,oi=t=>t.charAt(0).toUpperCase()+t.slice(1),Qe={ja:{cannotDraw:t=>`\u56F3\u3092\u63CF\u3051\u306A\u3044: ${t}`,kindNotLoaded:t=>`${t} \u306E\u56F3\u306E\u90E8\u54C1\u3092\u8AAD\u3093\u3067\u3044\u306A\u3044\u3002\u63CF\u304F\u524D\u306B loadKind \u3092\u5F85\u3064`,unknownColor:t=>`colors \u306E ${t} \u306F\u8272\u5473\u306B\u7121\u3044\u8272\u306E\u540D\u524D`,unreadableColor:t=>`colors \u306E ${t} \u306E\u5024\u3092\u8272\u3068\u3057\u3066\u8AAD\u3081\u306A\u3044`,overview:"\u5168\u4F53\u56F3",prev:"\u524D\u306E\u6BB5",pause:"\u6B62\u3081\u308B",play:"\u52D5\u304B\u3059",next:"\u6B21\u306E\u6BB5",steps:t=>`${t} \u306E\u6BB5`,side:"\u8107\u9053",sideNote:"\u4ECA\u56DE\u306F\u901A\u3089\u306A\u3044",sideFrom:t=>`${t} \u3064\u306E\u72B6\u614B\u304B\u3089\u5165\u308C\u308B`,trail:"\u901A\u3063\u305F\u72B6\u614B",start:"\u59CB\u307E\u308A",end:"\u7D42\u308F\u308A",badgeName:t=>`\u6BB5\u306E\u756A\u53F7 ${t}`,quoted:t=>`\u300C${t}\u300D`,iconOf:t=>`\u300C${t} \u306E\u7D75\u67C4\u300D`,coin:"\u300C\u786C\u8CA8\u300D",envelope:"\u300C\u5C01\u7B52\u300D",textsOverlap:(t,n)=>`${Yn(t)}\u3068${Yn(n)}\u304C\u91CD\u306A\u308B`,lineCrosses:(t,n,a)=>`\u7DDA ${t} \u2192 ${n} \u304C${Yn(a)}\u3092\u6A2A\u5207\u308B`,timeUnits:{ms:"\u30DF\u30EA\u79D2",s:"\u79D2",min:"\u5206",h:"\u6642\u9593",d:"\u65E5"},zoom:"\u62E1\u5927",range:(t,n)=>`${t}\u301C${n}`,headJoin:" \u30FB ",empty:"\u7A7A\u304D"},en:{cannotDraw:t=>`Cannot draw the diagram: ${t}`,kindNotLoaded:t=>`The ${t} diagram parts are not loaded. Await loadKind before drawing`,unknownColor:t=>`colors.${t} is not a color name of the palette`,unreadableColor:t=>`colors.${t} cannot be read as a color`,overview:"Overview",prev:"Previous step",pause:"Pause",play:"Play",next:"Next step",steps:t=>`Steps of ${t}`,side:"Side path",sideNote:"Not taken this time",sideFrom:t=>`Enterable from ${t} ${t===1?"state":"states"}`,trail:"States passed",start:"Start",end:"End",badgeName:t=>`step number ${t}`,quoted:t=>`"${t}"`,iconOf:t=>`the icon of "${t}"`,coin:"the coin",envelope:"the envelope",textsOverlap:(t,n)=>oi(`${t} and ${n} overlap`),lineCrosses:(t,n,a)=>`The line ${t} \u2192 ${n} crosses ${a}`,timeUnits:{ms:"ms",s:"s",min:"min",h:"h",d:"d"},zoom:"Zoom",range:(t,n)=>`${t}\u2013${n}`,headJoin:" \xB7 ",empty:"Empty"}};var Ce=[[0,Number.POSITIVE_INFINITY]],Vn=.5,Ns=(t,n)=>t.shown.some(([a,p])=>a<=n&&n<p),Kn=t=>({text:t.text,rect:{x:t.rect.x,y:t.rect.y,w:t.rect.w,h:t.rect.h},badge:t.badge===!0,...t.part?{part:t.part}:{}});function Es(t,n,a=[]){let p=[];return n.forEach((l,e)=>{let s=t.filter(o=>Ns(o,l));s.forEach((o,i)=>{for(let c of s.slice(i+1)){let m=Math.min(o.rect.x+o.rect.w,c.rect.x+c.rect.w)-Math.max(o.rect.x,c.rect.x),f=Math.min(o.rect.y+o.rect.h,c.rect.y+c.rect.h)-Math.max(o.rect.y,c.rect.y);m>Vn&&f>Vn&&p.push({kind:"texts",step:e,texts:[o.text,c.text],spots:[Kn(o),Kn(c)]})}});let r=a.filter(o=>Ns(o,l));for(let o of s)if(!o.boxed)for(let i of r)Ht(i.points,o.rect,Vn)&&p.push({kind:"line",step:e,text:o.text,line:{from:i.from,to:i.to},spots:[Kn(o)]})}),p}var ve=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),Zt=(t,n)=>t===void 0?n:`<a href="${ve(t)}">${n}</a>`,ne=t=>Math.round(t*100)/100,ke=t=>t==="coin"?"--c:var(--coin);--ct:var(--coint)":`--c:var(--c-${t});--ct:var(--t-${t})`;function rt(t,n,a,p,l="dg-gl"){let e=t!==void 0&&_t(t)?Ft[t]:void 0;return e?`<path class="${l}" transform="translate(${ne(n)} ${ne(a)}) scale(${p})" d="${e}"/>`:""}function it(t){let n=t.filter((e,s)=>s===0||e[0]!==t[s-1][0]||e[1]!==t[s-1][1]),[a,p]=n[0],l=`M ${ne(a)} ${ne(p)}`;for(let e=1;e<n.length-1;e++){let[s,r]=n[e-1],[o,i]=n[e],[c,m]=n[e+1],f=Math.hypot(o-s,i-r),d=Math.hypot(c-o,m-i),u=Math.min(w.edge.bend,f/2,d/2);l+=` L ${ne(o-(o-s)/f*u)} ${ne(i-(i-r)/f*u)} Q ${ne(o)} ${ne(i)} ${ne(o+(c-o)/d*u)} ${ne(i+(m-i)/d*u)}`}if(n.length>1){let[e,s]=n[n.length-1];l+=` L ${ne(e)} ${ne(s)}`}return l}function At(t){let[n,a]=t[t.length-1],[p,l]=t[t.length-2],e=Math.hypot(n-p,a-l)||1,s=(n-p)/e,r=(a-l)/e,{arrow:o,arrowHalf:i}=w.edge;return`M ${ne(n-s*o-r*i)} ${ne(a-r*o+s*i)} L ${ne(n)} ${ne(a)} L ${ne(n-s*o+r*i)} ${ne(a-r*o-s*i)}`}var _t=t=>t!==void 0&&Object.hasOwn(Ft,t),Ls=t=>t.some(n=>_t(n.icon)||n.slot!==void 0)?{name:w.box.nameY,sub:w.box.subY}:{name:w.box.nameMid,sub:w.box.subMid},Bt=t=>({...t,family:"sans"});function Me(t,n,a,p,l,e,s=Ce,r){return t?.push({text:l,rect:Ge(l,a,p,e,r),shown:s}),`<text class="${n}" x="${ne(a)}" y="${ne(p)}"${r?` text-anchor="${r}"`:""}>${ve(l)}</text>`}function qs(t,n){let a=[[0,{opacity:0}]];for(let[p,l]of n)a.push([p,{opacity:0},fe.out],[p+oe.fade,{opacity:1}],[l-.1,{opacity:1},fe.inOut],[l+.25,{opacity:0}]);return a.push([t.total,{opacity:0}]),t.kf(a)}function Qt(t,n){let a=[];for(let p=0;p<n.length;){let l=p;for(;l+1<n.length&&n[l+1]===n[l]+1;)l++;a.push([t.t.steps[n[p]].start,t.t.steps[n[l]].end]),p=l+1}return qs(t.m,a)}function As(t,n){let{radius:a,icon:p,iconRadius:l,iconScale:e,nameY:s,line:r}=w.region,{x:o,y:i}=t.header,c=t.lines.map((d,u)=>Me(n,"dg-bz",o,t.y+s+u*r,d,A.regionName)).join(""),m=t.note?Me(n,"dg-bx",o,t.y+s+t.lines.length*r+1,t.note,A.regionNote):"",f=_t(t.icon)?`<rect class="dg-bi" x="${ne(o)}" y="${ne(i)}" width="${p}" height="${p}" rx="${l}"/>${rt(t.icon,o+p/2,i+p/2,e)}`:"";return`<g style="${ke(t.color)}"><rect class="dg-band" x="${ne(t.x+.5)}" y="${ne(t.y+.5)}" width="${ne(t.w-1)}" height="${ne(t.h-1)}" rx="${a}"/>${f}${c}${m}</g>`}function en(t,n,a,p,l,e){let s=[[0,t.sub??"","dg-ss"],...a];return s.map(([r,o,i],c)=>{let m=s[c+1]?.[0],f=c===0?m===void 0?"":n.until(m-oe.untilFade):m===void 0?n.rise(r):n.rise(r,m-oe.untilFade);if(o==="")return"";let d=[[c===0?0:r,m===void 0?Number.POSITIVE_INFINITY:m-oe.untilFade]],u=i==="dg-ss"?A.boxSub:A.boxSubStrong,M=e===void 0?Me(l,i,t.cx,p,o,u,d,"middle"):Me(l,i,e-pe(o,u),p,o,u,d);return`<g${f?` class="dg-a" style="${f}"`:""}>${M}</g>`}).join("")}function js(t,n,a,p,l){let e=(s,r="")=>`<rect class="${s}" x="${ne(t.x)}" y="${ne(p)}" width="${ne(t.w)}" height="${l}" rx="${w.box.radius}"${r}/>`;return`${a?`<g class="dg-a" style="${a}">${e("dg-halo")}</g>`:""}${e("dg-st",` ${n.sh}`)}${a?`<g class="dg-a" style="${a}">${e("dg-on")}</g>`:""}`}function tn(t,n,a,p,l){let{icon:e,iconRadius:s,iconScale:r,iconY:o}=w.box,i=en(t,n.m,p,t.cy+n.boxText.sub,n.ink),c=l?l.length>0?qs(n.m,l.map(u=>[u.start,u.end])):void 0:a.length>0?Qt(n,a):void 0,m=t.iconX??t.cx,f=t.slot?`<rect class="dg-slot" x="${ne(t.slot.x)}" y="${ne(t.slot.y)}" width="${ne(t.slot.w)}" height="${ne(t.slot.h)}" rx="${w.slot.radius}"/>`:"",d="";if(_t(t.icon)){let u={x:m-e/2,y:t.cy+o-e/2,w:e,h:e};n.ink.push({text:`${t.name} \u306E\u7D75\u67C4`,rect:u,shown:Ce,boxed:!0,part:{kind:"icon",box:t.name}}),d=`<rect class="dg-ic" x="${ne(u.x)}" y="${ne(u.y)}" width="${e}" height="${e}" rx="${s}"/>${rt(t.icon,m,t.cy+o,r)}`}return`<g style="${ke(t.color)}">${js(t,n,c,t.y,t.h)}${f}${d}${Me(n.ink,"dg-sn",t.cx,t.cy+n.boxText.name,t.name,A.boxName,Ce,"middle")}${i}</g>`}function Rs(t,n,a,p){let{pad:l,h:e,nameY:s,subY:r}=w.follow.head,o=en(t,n.m,p,l+r),i=a.length>0?Qt(n,a):void 0;return`<g style="${ke(t.color)}">${js(t,n,i,l,e)}<text class="dg-sn" x="${ne(t.cx)}" y="${ne(l+s)}" text-anchor="middle">${ve(t.name)}</text>${o}</g>`}function Ds(t,n){let{icon:a,iconRadius:p,iconScale:l,radius:e}=w.box,s=w.state.ghost,r=t.x+s.pad+a/2,o=t.x+s.pad+a+s.gap,i=_t(t.icon)?`<rect class="dg-ic" x="${ne(r-a/2)}" y="${ne(t.cy-a/2)}" width="${a}" height="${a}" rx="${p}"/>${rt(t.icon,r,t.cy,l)}`:"",c=t.sub?s.nameY:w.baseline.mark,m=t.sub?Me(n,"dg-ss",o,t.cy+s.subY,t.sub,A.boxSub,Ce,"start"):"";return`<g data-ghost="${ve(t.id)}" style="${ke(t.color)}"><rect class="dg-ghost" x="${ne(t.x)}" y="${ne(t.y)}" width="${ne(t.w)}" height="${t.h}" rx="${e}"/>${i}${Me(n,"dg-sn",o,t.cy+c,t.name,A.boxName,Ce,"start")}${m}</g>`}function Is(t,n,a){let{r:p,inset:l}=w.state.done,e=t.x+t.w-l,s=t.y+l;return`<g class="dg-popc dg-a" data-done="${ve(t.id)}" style="${ke(t.color)};${a.m.pop(n)}"><circle class="dg-done" cx="${ne(e)}" cy="${ne(s)}" r="${p}"/>${rt("check",e,s,.5,"dg-done-ck")}</g>`}function Cs(t,n,a,p){p.push({from:t.from,to:t.to,points:t.points,shown:Ce});let l=t.label?.family==="sans",e=t.label?Me(a,`dg-path-t${l?" dg-path-tj":""}`,t.label.x+w.label.padX,t.label.y+t.label.h/2+w.baseline.label,t.label.text,l?A.labelJa:A.label):"";return`<g data-path="${ve(`${t.from}->${t.to}`)}" style="${ke(n)}"><path class="dg-path" d="${it(t.points)}"/><path class="dg-path-h" d="${At(t.points)}"/>${e}</g>`}function Fs(t,n,a){let{pad:p}=w.state.side,l=t.y+p+A.regionName.size,e=t.notes.map((s,r)=>Me(a,"dg-side-n",t.x+p,l+w.region.line*(r+1),s,A.regionNote)).join("");return`<g style="${ke(n)}"><rect class="dg-side" x="${ne(t.x+.5)}" y="${ne(t.y+.5)}" width="${ne(t.w-1)}" height="${ne(t.h-1)}" rx="${w.region.radius}"/>${Me(a,"dg-side-t",t.x+p,l,t.title,A.regionName)}${e}</g>`}function _s(t,n,a){let{end:p}=w.state,l=Ut(t),e=t.text===""?"":Me(a,"dg-mark",l[0],l[1],t.text,A.regionNote),s=ne(t.x),r=ne(t.y);return t.kind==="start"?`<g data-end="start"><circle class="dg-start" cx="${s}" cy="${r}" r="${t.r}"/>${e}</g>`:t.ghost?`<g data-end="finish" style="${ke(n)}"><circle class="dg-end-x" cx="${s}" cy="${r}" r="${t.r}"/><circle class="dg-end-xi" cx="${s}" cy="${r}" r="${p.inner}"/>${e}</g>`:`<g data-end="finish"><circle class="dg-end" cx="${s}" cy="${r}" r="${t.r}"/><circle class="dg-end-in" cx="${s}" cy="${r}" r="${p.inner}"/>${e}</g>`}function Bs(t,n,a){return`<line class="dg-ll" x1="${ne(t)}" y1="${ne(n)}" x2="${ne(t)}" y2="${ne(a)}"/>`}function Gs(t,n,a,p=!1,l=0){let{m:e}=a;a.traces.push({from:t.from,to:t.to,points:t.points,shown:l>0?[[l,Number.POSITIVE_INFINITY]]:Ce});let s=it(t.points),r=At(t.points),{start:o,drawn:i,end:c}=n,m=p?[[c,{opacity:1},fe.inOut],[c+.4,{opacity:0}],[e.total,{opacity:0}]]:[[c,{opacity:1},fe.inOut],[c+.4,{opacity:.45}],[a.end+.3,{opacity:.45},fe.inOut],[a.end+1,{opacity:.95}],[e.last,{opacity:.95},fe.inOut],[e.total,{opacity:0}]],f=e.kf([[0,{opacity:0,"stroke-dashoffset":1}],[o,{opacity:0,"stroke-dashoffset":1},fe.inOut],[o+.05,{opacity:1}],[i,{"stroke-dashoffset":0}],[e.last,{"stroke-dashoffset":0}],[e.total,{"stroke-dashoffset":1}],...m]),d=e.kf([[0,{opacity:0}],[i-.05,{opacity:0}],[i,{opacity:1}],...m]),u=-(c-i)*26,M=e.kf([[0,{opacity:0,"stroke-dashoffset":0}],[i,{opacity:0,"stroke-dashoffset":0}],[i+.25,{opacity:.9}],[c-.1,{opacity:.9},fe.inOut],[c+.2,{opacity:0,"stroke-dashoffset":u}],[e.total,{opacity:0,"stroke-dashoffset":u}]]),x=p?e.kf([[0,{opacity:0}],[c,{opacity:0},fe.inOut],[c+.4,{opacity:1}],[e.last,{opacity:1},fe.inOut],[e.total,{opacity:0}]]):"",h=`<path class="dg-e" d="${s}"/><path class="dg-eh" d="${r}"/>`;return{base:`${l>0?`<g class="dg-a" style="${e.vis(l)}">${h}</g>`:h}${p?`<path class="dg-e-past dg-a" d="${s}" style="${x}"/><path class="dg-eh-past dg-a" d="${r}" style="${x}"/>`:""}`,lit:`<g style="${ke(t.color)}"><path class="dg-e-on dg-a" pathLength="1" d="${s}" style="${f}"/><path class="dg-eh-on dg-a" d="${r}" style="${d}"/><path class="dg-flow dg-a" d="${s}" style="${M}"/></g>`}}function Ys(t,n,a){let p=t.family==="sans"?" dg-capj":"",{radius:l}=w.label,e=n.again?[[n.start,n.end],[n.again.start,n.again.end]]:[[n.start,n.end]];a.ink.push({text:t.text,rect:t,shown:e,boxed:!0}),n.after&&a.ink.push({text:t.text,rect:Ge(t.text,t.x+t.w/2,t.y+t.h/2+w.baseline.label,t.family==="sans"?A.labelJa:A.label,"middle"),shown:[[n.after.start,n.after.end]]});let s=ne(t.x+t.w/2),r=ne(t.y+t.h/2+w.baseline.label),o=n.after?`<g class="dg-cap-past${t.family==="sans"?" dg-cap-pastj":""} dg-a" style="${a.m.vis(n.after.start,n.after.end)}"><text x="${s}" y="${r}" text-anchor="middle">${ve(t.text)}</text></g>`:"",i=e.map(([c,m])=>`<g class="dg-cap${p} dg-a" style="${ke(t.color)};${a.m.rise(c,m,!0)}"><rect x="${ne(t.x)}" y="${ne(t.y)}" width="${ne(t.w)}" height="${t.h}" rx="${l}"/><text x="${s}" y="${r}" text-anchor="middle">${ve(t.text)}</text></g>`);return`${o}${i.join("")}`}function Wn(t,n,a,p,l){let e=l?[[n,a],[l.start,l.end]]:[[n,a]];return p.ink.push({text:t.text,rect:t,shown:e,boxed:!0}),e.map(([s,r])=>`<g class="dg-act dg-a" style="${ke(t.color)};${p.m.rise(s,r,!0)}"><rect x="${ne(t.x)}" y="${ne(t.y)}" width="${ne(t.w)}" height="${t.h}" rx="${w.action.radius}"/><text x="${ne(t.x+t.w/2)}" y="${ne(t.y+t.h/2+w.baseline.action)}" text-anchor="middle">${ve(t.text)}</text></g>`).join("")}function ai(t,n){let a=w.carrier;if(t.carry.kind==="coin")return`<circle class="dg-coin" r="${a.coinR}"/><circle class="dg-coin-in" r="${a.coinIn}"/>`;if(t.carry.kind==="tag"){let p=t.carry.text,l=Ie(p),e=pe(p,l?A.carrierJa:A.carrier)+a.tagPadX*2;return`<rect class="dg-car" x="${ne(-e/2)}" y="${-a.tagH/2}" width="${ne(e)}" height="${a.tagH}" rx="${a.tagH/2}" ${n}/><text class="dg-car-t${l?" dg-car-tj":""}" y="${w.baseline.carrier}" text-anchor="middle">${ve(p)}</text>`}return`<rect class="dg-env" x="${-a.envW/2}" y="${-a.envH/2}" width="${a.envW}" height="${a.envH}" rx="3" ${n}/><path class="dg-env-in" d="M -8 -4.5 L 0 1.5 L 8 -4.5"/>`}var li=t=>t<.5?4*t*t*t:1-(-2*t+2)**3/2;function nn(t,n,a){let{m:p}=a,l=w.carrier.samples,e=t.wait?[t.wait,...t.points]:t.points,s=ut(e),{depart:r,arrive:o,start:i,end:c}=n,m=[];for(let P=0;P<=l;P++){let[j,$]=et(e,li(P/l)*s);m.push([r+(o-r)*P/l,j,$])}let f=m[0],d=m[m.length-1],u=t.settle??[d[1],d[2]],M=[[0,f[1],f[2]],...m];t.settle&&M.push([Math.min(o+.3,Math.max(c,o+.01)),u[0],u[1]]),M.push([c,u[0],u[1]],[p.total,u[0],u[1]]);let[x,h]=lt(t.carry),g=t.carry.kind==="tag"?t.carry.text:t.carry.kind==="coin"?"\u786C\u8CA8":"\u5C01\u7B52",L=t.carry.kind==="tag"?{}:{part:{kind:t.carry.kind==="coin"?"coin":"envelope"}},O=P=>({x:P[0]-x,y:P[1]-h,w:x*2,h:h*2});r>i&&a.ink.push({text:g,rect:O([f[1],f[2]]),shown:[[i,r]],boxed:!0,...L}),a.ink.push({text:g,rect:O(u),shown:[[o,c]],boxed:!0,...L});let _=c<p.last?.05:.18;return`<g class="dg-a" style="${p.move(M,p.blink(i+.02,c,_))}">${ai(t,a.sh)}</g>`}function Hn(t,n,a=!1){let{m:p}=n,l=n.t.steps[t.step],e=l.start,s=l.end,{r,ring:o}=w.badge,i={visibility:"visible"},c={visibility:"hidden"},m=t.until===void 0?void 0:n.t.steps[t.until].start,f=m!==void 0&&m<=s+1e-6,d=p.kf([[0,{opacity:0,transform:"scale(.5)",...c}],[e,{opacity:0,transform:"scale(.5)",...c},fe.pop],[e+.35,{opacity:1,transform:"scale(1)",...i}],[s,{opacity:1,transform:"scale(1)",...i},fe.inOut],[s+(f?oe.untilFade:.4),{opacity:0,transform:"scale(1)",...c}],[p.total,{opacity:0,transform:"scale(.5)",...c}]]),u=m??p.last,M=f?p.kf([[0,{opacity:0,...c}],[p.total,{opacity:0,...c}]]):p.kf([[0,{opacity:0,...c}],[s,{opacity:0,...c},fe.inOut],[s+.4,{opacity:1,...i}],[u,{opacity:1,...i},fe.inOut],...m===void 0?[]:[[m+oe.untilFade,{opacity:0,...c}]],[p.total,{opacity:0,...c}]]),x=p.kf([[0,{opacity:0,transform:"scale(1)"}],[e+.05,{opacity:0,transform:"scale(1)"}],[e+.1,{opacity:.7,transform:"scale(1)"},fe.out],[e+.9,{opacity:0,transform:"scale(2.3)"}],[p.total,{opacity:0,transform:"scale(1)"}]]),h=ne(t.x),g=ne(t.y),L=ne(t.y+w.baseline.badge),O=t.step+1;return n.ink.push({text:String(O),rect:{x:t.x-r,y:t.y-r,w:r*2,h:r*2},shown:[[e,u]],boxed:!0,badge:!0}),`<g class="dg-bd" data-step="${t.step}" style="${ke(t.color)}"><circle class="dg-bdr dg-popc dg-a" cx="${h}" cy="${g}" r="${o}" style="${x}"/><g class="dg-a" style="${M}"><circle class="${a?"dg-bdp-g":"dg-bdp"}" cx="${h}" cy="${g}" r="${o}"/><text class="${a?"dg-bdpt-g":"dg-bdpt"}" x="${h}" y="${L}" text-anchor="middle">${O}</text></g><g class="dg-popc dg-a" style="${d}"><circle class="dg-bdf" cx="${h}" cy="${g}" r="${r}"/><text class="dg-bdft" x="${h}" y="${L}" text-anchor="middle">${O}</text></g></g>`}function Vs(t,n,a,p=!1,l=new Map,e){let{m:s,sh:r}=a,o=w.strip,i=t.y+o.h/2,c=[`<rect class="dg-strip" x="${ne(t.x+.5)}" y="${ne(t.y+.5)}" width="${ne(t.w-1)}" height="${ne(t.h-1)}" rx="${w.region.radius}" ${r}/>`,`<g style="${ke("slate")}"><rect class="dg-bi" x="${ne(t.x+o.pad)}" y="${ne(i-o.icon/2)}" width="${o.icon}" height="${o.icon}" rx="${w.box.iconRadius}"/>${rt("env",t.x+o.pad+o.icon/2,i,.78)}</g>`,Me(a.ink,"dg-sh",t.x+o.titleX,i+w.baseline.stripTitle,t.title,A.stripTitle)];if(t.fields.forEach((m,f)=>{let d=t.fields[f-1];if(d&&d.y===m.y){let g=m.x-o.fieldGap/2;c.push(`<line class="dg-sep" x1="${ne(g)}" y1="${ne(m.y+o.sepInset)}" x2="${ne(g)}" y2="${ne(m.y+o.h-o.sepInset)}"/>`)}c.push(Me(a.ink,"dg-fl",m.x,m.y+o.nameY,m.name,A.fieldName));let u=e?.(m);if(u!==void 0){c.push(u);return}let M=n.get(m.name)??[],x=M.filter(g=>g.value!==void 0),h=M.filter(g=>g.tag!==void 0);x.forEach((g,L)=>{let O=x[L+1]?.at,_=g.value,P=Ie(_)?"dg-fvj":"dg-fv";a.ink.push({text:_,rect:Ge(_,m.x,m.y+o.valueY,Ie(_)?A.fieldValueJa:A.fieldValue),shown:[[g.at,O===void 0?Number.POSITIVE_INFINITY:O-oe.untilFade]]});let j=F=>`<text class="${F}" x="${ne(m.x)}" y="${ne(m.y+o.valueY)}">${ve(_)}</text>`,$=j(P);if(!p){let F=O===void 0?s.rise(g.at):s.rise(g.at,O-oe.untilFade);c.push(`<g class="dg-a" style="${F}">${$}</g>`);return}let S=Math.min(g.until,O??g.until),y=`<circle class="dg-fl-now" cx="${ne(m.x+pe(m.name,A.fieldName)+o.now.gap)}" cy="${ne(m.y+o.nameY-A.fieldName.size/3)}" r="${o.now.r}"/>`;c.push(`<g class="dg-fv-now dg-a" data-step="${g.step}" style="${ke(g.color)};${s.rise(g.at,S-oe.untilFade)}">${j(`${P} dg-fv-c`)}${y}</g>`),(O===void 0||O>S)&&c.push(`<g class="dg-a" style="${s.vis(S-oe.untilFade,O===void 0?s.last:O-oe.untilFade)}">${$}</g>`)}),h.forEach((g,L)=>{let O=h[L+1]?.at,_=g.tag,P=[...x].reverse().find(y=>y.at<=g.at+1e-9)?.value,j=m.x+(P?pe(P,Ie(P)?A.fieldValueJa:A.fieldValue)+o.tagGap:0),$=pe(_,A.tag)+o.tagPadX*2,S=m.y+o.valueY-o.tagH/2-w.baseline.tag;a.ink.push({text:_,rect:{x:j,y:S,w:$,h:o.tagH},shown:[[g.at,O===void 0?Number.POSITIVE_INFINITY:O-oe.untilFade]],boxed:!0}),c.push(`<g class="dg-tg dg-popc dg-a" style="${ke(g.color)};${O===void 0?s.pop(g.at):s.pop(g.at,O-oe.untilFade)}"><rect x="${ne(j)}" y="${ne(S)}" width="${ne($)}" height="${o.tagH}" rx="${o.tagH/2}"/><text x="${ne(j+$/2)}" y="${ne(S+o.tagH/2+w.baseline.tag)}" text-anchor="middle">${ve(_)}</text></g>`)})}),t.trail){let m=t.trail,f=t.fields[t.fields.length-1];if(f&&f.y===m.y){let u=m.x-o.fieldGap/2;c.push(`<line class="dg-sep" x1="${ne(u)}" y1="${ne(m.y+o.sepInset)}" x2="${ne(u)}" y2="${ne(m.y+o.h-o.sepInset)}"/>`)}c.push(Me(a.ink,"dg-fl",m.x,m.y+o.nameY,m.title,A.fieldName));let d=m.y+o.valueY-A.fieldValue.size/3;m.states.forEach((u,M)=>{let x=ne(m.x+o.trail.r+M*o.trail.step),h=l.get(u.box),g=h===void 0?"":`<circle class="dg-tr-fill dg-a" cx="${x}" cy="${ne(d)}" r="${o.trail.r}" style="${s.pop(h)}"/>`;c.push(`<g data-trail="${ve(u.box)}" style="${ke(u.color)}"><circle class="dg-tr-ring" cx="${x}" cy="${ne(d)}" r="${o.trail.r}"/>${g}</g>`)})}return c.join("")}var pt=t=>Math.round(t*100)/100,Ks=t=>[t.x+t.w/2,t.y+t.h/2];function pi(t,n){let a=w.carrier,p=Ie(t),l=pe(t,p?A.carrierJa:A.carrier)+a.tagPadX*2;return`<rect class="dg-car" x="${pt(-l/2)}" y="${-a.tagH/2}" width="${pt(l)}" height="${a.tagH}" rx="${a.tagH/2}" ${n}/><text class="dg-car-t${p?" dg-car-tj":""}" y="${w.baseline.carrier}" text-anchor="middle">${ve(t)}</text>`}function Ws(t,n,a,p){let{m:l}=p,e=w.git,s=(d,u)=>a.edges.find(M=>M.step===d&&M.event===u),r=t.links.map(d=>{let u=s(d.step,d.event);if(!u)return"";p.traces.push({from:d.from,to:d.to,points:d.points,shown:[[u.start,Number.POSITIVE_INFINITY]]});let M=it(d.points);if(d.kind==="copy")return`<g style="${ke(d.color)}"><path class="dg-git-cp dg-a" d="${M}" style="${l.vis(u.start,l.last)}"/></g>`;let x=l.kf([[0,{opacity:0,"stroke-dashoffset":1}],[u.start,{opacity:0,"stroke-dashoffset":1},fe.inOut],[u.start+.05,{opacity:1}],[u.drawn,{"stroke-dashoffset":0}],[l.last,{opacity:1,"stroke-dashoffset":0},fe.inOut],[l.total,{opacity:0,"stroke-dashoffset":0}]]);return`<g style="${ke(d.color)}"><path class="dg-git-l dg-a" pathLength="1" d="${M}" style="${x}"/></g>`}).join(""),o=t.commits.map(d=>{let u=s(d.step,d.event)?.drawn??0,M={x:d.cx-d.r,y:d.cy-d.r,w:d.r*2,h:d.r*2};p.ink.push({text:d.id,rect:M,shown:[[u,Number.POSITIVE_INFINITY]],boxed:!0});let x=(d.text?.lines??[]).map((P,j)=>{let $=j===0&&d.hash!==void 0,S=d.text?.baselines[j]??d.cy;return Me(p.ink,$?"dg-git-h":"dg-git-n",d.cx,S,P,$?A.gitHash:A.gitNote,[[u,Number.POSITIVE_INFINITY]],"middle")}).join(""),h=`<text class="dg-git-id" x="${pt(d.cx)}" y="${pt(d.cy+w.baseline.badge)}" text-anchor="middle">${ve(d.id)}</text>`,g=`<g class="dg-popc dg-a" style="${l.pop(u)}"><circle class="dg-git-c" cx="${pt(d.cx)}" cy="${pt(d.cy)}" r="${d.r}" ${p.sh}/>${h}</g>`,L=x===""?"":`<g class="dg-a" style="${l.vis(u)}">${x}</g>`,O=d.orphan===void 0?void 0:s(d.orphan,d.orphanEvent??0)?.drawn,_=O===void 0?"":`<g class="dg-a" data-orphan="${ve(d.id)}" style="${l.vis(O,l.last,{f:.5})}"><circle class="dg-git-old" cx="${pt(d.cx)}" cy="${pt(d.cy)}" r="${e.orphan}"/><text class="dg-git-oldl" x="${pt(d.cx)}" y="${pt(d.cy+w.baseline.badge)}" text-anchor="middle">${ve(d.id)}</text></g>`;return`<g data-commit="${ve(d.id)}" style="${ke(d.color)}">${g}${L}${_}</g>`}).join(""),i=t.moves.flatMap(d=>{let u=s(d.step,d.event);if(!d.line||!u)return[];let M=a.steps[d.step].end;p.traces.push({from:d.ref,to:d.target??d.ref,points:d.line,shown:[[u.start,M+.4]]});let x=l.kf([[0,{opacity:0,"stroke-dashoffset":1}],[u.start,{opacity:0,"stroke-dashoffset":1},fe.inOut],[u.start+.05,{opacity:1}],[u.drawn,{"stroke-dashoffset":0}],[M,{opacity:1},fe.inOut],[M+.4,{opacity:0}],[l.total,{opacity:0,"stroke-dashoffset":0}]]);return[`<g style="${ke(d.color)}"><path class="dg-e-on dg-a" pathLength="1" d="${it(d.line)}" style="${x}"/></g>`]}).join(""),c=a.carriers.flatMap(d=>{let u=t.moves.find(h=>h.step===d.step&&h.event===d.event&&h.line),M=n.steps[d.step]?.events[d.event];if(!u?.line||M?.type!=="edge")return[];let x={step:d.step,event:d.event,from:u.ref,to:u.target??u.ref,points:u.line,color:u.color,carry:M.carry};return[nn(x,{...d,start:d.depart,end:d.arrive+oe.fade},p)]}).join(""),f=[...new Set(t.moves.map(d=>d.ref))].map(d=>ci(d,t.moves.filter(u=>u.ref===d),s,p)).join("")+c;return{links:r,lines:i,commits:o,tags:f}}function ci(t,n,a,p){let{m:l}=p,e=[],s=[[0,{opacity:0}]],r=!1,o,i=d=>{o&&p.ink.push({text:t,rect:o.rect,shown:[[o.since,d]],boxed:!0}),o=void 0};for(let d of n){let u=a(d.step,d.event);if(!u)continue;let{start:M,drawn:x}=u,h=d.from?Ks(d.from):void 0,g=d.to?Ks(d.to):void 0;if(i(M),d.carried&&h&&g&&r){e.push([M+oe.fade,h[0],h[1]],[x-oe.fade,g[0],g[1]]),s.push([M,{opacity:1},fe.inOut],[M+oe.fade,{opacity:0}],[x-oe.fade,{opacity:0},fe.out],[x,{opacity:1}]),o={rect:d.to,since:x};continue}if(h&&e.push([M,h[0],h[1]]),g&&e.push([x,g[0],g[1]]),g&&!r){let L=h?M:x-oe.fade;s.push([L,{opacity:0},fe.out],[L+oe.fade,{opacity:1}]),r=!0}else!g&&r&&(s.push([x,{opacity:1},fe.inOut],[x+oe.untilFade,{opacity:0}]),r=!1);d.to&&(o={rect:d.to,since:x})}if(i(Number.POSITIVE_INFINITY),e.length===0)return"";let c=e[0],m=e[e.length-1];r?s.push([l.last,{opacity:1},fe.inOut],[l.total,{opacity:0}]):s.push([l.total,{opacity:0}]);let f=l.move([[0,c[1],c[2]],...e,[l.total,m[1],m[2]]],s);return`<g class="dg-a" data-ref="${ve(t)}" style="${f}">${pi(t,p.sh)}</g>`}var Un={};Tt(Un,{drawLineup:()=>Xs,layoutLineup:()=>Hs});function di(t,n,a){let p=t.steps.flatMap(l=>l.events.flatMap(e=>e.type==="swap"&&e.box===n?[pe(e.text,A.boxSubStrong)]:[]));return a===void 0?p:[pe(a,A.boxSub),...p]}function Hs(t){let{margin:n,gap:a,lineup:p}=w,l=t.lineup?.items??[],e=new Set(l.map(S=>S.id)),s=Math.max(p.chip.w,...l.map(S=>S.label===void 0?0:pe(S.label,A.chip)+p.chip.padX*2)),r=s+p.chip.gap,o=r*Dn-p.chip.gap,i=t.boxes.map(S=>pe(S.name,A.boxName)+p.textGap+Math.max(0,...di(t,S.id,S.sub))),c=Math.max(o+p.padX*2,...i.map(S=>S+p.padX*2),ze(t)),m=He(t),f=t.boxes.map((S,y)=>{let F=n+y*(p.h+a),C=F+p.textY,X=n+c-p.padX;return{id:S.id,name:S.name,...S.sub!==void 0?{sub:S.sub}:{},color:m.get(S.id)??"slate",x:n,y:F,w:c,h:p.h,cx:n+c/2,cy:F+p.h/2,title:{...Ge(S.name,n+p.padX,C,A.boxName),text:S.name,baseline:C},...S.sub!==void 0?{note:{...Ge(S.sub,X-pe(S.sub,A.boxSub),C,A.boxSub),text:S.sub,baseline:C}}:{},noteRight:X,track:{x:n+p.padX,y:F+p.trackY,w:o,h:p.chip.h}}}),d=new Map(f.map(S=>[S.id,S])),u=[],M=[],x=[],h=[],g=new Map,L=new Map,O;t.steps.forEach((S,y)=>{let F=[...g.values()].flat();S.events.forEach((C,X)=>{if(C.type!=="line"&&C.type!=="seal"&&C.type!=="open"&&C.type!=="pick"&&C.type!=="stamp")return;let z=d.get(C.box);if(!z)return;let Q={step:y,event:X};if(C.type==="seal"&&!L.has(z.id)){let{over:B}=p.seal,v={...Q,lane:z.id,x:z.track.x-B,y:z.track.y-B,w:z.track.w+B*2,h:z.track.h+B*2};M.push(v),L.set(z.id,v)}else if(C.type==="open"){let B=L.get(z.id);B&&(B.until=Q),L.delete(z.id)}else if(C.type==="pick"&&O!==z.id)h.push({...Q,lane:z.id}),O=z.id;else if(C.type==="stamp"){let B=pe(C.text,A.stamp)+p.stamp.padX*2;x.push({...Q,lane:z.id,text:C.text,x:z.x+z.w-p.padX-B,y:z.track.y+(z.track.h-p.stamp.h)/2,w:B,h:p.stamp.h})}else if(C.type==="line"){let B=g.get(z.id)??[],D=[...new Set(C.items)].filter(R=>e.has(R)).slice(0,Dn).map((R,W)=>{let J=B.find(ue=>ue.id===R);if(J?.index===W)return J;let Z=F.filter(ue=>ue.id===R),ie=J??Z.find(ue=>ue.lane===O)??Z.at(-1),de={...Q,id:R,lane:z.id,index:W,x:z.track.x+r*W,y:z.track.y,w:s,h:p.chip.h,...ie?{from:[ie.x,ie.y]}:{}};return u.push(de),de});for(let R of B)D.includes(R)||(R.until=Q);g.set(z.id,D)}})});let _={kind:"lineup",width:0,height:0,regions:[],boxes:f,lifelines:[],edges:[],labels:[],actions:[],badges:[],paths:[],ends:[],lanes:f,chips:u,seals:M,stamps:x,picks:h},P=Math.max(...f.map(S=>S.y+S.h),n),j=c+n*2,$=Ue(t,n,P+a,j-n*2);return _.width=j,_.height=($?$.y+$.h:P)+n,$&&(_.strip=$),_.badges=mi(t,_),_}function mi(t,n){let{inset:a}=w.badge,p=[],l=(e,s,r,o)=>{p.push({step:e,x:s,y:r,color:o})};return t.steps.forEach((e,s)=>{let r=e.events.flatMap(i=>"box"in i?[i.box]:[]).flatMap(i=>n.lanes.filter(c=>c.id===i))[0];if(r){l(s,r.x,r.track.y+r.track.h/2,r.color);return}let o=p[p.length-1];n.strip&&e.events.some(i=>i.type==="strip")?l(s,n.strip.x+a,n.strip.y+a,"slate"):o?p.push({...o,step:s}):l(s,w.margin,w.margin,n.lanes[0]?.color??"slate")}),Xe(p)}var Fe=t=>Math.round(t*100)/100,zn=(t,n,a=1)=>`translate(${Fe(t)}px,${Fe(n)}px) scale(${a})`,fi=(t,n)=>n.reduce((a,[p,l])=>a.flatMap(([e,s])=>l<=e||p>=s?[[e,s]]:[...e<p?[[e,p]]:[],...l<s?[[l,s]]:[]]),[t]);function Xs(t,n,a,p,l){let{m:e}=p,s=w.lineup,r=oe.lineup.cut,o=y=>a.edges.find(F=>F.step===y.step&&F.event===y.event)??{start:0,drawn:0},i=new Map((n.lineup?.items??[]).map(y=>[y.id,y])),c=new Map(t.lanes.map(y=>[y.id,[]])),m=new Set,f=(y,F,C)=>{m.has(y)!==C&&(C?m.add(y):m.delete(y),c.get(y)?.push([F,C]))};for(let y of[...a.edges].sort((F,C)=>F.start-C.start)){let F=n.steps[y.step]?.events[y.event];if(F?.type==="line"&&f(F.box,y.start,!1),F?.type==="pick")for(let C of t.lanes)f(C.id,y.start,C.id!==F.box)}let d=y=>{let F=c.get(y)??[];if(F.length===0)return;let C=[[0,{opacity:1}]],X=1;for(let[z,Q]of F){let B=Q?s.faint:1;C.push([z,{opacity:X},fe.inOut],[z+oe.fade,{opacity:B}]),X=B}return C.push([e.last,{opacity:X},fe.inOut],[e.total,{opacity:1}]),e.kf(C)},u=y=>[o(y).drawn,y.until?o(y.until).start:Number.POSITIVE_INFINITY],M=y=>{if(y.length===0)return;let F=[[0,{opacity:1}]];for(let C of y){let[X,z]=u(C);F.push([X,{opacity:1}],[X+r,{opacity:0}]),C.until&&F.push([z,{opacity:0}],[z+r,{opacity:1}])}return F.push([e.total-r,{opacity:y.at(-1)?.until?1:0}],[e.total,{opacity:1}]),e.kf(F)},x=y=>{let{start:F,drawn:C}=o(y),X={opacity:0,transform:"scaleX(0)"},z=y.until?[[o(y.until).start,{opacity:1},fe.inOut],[o(y.until).start+oe.fade,{opacity:0}],[e.total,{opacity:0}]]:[[e.last,{opacity:1},fe.inOut],[e.total,{opacity:0}]];return e.kf([[0,X],[F-r,X],[F,{opacity:1,transform:"scaleX(0)"},fe.inOut],[C,{transform:"scaleX(1)"}],...z])},h=y=>{if(!y.until)return;let F=y.until,C=t.chips.find(X=>X!==y&&X.id===y.id&&X.step===F.step&&X.from?.[0]===y.x&&X.from?.[1]===y.y);return C?{at:o(C).start,moved:!0}:{at:o(F).start,moved:!1}},g=y=>{let F=o(y).start,C=zn(0,0),X=[];if(y.from){let Q=zn(y.from[0]-y.x,y.from[1]-y.y);X.push([0,{opacity:0,transform:Q}],[F-r,{opacity:0,transform:Q}],[F,{opacity:1,transform:Q},fe.inOut],[F+oe.lineup.slide,{transform:C}])}else{let Q=zn(0,0,w.popFrom);X.push([0,{opacity:0,transform:Q}],[F,{opacity:0,transform:Q},fe.pop],[F+oe.popFade,{opacity:1,transform:C}])}let z=h(y);return z?X.push([z.at,{opacity:1},fe.inOut],[z.at+(z.moved?r:oe.fade),{opacity:0}],[e.total,{opacity:0}]):X.push([e.last,{opacity:1},fe.inOut],[e.total,{opacity:0}]),e.kf(X)},L=(y,F)=>{let C=i.get(y.id),X=C?.color,z=`<rect class="${X?"dg-ln-chip":"dg-ln-plain"}" x="${Fe(y.x)}" y="${Fe(y.y)}" width="${Fe(y.w)}" height="${y.h}" rx="${s.chip.radius}"/>`,Q=fi([o(y).start+oe.lineup.slide,h(y)?.at??Number.POSITIVE_INFINITY],F),B=C?.label===void 0?"":Me(p.ink,X?"dg-ln-t":"dg-ln-tp",y.x+y.w/2,y.y+y.h/2+w.baseline.tag,C.label,A.chip,Q,"middle");return`<g class="dg-popc dg-a" data-lineup-chip="${ve(y.id)}" data-lineup-on="${ve(y.lane)}" data-lineup-seat="${y.index}" style="${X?`${ke(X)};`:""}${g(y)}">${z}${B}</g>`},O=(y,F,C)=>`<g class="dg-a" data-lineup-ring="${ve(y.lane)}" style="${e.vis(o(y).start,F?o(F).start:e.last)}">${C}</g>`,_=new Map(t.lanes.map(y=>[y.id,d(y.id)])),P=t.lanes.map(y=>{let F=(Q,B="")=>`<rect class="${Q}" x="${Fe(y.x)}" y="${Fe(y.y)}" width="${Fe(y.w)}" height="${y.h}" rx="${s.radius}"${B}/>`,C=t.picks.flatMap((Q,B)=>Q.lane===y.id?[O(Q,t.picks[B+1],`${F("dg-halo")}${F("dg-on")}`)]:[]).join(""),X=en(y,e,l.get(y.id)??[],y.title.baseline,p.ink,y.noteRight),z=_.get(y.id);return`<g${z?' class="dg-a"':""} data-lineup-lane="${ve(y.id)}" style="${ke(y.color)}${z?`;${z}`:""}">${F("dg-st",` ${p.sh}`)}${C}${Me(p.ink,"dg-sn",y.title.x,y.title.baseline,y.name,A.boxName,Ce)}${X}</g>`}).join(""),j=s.seal.stripe,$=`<defs><pattern id="dg-seal-${p.id}" patternUnits="userSpaceOnUse" width="${j*2}" height="${j*2}" patternTransform="rotate(45)"><rect class="dg-ln-sl" width="${j*2}" height="${j*2}"/><rect class="dg-ln-sd" width="${j}" height="${j*2}"/></pattern></defs>`,S=t.lanes.map(y=>{let F=t.seals.filter(R=>R.lane===y.id),C=F.map(u),X=t.chips.filter(R=>R.lane===y.id).map(R=>L(R,C)).join(""),z=M(F),Q=`<g${z?' class="dg-a"':""} data-lineup-track="${ve(y.id)}"${z?` style="${z}"`:""}>${X}</g>`,B=F.map(R=>`<rect class="dg-ln-seal dg-a" data-lineup-seal="${ve(y.id)}" x="${Fe(R.x)}" y="${Fe(R.y)}" width="${Fe(R.w)}" height="${Fe(R.h)}" rx="${s.seal.radius}" fill="url(#dg-seal-${p.id})" style="${x(R)}"/>`).join(""),v=t.stamps.filter(R=>R.lane===y.id).map(R=>{let W=o(R).start,J=R.x+R.w/2,Z=R.y+R.h/2,ie=Me(p.ink,"dg-ln-st",J,Z+w.baseline.tag,R.text,A.stamp,[[W,Number.POSITIVE_INFINITY]],"middle");return`<g class="dg-popc dg-a" data-lineup-stamp="${ve(y.id)}" style="${ke(s.stamp.color)};${e.pop(W)}"><g transform="rotate(${s.stamp.tilt} ${Fe(J)} ${Fe(Z)})"><rect class="dg-ln-stamp" x="${Fe(R.x)}" y="${Fe(R.y)}" width="${Fe(R.w)}" height="${R.h}" rx="${s.stamp.radius}"/>${ie}</g></g>`}).join(""),D=_.get(y.id);return`<g${D?` class="dg-a" style="${D}"`:""}>${Q}${B}${v}</g>`}).join("");return{lanes:P,chips:`${$}${S}`}}var zs={};function jt(t,n){zs[t]=n}function nt(t,n="ja"){let a=zs[t];if(a===void 0)throw new Error(Qe[n].kindNotLoaded(t));return a}var Jn={};Tt(Jn,{layoutState:()=>Js});var Us=t=>Nt.includes(t);function ui(t){let n=[],a=p=>{!Us(p)&&!n.includes(p)&&n.push(p)};for(let{edge:p}of $t(t))a(p.from),a(p.to);return n}var hi=(t,n)=>t.from===n.from&&t.to===n.to;function Js(t,n){let{box:a,state:p,margin:l,gap:e}=w,s=w.edge.inset,r=Qe[n],o=He(t),i=$t(t),c=ui(t),m=t.boxes.map(k=>k.id).filter(k=>!c.includes(k)),f=(t.state?.paths??[]).filter(k=>!i.some(({edge:V})=>hi(V,k))),d=[...i.map(({edge:k})=>k),...f],u=p.ghost,M=k=>{let V=t.boxes.find(te=>te.id===k);return u.pad*2+a.icon+u.gap+Math.max(pe(V?.name??k,A.boxName),pe(V?.sub??"",A.boxSub))},x=kt(t),h=Math.max(a.padX,p.done.inset+p.done.r+w.slot.clear),g=new Map(t.boxes.map(k=>[k.id,m.includes(k.id)?M(k.id):Math.max(tt(t,k.id,!0),vt(x.get(k.id),k.icon!==void 0,h))])),L=Math.max(1,Math.min(p.columns,c.length)),O=Math.max(1,Math.ceil(c.length/p.columns)),_=new Map(c.map((k,V)=>{let te=Math.floor(V/p.columns),xe=V%p.columns;return[k,{row:te,col:te%2===0?xe:L-1-xe}]})),P=Array.from({length:L},(k,V)=>Math.max(a.minW,...c.filter(te=>_.get(te)?.col===V).map(te=>g.get(te)??a.minW))),j=Array.from({length:Math.max(0,L-1)},()=>p.columnGap);for(let k of d){let V=_.get(k.from),te=_.get(k.to);if(!V||!te||k.label===void 0||V.row!==te.row||Math.abs(V.col-te.col)!==1)continue;let xe=Math.min(V.col,te.col);j[xe]=Math.max(j[xe]??0,pe(k.label,We(k.label))+w.label.padX*2+p.labelRoom*2)}let $=[];for(let k=0;k<L;k++)$.push(k===0?l:$[k-1]+P[k-1]+j[k-1]);let S=k=>$[k]+P[k]/2,y=k=>m.includes(k),F=new Set(f.filter(k=>y(k.to)&&!y(k.from)&&!Us(k.from)).map(k=>k.from)),C=[r.sideNote,...F.size>0?[r.sideFrom(F.size)]:[]],X=Math.max(pe(r.side,A.regionName),...C.map(k=>pe(k,A.regionNote))),z=p.side.pad*2+Math.max(u.h,A.regionName.size+w.region.line*C.length+p.side.pad/4),Q=d.some(k=>k.from==="start"),B=l+(m.length>0?z+p.side.gap:Q?p.start+p.drop:0),v=k=>B+k*(a.h+p.rowGap),D=(k,V,te,xe)=>{let be=t.boxes.find(Le=>Le.id===k),$e=g.get(k)??a.minW,Je=xe?u.h:a.h;return{id:k,name:be?.name??k,...be?.sub!==void 0?{sub:be.sub}:{},...be?.icon!==void 0?{icon:be.icon}:{},color:o.get(k)??"slate",x:V-$e/2,y:te,w:$e,h:Je,cx:V,cy:te+Je/2,...xe?{ghost:!0}:{}}},R=c.map(k=>{let V=_.get(k);return D(k,S(V.col),v(V.row),!1)});for(let k of R)Pt(k,x.get(k.id),h);let W=new Map(R.map(k=>[k.id,k])),J=k=>R.some(V=>V!==k&&Math.abs(V.cx-k.cx)<.5&&V.y>k.y),Z=[],ie=R[0],de=Math.max(...R.map(k=>k.x+k.w)),ue,I=l+z+p.side.lane;if(m.length>0){let k=Le=>f.filter(Be=>Be.to===Le).flatMap(Be=>W.get(Be.from)??[]),V=m.flatMap(k),te=Math.max(l,Math.min(...V.length>0?V.map(Le=>Le.x):[l+p.side.pad])-p.side.pad),xe=te+p.side.pad+X+e*2,be=m.map(Le=>{let Be=k(Le);return{id:Le,cx:Be.length>0?Be.reduce((yt,St)=>yt+St.cx,0)/Be.length:xe}});be.sort((Le,Be)=>Le.cx-Be.cx);let $e=te;for(let{id:Le,cx:Be}of be){let yt=g.get(Le)??a.minW,St=Math.max(Be-yt/2,xe),mt=D(Le,St+yt/2,l+(z-u.h)/2,!0);R.push(mt),W.set(Le,mt);let ms=f.some(fs=>fs.from===Le&&fs.to==="finish");ms&&Z.push({kind:"finish",x:mt.x+mt.w+p.beside,y:mt.cy,r:p.end.r,ghost:!0,text:"",box:Le}),$e=ms?mt.x+mt.w+p.beside+p.end.r:mt.x+mt.w,xe=$e+e*2}let Je=Math.max($e+p.side.pad,de);ue={x:te,y:l,w:Je-te,h:z,title:r.side,notes:C}}if(ie&&Q){let k=ie.cx+p.start+p.text+pe(r.start,A.regionNote)+e,V=ue&&k<ue.x?ue.y+p.side.pad+p.start:ie.y-p.drop;Z.unshift({kind:"start",x:ie.cx,y:V,r:p.start,ghost:!1,text:r.start})}for(let k of R.filter(V=>!V.ghost&&d.some(te=>te.from===V.id&&te.to==="finish")))Z.push(J(k)?{kind:"finish",x:k.x+k.w+p.beside,y:k.cy,r:p.end.r,ghost:!1,text:r.end,box:k.id}:{kind:"finish",x:k.cx,y:k.y+k.h+p.below,r:p.end.r,ghost:!1,text:r.end,box:k.id});let me=(k,V)=>{let te=_.get(k.id),xe=_.get(V.id);if(!te||!xe)return[[k.cx,k.y+k.h],[V.cx,V.y-s]];if(te.row===xe.row&&Math.abs(te.col-xe.col)===1)return V.cx>k.cx?[[k.x+k.w,k.cy],[V.x-s,V.cy]]:[[k.x,k.cy],[V.x+V.w+s,V.cy]];if(te.row===xe.row){let $e=k.y+k.h+p.rowGap/4;return[[k.cx,k.y+k.h],[k.cx,$e],[V.cx,$e],[V.cx,V.y+V.h+s]]}if(xe.row>te.row){if(Math.abs(k.cx-V.cx)<.5)return[[k.cx,k.y+k.h],[V.cx,V.y-s]];let $e=k.y+k.h+p.rowGap/2;return[[k.cx,k.y+k.h],[k.cx,$e],[V.cx,$e],[V.cx,V.y-s]]}if(Math.abs(k.cx-V.cx)<.5)return[[k.cx,k.y],[V.cx,V.y+V.h+s]];let be=V.y+V.h+p.rowGap/2;return[[k.cx,k.y],[k.cx,be],[V.cx,be],[V.cx,V.y+V.h+s]]},ae=(k,V)=>{let te=f.filter(be=>be.to===V.id).flatMap(be=>W.get(be.from)??[]).sort((be,$e)=>be.cx-$e.cx),xe=te.findIndex(be=>be.id===k);return te.length<=1?Math.min(Math.max(te[0]?.cx??V.cx,V.x+p.side.entry),V.x+V.w-p.side.entry):V.x+p.side.entry+(V.w-p.side.entry*2)*Math.max(0,xe)/(te.length-1)},ye=k=>Q&&k===ie?k.cx+p.side.entry:k.cx,we=k=>Z.find(V=>V.kind==="finish"&&V.box===k),E=(k,V)=>{if(k==="start"){let be=Z.find(Je=>Je.kind==="start"),$e=W.get(V);return!be||!$e?[]:[[be.x,be.y+be.r],[$e.cx,$e.y-s]]}let te=W.get(k);if(!te)return[];if(V==="finish"){let be=we(k);return be?Math.abs(be.x-te.cx)<.5?[[te.cx,te.y+te.h],[te.cx,be.y-be.r-s]]:[[te.x+te.w,te.cy],[be.x-be.r-s,te.cy]]:[]}let xe=W.get(V);if(!xe)return[];if(k===V)return Et(te);if(xe.ghost&&!te.ghost){let be=ye(te),$e=ae(k,xe);return Math.abs(be-$e)<.5?[[be,te.y],[$e,xe.y+xe.h+s]]:[[be,te.y],[be,I],[$e,I],[$e,xe.y+xe.h+s]]}return te.ghost&&xe.ghost?[[te.x+te.w,te.cy],[xe.x-s,xe.cy]]:te.ghost?[[te.cx,te.y+te.h],[te.cx,I],[xe.cx,I],[xe.cx,xe.y-s]]:me(te,xe)},N=k=>{let V=k.to==="finish"?we(k.from):void 0;if(!V)return;let te=W.get(k.from);return te&&Math.abs(V.x-te.cx)<.5?[V.x-V.r-e-lt(k.carry)[0],V.y]:[V.x,V.y+V.r+e+w.carrier.tagH/2]},se=k=>{let V=k.from==="start"?Z.find(te=>te.kind==="start"):void 0;return V?[V.x-V.r-w.slot.mark-lt(k.carry)[0],V.y]:void 0},T=i.map(({step:k,event:V,edge:te})=>{let xe=N(te),be=te.carry.kind==="none"?void 0:se(te);return{step:k,event:V,from:te.from,to:te.to,points:E(te.from,te.to),color:gi(te,o),carry:te.carry,...xe?{settle:xe}:{},...be?{wait:be}:{}}});ft(T,W,x);let ee=new Map;for(let k of T){if(k.points.length!==2||!T.some($e=>$e.from===k.to&&$e.to===k.from&&$e.points.length===2))continue;let[V,te]=k.points,xe=Math.abs(te[1]-V[1])<Math.abs(te[0]-V[0]),be=(k.from<k.to?1:-1)*w.edge.parallel;k.points=k.points.map(([$e,Je])=>xe?[$e,Je+be]:[$e+be,Je]),ee.set(k,xe?be>0?"below":"above":be>0?"right":"left")}let b=f.map(k=>({from:k.from,to:k.to,points:E(k.from,k.to)})),G=(k,V,te)=>k.from===k.to?Xt(k.points):st(k.points,V,te),q=[],Y=Z.flatMap(k=>k.text===""?[]:[Ge(k.text,...Ut(k),A.regionNote)]),U=[...ht(T,t.steps.length,G).values()].map(k=>Ye(k.point)),K=[...ue?[{x:ue.x,y:ue.y,w:p.side.pad+X,h:ue.h}]:[],...Y],H=k=>[...T.map(V=>V.points),...b.map(V=>V.points)].filter(V=>V!==k);for(let k of T){let V=t.steps[k.step]?.events[k.event];if(V?.type!=="edge"||V.label===void 0)continue;let te=k.from===k.to,xe=Ct(k),be=q.filter(yt=>yt.text===V.label&&T.some(St=>St.step===yt.step&&St.event===yt.event&&Ct(St)===xe)),$e=be[be.length-1];if($e){$e.until=k.step,q.push({x:$e.x,y:$e.y,w:$e.w,h:$e.h,step:k.step,event:k.event,text:$e.text,family:$e.family,color:k.color});continue}let Je=pe(V.label,We(V.label))+w.label.padX*2,Le=te?{side:"below",base:zt(k.points,Je)}:{},Be=V.labelSide??(k.to==="finish"?"left":ee.get(k));q.push(Ze({step:k.step,event:k.event,text:V.label,points:k.points,color:k.color,...Be?{side:Be}:te?{}:{flip:!0},...Le},{hard:R,soft:[...K,...q],touch:U,lines:H(k.points)}))}let re=[];f.forEach((k,V)=>{let te=b[V];if(k.label===void 0||te.points.length===0)return;let xe=We(k.label),be=W.get(k.to)?.ghost===!0&&W.get(k.from)?.ghost!==!0,$e=te.points[0][0],Je=be?{side:"below",base:{x:$e+w.label.soft,y:I+w.label.soft},slide:Math.max(...te.points.map(([Be])=>Math.abs(Be-$e)))}:{},Le=Ze({step:-1,event:V,text:k.label,points:te.points,color:"slate",...Je},{hard:R,soft:[...K,...q,...re],touch:U,lines:H(te.points)});re.push(Le),te.label={x:Le.x,y:Le.y,w:Le.w,h:Le.h,text:k.label,family:xe.family}});let le={kind:"state",width:0,height:0,regions:[],boxes:R,lifelines:[],edges:T,labels:q,actions:[],badges:[],paths:b,ends:Z,...ue?{side:ue}:{}},Se=[...R.map(k=>k.x),...q.map(k=>k.x),...b.flatMap(k=>k.label?[k.label.x]:[])],qe=[...q.map(k=>k.y),...b.flatMap(k=>k.label?[k.label.y]:[])],Re=Math.max(0,l-Math.min(...Se)),Oe=qe.length>0?Math.max(0,l-Math.min(...qe)):0;(Re>0||Oe>0)&&Lt(le,Re,Oe);let De=k=>k.x+(k.text===""?k.r:p.text+pe(k.text,A.regionNote)),Ve=[...R.map(k=>k.x+k.w),...q.map(k=>k.x+k.w),...Z.map(De),...T.flatMap(k=>k.points.map(V=>V[0])),...b.flatMap(k=>[...k.points.map(V=>V[0]),...k.label?[k.label.x+k.label.w]:[]]),...ue?[ue.x+ue.w]:[]],Ke=[...R.map(k=>k.y+k.h),...q.map(k=>k.y+k.h),...Z.map(k=>k.y+k.r),...T.flatMap(k=>k.points.map(V=>V[1]))],gt={title:r.trail,states:c.map(k=>({box:k,color:o.get(k)??"slate"}))},dt=Math.max(Math.max(...Ve)+l,ze(t,gt)+l*2),Rt=Math.max(...Ke,v(O-1)+a.h),Dt=Ue(t,l,Rt+e,dt-l*2,gt);le.width=dt,le.height=(Dt?Dt.y+Dt.h:Rt)+l,Dt&&(le.strip=Dt);let qr=ht(T,t.steps.length,G);return le.badges=Xe(t.steps.map((k,V)=>{let te=qr.get(V);return te?{step:V,x:te.point[0],y:te.point[1],color:te.edge.color}:qt(k.events,V,le)})),le}function gi(t,n){return t.carry.kind==="coin"?at(t,n):n.get(t.to==="finish"?t.from:t.to)??"slate"}var Qn={};Tt(Qn,{drawTime:()=>rr,layoutTime:()=>nr,meterField:()=>ir,timeFocus:()=>or});var sn={d:86400,h:3600,min:60,s:1,ms:.001},yi=Object.keys(sn);function bi(t){let n=/^([0-9]+(?:\.[0-9]+)?)(ms|s|min|h|d)$/u.exec(t);if(!n)return{seconds:1,unit:"s"};let a=n[2];return{seconds:Number(n[1])*sn[a],unit:a}}var Zs=(t,n)=>yi.find(a=>t/sn[a]>=2-1e-9)??n,Qs=(t,n,a)=>`${Number((t/sn[n]).toFixed(2))} ${Qe[a].timeUnits[n]}`;function xi(t,n,a){let p=1;if(n)p=n*Math.max(1,Math.ceil(t/n/8));else for(let s=1;;s*=10){let r=[s,s*2,s*5].find(o=>t/o<=w.time.ticks);if(r!==void 0){p=r;break}}let l=[];for(let s=0;s<=t;s+=p)l.push(s);let e=l[l.length-1];return e!==t&&(t-e)*a>=w.time.minorPx&&l.push(t),{at:l,step:p}}function wi(t,n,a,p){let l=Array.from({length:n-1},(s,r)=>r+1).find(s=>n%s===0&&s*a>=w.time.minorPx);if(l===void 0)return[];let e=[];for(let s=l;s<t;s+=l)p.includes(s)||e.push(s);return e}function er(t){let n=0;return t.steps.map(a=>{let p=n;for(let l of a.events)l.type==="now"&&(n=Math.max(n,l.to+1));return[p,n]})}function nr(t,n="ja"){let a=w.time,{margin:p,gap:l}=w,e=w.region,s=Qe[n],r=t.time??{scale:{unit:"",length:"1s",count:1},rows:[]},{scale:o}=r,i=Math.max(1,o.count),c=bi(o.length),m=Math.max(a.width,ze(t)+p*2),f=Math.max(0,...r.rows.map(T=>pe(T.name,A.timeRow))),d=Math.max(a.axisX,p+e.inset+f+a.gutterGap),u=m-a.right-d,M=u/i,x=He(t),h=kt(t),g=[],L=[],O=[],_=[],P=new Map(r.rows.map(T=>[T.id,T])),j,$=p;if(r.zoom){let{from:T,to:ee}=r.zoom,b=ee-T+1,G=u/b,q=p,Y=Zs(ee*c.seconds,c.unit),U=[];for(let re=0;re<b;re++){let le=T+re,Se=d+re*G,qe=t.boxes.map((Oe,De)=>{let Ve=h.get(Oe.id),Ke=Math.max(tt(t,Oe.id,!1),vt(Ve,Oe.icon!==void 0,w.box.padX)),gt=q+a.boxTop+De*(w.box.h+a.boxGap),dt=P.get(Oe.id),Rt={id:Oe.id,name:Oe.name,...Oe.sub!==void 0?{sub:Oe.sub}:{},...Oe.icon!==void 0?{icon:Oe.icon}:{},color:x.get(Oe.id)??"slate",x:Se+G/2-Ke/2,y:gt,w:Ke,h:w.box.h,cx:Se+G/2,cy:gt+w.box.h/2,...dt?{row:dt.id}:{},...dt?.empty?.includes(le)?{empty:!0}:{}};return Pt(Rt,Ve),Rt});L.push(...qe);let Re=`${o.unit} ${(o.from??0)+le}${s.headJoin}${Qs(le*c.seconds,Y,n)}`;U.push({unit:le,head:Re,boxes:qe,x:Se,y:q,w:G,h:0})}let H=Math.max(q+a.boxTop,...L.map(re=>re.y+re.h))+a.zoomBottom;for(let re of U)re.h=H-q;g.push({id:"zoom",lines:[s.zoom],note:`${b} ${o.unit}`,icon:"clock",color:"blue",x:p,y:q,w:m-p*2,h:H-q,header:{x:p+e.inset,y:q+e.inset,w:Math.max(e.icon,pe(s.zoom,A.regionName)),h:e.nameY-e.inset+e.line}}),j={from:T,to:ee,frame:{x:0,y:0,w:0,h:0},guides:[],columns:U,empty:s.empty,headY:q+a.head},$=H+a.zoomGap}let S=$+a.rowsTop,y=r.rows.map((T,ee)=>({id:T.id,name:T.name,color:T.color??x.get(T.id)??bt[ee%bt.length],x:d,y:S+ee*(a.row+a.rowGap),w:u,h:a.row})),F=y.length>0?Math.max(...y.map(T=>T.y+T.h)):S,C=Math.min(a.markMax,Math.max(a.markMin,M*a.markRatio)),X=y.flatMap((T,ee)=>Array.from({length:i},(b,G)=>({row:T.id,unit:G,empty:r.rows[ee]?.empty?.includes(G)===!0,color:T.color,colors:[],x:d+(G+.5)*M-C/2,y:T.y,w:C,h:T.h})));if(t.steps.forEach((T,ee)=>T.events.forEach((b,G)=>{if(b.type==="mark")for(let q of X)q.row===b.row&&q.unit>=b.from&&q.unit<=b.to&&!q.empty&&q.colors.push({step:ee,event:G,color:b.color})})),j){let T={x:d+j.from*M-a.frame,y:S-a.frame,w:(j.to-j.from+1)*M+a.frame*2,h:F-S+a.frame*2},ee=Math.max(...j.columns.map(b=>b.y+b.h));j.frame=T,j.guides=[[[T.x,T.y],[d,ee]],[[T.x+T.w,T.y],[d+u,ee]]]}let z=F+a.point.drop,Q=(r.points??[]).map(T=>{let ee=[];t.steps.forEach((K,H)=>K.events.forEach((re,le)=>{re.type==="swap"&&re.box===T.id&&ee.push({step:H,event:le,text:re.text,...re.color?{color:re.color}:{}})}));let b=d+(T.at+.5)*M,G=b+a.point.text,q=Math.max(pe(T.id,A.pointName),...ee.map(K=>pe(K.text,A.pointState))),Y=z+a.point.nameY-A.pointName.size*.8,U=z+a.point.stateY+A.pointState.size*.2;return{id:T.id,unit:T.at,cx:b,cy:z,r:a.point.r,text:{x:G,y:Y,w:q,h:U-Y},changes:ee}}),B=new Map(Q.map(T=>[T.id,T])),v=(T,ee)=>B.get(T)?.changes.filter(G=>G.step<=ee&&G.color).at(-1)?.color;t.steps.forEach((T,ee)=>T.events.forEach((b,G)=>{if(b.type!=="edge")return;if(b.at===void 0){let U=B.get(b.from),K=B.get(b.to);if(!U||!K||U===K)return;let H=K.cx>U.cx,re=H?Math.max(U.cx+U.r,U.text.x+U.text.w+a.point.link):U.cx-U.r-a.point.end,le=H?K.cx-K.r-a.point.end:Math.min(K.cx-K.r,K.text.x+K.text.w+a.point.link),Se={step:ee,event:G,from:b.from,to:b.to,points:[[re,U.cy],[le,K.cy]],color:b.carry.kind==="coin"?"coin":v(b.to,ee)??"slate",carry:b.carry};b.carry.kind!=="none"&&(Se.settle=[le-(H?1:-1)*(w.carrier.coinR+w.edge.arrow),K.cy]),O.push(Se);return}let q=$i(b,j);if(!q)return;let Y={step:ee,event:G,from:b.from,to:b.to,points:q.points,color:at(b,x),carry:b.carry};ki(Y,q.from,q.to,h),O.push(Y),_.push({step:ee,event:G,from:q.from,to:q.to,column:b.at,into:b.into??b.at})}));let D={kind:"time",width:m,height:0,regions:g,boxes:L,lifelines:[],edges:O,labels:[],actions:[],badges:[],paths:[],ends:[],axis:{x:d,w:u,unit:M,count:i,line:0},rows:y,marks:X,ticks:[],minor:[],periods:[],points:Q,...j?{zoom:j}:{},spans:[],wires:_,needle:{y1:S-a.needle.over,y2:F+a.needle.over}},R=F,W=t.steps.some(T=>T.events.some(ee=>ee.type==="edge"&&ee.at===void 0&&ee.label!==void 0)),{r:J,inset:Z}=w.badge,ie=Q.length>0?z+a.point.r+(W?a.point.room:a.point.plain):R+(J+Z)*2,de=[],ue=t.steps.flatMap((T,ee)=>T.events.flatMap((b,G)=>b.type==="span"?[{s:ee,e:G,event:b}]:[]));for(let{s:T,e:ee,event:b}of ue){let G=b.shape==="box"?"box":"bracket",q=ue.find(re=>re.s>T&&(re.event.shape==="box"?"box":"bracket")===G&&re.event.from<=b.to&&b.from<=re.event.to),Y=b.color??"slate",U=d+b.from*M,K=d+(b.to+1)*M,H={step:T,event:ee,kind:G,from:b.from,to:b.to,text:b.text,color:Y,...q?{until:q.s}:{}};if(G==="box"){let re=a.box,le={x:U-re.pad,y:S-re.pad,w:K-U+re.pad*2,h:F-S+re.pad*2},Se=pe(b.text,A.tag)+re.tagPadX*2,qe={x:le.x+re.tagX,y:le.y-re.tagH/2,w:Se,h:re.tagH};de.push({...H,...le,textRect:qe,textY:le.y+w.baseline.tag})}else de.push({...H,x:U,y:0,w:K-U,h:a.bracket.tick,textRect:{x:0,y:0,w:0,h:0},textY:0})}D.spans=de,D.badges=tr(t,D,er(t)),D.labels=Pi(t,D),ie=Math.max(ie,...D.labels.map(T=>T.y+T.h+w.label.soft));let I=[];for(let T of de.filter(ee=>ee.kind==="bracket")){let ee=pe(T.text,A.spanText),b=Math.min(d+u-ee/2,Math.max(d+ee/2,T.x+T.w/2)),G={x:Math.min(T.x,b-ee/2),w:Math.max(T.x+T.w,b+ee/2)-Math.min(T.x,b-ee/2)},q=U=>{let K=U.until===void 0||U.until>T.step,H=Math.min(U.x,U.textRect.x),re=Math.max(U.x+U.w,U.textRect.x+U.textRect.w)-H;return K&&G.x<H+re&&H<G.x+G.w},Y=I.findIndex(U=>!U.some(q));Y<0&&(I.push([]),Y=I.length-1),I[Y].push(T),T.y=ie+a.bracket.gap+Y*a.bracket.lane,T.textY=T.y+a.bracket.tick+a.bracket.text,T.textRect=Ge(T.text,b,T.textY,A.spanText,"middle")}I.length>0&&(ie=Math.max(...de.filter(T=>T.kind==="bracket").map(T=>T.textRect.y+T.textRect.h)));let me=ie+a.axisGap;D.axis.line=me;let ae=xi(i,r.period?.length,M),ye=me+a.tickY,we=Zs(i*c.seconds,c.unit);D.ticks=ae.at.map(T=>{let ee=Qs(T*c.seconds,we,n),b=pe(ee,A.timeTick),G=d+T*M,q=T===0?G:T===i?G-b:Math.min(d+u-b,Math.max(d,G-b/2));return{at:T,x:G,text:ee,left:q,y:ye}}),D.minor=wi(i,ae.step,M,ae.at);let E=ye+A.timeTick.size*.2;if(r.period){let T=r.period,ee=[];for(let q=0,Y=0;Y<i;q++,Y+=T.length){let U=Math.min(i,Y+T.length)-1,K=`${T.name} ${(T.from??0)+q}`,H=(o.from??0)+Y,re=`${o.unit} ${s.range(String(H),String((o.from??0)+U))}`;ee.push({index:q,from:Y,to:U,name:K,range:re,x:d+Y*M,y:me,w:(U-Y+1)*M,h:0,nameY:ye,rangeY:ye+a.rangeY})}let b=D.ticks.map(q=>Ge(q.text,q.left,q.y,A.timeTick)),G=ee.some(q=>{let Y=Ge(q.name,q.x+q.w/2,q.nameY,A.timePeriod,"middle");return b.some(U=>Y.x<U.x+U.w+a.nameGap&&U.x<Y.x+Y.w+a.nameGap)});for(let q of ee)G&&(q.nameY=ye+a.rangeY+2,q.rangeY=q.nameY+a.rangeY),q.h=q.rangeY+A.timeRange.size*.2-me;D.periods=ee,E=Math.max(E,...ee.map(q=>q.rangeY+A.timeRange.size*.2))}let N=E+a.bottom;g.push({id:"axis",lines:[],color:"slate",x:p,y:$,w:m-p*2,h:N-$,header:{x:p+e.inset,y:$+e.inset,w:0,h:0}});let se=Ue(t,p,N+l,m-p*2);return se&&(D.strip=se),D.height=(se?se.y+se.h:N)+p,D.badges=tr(t,D,er(t)),D}function $i(t,n){if(!n||t.at===void 0)return;let a=t.into??t.at,p=n.columns.find(d=>d.unit===t.at),l=n.columns.find(d=>d.unit===a),e=p?.boxes.find(d=>d.id===t.from),s=l?.boxes.find(d=>d.id===t.to);if(!p||!l||!e||!s||e===s)return;let r=p.boxes.indexOf(e),o=l.boxes.indexOf(s),i=o>r;if(p===l){if(Math.abs(o-r)===1)return{from:e,to:s,points:[[e.cx,i?e.y+e.h+1:e.y-1],[s.cx,i?s.y-1:s.y+s.h+1]]};let d=Math.min(p.x+p.w-w.gap,Math.max(e.x+e.w,s.x+s.w)+w.gap);return{from:e,to:s,points:[[e.x+e.w+1,e.cy],[d,e.cy],[d,s.cy],[s.x+s.w+1,s.cy]]}}let c=l.x>p.x;if(r===o)return{from:e,to:s,points:[[c?e.x+e.w+1:e.x-1,e.cy],[c?s.x-1:s.x+s.w+1,s.cy]]};let m=e.cx+(c?1:-1)*e.w/4,f=s.cx-(c?1:-1)*s.w/4;return{from:e,to:s,points:[[m,i?e.y+e.h+1:e.y-1],[f,i?s.y-1:s.y+s.h+1]]}}function ki(t,n,a,p){let l={...t};ft([l],new Map([[t.to,a]]),p);let e={...t};ft([e],new Map([[t.from,n]]),p),l.settle&&(t.settle=l.settle),e.wait&&(t.wait=e.wait)}function tr(t,n,a){let{r:p,inset:l}=w.badge,{axis:e}=n,s=[],r=[],o=Math.min(...n.rows.map(m=>m.y),n.needle.y1+w.time.needle.over),i=Math.max(...n.rows.map(m=>m.y+m.h),o),c=n.points[0]?(i+n.points[0].cy-n.points[0].r)/2:i+p+l;return t.steps.forEach((m,f)=>{let d=(g,L)=>{s.push(g),r.push({step:f,x:g[0],y:g[1],color:L})},u=n.edges.filter(g=>g.step===f).sort((g,L)=>g.event-L.event)[0];if(u){let g=u.carry.kind!=="none"&&!u.wait?[u.points[0]]:[],L=n.edges.filter(O=>O!==u).map(O=>O.points);d(st(u.points,[...s,...g],L),u.color);return}let[M,x]=a[f]??[0,0];if(x>M){let g=e.x+(M+x)/2*e.unit,L=n.points.find(O=>Math.abs(O.cx-g)<p+l);L&&(g=L.cx+p+l*2),d([g,c],"slate");return}for(let g of m.events){let L=vi(g,f,n);if(L){d(L.at,L.color);return}}if(n.strip&&m.events.some(g=>g.type==="strip")){r.push({step:f,x:n.strip.x+l,y:n.strip.y+l,color:"slate"});return}let h=r[r.length-1];r.push(h?{...h,step:f}:{step:f,x:e.x-p-l,y:o,color:"slate"})}),Xe(r)}function vi(t,n,a){let{r:p,inset:l}=w.badge;if(t.type==="span"){let e=a.spans.find(s=>s.step===n&&s.from===t.from&&s.to===t.to&&s.text===t.text);return e?e.kind==="box"?{at:[e.x,e.y],color:e.color}:{at:[e.x-p-l,e.y+e.h/2],color:e.color}:void 0}if(t.type==="swap"){let e=a.points.find(s=>s.id===t.box);if(e)return{at:[e.cx-e.r-l-p,e.cy],color:t.color??"slate"}}if(t.type==="mark"){let e=a.rows.find(r=>r.id===t.row),s=Math.min(...a.rows.map(r=>r.y));if(e)return{at:[a.axis.x+(t.from+t.to+1)/2*a.axis.unit,s-p-l],color:t.color}}}function Pi(t,n){let a=[],p=n.points.map(s=>({x:s.cx-s.r,y:s.cy-s.r,w:s.r*2,h:s.r*2})),l=n.points.map(s=>s.text),e=(n.zoom?.columns??[]).map(s=>Ge(s.head,s.x+s.w/2,n.zoom?.headY??0,A.timeHead,"middle"));for(let s of n.edges){let r=t.steps[s.step]?.events[s.event];if(r?.type!=="edge"||r.label===void 0)continue;let o=n.badges.filter(c=>c.step<=s.step).map(c=>Ye([c.x,c.y])),i=r.labelSide??(r.at===void 0?"below":void 0);a.push(Ze({step:s.step,event:s.event,text:r.label,points:s.points,color:s.color,...i?{side:i}:{},flip:r.at!==void 0},{hard:[...p,...n.boxes],soft:[...l,...e,...a.filter(c=>c.step===s.step)],touch:o}))}return a}var ce=t=>Math.round(t*100)/100,Mt=(t,n)=>Ie(n)?`${t} ${t}j`:t;function sr(t){let n=[];for(let a of t){let p=n[n.length-2],l=n[n.length-1];if(p&&l){let e=l[0]===p[0]?Number.NaN:(l[1]-p[1])/(l[0]-p[0]),s=a[0]===l[0]?Number.NaN:(a[1]-l[1])/(a[0]-l[0]);Number.isFinite(e)&&Number.isFinite(s)&&Math.abs(e-s)<1e-9?n[n.length-1]=a:n.push(a)}else n.push(a)}return n}function Zn(t,n){let a=t[0];if(!a)return 0;if(n<=a[0])return a[1];for(let p=1;p<t.length;p++){let[l,e]=t[p],[s,r]=t[p-1];if(n<=l)return l===s?e:r+(e-r)*(n-s)/(l-s)}return t[t.length-1][1]}function rr(t,n,a,p,l){let{m:e,ink:s}=p,r=w.time,{axis:o}=t,i=new Map((a.units??[]).map(v=>[v.unit,v.passed])),c=(v,D)=>a.events.find(R=>R.step===v&&R.event===D)?.at,m=(v,D)=>a.edges.find(R=>R.step===v&&R.event===D)?.drawn,f=[],d=[],u=[],M=[],x=Math.min(...t.rows.map(v=>v.y)),h=Math.max(...t.rows.map(v=>v.y+v.h)),g=new Map;for(let v of t.wires){let D=m(v.step,v.event);D!==void 0&&g.set(v.to,Math.min(g.get(v.to)??Number.POSITIVE_INFINITY,D))}let L=(v,D)=>{let R=t.zoom?.columns.find(J=>J.unit===D)?.boxes.find(J=>J.id===v),W=[i.get(D),R?g.get(R):void 0].filter(J=>J!==void 0);return W.length>0?Math.min(...W):void 0};for(let v of t.periods)v.index%2===1&&f.push(`<rect class="dg-tm-ep" x="${ce(v.x)}" y="${ce(x-r.shade)}" width="${ce(v.w)}" height="${ce(h-x+r.shade*2)}" rx="4"/>`);if(t.zoom){let v=t.zoom;v.columns.forEach((D,R)=>{R>0&&f.push(`<line class="dg-tm-sep" x1="${ce(D.x)}" y1="${ce(D.y+r.sep)}" x2="${ce(D.x)}" y2="${ce(D.y+D.h-r.sep)}"/>`),f.push(Me(s,Mt("dg-tm-hd",D.head),D.x+D.w/2,v.headY,D.head,A.timeHead,Ce,"middle"));for(let W of D.boxes)u.push(O(W,D.unit))})}function O(v,D){let R=[...new Set(t.wires.filter(ie=>ie.from===v||ie.to===v).map(ie=>ie.step))].sort((ie,de)=>ie-de),W=ie=>`<rect class="${ie}" x="${ce(v.x)}" y="${ce(v.y)}" width="${ce(v.w)}" height="${v.h}" rx="${w.box.radius}"/>`;if(v.empty){let ie=i.get(D),de=t.zoom?.empty??"",ue=ie===void 0?"":`<g class="dg-a" style="${e.vis(ie)}">${W("dg-tm-ex")}${Me(s,"dg-tm-ext",v.cx,v.cy+w.baseline.mark,de,A.emptyText,[[ie,Number.POSITIVE_INFINITY]],"middle")}</g>`;return`<g data-empty="${ve(v.id)}">${W("dg-tm-ph")}${ue}</g>`}let J=Zt(n.boxes.find(ie=>ie.id===v.id)?.link,tn(v,p,R,l.get(v.id)??[]));if(!v.row)return J;let Z=L(v.row,D);return Z===void 0?W("dg-tm-ph"):`<g class="dg-a" style="${e.until(Z)}">${W("dg-tm-ph")}</g><g class="dg-popc dg-a" style="${e.pop(Z)}">${J}</g>`}for(let v of t.rows){let D=[];for(let R of t.marks.filter(W=>W.row===v.id)){let W=(Z,ie="")=>`<rect class="${Z}" x="${ce(R.x)}" y="${ce(R.y)}" width="${ce(R.w)}" height="${ce(R.h)}" rx="${r.markRadius}"${ie}/>`;if(D.push(W("dg-tm-slot")),R.empty){let Z=i.get(R.unit);Z!==void 0&&D.push(`<circle class="dg-tm-x dg-a" cx="${ce(R.x+R.w/2)}" cy="${ce(R.y+R.h/2)}" r="${r.emptyR}" style="${e.vis(Z,e.last,{f:.2})}"/>`);continue}let J=L(v.id,R.unit);J!==void 0&&D.push(W("dg-tm-m dg-a",` style="${e.vis(J,e.last,{f:.2})}"`)),R.colors.forEach((Z,ie)=>{let de=c(Z.step,Z.event);if(de===void 0)return;let ue=R.colors[ie+1],I=ue?c(ue.step,ue.event):void 0;D.push(`<g style="${ke(Z.color)}">${W("dg-tm-m dg-a",` style="${e.vis(de,I??e.last,{f:.35})}"`)}</g>`)})}f.push(`<g data-row="${ve(v.id)}" style="${ke(v.color)}">${D.join("")}</g>`),f.push(Me(s,"dg-tm-rn",w.margin+w.region.inset,v.y+v.h/2+w.baseline.mark,v.name,A.timeRow))}if(t.zoom){let v=t.zoom,D=t.spans.filter(J=>J.kind==="box"&&J.from<=v.to&&v.from<=J.to).map(J=>c(J.step,J.event)).filter(J=>J!==void 0).sort((J,Z)=>J-Z)[0],R=v.guides.map(J=>`<path class="dg-tm-gd" d="${it(J)}"/>`).join(""),W=`<rect class="dg-tm-fr" x="${ce(v.frame.x)}" y="${ce(v.frame.y)}" width="${ce(v.frame.w)}" height="${ce(v.frame.h)}" rx="4"/>${R}`;f.push(D===void 0?W:`<g class="dg-a" style="${e.until(D)}">${W}</g>`)}let _=v=>ce(o.x+v*o.unit),P=t.ticks.map(v=>`M ${_(v.at)} ${ce(o.line-r.major/2)} V ${ce(o.line+r.major/2)}`),j=t.minor.map(v=>`M ${_(v)} ${ce(o.line-r.minor/2)} V ${ce(o.line+r.minor/2)}`);f.push(`<path class="dg-tm-ax" d="M ${_(0)} ${ce(o.line)} H ${_(o.count)} ${[...P,...j].join(" ")}"/>`);for(let v of t.ticks)f.push(Me(s,Mt("dg-tm-tk",v.text),v.left,v.y,v.text,A.timeTick));for(let v of t.periods)f.push(Me(s,Mt("dg-tm-en",v.name),v.x+v.w/2,v.nameY,v.name,A.timePeriod,Ce,"middle")),f.push(Me(s,Mt("dg-tm-er",v.range),v.x+v.w/2,v.rangeY,v.range,A.timeRange,Ce,"middle"));for(let v of t.spans){let D=c(v.step,v.event);if(D===void 0)continue;let R=v.until===void 0?void 0:a.steps[v.until].start,W=[[D,R??Number.POSITIVE_INFINITY]],J=R===void 0?e.vis(D):e.vis(D,R,{within:!0});if(v.kind==="bracket"){let[ie,de,ue,I]=[ce(v.x+1),ce(v.x+v.w-1),ce(v.y),ce(v.y+v.h)],me=Me(s,Mt("dg-tm-bt",v.text),v.textRect.x+v.textRect.w/2,v.textY,v.text,A.spanText,W,"middle");f.push(`<g class="dg-a" data-span="${v.step}" style="${ke(v.color)};${J}"><path class="dg-tm-br" d="M ${ie} ${ue} L ${ie} ${I} L ${de} ${I} L ${de} ${ue}"/>${me}</g>`);continue}f.push(`<g class="dg-a" data-span="${v.step}" style="${ke(v.color)};${J}"><rect class="dg-tm-bx" x="${ce(v.x)}" y="${ce(v.y)}" width="${ce(v.w)}" height="${ce(v.h)}" rx="6"/></g>`);let Z=v.textRect;s.push({text:v.text,rect:Z,shown:W,boxed:!0}),M.push(`<g class="dg-tg dg-popc dg-a" style="${ke(v.color)};${R===void 0?e.pop(D):e.pop(D,R)}"><rect x="${ce(Z.x)}" y="${ce(Z.y)}" width="${ce(Z.w)}" height="${Z.h}" rx="${Z.h/2}"/><text x="${ce(Z.x+Z.w/2)}" y="${ce(v.textY)}" text-anchor="middle">${ve(v.text)}</text></g>`)}let $=r.point;for(let v of t.points){let{cx:D,cy:R,r:W}=v,J=v.changes.map(ye=>c(ye.step,ye.event)??Number.POSITIVE_INFINITY),Z=J[0];f.push(`<path class="dg-tm-con" d="M ${ce(D)} ${ce(h+3)} L ${ce(D)} ${ce(R-W-2)}"/>`);let ie=v.text.x,de=Me(s,Mt("dg-tm-pn",v.id),ie,R+$.nameY,v.id,A.pointName),ue=de.replace(/class="([^"]*)"/u,'class="$1 dg-tm-pn-g"'),I=Z===void 0||!Number.isFinite(Z)?ue:`<g class="dg-a" style="${e.until(Z)}">${ue}</g><g class="dg-a" style="${e.vis(Z)}">${de}</g>`,me=v.changes.map((ye,we)=>{let E=J[we];if(!Number.isFinite(E))return"";let N=J[we+1],se=N!==void 0&&Number.isFinite(N)?N-oe.untilFade:void 0,T=Me(s,Mt("dg-tm-ps",ye.text),ie,R+$.stateY,ye.text,A.pointState,[[E,se??Number.POSITIVE_INFINITY]]);return`<g class="dg-a" style="${ke(ye.color??"slate")};${se===void 0?e.rise(E):e.rise(E,se)}">${T}</g>`}).join(""),ae=v.changes.map((ye,we)=>{let E=J[we];return!ye.color||!Number.isFinite(E)?"":`<g class="dg-popc dg-a" style="${ke(ye.color)};${e.pop(E)}"><circle class="dg-tm-pc" cx="${ce(D)}" cy="${ce(R)}" r="${W+.5}"/>${rt("flag",D,R,$.glyph,"dg-tm-pcg")}</g>`}).join("");u.push(`<g data-point="${ve(v.id)}"><circle class="dg-tm-pg" cx="${ce(D)}" cy="${ce(R)}" r="${W}"/>${rt("flag",D,R,$.glyph,"dg-tm-pgl")}${ae}${I}${me}</g>`)}let S=new Set(t.wires.map(v=>`${v.step}/${v.event}`));for(let v of t.edges){if(S.has(`${v.step}/${v.event}`))continue;let D=a.edges.find(J=>J.step===v.step&&J.event===v.event);if(!D)continue;p.traces.push({from:v.from,to:v.to,points:v.points,shown:[[D.start,Number.POSITIVE_INFINITY]]});let R=e.kf([[0,{opacity:0,"stroke-dashoffset":1}],[D.start,{opacity:0,"stroke-dashoffset":1},fe.inOut],[D.start+.05,{opacity:1}],[D.drawn,{"stroke-dashoffset":0}],[e.last,{opacity:1,"stroke-dashoffset":0},fe.inOut],[e.total,{opacity:0,"stroke-dashoffset":0}]]),W=e.kf([[0,{opacity:0}],[D.drawn-.05,{opacity:0}],[D.drawn,{opacity:1}],[e.last,{opacity:1},fe.inOut],[e.total,{opacity:0}]]);d.push(`<g data-link="${ve(`${v.from}->${v.to}`)}" style="${ke(v.color)}"><path class="dg-tm-ln dg-a" pathLength="1" d="${it(v.points)}" style="${R}"/><path class="dg-eh-on dg-a" d="${At(v.points)}" style="${W}"/></g>`)}let y=a.needle??[],F=sr(y.filter(([v])=>v<e.total)),C=F[F.length-1]?.[1]??0,X=[...F.map(([v,D])=>[v,o.x+D*o.unit,0]),[e.last,o.x+C*o.unit,0],[e.total,o.x,0]],{y1:z,y2:Q}=t.needle,B=r.needle;return M.push(`<g class="dg-a" data-needle="" style="${e.move(X)}"><line class="dg-tm-nd" x1="0" y1="${ce(z)}" x2="0" y2="${ce(Q)}"/><path class="dg-tm-nh" d="M ${-B.head*.75} ${ce(z-B.head)} L ${B.head*.75} ${ce(z-B.head)} L 0 ${ce(z)} Z"/><circle class="dg-tm-nh" cy="${ce(o.line)}" r="${B.dot}"/></g>`),{base:f.join(""),lit:d.join(""),node:u.join(""),top:M.join("")}}function ir(t,n,a){let{m:p}=a,l=w.time.meter,{x:e,w:s,line:r,text:o}=t.meter,i=t.y+l.y,c=p.kf([...sr(n).map(([f,d])=>[f,{transform:`scaleX(${ce(d*1e3)/1e3})`}]),[p.last,{transform:`scaleX(${ce(Zn(n,p.last)*1e3)/1e3})`},fe.inOut],[p.total,{transform:"scaleX(0)"}]]),m=e+s*r;return`<rect class="dg-tm-mt" x="${ce(e)}" y="${ce(i)}" width="${ce(s)}" height="${l.h}" rx="${l.h/2}"/><rect class="dg-tm-mf dg-a" x="${ce(e)}" y="${ce(i)}" width="${ce(s)}" height="${l.h}" rx="${l.h/2}" style="${ke(l.color)};${c}"/><line class="dg-tm-mk" x1="${ce(m)}" y1="${ce(i-l.mark)}" x2="${ce(m)}" y2="${ce(i+l.h+l.mark)}"/>`+Me(a.ink,"dg-tm-ml",m,t.y+l.textY,o,A.meterLine,Ce,"middle")}function or(t,n,a,p,l,e){let s=n.steps[a],r=Zn(n.needle??[],s.end-oe.still),o=t.badges.find(h=>h.step===a),c=o&&Zn(n.needle??[],s.start)===r&&!(t.strip&&o.y>=t.strip.y)?o.x:t.axis.x+r*t.axis.unit,m=Math.min(...t.rows.map(h=>h.y)),f=Math.max(...t.rows.map(h=>h.y+h.h)),d={x:c-1,y:m,w:2,h:f-m},u=h=>Math.hypot(Math.max(0,h.x-c,c-h.x-h.w),Math.max(0,h.y-m,m-h.y-h.h)),M=t.points.filter(h=>h.changes.some(g=>g.step===a)).map(h=>({x:h.cx-h.r,y:h.cy-h.r,w:h.text.x+h.text.w-h.cx+h.r,h:h.r*2})),x=[...o?[{x:o.x-w.badge.r,y:o.y-w.badge.r,w:w.badge.r*2,h:w.badge.r*2}]:[],...[...p,...M].sort((h,g)=>u(h)-u(g))];for(let h of x){let g=Math.min(d.x,h.x),L=Math.min(d.y,h.y),O={x:g,y:L,w:Math.max(d.x+d.w,h.x+h.w)-g,h:Math.max(d.y+d.h,h.y+h.h)-L};O.w<=l&&O.h<=e&&(d=O)}return d}var es={};Tt(es,{drawTree:()=>pr,layoutTree:()=>lr});function Si(t){let n=new Set(t.boxes.map(e=>e.id)),a=new Set,p=new Map,l=[];return t.steps.forEach((e,s)=>{e.events.forEach((r,o)=>{if(r.type!=="leaf"&&r.type!=="node"||a.has(r.id)||n.has(r.id))return;let i=r.type==="node"?[...new Set(r.children)].filter(c=>a.has(c)&&!p.has(c)):[];for(let c of i)p.set(c,r.id);l.push({id:r.id,kind:r.type,children:i,step:s,event:o,...r.hash!==void 0?{hash:r.hash}:{}}),a.add(r.id)})}),{grown:l,parents:p}}function Mi(t,n){return t.hash===void 0?[{text:t.id,style:A.boxName}]:n?[{text:t.id,style:A.rootName},{text:t.hash,style:A.rootHash}]:t.kind==="leaf"?[{text:t.hash,style:A.treeHash}]:[{text:t.hash,style:A.treeHash},{text:t.id,style:A.treeName}]}function Oi(t,n){let a=w.edge.inset,p=Math.max(t.y,n.y),l=Math.min(t.y+t.h,n.y+n.h);if(l>p){let i=(p+l)/2;return n.x>=t.x+t.w?[[t.x+t.w+a,i],[n.x-a,i]]:[[t.x-a,i],[n.x+n.w+a,i]]}let e=Math.max(t.x,n.x),s=Math.min(t.x+t.w,n.x+n.w);if(s>e){let i=(e+s)/2;return n.y>=t.y+t.h?[[i,t.y+t.h+a],[i,n.y-a]]:[[i,t.y-a],[i,n.y+n.h+a]]}let r=t.x+t.w/2,o=n.y+n.h/2;return[[r,n.y>t.y?t.y+t.h+a:t.y-a],[r,o],[n.x>r?n.x-a:n.x+n.w+a,o]]}function lr(t){let{margin:n,gap:a,box:p,tree:l,badge:e}=w,{grown:s,parents:r}=Si(t),o=s.filter(N=>!r.has(N.id)),i=o[o.length-1]?.id,c=new Map(s.map(N=>[N.id,N])),m=new Map,f=(N,se)=>{m.set(N,se);for(let T of c.get(N)?.children??[])f(T,se+1)};for(let N of o)f(N.id,0);let d=new Map(s.map(N=>[N.id,Mi(N,N.id===i)])),u=N=>Math.max(0,...(d.get(N)??[]).map(se=>pe(se.text,se.style))),M=N=>N.id===i?Math.max(l.root.w,l.root.textX+u(N.id)+l.root.padR):Math.max(l.w,u(N.id)+l.padX*2),x=N=>Math.max(l.card.minW,l.card.padX*2+l.card.icon+l.card.gap+pe(N.id,A.treeCard)),h=N=>N.kind==="leaf"&&N.hash!==void 0,g=s.filter(N=>N.children.length===0),L=Math.max(...s.filter(N=>N.id!==i||N.children.length===0).map(N=>Math.max(M(N),h(N)?x(N):0)),l.w)+l.slotGap,O=n+e.r*2+e.inset,_=new Map;g.forEach((N,se)=>_.set(N.id,O+L*(se+.5)));let P=N=>{let se=_.get(N);if(se!==void 0)return se;let T=c.get(N)?.children??[],ee=(P(T[0])+P(T[T.length-1]))/2;return _.set(N,ee),ee},j=n+l.top,$=N=>j+l.root.h/2+N*l.row,S=He(t),y=s.map(N=>{let se=N.id===i,T=m.get(N.id)??0,ee=P(N.id),b=$(T),G=M(N),q=se?l.root.h:l.h,Y=d.get(N.id)??[],U=Y.length===1?[b+l.oneY]:se?[b+l.root.nameY,b+l.root.hashY]:[b+l.hashY,b+l.nameY],K=r.get(N.id),H=se?l.rootColor:l.color;S.set(N.id,H);let re=x(N);return{id:N.id,kind:N.kind,depth:T,...K!==void 0?{parent:K}:{},children:N.children,step:N.step,event:N.event,...N.hash!==void 0?{hash:N.hash}:{},root:se,x:ee-G/2,y:b-q/2,w:G,h:q,cx:ee,cy:b,color:H,lines:Y.map(le=>le.text),baselines:U,styles:Y.map(le=>le.style),...h(N)?{card:{x:ee-re/2,y:b+l.card.drop-l.card.h/2,w:re,h:l.card.h,text:N.id}}:{}}}),F=new Map(y.map(N=>[N.id,N])),C=y.flatMap(N=>N.children.flatMap(se=>{let T=F.get(se);if(!T)return[];let ee=(T.y+N.y+N.h)/2,b=[[T.cx,T.y-w.edge.inset],[T.cx,ee],[N.cx,ee],[N.cx,N.y+N.h+w.edge.inset]];return[{from:T.id,to:N.id,step:N.step,event:N.event,points:b}]})),X=kt(t),z=Math.max(O,...y.flatMap(N=>[N.x+N.w,...N.card?[N.card.x+N.card.w]:[]])),Q=y.find(N=>N.root),B=new Set(t.boxes.map(N=>N.id)),v=$t(t).flatMap(({edge:N})=>N.label!==void 0&&(B.has(N.from)||B.has(N.to))?[pe(N.label,We(N.label))+w.label.padX*2]:[]),D=Math.max(z+l.boxGap,(Q?Q.x+Q.w:O)+Math.max(0,...v)+a*2),R=Q?.y??j,W=t.boxes.map(N=>{let se=Math.max(tt(t,N.id,!0),vt(X.get(N.id),N.icon!==void 0,p.padX)),T=R;R+=p.h+a;let ee={id:N.id,name:N.name,...N.sub!==void 0?{sub:N.sub}:{},...N.icon!==void 0?{icon:N.icon}:{},color:S.get(N.id)??"slate",x:D,y:T,w:se,h:p.h,cx:D+se/2,cy:T+p.h/2};return Pt(ee,X.get(N.id)),ee}),J=new Map(W.map(N=>[N.id,N])),Z=[],ie=t.steps.flatMap((N,se)=>N.events.flatMap((T,ee)=>{if(T.type!=="edge")return[];let b=F.get(T.from)??J.get(T.from),G=F.get(T.to)??J.get(T.to);if(!b||!G)return[];let q=C.find(H=>H.from===T.from&&H.to===T.to),Y=C.find(H=>H.from===T.to&&H.to===T.from),U=q??Y;U&&Z.push({step:se,event:ee,link:U.from});let K=q?q.points:Y?[...Y.points].reverse():T.from===T.to?Et({cx:b.x+b.w/2,y:b.y,h:b.h}):Oi(b,G);return[{step:se,event:ee,from:T.from,to:T.to,points:K,color:at(T,S),carry:T.carry}]}));ft(ie,J,X);let de={kind:"tree",width:0,height:0,regions:[],boxes:W,lifelines:[],edges:ie,labels:[],actions:[],badges:[],paths:[],ends:[],nodes:y,links:C,runs:Z};de.badges=ar(t,de),de.labels=Ei(t,de);let ue=y.flatMap(N=>N.card?[N.card]:[]),I=[...y,...ue,...W,...de.labels],me=ie.flatMap(N=>N.points),ae=Math.max(...I.map(N=>N.x+N.w),...me.map(([N])=>N),O),ye=Math.max(...I.map(N=>N.y+N.h),...me.map(([,N])=>N),j),we=Math.max(ae+n,ze(t)+n*2),E=Ue(t,n,ye+a,we-n*2);return de.width=we,de.height=(E?E.y+E.h:ye)+n,E&&(de.strip=E),de.badges=ar(t,de),de}function ar(t,n){let{r:a,inset:p}=w.badge,l=a*2+p,e=[],s=[],r=[...n.nodes,...n.nodes.flatMap(m=>m.card?[m.card]:[]),...n.boxes],o=m=>e.every(([f,d])=>Math.hypot(m[0]-f,m[1]-d)>=l)&&r.every(f=>wt(Ye(m),f)>=w.label.touch),i=(m,f,d)=>{e.push(f),s.push({step:m,x:f[0],y:f[1],color:d})},c=new Map;return t.steps.forEach((m,f)=>{let d=m.events.findIndex(O=>O.type==="leaf"||O.type==="node"||O.type==="edge"),u=m.events[d],M=n.nodes.find(O=>O.step===f&&O.event===d);if(u&&u.type!=="edge"&&M){let O=[[M.x-p-a,M.cy],[M.x,M.y],[M.x+M.w+p+a,M.cy],[M.x+M.w,M.y]];i(f,O.find(o)??O[0],M.color);return}let x=n.edges.find(O=>O.step===f&&O.event===d);if(u?.type==="edge"&&x){let O=[x.from,x.to].sort().join(`
|
|
2
|
-
`),_=n.runs.some($=>$.step===f&&$.event===d),P=n.edges.filter($=>$!==x).map($=>$.points),j=c.get(O)??(_?Ti(x.points,o):Ni(x,o))??st(x.points,e,P);c.set(O,j),i(f,j,x.color);return}let h=m.events.flatMap(O=>O.type==="swap"||O.type==="action"?[O.box]:[]).flatMap(O=>n.boxes.filter(_=>_.id===O))[0];if(h){s.push({step:f,x:h.x,y:h.y,color:h.color});return}if(n.strip&&m.events.some(O=>O.type==="strip")){s.push({step:f,x:n.strip.x+p,y:n.strip.y+p,color:"slate"});return}let g=s[s.length-1],L=n.nodes.find(O=>O.root);s.push(g?{...g,step:f}:{step:f,x:L?.x??w.margin,y:L?.y??w.margin,color:L?.color??"slate"})}),Xe(s)}function Ti(t,n){let[a,p,l]=t,e=Math.abs(l[0]-p[0]),{r:s,inset:r}=w.badge;if(e>=w.tree.badgeAlong+s){let i=et(t,ut([a,p])+w.tree.badgeAlong);if(n(i))return i}let o=[p[0]+s+r,p[1]];return n(o)?o:void 0}function Ni(t,n){let a=ut(t.points),p=lt(t.carry)[0]+w.badge.r+w.badge.inset;for(let l=0;l<=a/2-p;l+=1)for(let e of[a/2-l,a/2+l]){let s=et(t.points,e);if(n(s))return s}}function Ei(t,n){let a=[],p=n.nodes.flatMap(l=>l.card?[l.card]:[]);for(let l of n.edges){let e=t.steps[l.step]?.events[l.event];if(e?.type!=="edge"||e.label===void 0)continue;let s=n.badges.filter(r=>r.step<=l.step).map(r=>Ye([r.x,r.y]));a.push(Ze({step:l.step,event:l.event,text:e.label,points:l.points,color:l.color,...e.labelSide?{side:e.labelSide}:{},flip:!0},{hard:[...n.nodes,...n.boxes],soft:[...p,...a.filter(r=>r.step===l.step)],touch:s}))}return a}var ot=t=>Math.round(t*100)/100;function pr(t,n,a,p){let{m:l}=p,e=w.tree,s=w.box,r=(P,j)=>a.edges.find($=>$.step===P&&$.event===j),o=new Map,i=new Map;n.steps.forEach((P,j)=>{for(let $ of P.events)if($.type==="edge")for(let S of[$.from,$.to])o.set(S,(o.get(S)??new Set).add(j)),$.carry.kind!=="none"&&!i.has(S)&&i.set(S,j)});let c=(P,j)=>{let $=n.steps[P]?.events[j];return $?.type==="edge"&&$.carry.kind!=="none"},m=t.runs.filter(P=>c(P.step,P.event)).reduce((P,j)=>P===void 0?j.step:Math.min(P,j.step),void 0),f=m===void 0?void 0:a.steps[m]?.start,d=P=>{if(m===void 0||f===void 0)return;let j=i.get(P);if(j!==void 0&&j<=m)return;let $=j===void 0?void 0:a.steps[j]?.start,S=[[0,{opacity:1}],[f,{opacity:1},fe.inOut],[f+oe.fade,{opacity:e.faint}]];return $!==void 0&&S.push([$,{opacity:e.faint},fe.inOut],[$+oe.fade,{opacity:1}]),S.push([l.last,{opacity:$===void 0?e.faint:1},fe.inOut],[l.total,{opacity:1}]),l.kf(S)},u=(P,j,$="")=>{let S=d(P);return S?`<g class="dg-a"${$} style="${S}">${j}</g>`:$===""?j:`<g${$}>${j}</g>`},M=new Map(t.nodes.map(P=>[P.id,r(P.step,P.event)?.drawn??0])),x=t.links.map(P=>{let j=r(P.step,P.event);if(!j)return"";p.traces.push({from:P.from,to:P.to,points:P.points,shown:[[j.start,Number.POSITIVE_INFINITY]]});let $=l.kf([[0,{opacity:0,"stroke-dashoffset":1}],[j.start,{opacity:0,"stroke-dashoffset":1},fe.inOut],[j.start+.05,{opacity:1}],[j.drawn,{"stroke-dashoffset":0}],[l.last,{opacity:1,"stroke-dashoffset":0},fe.inOut],[l.total,{opacity:0,"stroke-dashoffset":0}]]);return u(P.from,`<path class="dg-tree-l dg-a" data-tree-link="${ve(P.from)}" pathLength="1" d="${it(P.points)}" style="${$}"/>`)}).join(""),h=t.nodes.flatMap(P=>{if(!P.card)return[];let j=M.get(P.id)??0,$=`M ${ot(P.cx)} ${ot(P.y+P.h+w.edge.inset)} V ${ot(P.card.y-w.edge.inset)}`;return[u(P.id,`<path class="dg-tree-con dg-a" d="${$}" style="${l.vis(j)}"/>`)]}).join(""),g=new Set,L=t.runs.flatMap(P=>{let j=t.edges.find(z=>z.step===P.step&&z.event===P.event);if(!j||g.has(P.link))return[];let $=a.carriers.find(z=>z.step===P.step&&z.event===P.event),S=r(P.step,P.event),y=$?.depart??S?.start,F=$?.arrive??S?.drawn;if(y===void 0||F===void 0)return[];g.add(P.link);let C=l.kf([[0,{opacity:0,"stroke-dashoffset":1}],[y,{opacity:0,"stroke-dashoffset":1},fe.inOut],[y+.05,{opacity:1}],[F,{"stroke-dashoffset":0}],[l.last,{opacity:1,"stroke-dashoffset":0},fe.inOut],[l.total,{opacity:0,"stroke-dashoffset":0}]]),X=it(j.points);return[`<g style="${ke(j.color)}"><path class="dg-tree-tr dg-a" data-tree-trail="${ve(P.link)}" pathLength="1" d="${X}" style="${C}"/><path class="dg-tree-h dg-a" d="${At(j.points)}" style="${l.vis(F)}"/></g>`]}).join(""),O=t.nodes.flatMap(P=>{let j=P.card;if(!j)return[];let $=j.x+e.card.padX+e.card.icon/2,S=j.y+j.h/2,y=Me(p.ink,"dg-tree-ct",j.x+e.card.padX+e.card.icon+e.card.gap,S+w.baseline.label,j.text,A.treeCard,Ce);return[u(P.id,`<rect class="dg-tree-card" x="${ot(j.x)}" y="${ot(j.y)}" width="${ot(j.w)}" height="${j.h}" rx="${e.card.radius}"/>${rt("doc",$,S,e.card.glyph,"dg-tree-cg")}${y}`,` data-tree-card="${ve(P.id)}"`)]}).join(""),_=t.nodes.map(P=>{let j=M.get(P.id)??0,$=[...o.get(P.id)??[]].sort((D,R)=>D-R),S=$.length>0?Qt(p,$):void 0,y=P.root?e.root.radius:e.radius,F=(D,R="")=>`<rect class="${D}" x="${ot(P.x)}" y="${ot(P.y)}" width="${ot(P.w)}" height="${P.h}" rx="${y}"${R}/>`,C=`${S?`<g class="dg-a" style="${S}">${F("dg-halo")}</g>`:""}${F("dg-st",` ${p.sh}`)}${S?`<g class="dg-a" style="${S}">${F("dg-on")}</g>`:""}`,X=P.x+e.root.iconX+s.icon/2,z=P.root?`<rect class="dg-ic" x="${ot(X-s.icon/2)}" y="${ot(P.cy-s.icon/2)}" width="${s.icon}" height="${s.icon}" rx="${s.iconRadius}"/>${rt("tree",X,P.cy,s.iconScale)}`:"",Q=[[j,Number.POSITIVE_INFINITY]],B=P.lines.map((D,R)=>{let W=P.styles[R]??A.boxName,J=W===A.treeHash?"dg-tree-hash":W===A.treeName?"dg-tree-name":W===A.rootHash?"dg-tree-rh":W===A.rootName?"dg-tree-rn":"dg-tree-one",Z=P.baselines[R]??P.cy;return P.root?Me(p.ink,J,P.x+e.root.textX,Z,D,W,Q):Me(p.ink,J,P.cx,Z,D,W,Q,"middle")}).join(""),v=u(P.id,`${C}${z}${B}`,` data-tree-node="${ve(P.id)}"${P.root?` data-tree-root="${ve(P.id)}"`:""}`);return`<g class="dg-popc dg-a" style="${ke(P.color)};${l.pop(j)}">${v}</g>`}).join("");return{links:x+h,trails:L,nodes:O+_,appear:M}}jt("git",Xn);jt("lineup",Un);jt("state",Jn);jt("time",Qn);jt("tree",es);function dr(t){let n=Li(t),a=qi(t,n),p=n.map(()=>({top:0,bottom:0})),l=cr(t,n,a,p);for(let e=0;e<3&&Ri(l,n,a,p);e++)l=cr(t,n,a,p);return l}function Li(t){let n=t.regions??[],a=new Set(n.map(e=>e.id)),p=n.map(e=>({region:e,members:t.boxes.filter(s=>s.region===e.id).map(s=>s.id)})),l=t.boxes.filter(e=>e.region===void 0||!a.has(e.region)).map(e=>e.id);return l.length>0&&p.push({members:l}),p}var mr=t=>t==="left"||t==="right";function qi(t,n){let a=w.architecture.columns,p=$t(t).map(s=>s.edge),l=new Map;n.forEach((s,r)=>{let o=new Set(s.members),i=new Set,c=(h,g)=>h>=0&&h<a&&!i.has(`${h},${g}`),m=(h,g)=>{let L=Math.min(a-1,Math.max(0,h));for(let O=g;;O++)for(let _=0;_<a;_++)for(let P of[L+_,L-_])if(c(P,O))return[P,O]},f=(h,g,L)=>{l.set(h,{group:r,col:g,row:L}),i.add(`${g},${L}`)},d=1,u=h=>{for(let g of p){let L=g.from===h?g.to:g.to===h?g.from:void 0;if(L===void 0||!o.has(L)||l.has(L))continue;let O=l.get(h),[_,P]=mr(g.labelSide)?m(O.col,O.row+1):c(O.col+d,O.row)?[O.col+d,O.row]:m(O.col+d,O.row);f(L,_,P),u(L)}},M=h=>{for(let g=0;g<p.length;g++){let L=p[g],O=L?.from===h?L.to:L?.to===h?L.from:void 0,_=O===void 0?void 0:l.get(O);if(_&&_.group<r)return{order:g,col:_.col}}},x=0;for(;;){let h=s.members.filter(j=>!l.has(j));if(h.length===0)break;let g=h.map(j=>({id:j,anchor:M(j)})).filter(j=>j.anchor!==void 0);g.sort((j,$)=>(j.anchor?.order??0)-($.anchor?.order??0));let L=g[0]??{id:h[0],anchor:void 0},O=L.anchor?.col??0;x===0&&(d=O>=(a-1)/2?-1:1);let[_,P]=c(O,0)?[O,0]:m(O,0);f(L.id,_,P),u(L.id),x++}});let e=[...new Set([...l.values()].map(s=>s.col))].sort((s,r)=>s-r);for(let s of l.values())s.col=e.indexOf(s.col);return l}function Ai(t){let n=[...t.matchAll(/ /g)].map(p=>p.index);if(n.length===0)return[t];let a=n.reduce((p,l)=>Math.abs(l-t.length/2)<Math.abs(p-t.length/2)?l:p);return[t.slice(0,a),t.slice(a+1)]}function ji(t){let{icon:n,nameY:a,line:p,inset:l}=w.region,e=Ai(t.name),s=Math.max(n,...e.map(o=>pe(o,A.regionName)),pe(t.note??"",A.regionNote)),r=a-l+(e.length-1)*p+(t.note?p:0)+w.gap/2;return{w:s,h:r,lines:e}}function cr(t,n,a,p){let{box:l,region:e,architecture:s,margin:r,gap:o}=w,i=He(t),c=Cn(t),m=$t(t),f=Math.max(1,...[...a.values()].map(b=>b.col+1)),d=kt(t),u=new Map(t.boxes.map(b=>[b.id,Math.max(tt(t,b.id,!0),vt(d.get(b.id),b.icon!==void 0,l.padX))])),M=Array.from({length:f},(b,G)=>Math.max(l.minW,...[...a].filter(([,q])=>q.col===G).map(([q])=>u.get(q)??l.minW))),x=Array.from({length:Math.max(0,f-1)},()=>s.columnGap);for(let{edge:b}of m){let G=a.get(b.from),q=a.get(b.to);if(!G||!q||b.label===void 0||G.group!==q.group||G.row!==q.row||Math.abs(G.col-q.col)!==1||mr(b.labelSide))continue;let Y=pe(b.label,We(b.label))+w.label.padX*2+s.labelRoom*2,U=Math.min(G.col,q.col);Y<=s.maxColumnGap&&(x[U]=Math.max(x[U]??0,Y))}let h=n.map(b=>b.region?ji(b.region):void 0),g=Math.max(0,...h.map(b=>b?b.w+e.inset*2:0)),L=[];for(let b=0;b<f;b++)L.push(b===0?r+(g>0?g:e.pad):L[b-1]+M[b-1]+x[b-1]);let O=b=>L[b]+M[b]/2,_=new Set(m.filter(({edge:b})=>b.from===b.to).map(({edge:b})=>b.from)),P=new Set([..._].flatMap(b=>{let G=a.get(b);return G?[`${G.group}:${G.row}`]:[]})),j=(b,G)=>P.has(`${b}:${G}`)?Fn:0,$=[],S=[],y=r;n.forEach((b,G)=>{let q=Math.max(1,...b.members.map(Se=>(a.get(Se)?.row??0)+1)),Y=p[G],U=y+e.pad+Y.top,K=[0];for(let Se=1;Se<q;Se++)K.push(K[Se-1]+l.h+s.rowGap+j(G,Se-1));for(let Se of b.members){let qe=a.get(Se),Re=t.boxes.find(Ke=>Ke.id===Se),Oe=u.get(Se)??l.minW,De=O(qe.col),Ve=U+K[qe.row];$.push({id:Se,name:Re?.name??Se,...Re?.sub!==void 0?{sub:Re.sub}:{},...Re?.icon!==void 0?{icon:Re.icon}:{},color:i.get(Se)??"slate",x:De-Oe/2,y:Ve,w:Oe,h:l.h,cx:De,cy:Ve+l.h/2})}let H=U+K[q-1]+l.h+j(G,q-1),re=h[G],le=Math.max(H+e.pad+Y.bottom-y,re?re.h+e.inset*2:0,b.region?e.minH:0);S.push({group:G,y,h:le,rows:q}),y+=le+e.gap});let F=y-e.gap;for(let b of $)Pt(b,d.get(b.id));let C=new Map($.map(b=>[b.id,b])),X=b=>S[a.get(b)?.group??0],z=(b,G,q)=>{for(let Y=1;Y<b.length;Y++){let[U,K]=b[Y-1],[H,re]=b[Y];if(Math.min(U,H)<=G.x+G.w+q&&Math.max(U,H)>=G.x-q&&Math.min(K,re)<=G.y+G.h+q&&Math.max(K,re)>=G.y-q)return!0}return!1},Q=[..._].flatMap(b=>{let G=C.get(b);return G?[{x:G.x,y:G.y+G.h,w:G.w,h:Fn}]:[]}),B=b=>Q.some(G=>z(b,G,0)),v=(b,G,q)=>$.some(Y=>Y.id!==G&&Y.id!==q&&z(b,Y,w.label.search))||B(b),D=b=>{let G=C.get(b),q=X(b),Y=a.get(b),U=G.y+G.h+(Y?j(Y.group,Y.row):0);return(Y?.row??0)<q.rows-1?U+s.rowGap/2:Math.min(U+e.pad/2,q.y+q.h-w.edge.inset)},R=b=>{let G=C.get(b),q=X(b);return(a.get(b)?.row??0)>0?G.y-s.rowGap/2:Math.max(G.y-e.pad/2,q.y+w.edge.inset)},W=w.edge.inset,J=(b,G)=>G?L[b]+M[b]+(x[b]??s.columnGap)/2:L[b]-(x[b-1]??s.columnGap)/2,Z=(b,G)=>{let q=C.get(b),Y=C.get(G);if(b===G)return Et(q);let U=a.get(b),K=a.get(G);if(U.group===K.group&&U.row===K.row){let Oe=Y.cx>q.cx,De=[[Oe?q.x+q.w:q.x,q.cy],[Oe?Y.x-W:Y.x+Y.w+W,Y.cy]];if(!v(De,b,G))return De;let Ve=D(b),Ke=[[q.cx,q.y+q.h],[q.cx,Ve],[Y.cx,Ve],[Y.cx,Y.y+Y.h+W]];if(!B(Ke))return Ke;let gt=R(b),dt=[[q.cx,q.y],[q.cx,gt],[Y.cx,gt],[Y.cx,Y.y-W]];return B(dt)?Ke:dt}let H=Y.cy>q.cy,re=[q.cx,H?q.y+q.h:q.y],le=[Y.cx,H?Y.y-W:Y.y+Y.h+W];if(U.col===K.col){let Oe=[re,le];if(!v(Oe,b,G))return Oe;let De=J(U.col,!0);return[[q.x+q.w,q.cy],[De,q.cy],[De,Y.cy],[Y.x+Y.w+W,Y.cy]]}let Se=Y.cx>q.cx,qe=H?D(b):R(b),Re=[[re,[q.cx,Y.cy],[Se?Y.x-W:Y.x+Y.w+W,Y.cy]],[[Se?q.x+q.w:q.x,q.cy],[Y.cx,q.cy],le],[re,[q.cx,qe],[Y.cx,qe],le]];if(_.has(b)||_.has(G)){let Oe=J(U.col,Se),De=J(K.col,!Se),Ve=[[Se?q.x+q.w:q.x,q.cy],[Oe,q.cy]],Ke=[Se?Y.x-W:Y.x+Y.w+W,Y.cy];Re.push([...Ve,[Oe,Y.cy],Ke],[...Ve,[Oe,qe],[Y.cx,qe],le],[re,[q.cx,qe],[De,qe],[De,Y.cy],Ke],[...Ve,[Oe,qe],[De,qe],[De,Y.cy],Ke])}return Re.find(Oe=>!v(Oe,b,G))??Re[2]},ie=m.map(({step:b,event:G,edge:q})=>({step:b,event:G,from:q.from,to:q.to,points:Z(q.from,q.to),color:at(q,i),carry:q.carry}));ft(ie,C,d);let de=new Map;for(let b of ie){if(b.points.length!==2||!ie.some(H=>H.from===b.to&&H.to===b.from&&H.points.length===2))continue;let[q,Y]=b.points,U=Math.abs(Y[1]-q[1])<Math.abs(Y[0]-q[0]),K=(b.from<b.to?1:-1)*w.edge.parallel;b.points=b.points.map(([H,re])=>U?[H,re+K]:[H+K,re]),de.set(b,U?K>0?"below":"above":K>0?"right":"left")}let ue=[];n.forEach((b,G)=>{let q=S[G],Y=h[G];!b.region||!Y||ue.push({id:b.region.id,lines:Y.lines,...b.region.note!==void 0?{note:b.region.note}:{},...b.region.icon!==void 0?{icon:b.region.icon}:{},color:c.get(b.region.id)??"slate",x:r,y:q.y,w:0,h:q.h,header:{x:r+e.inset,y:q.y+e.inset,w:Y.w,h:Y.h}})});let I=(b,G,q)=>b.from===b.to?Xt(b.points):st(b.points,G,q),me=ht(ie,t.steps.length,I),ae=[];for(let b of ie){let G=t.steps[b.step]?.events[b.event];if(G?.type!=="edge"||G.label===void 0)continue;let q=[...me].filter(([H])=>H<=b.step).map(([,H])=>Ye(H.point)),Y=[...ue.map(H=>H.header),...ae.filter(H=>H.step===b.step)],U=G.labelSide??de.get(b),K=b.from===b.to?{side:"below",base:zt(b.points,pe(G.label,We(G.label))+w.label.padX*2)}:void 0;ae.push(Ze({step:b.step,event:b.event,text:G.label,points:b.points,color:b.color,...K??(U?{side:U}:{flip:!0})},{hard:$,soft:Y,touch:q}))}let ye={kind:"architecture",width:0,height:0,regions:ue,boxes:$,lifelines:[],edges:ie,labels:ae,actions:[],badges:[],paths:[],ends:[]},we=ae.length>0?Math.max(0,r+w.label.soft-Math.min(...ae.map(b=>b.x))):0;we>0&&Lt(ye,we,0);let E=Math.max(...$.map(b=>b.x+b.w+e.pad),...ae.map(b=>b.x+b.w+w.label.soft),...ie.flatMap(b=>b.points.map(G=>G[0]+e.pad))),N=Math.max(E+r,ze(t)+r*2);for(let b of ue)b.w=N-r*2;let se=Math.max(F,...ae.map(b=>b.y+b.h)),T=Ue(t,r,se+o,N-r*2);ye.width=N,ye.height=(T?T.y+T.h:se)+r,T&&(ye.strip=T);let ee=ht(ie,t.steps.length,I);return ye.badges=Xe(t.steps.map((b,G)=>{let q=ee.get(G);return q?{step:G,x:q.point[0],y:q.point[1],color:q.edge.color}:qt(b.events,G,ye)})),ye}function Ri(t,n,a,p){let l=!1,e=w.label.soft;for(let s of t.labels){let r=t.edges.find(u=>u.step===s.step&&u.event===s.event),o=r&&a.get(r.from),i=r&&a.get(r.to);if(!o||!i||o.group!==i.group||!n[o.group]?.region)continue;let c=t.regions.find(u=>u.id===n[o.group]?.region?.id),m=p[o.group];if(!c||!m)continue;let f=c.y+e-s.y,d=s.y+s.h-(c.y+c.h-e);f>0&&(m.top+=f,l=!0),d>0&&(m.bottom+=d,l=!0)}return l}function fr(t){let{box:n,sequence:a,label:p,margin:l,gap:e}=w,s=He(t),r=t.sequence?.lifelines??[],o=[...r,...t.boxes.map(B=>B.id).filter(B=>!r.includes(B))],i=new Map(o.map((B,v)=>[B,v])),c=o.map(B=>tt(t,B,!1)),m=c.slice(1).map((B,v)=>c[v]/2+B/2+a.columnGap),f=[];for(let B of t.steps)for(let v of B.events){if(v.type!=="edge"||v.label===void 0)continue;let D=i.get(v.from)??0,R=i.get(v.to)??0,W=pe(v.label,We(v.label))+p.padX*2;D===R?D<m.length&&f.push({from:D,to:D+1,need:a.selfW+p.side+W+a.labelRoom}):f.push({from:Math.min(D,R),to:Math.max(D,R),need:W+a.labelRoom*2})}f.sort((B,v)=>B.to-B.from-(v.to-v.from));for(let{from:B,to:v,need:D}of f){let R=0;for(let J=B;J<v;J++)R+=m[J]??0;if(R>=D)continue;let W=(D-R)/(v-B);for(let J=B;J<v;J++)m[J]=(m[J]??0)+W}let d=[];o.forEach((B,v)=>d.push(v===0?l+c[0]/2:d[v-1]+m[v-1]));let u=o.map((B,v)=>{let D=t.boxes.find(J=>J.id===B),R=c[v],W=d[v];return{id:B,name:D?.name??B,...D?.sub!==void 0?{sub:D.sub}:{},...D?.icon!==void 0?{icon:D.icon}:{},color:s.get(B)??"slate",x:W-R/2,y:l,w:R,h:n.h,cx:W,cy:l+n.h/2}}),M=l+n.h,x=[],h=[],g=[],L=M+a.firstRow,O=0,_=!0;t.steps.forEach((B,v)=>{B.events.forEach((D,R)=>{if(D.type!=="edge"&&D.type!=="action")return;let W,J;if(D.type==="edge"){let Z=D.labelSide??"above",ie=D.from===D.to,de=D.label!==void 0;W=de&&Z==="above"?a.labelOffset+p.h/2:e,J=ie?a.selfH+e:de&&Z==="below"?a.labelOffset+p.h/2:e}else W=w.action.h/2,J=w.action.h/2;if(L=_?L+W:L+Math.max(a.minPitch,O+a.rowGap+W)+(R===0&&v>0?a.stepGap:0),_=!1,O=J,D.type==="edge"){let Z=d[i.get(D.from)??0],ie=d[i.get(D.to)??0],de=Math.sign(ie-Z)||1,ue=Z===ie?[[Z,L],[Z+a.selfW,L],[Z+a.selfW,L+a.selfH],[Z+w.edge.inset,L+a.selfH]]:[[Z,L],[ie-de*w.edge.inset,L]],I=at(D,s),me={};if(D.carry.kind!=="none"){let ae=w.slot.lifeline+lt(D.carry)[0],[ye,we]=ue,[E,N]=ue.slice(-2),se=Math.sign(we[0]-ye[0])||1,T=Math.sign(N[0]-E[0])||-1;me.wait=[Z-se*ae,ye[1]],me.settle=[ie+T*ae,N[1]]}x.push({step:v,event:R,from:D.from,to:D.to,points:ue,color:I,carry:D.carry,...me}),D.label!==void 0&&g.push({step:v,event:R,text:D.label,points:ue,color:I,...D.labelSide?{side:D.labelSide}:Z===ie?{side:"right"}:{},offset:a.labelOffset})}else{let Z=d[i.get(D.box)??0],ie=pe(D.label,A.action)+w.action.padX*2;h.push({step:v,event:R,box:D.box,text:D.label,color:s.get(D.box)??"slate",x:Z+w.badge.r+4,y:L-w.action.h/2,w:ie,h:w.action.h})}})});let P=(_?M:L+O)+a.tail,j=o.map((B,v)=>({id:B,x:d[v],y1:M,y2:P})),$=ht(x,t.steps.length),S=[];for(let B of g){let v=[...$].filter(([R])=>R<=B.step).map(([,R])=>Ye(R.point)),D=[...S.filter(R=>R.step===B.step),...h];S.push(Ze(B,{hard:u,soft:D,touch:v}))}let y={kind:"sequence",width:0,height:0,regions:[],boxes:u,lifelines:j,edges:x,labels:S,actions:h,badges:[],paths:[],ends:[]},F=[...u.map(B=>B.x),...S.map(B=>B.x),...h.map(B=>B.x)],C=Math.max(0,l-Math.min(...F));C>0&&Lt(y,C,0);let X=[...u.map(B=>B.x+B.w),...S.map(B=>B.x+B.w),...h.map(B=>B.x+B.w),...x.flatMap(B=>B.points.map(v=>v[0]))],z=Math.max(Math.max(...X)+l,ze(t)+l*2),Q=Ue(t,l,P+e,z-l*2);return y.width=z,y.height=(Q?Q.y+Q.h:P)+l,Q&&(y.strip=Q),y.badges=Di(t,y),y}function Di(t,n){let a=ht(n.edges,t.steps.length),p=t.steps.map((l,e)=>{let s=a.get(e);if(s)return{step:e,x:s.point[0],y:s.point[1],color:s.edge.color};let r=n.actions.find(i=>i.step===e),o=r&&n.lifelines.find(i=>i.id===r.box);return r&&o?{step:e,x:o.x,y:r.y+r.h/2,color:r.color}:qt(l.events,e,n)});return Xe(p)}var Ii={string:"\u6587\u5B57\u5217\u306B\u3059\u308B",integer:"\u6574\u6570\u306B\u3059\u308B",number:"\u6570\u306B\u3059\u308B",object:"\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306B\u3059\u308B",array:"\u914D\u5217\u306B\u3059\u308B",boolean:"true \u304B false \u306B\u3059\u308B",null:"null \u306B\u3059\u308B"},Ci={string:"Use a string",integer:"Use an integer",number:"Use a number",object:"Use an object",array:"Use an array",boolean:"Use true or false",null:"Use null"},rn=(t,n)=>`${t} ${n}${t===1?"":"s"}`,Fi={additionalProperties:t=>`${t} \u3068\u3044\u3046\u6B04\u306F\u66F8\u3051\u306A\u3044`,required:t=>`${t} \u306E\u6B04\u304C\u8981\u308B`,enum:t=>`${t.join(" / ")} \u306E\u3069\u308C\u304B\u306B\u3059\u308B`,type:t=>Ii[t]??`${t} \u306B\u3059\u308B`,minLength:t=>`${t} \u5B57\u4EE5\u4E0A\u66F8\u304F`,maxLength:t=>`${t} \u5B57\u307E\u3067\u306B\u3059\u308B`,pattern:t=>t?`${t.space?"\u7A7A\u767D\u3068 ":""}${t.chars.join(" ")} \u306F\u4F7F\u3048\u306A\u3044`:"\u4F7F\u3048\u306A\u3044\u5B57\u304C\u5165\u3063\u3066\u3044\u308B",minItems:t=>`${t} \u3064\u4EE5\u4E0A\u66F8\u304F`,maxItems:t=>`${t} \u3064\u307E\u3067\u306B\u3059\u308B`,minimum:t=>`${t} \u4EE5\u4E0A\u306B\u3059\u308B`,const:t=>`${t} \u306B\u3059\u308B`,not:t=>t?`${t.field} \u306E\u6B04\u306F kind \u304C ${t.kind} \u306E\u6642\u3060\u3051\u66F8\u3051\u308B`:"\u3053\u306E\u6B04\u306E\u7D44\u307F\u5408\u308F\u305B\u306F\u66F8\u3051\u306A\u3044",reserved:t=>`${t.join(" \u3068 ")} \u306F\u72B6\u614B\u9077\u79FB\u56F3\u306E\u59CB\u307E\u308A\u3068\u7D42\u308F\u308A\u306E\u5370\u306E\u540D\u524D\u3067\u3001\u7BB1\u306E\u540D\u672D\u306B\u4F7F\u3048\u306A\u3044`,kindOnly:(t,n)=>`${t.join(" \u3068 ")} \u306E\u51FA\u6765\u4E8B\u306F kind \u304C ${n} \u306E\u6642\u3060\u3051\u66F8\u3051\u308B`,hex:(t,n)=>`0 \u304B\u3089 9 \u3068 a \u304B\u3089 f \u306E\u5B57\u3067 ${t} \u304B\u3089 ${n} \u5B57\u306B\u3059\u308B`,duration:t=>`\u6570\u3068\u5358\u4F4D (${t.join(" / ")}) \u306E\u7D44\u3067\u66F8\u304F (12s \u306A\u3069)`,ratio:"\u5206\u6570 (2/3) \u304B\u767E\u5206\u7387 (97%) \u3067\u66F8\u304F",url:"/ \u3067\u59CB\u307E\u308B path \u304B\u3001http:// \u304B https:// \u3067\u59CB\u307E\u308B URL \u306B\u3059\u308B",anyOf:t=>t.length>0?`${t.join(" \u304B ")} \u306E${t.length===2?"\u3069\u3061\u3089\u304B":"\u3069\u308C\u304B"}\u306E\u6B04\u304C\u8981\u308B`:"\u66F8\u3051\u308B\u5F62\u306E\u3069\u308C\u306B\u3082\u5408\u308F\u306A\u3044",oneOf:"\u66F8\u3051\u308B\u5F62\u306E\u3069\u308C\u304B 1 \u3064\u3060\u3051\u306B\u5408\u308F\u305B\u308B",discriminator:(t,n)=>`${t} \u306F ${n.join(" / ")} \u306E\u3069\u308C\u304B\u306B\u3059\u308B`,newer:(t,n)=>`\u7248 ${t} \u306E\u56F3\u306F\u3001\u3053\u306E\u9053\u5177 (\u7248 ${n}) \u3088\u308A\u65B0\u3057\u3044\u306E\u3067\u8AAD\u3081\u306A\u3044\u3002\u9053\u5177\u3092\u65B0\u3057\u304F\u3059\u308B`},_i={additionalProperties:t=>`The ${t} field is not allowed`,required:t=>`The ${t} field is required`,enum:t=>`Use one of ${t.join(" / ")}`,type:t=>Ci[t]??`Use ${t}`,minLength:t=>`Write at least ${rn(t,"character")}`,maxLength:t=>`Write at most ${rn(t,"character")}`,pattern:t=>t?`Cannot contain ${t.space?"spaces or ":""}${t.chars.join(" ")}`:"Contains characters that are not allowed",minItems:t=>`Write at least ${rn(t,"item")}`,maxItems:t=>`Write at most ${rn(t,"item")}`,minimum:t=>`Use ${t} or greater`,const:t=>`Use ${t}`,not:t=>t?`The ${t.field} field is allowed only when kind is ${t.kind}`:"This combination of fields is not allowed",reserved:t=>`${t.join(" and ")} name the start and end marks of a state diagram and cannot be box ids`,kindOnly:(t,n)=>`${t.join(" and ")} events are allowed only when kind is ${n}`,hex:(t,n)=>`Use ${t} to ${n} characters of 0-9 and a-f`,duration:t=>`Write a number and a unit (${t.join(" / ")}), such as 12s`,ratio:"Write a fraction (2/3) or a percentage (97%)",url:"Use a path that starts with / or a URL that starts with http:// or https://",anyOf:t=>t.length>0?`Write one of the ${t.join(" or ")} fields`:"Does not match any of the allowed shapes",oneOf:"Match exactly one of the allowed shapes",discriminator:(t,n)=>`${t} is one of ${n.join(" / ")}`,newer:(t,n)=>`Version ${t} diagrams are newer than this tool (version ${n}) and cannot be read. Update the tool`},on={ja:Fi,en:_i};function Bi(t){let n=0;for(let a of t)n++;return n}var ss=yr,ts={title:"dragon \u306E\u56F3\u306E\u539F\u672C",description:"\u533A\u753B\u3001\u7BB1\u3001\u7DDA\u3001\u904B\u3076\u7269\u3001\u6BB5\u3001\u4E2D\u8EAB\u306E\u5E2F\u306E 6 \u90E8\u54C1\u3092\u5171\u901A\u306E\u9AA8\u7D44\u307F\u306B\u7F6E\u304D\u3001\u56F3\u306E\u7A2E\u985E\u3060\u3051\u306E\u7269\u306F\u7A2E\u985E\u306E\u6B04\u306B\u7F6E\u304F\u3002\u5EA7\u6A19\u306F\u6301\u305F\u306A\u3044\u3002\u7BB1\u306F\u679D\u5206\u304B\u308C\u306E\u56F3\u3068\u6642\u9593\u8EF8\u306E\u56F3\u3068\u6728\u306E\u56F3\u3060\u3051\u304C\u6301\u305F\u306A\u304F\u3066\u3088\u3044\u3002\u5217\u306E\u56F3\u306E\u7BB1\u306F\u5217\u306B\u306A\u308B\u3002",type:"object",additionalProperties:!1,required:["version","kind","title","boxes","steps"],properties:{version:{description:"\u5F62\u5F0F\u306E\u7248",type:"integer",minimum:1},kind:{description:"\u56F3\u306E\u7A2E\u985E",enum:["sequence","architecture","state","git","time","tree","lineup"]},title:{$ref:"#/definitions/text"},view:{description:"\u898B\u305B\u65B9\u3002\u66F8\u304B\u306A\u3051\u308C\u3070\u5B57\u306E\u5927\u304D\u3055\u3067\u9078\u3076\u3002fixed \u306F\u5168\u4F53\u3092\u6B62\u3081\u3066\u4E2D\u3060\u3051\u52D5\u304B\u3057\u3001follow \u306F\u5BC4\u3063\u3066\u52D5\u304B\u3057\u5168\u4F53\u56F3\u3067\u4ECA\u3069\u3053\u304B\u3092\u793A\u3059",enum:["fixed","follow"]},regions:{type:"array",items:{$ref:"#/definitions/region"}},boxes:{type:"array",items:{$ref:"#/definitions/box"}},strip:{$ref:"#/definitions/strip"},steps:{type:"array",minItems:1,items:{$ref:"#/definitions/step"}},sequence:{$ref:"#/definitions/sequence"},state:{$ref:"#/definitions/state"},git:{$ref:"#/definitions/git"},time:{$ref:"#/definitions/time"},lineup:{$ref:"#/definitions/lineup"}},if:{required:["kind"],properties:{kind:{const:"sequence"}}},then:{required:["sequence"],properties:{boxes:{minItems:1},steps:{$ref:"#/definitions/plainSteps"},strip:{$ref:"#/definitions/plainStrip"},state:{$ref:"#/definitions/absent"},git:{$ref:"#/definitions/absent"},time:{$ref:"#/definitions/absent"},lineup:{$ref:"#/definitions/absent"}}},else:{properties:{sequence:{$ref:"#/definitions/absent"}},if:{required:["kind"],properties:{kind:{const:"state"}}},then:{properties:{boxes:{minItems:1,items:{properties:{id:{description:"\u59CB\u307E\u308A\u3068\u7D42\u308F\u308A\u306E\u5370\u306E\u540D\u524D\u306F\u7BB1\u306E\u540D\u672D\u306B\u4F7F\u3048\u306A\u3044",not:{enum:["start","finish"]}}}}},steps:{$ref:"#/definitions/plainSteps"},strip:{$ref:"#/definitions/plainStrip"},git:{$ref:"#/definitions/absent"},time:{$ref:"#/definitions/absent"},lineup:{$ref:"#/definitions/absent"}}},else:{if:{required:["kind"],properties:{kind:{const:"git"}}},then:{required:["git"],properties:{steps:{$ref:"#/definitions/gitSteps"},strip:{$ref:"#/definitions/plainStrip"},state:{$ref:"#/definitions/absent"},regions:{$ref:"#/definitions/absent"},time:{$ref:"#/definitions/absent"},lineup:{$ref:"#/definitions/absent"}}},else:{if:{required:["kind"],properties:{kind:{const:"time"}}},then:{required:["time"],properties:{steps:{$ref:"#/definitions/timeSteps"},state:{$ref:"#/definitions/absent"},git:{$ref:"#/definitions/absent"},regions:{$ref:"#/definitions/absent"},lineup:{$ref:"#/definitions/absent"}}},else:{if:{required:["kind"],properties:{kind:{const:"tree"}}},then:{properties:{steps:{$ref:"#/definitions/treeSteps"},strip:{$ref:"#/definitions/plainStrip"},state:{$ref:"#/definitions/absent"},git:{$ref:"#/definitions/absent"},time:{$ref:"#/definitions/absent"},regions:{$ref:"#/definitions/absent"},lineup:{$ref:"#/definitions/absent"}}},else:{if:{required:["kind"],properties:{kind:{const:"lineup"}}},then:{required:["lineup"],properties:{boxes:{minItems:1,items:{properties:{icon:{$ref:"#/definitions/absent"},link:{$ref:"#/definitions/absent"},region:{$ref:"#/definitions/absent"}}}},steps:{$ref:"#/definitions/lineupSteps"},strip:{$ref:"#/definitions/plainStrip"},state:{$ref:"#/definitions/absent"},git:{$ref:"#/definitions/absent"},time:{$ref:"#/definitions/absent"},regions:{$ref:"#/definitions/absent"}}},else:{properties:{boxes:{minItems:1},steps:{$ref:"#/definitions/plainSteps"},strip:{$ref:"#/definitions/plainStrip"},state:{$ref:"#/definitions/absent"},git:{$ref:"#/definitions/absent"},time:{$ref:"#/definitions/absent"},lineup:{$ref:"#/definitions/absent"}}}}}}}},definitions:{text:{type:"string",minLength:1},absent:{description:"\u3053\u306E\u56F3\u306E\u7A2E\u985E\u3067\u306F\u66F8\u3051\u306A\u3044\u6B04",not:{}},plainSteps:{description:"\u679D\u5206\u304B\u308C\u306E\u56F3\u3067\u3082\u6642\u9593\u8EF8\u306E\u56F3\u3067\u3082\u6728\u306E\u56F3\u3067\u3082\u5217\u306E\u56F3\u3067\u3082\u306A\u3044\u56F3\u306E\u6BB5\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (commit \u3068 branch) \u3068\u3001\u6642\u9593\u8EF8\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (now \u3068 mark \u3068 span) \u3068\u6B04 (at \u3068 into \u3068 color) \u3068\u3001\u6728\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (leaf \u3068 node) \u3068\u3001\u5217\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (line \u3068 seal \u3068 open \u3068 pick \u3068 stamp) \u3092\u66F8\u3051\u306A\u3044",items:{properties:{events:{items:{not:{$ref:"#/definitions/timeEvent"},allOf:[{not:{$ref:"#/definitions/treeEvent"}},{$ref:"#/definitions/notLineupEvent"}],properties:{type:{not:{enum:["commit","branch"]}},at:{$ref:"#/definitions/absent"},into:{$ref:"#/definitions/absent"},color:{$ref:"#/definitions/absent"}}}}}}},gitSteps:{description:"\u679D\u5206\u304B\u308C\u306E\u56F3\u306E\u6BB5\u3002\u6642\u9593\u8EF8\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (now \u3068 mark \u3068 span) \u3068\u6B04 (at \u3068 into \u3068 color) \u3068\u3001\u6728\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (leaf \u3068 node) \u3068\u3001\u5217\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (line \u3068 seal \u3068 open \u3068 pick \u3068 stamp) \u3092\u66F8\u3051\u306A\u3044",items:{properties:{events:{items:{not:{$ref:"#/definitions/timeEvent"},allOf:[{not:{$ref:"#/definitions/treeEvent"}},{$ref:"#/definitions/notLineupEvent"}],properties:{at:{$ref:"#/definitions/absent"},into:{$ref:"#/definitions/absent"},color:{$ref:"#/definitions/absent"}}}}}}},timeSteps:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u6BB5\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (commit \u3068 branch) \u3068\u3001\u6728\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (leaf \u3068 node) \u3068\u3001\u5217\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (line \u3068 seal \u3068 open \u3068 pick \u3068 stamp) \u3092\u66F8\u3051\u306A\u3044",items:{properties:{events:{items:{allOf:[{not:{$ref:"#/definitions/treeEvent"}},{$ref:"#/definitions/notLineupEvent"}],properties:{type:{not:{enum:["commit","branch"]}}}}}}}},treeSteps:{description:"\u6728\u306E\u56F3\u306E\u6BB5\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (commit \u3068 branch) \u3068\u3001\u6642\u9593\u8EF8\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (now \u3068 mark \u3068 span) \u3068\u6B04 (at \u3068 into \u3068 color) \u3068\u3001\u5217\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (line \u3068 seal \u3068 open \u3068 pick \u3068 stamp) \u3092\u66F8\u3051\u306A\u3044",items:{properties:{events:{items:{not:{$ref:"#/definitions/timeEvent"},allOf:[{$ref:"#/definitions/notLineupEvent"}],properties:{type:{not:{enum:["commit","branch"]}},at:{$ref:"#/definitions/absent"},into:{$ref:"#/definitions/absent"},color:{$ref:"#/definitions/absent"}}}}}}},lineupSteps:{description:"\u5217\u306E\u56F3\u306E\u6BB5\u3002\u7DDA\u3068\u51E6\u7406\u3068\u3001\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (commit \u3068 branch) \u3068\u3001\u6642\u9593\u8EF8\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (now \u3068 mark \u3068 span) \u3068\u6B04 (color) \u3068\u3001\u6728\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (leaf \u3068 node) \u3092\u66F8\u3051\u306A\u3044",items:{properties:{events:{items:{not:{$ref:"#/definitions/timeEvent"},allOf:[{not:{$ref:"#/definitions/treeEvent"}},{$ref:"#/definitions/notWiredEvent"}],properties:{type:{not:{enum:["commit","branch"]}},color:{$ref:"#/definitions/absent"}}}}}}},treeEvent:{description:"\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u51FA\u6765\u4E8B",required:["type"],properties:{type:{enum:["leaf","node"]}}},notLineupEvent:{description:"\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u51FA\u6765\u4E8B\u3092\u66F8\u3051\u306A\u3044",not:{required:["type"],properties:{type:{enum:["line","seal","open","pick","stamp"]}}}},notWiredEvent:{description:"\u7BB1\u3068\u7DDA\u306E\u56F3\u306E\u51FA\u6765\u4E8B\u3092\u66F8\u3051\u306A\u3044",not:{required:["type"],properties:{type:{enum:["edge","action"]}}}},timeEvent:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u51FA\u6765\u4E8B",required:["type"],properties:{type:{enum:["now","mark","span"]}}},plainStrip:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u3067\u306A\u3044\u56F3\u306E\u4E2D\u8EAB\u306E\u5E2F\u3002\u7269\u5DEE\u3057\u3092\u66F8\u3051\u306A\u3044",properties:{meters:{$ref:"#/definitions/absent"}}},id:{type:"string",pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},color:{enum:["blue","amber","green","violet","rose","slate","coin"]},icon:{description:"\u7BB1\u3068\u533A\u753B\u306E\u30A2\u30A4\u30B3\u30F3\u540D\u3002\u63CF\u304F\u90E8\u54C1\u306E\u30A2\u30A4\u30B3\u30F3\u306E\u8868 (ICONS) \u306B\u5728\u308B\u540D\u524D\u3060\u3051",enum:["app","router","on","off","pool","db","exe","idx","sign","env","lock","check","flag","x","chain","net","user","server","key","shield","globe","bolt","doc","box","truck","card","cart","clock","branch","cloud","refresh","undo","yen","layers","code","paint","tree","block"]},region:{type:"object",additionalProperties:!1,required:["id","name"],properties:{id:{$ref:"#/definitions/id"},name:{$ref:"#/definitions/text"},note:{$ref:"#/definitions/text"},color:{$ref:"#/definitions/color"},icon:{$ref:"#/definitions/icon"}}},box:{type:"object",additionalProperties:!1,required:["id","name"],properties:{id:{$ref:"#/definitions/id"},name:{$ref:"#/definitions/text"},sub:{$ref:"#/definitions/text"},color:{$ref:"#/definitions/color"},icon:{$ref:"#/definitions/icon"},region:{$ref:"#/definitions/id"},link:{description:"\u98DB\u3073\u5148\u3002\u63CF\u3044\u305F\u56F3\u3067\u306F\u3053\u306E\u7BB1\u304C\u3053\u3053\u3078\u306E link \u306B\u306A\u308B",$ref:"#/definitions/url"}}},strip:{type:"object",additionalProperties:!1,required:["title","fields"],properties:{title:{$ref:"#/definitions/text"},fields:{type:"array",minItems:1,items:{$ref:"#/definitions/text"}},meters:{description:"\u7269\u5DEE\u3057\u306B\u3059\u308B\u6B04\u3002\u6642\u9593\u8EF8\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"array",minItems:1,items:{$ref:"#/definitions/meter"}}}},meter:{description:"\u7269\u5DEE\u3057\u306E\u6B04\u3002line \u306E\u5272\u5408\u306E\u6240\u306B\u7DDA\u3092\u5F15\u304D\u3001set \u306E\u5024\u307E\u3067\u91DD\u3068\u4E00\u7DD2\u306B\u6E80\u3061\u308B",type:"object",additionalProperties:!1,required:["field","line"],properties:{field:{$ref:"#/definitions/text"},line:{$ref:"#/definitions/ratio"}}},ratio:{description:"\u5272\u5408\u3002\u5206\u6570 (2/3) \u304B\u767E\u5206\u7387 (97%)",type:"string",pattern:"^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$"},step:{type:"object",additionalProperties:!1,required:["title","body","events"],properties:{title:{$ref:"#/definitions/text"},body:{$ref:"#/definitions/text"},code:{$ref:"#/definitions/text"},sources:{description:"\u6BB5\u306E\u51FA\u5178\u3002\u8AAD\u307F\u4E0A\u3052\u306E\u6BB5\u306E\u4E00\u89A7\u306B\u3001\u540D\u524D\u3092 URL \u3078\u306E link \u306B\u3057\u3066\u66F8\u3044\u305F\u9806\u306B\u51FA\u3059",type:"array",minItems:1,items:{$ref:"#/definitions/source"}},events:{type:"array",items:{$ref:"#/definitions/event"}}}},source:{type:"object",additionalProperties:!1,required:["name","url"],properties:{name:{$ref:"#/definitions/text"},url:{$ref:"#/definitions/url"}}},url:{description:"\u9801\u3092\u79FB\u308B\u5F62\u3002/ \u3067\u59CB\u307E\u308B path \u304B\u3001http:// \u304B https:// \u3067\u59CB\u307E\u308B URL",type:"string",pattern:"^(/|https?://)"},event:{description:"\u6BB5\u306E\u4E2D\u3067\u8D77\u304D\u308B\u3053\u3068\u3002\u8D77\u304D\u308B\u9806\u306B\u4E26\u3079\u308B",type:"object",required:["type"],discriminator:{propertyName:"type"},oneOf:[{description:"\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B",type:"object",additionalProperties:!1,required:["type","from","to","carry"],properties:{type:{const:"edge"},from:{$ref:"#/definitions/id"},to:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"},carry:{$ref:"#/definitions/carry"},labelSide:{description:"\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)",enum:["above","below","left","right"]},at:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u7DDA\u3092\u5F15\u304F\u5217\u306E\u76EE\u76DB\u308A",$ref:"#/definitions/unit"},into:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u53D7\u3051\u308B\u7BB1\u3092\u9078\u3076\u5217\u306E\u76EE\u76DB\u308A\u3002\u66F8\u304B\u306A\u3051\u308C\u3070 at \u306E\u5217",$ref:"#/definitions/unit"}}},{description:"\u7BB1\u306E\u4E2D\u306E\u51E6\u7406",type:"object",additionalProperties:!1,required:["type","box","label"],properties:{type:{const:"action"},box:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"}}},{description:"\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048",type:"object",additionalProperties:!1,required:["type","box","text"],properties:{type:{const:"swap"},box:{$ref:"#/definitions/id"},text:{$ref:"#/definitions/text"},color:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u7BC0\u76EE\u306E\u4E38\u306E\u8272",$ref:"#/definitions/color"}}},{description:"commit \u3092\u7A4D\u3080\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u7A4D\u3093\u3060\u679D\u306E\u672D\u3068\u3001\u305D\u306E\u679D\u3092\u6307\u3059 HEAD \u304C\u9032\u3080\u3002\u5F53\u3066\u76F4\u3057 (copy) \u306F\u679D\u306E\u672D\u3092\u52D5\u304B\u3055\u305A\u3001merge commit (merge) \u306F\u53D6\u308A\u8FBC\u3080\u679D\u306E\u5148\u7AEF\u3082\u89AA\u306B\u6301\u3064",type:"object",additionalProperties:!1,required:["type","id","branch"],properties:{type:{const:"commit"},id:{$ref:"#/definitions/id"},branch:{$ref:"#/definitions/id"},copy:{$ref:"#/definitions/id"},merge:{$ref:"#/definitions/id"},hash:{$ref:"#/definitions/hash"},note:{$ref:"#/definitions/text"}}},{description:"\u679D\u3092\u5207\u308B\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u679D\u306E\u672D\u3092 from \u306E commit \u3078\u7F6E\u304D\u3001HEAD \u3092\u305D\u306E\u679D\u3078\u79FB\u3059",type:"object",additionalProperties:!1,required:["type","branch","from"],properties:{type:{const:"branch"},branch:{$ref:"#/definitions/id"},from:{$ref:"#/definitions/id"}}},{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u4ECA\u306E\u6642\u523B\u306E\u91DD\u3092\u3001to \u306E\u76EE\u76DB\u308A\u306E\u7D42\u308F\u308A\u307E\u3067\u9032\u3081\u308B",type:"object",additionalProperties:!1,required:["type","to"],properties:{type:{const:"now"},to:{$ref:"#/definitions/unit"}}},{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u5370\u306E\u5217 row \u306E\u3001from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306E\u5370\u306E\u8272\u3092\u5909\u3048\u308B",type:"object",additionalProperties:!1,required:["type","row","from","to","color"],properties:{type:{const:"mark"},row:{$ref:"#/definitions/id"},from:{$ref:"#/definitions/unit"},to:{$ref:"#/definitions/unit"},color:{$ref:"#/definitions/color"}}},{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306B\u3001\u62EC\u5F27\u3068\u5B57\u3092\u51FA\u3059\u3002shape \u304C box \u306A\u3089\u5370\u306E\u5217\u3092\u56F2\u307F\u3001\u5B57\u3092\u7E01\u306E\u672D\u306B\u3059\u308B",type:"object",additionalProperties:!1,required:["type","from","to","text"],properties:{type:{const:"span"},from:{$ref:"#/definitions/unit"},to:{$ref:"#/definitions/unit"},text:{$ref:"#/definitions/text"},shape:{enum:["box"]},color:{$ref:"#/definitions/color"}}},{description:"\u8449\u3092\u51FA\u3059\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u8449\u306E\u7BB1\u304C\u73FE\u308C\u308B\u3002hash \u3092\u66F8\u304F\u3068\u7BB1\u306B\u5024\u3092\u51FA\u3057\u3001\u540D\u672D\u3092\u8449\u306E\u4E0B\u306E\u672D\u306B\u51FA\u3059",type:"object",additionalProperties:!1,required:["type","id"],properties:{type:{const:"leaf"},id:{$ref:"#/definitions/id"},hash:{$ref:"#/definitions/hash"}}},{description:"1 \u3064\u4EE5\u4E0A\u306E\u5B50\u304B\u3089\u89AA\u3092\u7D44\u3080\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u89AA\u306E\u7BB1\u3068\u3001\u5B50\u304B\u3089\u89AA\u3078\u306E\u6728\u306E\u7DDA\u304C\u73FE\u308C\u308B",type:"object",additionalProperties:!1,required:["type","id","children"],properties:{type:{const:"node"},id:{$ref:"#/definitions/id"},children:{type:"array",minItems:1,items:{$ref:"#/definitions/id"}},hash:{$ref:"#/definitions/hash"}}},{description:"\u5217\u306E box \u306E\u4E26\u3073\u3092 items \u306B\u66F8\u304D\u63DB\u3048\u308B\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u30C1\u30C3\u30D7\u306F\u524D\u306B\u5C45\u305F\u5217\u304B\u3089\u6ED1\u308A\u3001\u3069\u306E\u5217\u306B\u3082\u5C45\u306A\u304B\u3063\u305F\u30C1\u30C3\u30D7\u306F\u5F3E\u3093\u3067\u73FE\u308C\u3001\u5217\u304B\u3089\u5916\u308C\u305F\u30C1\u30C3\u30D7\u306F\u6D88\u3048\u308B",type:"object",additionalProperties:!1,required:["type","box","items"],properties:{type:{const:"line"},box:{$ref:"#/definitions/id"},items:{type:"array",minItems:1,maxItems:12,items:{$ref:"#/definitions/id"}}}},{description:"\u5217 box \u306B\u5C01\u3092\u3057\u3066\u3001\u30C1\u30C3\u30D7\u3092\u96A0\u3059\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"object",additionalProperties:!1,required:["type","box"],properties:{type:{const:"seal"},box:{$ref:"#/definitions/id"}}},{description:"\u5217 box \u306E\u5C01\u3092\u958B\u3051\u308B\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"object",additionalProperties:!1,required:["type","box"],properties:{type:{const:"open"},box:{$ref:"#/definitions/id"}}},{description:"\u5217 box \u3092\u9078\u3076\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u5217\u306E\u7E01\u306B\u8272\u304C\u4ED8\u304D\u3001\u307B\u304B\u306E\u5217\u304C\u8584\u304F\u306A\u308B",type:"object",additionalProperties:!1,required:["type","box"],properties:{type:{const:"pick"},box:{$ref:"#/definitions/id"}}},{description:"\u5217 box \u306E\u53F3\u306B text \u306E\u672D\u3092\u62BC\u3059\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"object",additionalProperties:!1,required:["type","box","text"],properties:{type:{const:"stamp"},box:{$ref:"#/definitions/id"},text:{$ref:"#/definitions/text"}}},{description:"\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D",type:"object",additionalProperties:!1,required:["type","field"],anyOf:[{required:["value"]},{required:["tag"]}],properties:{type:{const:"strip"},field:{$ref:"#/definitions/text"},value:{$ref:"#/definitions/text"},tag:{$ref:"#/definitions/text"}}}]},carry:{description:"\u7DDA\u306E\u4E0A\u3092\u8D70\u308B\u7269\u3002\u5C01\u7B52 (\u30E1\u30C3\u30BB\u30FC\u30B8\u3084\u8981\u6C42)\u3001\u672D (\u540D\u524D\u306E\u3042\u308B\u5024)\u3001\u786C\u8CA8 (\u4FA1\u5024)\u3001\u7121\u3057",type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{enum:["envelope","tag","coin","none"]},text:{$ref:"#/definitions/text"}},if:{required:["kind"],properties:{kind:{const:"tag"}}},then:{required:["text"]},else:{not:{required:["text"]}}},sequence:{description:"\u6642\u7CFB\u5217\u56F3\u306E\u7A2E\u985E\u306E\u6B04\u3002\u751F\u5B58\u7DDA\u3092\u5DE6\u304B\u3089\u4E26\u3079\u308B\u9806",type:"object",additionalProperties:!1,required:["lifelines"],properties:{lifelines:{type:"array",minItems:1,items:{$ref:"#/definitions/id"}}}},state:{description:"\u72B6\u614B\u9077\u79FB\u56F3\u306E\u7A2E\u985E\u306E\u6B04\u3002\u6700\u521D\u306E\u6BB5\u3088\u308A\u524D\u306B\u66F8\u3044\u305F\u3001\u79FB\u308C\u308B\u304C\u6BB5\u3067\u901A\u308B\u3068\u306F\u9650\u3089\u306A\u3044\u7DDA",type:"object",additionalProperties:!1,required:["paths"],properties:{paths:{type:"array",minItems:1,items:{$ref:"#/definitions/path"}}}},git:{description:"\u679D\u5206\u304B\u308C\u306E\u56F3\u306E\u7A2E\u985E\u306E\u6B04\u3002\u679D\u3092\u4E0A\u304B\u3089\u5E2F\u306B\u4E26\u3079\u308B\u9806",type:"object",additionalProperties:!1,required:["branches"],properties:{branches:{type:"array",minItems:1,items:{$ref:"#/definitions/branch"}}}},branch:{description:"\u679D\u3002\u5E2F\u306E\u5DE6\u306B\u540D\u672D\u3068\u6DFB\u3048\u66F8\u304D\u3092\u7F6E\u304F",type:"object",additionalProperties:!1,required:["id"],properties:{id:{$ref:"#/definitions/id"},note:{$ref:"#/definitions/text"}}},hash:{description:"commit \u3068\u6728\u306E\u7BB1\u306E hash\u300216 \u9032\u306E\u5B57\u3067 4 \u304B\u3089 40 \u5B57",type:"string",pattern:"^[0-9a-f]{4,40}$"},lineup:{description:"\u5217\u306E\u56F3\u306E\u7A2E\u985E\u306E\u6B04\u3002\u5217\u306B\u4E26\u3079\u308B\u30C1\u30C3\u30D7",type:"object",additionalProperties:!1,required:["items"],properties:{items:{type:"array",minItems:1,items:{$ref:"#/definitions/item"}}}},item:{description:"\u30C1\u30C3\u30D7\u3002color \u3092\u66F8\u304B\u306A\u3044\u30C1\u30C3\u30D7\u306F\u8584\u3044\u8272\u3067\u3001label \u3092\u66F8\u304B\u306A\u3044\u30C1\u30C3\u30D7\u306F\u8272\u3060\u3051\u3067\u51FA\u3059",type:"object",additionalProperties:!1,required:["id"],properties:{id:{$ref:"#/definitions/id"},color:{$ref:"#/definitions/color"},label:{description:"\u30C1\u30C3\u30D7\u306B\u8F09\u305B\u308B\u5B57",type:"string",minLength:1,maxLength:4}}},time:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u7A2E\u985E\u306E\u6B04\u3002\u76EE\u76DB\u308A\u3001\u533A\u5207\u308A\u3001\u5370\u306E\u5217\u3001\u7BC0\u76EE\u3001\u62E1\u5927\u306E\u7BC4\u56F2",type:"object",additionalProperties:!1,required:["scale","rows"],properties:{scale:{$ref:"#/definitions/scale"},period:{$ref:"#/definitions/period"},rows:{type:"array",minItems:1,items:{$ref:"#/definitions/row"}},points:{type:"array",items:{$ref:"#/definitions/point"}},zoom:{$ref:"#/definitions/zoom"}}},scale:{description:"\u76EE\u76DB\u308A\u3002unit \u306E\u540D\u524D\u306E\u76EE\u76DB\u308A\u3092 length \u306E\u9577\u3055\u3067 count \u500B\u4E26\u3079\u3001\u6700\u521D\u306E\u76EE\u76DB\u308A\u306E\u756A\u53F7\u3092 from \u306B\u3059\u308B",type:"object",additionalProperties:!1,required:["unit","length","count"],properties:{unit:{$ref:"#/definitions/text"},length:{$ref:"#/definitions/duration"},count:{type:"integer",minimum:1},from:{type:"integer",minimum:0}}},duration:{description:"\u9577\u3055\u3002\u6570\u3068\u5358\u4F4D (ms\u3001s\u3001min\u3001h\u3001d) \u306E\u7D44",type:"string",pattern:"^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$"},unit:{description:"\u76EE\u76DB\u308A\u306E\u4F4D\u7F6E\u30020 \u304B\u3089\u6570\u3048\u308B",type:"integer",minimum:0},period:{description:"\u533A\u5207\u308A\u3002\u76EE\u76DB\u308A length \u500B\u3054\u3068\u306B name \u306E\u533A\u5207\u308A\u3092\u7F6E\u304D\u3001\u6700\u521D\u306E\u533A\u5207\u308A\u306E\u756A\u53F7\u3092 from \u306B\u3059\u308B",type:"object",additionalProperties:!1,required:["name","length"],properties:{name:{$ref:"#/definitions/text"},length:{type:"integer",minimum:1},from:{type:"integer",minimum:0}}},row:{description:"\u5370\u306E\u5217\u3002\u76EE\u76DB\u308A\u3054\u3068\u306B\u5370\u3092 1 \u3064\u7F6E\u304D\u3001empty \u306E\u76EE\u76DB\u308A\u306F\u7A7A\u304D\u306E\u5370\u306B\u3059\u308B",type:"object",additionalProperties:!1,required:["id","name"],properties:{id:{$ref:"#/definitions/id"},name:{$ref:"#/definitions/text"},color:{$ref:"#/definitions/color"},empty:{type:"array",items:{$ref:"#/definitions/unit"}}}},point:{description:"\u7BC0\u76EE\u3002at \u306E\u76EE\u76DB\u308A\u306E\u5370\u306E\u4E0B\u306B\u65D7\u306E\u4E38\u3068\u540D\u672D\u3092\u7F6E\u304F",type:"object",additionalProperties:!1,required:["id","at"],properties:{id:{$ref:"#/definitions/id"},at:{$ref:"#/definitions/unit"}}},zoom:{description:"\u62E1\u5927\u306E\u7BC4\u56F2\u3002from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u3054\u3068\u306B\u62E1\u5927\u306E\u5E2F\u306B\u5217\u3092\u4F5C\u308B",type:"object",additionalProperties:!1,required:["from","to"],properties:{from:{$ref:"#/definitions/unit"},to:{$ref:"#/definitions/unit"}}},path:{description:"\u79FB\u308C\u308B\u9053\u3002\u9001\u308B\u5074\u306B\u59CB\u307E\u308A\u306E\u5370 start\u3001\u53D7\u3051\u308B\u5074\u306B\u7D42\u308F\u308A\u306E\u5370 finish \u3092\u66F8\u3051\u308B\u3002\u3069\u306E\u6BB5\u306B\u3082\u51FA\u306A\u3044\u9053\u306F\u70B9\u7DDA\u3067\u63CF\u304D\u3001\u904B\u3076\u7269\u3092\u8D70\u3089\u305B\u306A\u3044",type:"object",additionalProperties:!1,required:["from","to"],properties:{from:{$ref:"#/definitions/id"},to:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"}}}}};function ct(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(Array.isArray(t)){let m=t.length;for(let f=0;f<m;f++){let d=t[f];if(d&&typeof d=="object"&&!Array.isArray(d)&&d.events!==void 0){let u=d.events;if(Array.isArray(u)){let M=u.length;for(let x=0;x<M;x++){let h=u[x],g=s,L=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let $;if(h.type===void 0&&($="type")){let S={};e===null?e=[S]:e.push(S),s++}else if(h.type!==void 0){let S=h.type;if(!(S==="now"||S==="mark"||S==="span")){let y={};e===null?e=[y]:e.push(y),s++}}}var r=L===s;if(r){let $={instancePath:n+"/"+f+"/events/"+x,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=g,e!==null&&(g?e.length=g:e=null);let O=s,_=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let $;if(h.type===void 0&&($="type")){let S={};e===null?e=[S]:e.push(S),s++}else if(h.type!==void 0){let S=h.type;if(!(S==="leaf"||S==="node")){let y={};e===null?e=[y]:e.push(y),s++}}}var o=_===s;if(o){let $={instancePath:n+"/"+f+"/events/"+x,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=O,e!==null&&(O?e.length=O:e=null);let P=s,j=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let $;if(h.type===void 0&&($="type")){let S={};e===null?e=[S]:e.push(S),s++}else if(h.type!==void 0){let S=h.type;if(!(S==="line"||S==="seal"||S==="open"||S==="pick"||S==="stamp")){let y={};e===null?e=[y]:e.push(y),s++}}}var i=j===s;if(i){let $={instancePath:n+"/"+f+"/events/"+x,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=P,e!==null&&(P?e.length=P:e=null);if(h&&typeof h=="object"&&!Array.isArray(h)){if(h.type!==void 0){let $=h.type,S=s,y=s;if(!($==="commit"||$==="branch")){let F={};e===null?e=[F]:e.push(F),s++}var c=y===s;if(c){let F={instancePath:n+"/"+f+"/events/"+x+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}else s=S,e!==null&&(S?e.length=S:e=null)}if(h.at!==void 0){let $={instancePath:n+"/"+f+"/events/"+x+"/at",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}if(h.into!==void 0){let $={instancePath:n+"/"+f+"/events/"+x+"/into",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}if(h.color!==void 0){let $={instancePath:n+"/"+f+"/events/"+x+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}}}}}}}return ct.errors=e,s===0}function je(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)&&t.meters!==void 0){let r={instancePath:n+"/meters",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[r]:e.push(r),s++}return je.errors=e,s===0}function an(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(Array.isArray(t)){let c=t.length;for(let m=0;m<c;m++){let f=t[m];if(f&&typeof f=="object"&&!Array.isArray(f)&&f.events!==void 0){let d=f.events;if(Array.isArray(d)){let u=d.length;for(let M=0;M<u;M++){let x=d[M],h=s,g=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let j;if(x.type===void 0&&(j="type")){let $={};e===null?e=[$]:e.push($),s++}else if(x.type!==void 0){let $=x.type;if(!($==="now"||$==="mark"||$==="span")){let S={};e===null?e=[S]:e.push(S),s++}}}var r=g===s;if(r){let j={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}else s=h,e!==null&&(h?e.length=h:e=null);let L=s,O=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let j;if(x.type===void 0&&(j="type")){let $={};e===null?e=[$]:e.push($),s++}else if(x.type!==void 0){let $=x.type;if(!($==="leaf"||$==="node")){let S={};e===null?e=[S]:e.push(S),s++}}}var o=O===s;if(o){let j={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}else s=L,e!==null&&(L?e.length=L:e=null);let _=s,P=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let j;if(x.type===void 0&&(j="type")){let $={};e===null?e=[$]:e.push($),s++}else if(x.type!==void 0){let $=x.type;if(!($==="line"||$==="seal"||$==="open"||$==="pick"||$==="stamp")){let S={};e===null?e=[S]:e.push(S),s++}}}var i=P===s;if(i){let j={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}else s=_,e!==null&&(_?e.length=_:e=null);if(x&&typeof x=="object"&&!Array.isArray(x)){if(x.at!==void 0){let j={instancePath:n+"/"+m+"/events/"+M+"/at",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}if(x.into!==void 0){let j={instancePath:n+"/"+m+"/events/"+M+"/into",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}if(x.color!==void 0){let j={instancePath:n+"/"+m+"/events/"+M+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}}}}}}}return an.errors=e,s===0}function ln(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(Array.isArray(t)){let c=t.length;for(let m=0;m<c;m++){let f=t[m];if(f&&typeof f=="object"&&!Array.isArray(f)&&f.events!==void 0){let d=f.events;if(Array.isArray(d)){let u=d.length;for(let M=0;M<u;M++){let x=d[M],h=s,g=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let _;if(x.type===void 0&&(_="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(x.type!==void 0){let P=x.type;if(!(P==="leaf"||P==="node")){let j={};e===null?e=[j]:e.push(j),s++}}}var r=g===s;if(r){let _={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}else s=h,e!==null&&(h?e.length=h:e=null);let L=s,O=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let _;if(x.type===void 0&&(_="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(x.type!==void 0){let P=x.type;if(!(P==="line"||P==="seal"||P==="open"||P==="pick"||P==="stamp")){let j={};e===null?e=[j]:e.push(j),s++}}}var o=O===s;if(o){let _={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}else s=L,e!==null&&(L?e.length=L:e=null);if(x&&typeof x=="object"&&!Array.isArray(x)&&x.type!==void 0){let _=x.type,P=s,j=s;if(!(_==="commit"||_==="branch")){let $={};e===null?e=[$]:e.push($),s++}var i=j===s;if(i){let $={instancePath:n+"/"+m+"/events/"+M+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=P,e!==null&&(P?e.length=P:e=null)}}}}}}return ln.errors=e,s===0}function pn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(Array.isArray(t)){let c=t.length;for(let m=0;m<c;m++){let f=t[m];if(f&&typeof f=="object"&&!Array.isArray(f)&&f.events!==void 0){let d=f.events;if(Array.isArray(d)){let u=d.length;for(let M=0;M<u;M++){let x=d[M],h=s,g=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let _;if(x.type===void 0&&(_="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(x.type!==void 0){let P=x.type;if(!(P==="now"||P==="mark"||P==="span")){let j={};e===null?e=[j]:e.push(j),s++}}}var r=g===s;if(r){let _={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}else s=h,e!==null&&(h?e.length=h:e=null);let L=s,O=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let _;if(x.type===void 0&&(_="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(x.type!==void 0){let P=x.type;if(!(P==="line"||P==="seal"||P==="open"||P==="pick"||P==="stamp")){let j={};e===null?e=[j]:e.push(j),s++}}}var o=O===s;if(o){let _={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}else s=L,e!==null&&(L?e.length=L:e=null);if(x&&typeof x=="object"&&!Array.isArray(x)){if(x.type!==void 0){let _=x.type,P=s,j=s;if(!(_==="commit"||_==="branch")){let $={};e===null?e=[$]:e.push($),s++}var i=j===s;if(i){let $={instancePath:n+"/"+m+"/events/"+M+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=P,e!==null&&(P?e.length=P:e=null)}if(x.at!==void 0){let _={instancePath:n+"/"+m+"/events/"+M+"/at",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}if(x.into!==void 0){let _={instancePath:n+"/"+m+"/events/"+M+"/into",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}if(x.color!==void 0){let _={instancePath:n+"/"+m+"/events/"+M+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}}}}}}}return pn.errors=e,s===0}function cn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(Array.isArray(t)){let m=t.length;for(let f=0;f<m;f++){let d=t[f];if(d&&typeof d=="object"&&!Array.isArray(d)&&d.events!==void 0){let u=d.events;if(Array.isArray(u)){let M=u.length;for(let x=0;x<M;x++){let h=u[x],g=s,L=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let $;if(h.type===void 0&&($="type")){let S={};e===null?e=[S]:e.push(S),s++}else if(h.type!==void 0){let S=h.type;if(!(S==="now"||S==="mark"||S==="span")){let y={};e===null?e=[y]:e.push(y),s++}}}var r=L===s;if(r){let $={instancePath:n+"/"+f+"/events/"+x,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=g,e!==null&&(g?e.length=g:e=null);let O=s,_=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let $;if(h.type===void 0&&($="type")){let S={};e===null?e=[S]:e.push(S),s++}else if(h.type!==void 0){let S=h.type;if(!(S==="leaf"||S==="node")){let y={};e===null?e=[y]:e.push(y),s++}}}var o=_===s;if(o){let $={instancePath:n+"/"+f+"/events/"+x,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=O,e!==null&&(O?e.length=O:e=null);let P=s,j=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let $;if(h.type===void 0&&($="type")){let S={};e===null?e=[S]:e.push(S),s++}else if(h.type!==void 0){let S=h.type;if(!(S==="edge"||S==="action")){let y={};e===null?e=[y]:e.push(y),s++}}}var i=j===s;if(i){let $={instancePath:n+"/"+f+"/events/"+x,schemaPath:"#/definitions/notWiredEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=P,e!==null&&(P?e.length=P:e=null);if(h&&typeof h=="object"&&!Array.isArray(h)){if(h.type!==void 0){let $=h.type,S=s,y=s;if(!($==="commit"||$==="branch")){let F={};e===null?e=[F]:e.push(F),s++}var c=y===s;if(c){let F={instancePath:n+"/"+f+"/events/"+x+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}else s=S,e!==null&&(S?e.length=S:e=null)}if(h.color!==void 0){let $={instancePath:n+"/"+f+"/events/"+x+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}}}}}}}return cn.errors=e,s===0}var Ot={enum:["blue","amber","green","violet","rose","slate","coin"]},hr={description:"\u7BB1\u3068\u533A\u753B\u306E\u30A2\u30A4\u30B3\u30F3\u540D\u3002\u63CF\u304F\u90E8\u54C1\u306E\u30A2\u30A4\u30B3\u30F3\u306E\u8868 (ICONS) \u306B\u5728\u308B\u540D\u524D\u3060\u3051",enum:["app","router","on","off","pool","db","exe","idx","sign","env","lock","check","flag","x","chain","net","user","server","key","shield","globe","bolt","doc","box","truck","card","cart","clock","branch","cloud","refresh","undo","yen","layers","code","paint","tree","block"]},Te=new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$","u"),Ne=Bi;function dn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.id===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[r]:e.push(r),s++}if(t.name===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="id"||r==="name"||r==="note"||r==="color"||r==="icon")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.id!==void 0){let r=t.id;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.name!==void 0){let r=t.name;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.note!==void 0){let r=t.note;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/note",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/note",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.color!==void 0){let r=t.color;if(!(r==="blue"||r==="amber"||r==="green"||r==="violet"||r==="rose"||r==="slate"||r==="coin")){let o={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[o]:e.push(o),s++}}if(t.icon!==void 0){let r=t.icon;if(!(r==="app"||r==="router"||r==="on"||r==="off"||r==="pool"||r==="db"||r==="exe"||r==="idx"||r==="sign"||r==="env"||r==="lock"||r==="check"||r==="flag"||r==="x"||r==="chain"||r==="net"||r==="user"||r==="server"||r==="key"||r==="shield"||r==="globe"||r==="bolt"||r==="doc"||r==="box"||r==="truck"||r==="card"||r==="cart"||r==="clock"||r==="branch"||r==="cloud"||r==="refresh"||r==="undo"||r==="yen"||r==="layers"||r==="code"||r==="paint"||r==="tree"||r==="block")){let o={instancePath:n+"/icon",schemaPath:"#/definitions/icon/enum",keyword:"enum",params:{allowedValues:hr.enum},message:"must be equal to one of the allowed values"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return dn.errors=e,s===0}var gr=new RegExp("^(/|https?://)","u");function mn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.id===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[r]:e.push(r),s++}if(t.name===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="id"||r==="name"||r==="sub"||r==="color"||r==="icon"||r==="region"||r==="link")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.id!==void 0){let r=t.id;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.name!==void 0){let r=t.name;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.sub!==void 0){let r=t.sub;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/sub",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/sub",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.color!==void 0){let r=t.color;if(!(r==="blue"||r==="amber"||r==="green"||r==="violet"||r==="rose"||r==="slate"||r==="coin")){let o={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[o]:e.push(o),s++}}if(t.icon!==void 0){let r=t.icon;if(!(r==="app"||r==="router"||r==="on"||r==="off"||r==="pool"||r==="db"||r==="exe"||r==="idx"||r==="sign"||r==="env"||r==="lock"||r==="check"||r==="flag"||r==="x"||r==="chain"||r==="net"||r==="user"||r==="server"||r==="key"||r==="shield"||r==="globe"||r==="bolt"||r==="doc"||r==="box"||r==="truck"||r==="card"||r==="cart"||r==="clock"||r==="branch"||r==="cloud"||r==="refresh"||r==="undo"||r==="yen"||r==="layers"||r==="code"||r==="paint"||r==="tree"||r==="block")){let o={instancePath:n+"/icon",schemaPath:"#/definitions/icon/enum",keyword:"enum",params:{allowedValues:hr.enum},message:"must be equal to one of the allowed values"};e===null?e=[o]:e.push(o),s++}}if(t.region!==void 0){let r=t.region;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/region",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/region",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.link!==void 0){let r=t.link;if(typeof r=="string"){if(!gr.test(r)){let o={instancePath:n+"/link",schemaPath:"#/definitions/url/pattern",keyword:"pattern",params:{pattern:"^(/|https?://)"},message:'must match pattern "^(/|https?://)"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/link",schemaPath:"#/definitions/url/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return mn.errors=e,s===0}var Gi=new RegExp("^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$","u");function fn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.field===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"field"},message:"must have required property 'field'"};e===null?e=[r]:e.push(r),s++}if(t.line===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"line"},message:"must have required property 'line'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="field"||r==="line")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.field!==void 0){let r=t.field;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/field",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/field",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.line!==void 0){let r=t.line;if(typeof r=="string"){if(!Gi.test(r)){let o={instancePath:n+"/line",schemaPath:"#/definitions/ratio/pattern",keyword:"pattern",params:{pattern:"^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$"},message:'must match pattern "^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/line",schemaPath:"#/definitions/ratio/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return fn.errors=e,s===0}function un(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.title===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};e===null?e=[r]:e.push(r),s++}if(t.fields===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"fields"},message:"must have required property 'fields'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="title"||r==="fields"||r==="meters")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.title!==void 0){let r=t.title;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.fields!==void 0){let r=t.fields;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/fields",schemaPath:"#/properties/fields/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++){let c=r[i];if(typeof c=="string"){if(Ne(c)<1){let m={instancePath:n+"/fields/"+i,schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[m]:e.push(m),s++}}else{let m={instancePath:n+"/fields/"+i,schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[m]:e.push(m),s++}}}else{let o={instancePath:n+"/fields",schemaPath:"#/properties/fields/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}if(t.meters!==void 0){let r=t.meters;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/meters",schemaPath:"#/properties/meters/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++)fn(r[i],{instancePath:n+"/meters/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?fn.errors:e.concat(fn.errors),s=e.length)}else{let o={instancePath:n+"/meters",schemaPath:"#/properties/meters/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return un.errors=e,s===0}function hn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.name===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};e===null?e=[r]:e.push(r),s++}if(t.url===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"url"},message:"must have required property 'url'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="name"||r==="url")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.name!==void 0){let r=t.name;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.url!==void 0){let r=t.url;if(typeof r=="string"){if(!gr.test(r)){let o={instancePath:n+"/url",schemaPath:"#/definitions/url/pattern",keyword:"pattern",params:{pattern:"^(/|https?://)"},message:'must match pattern "^(/|https?://)"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/url",schemaPath:"#/definitions/url/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return hn.errors=e,s===0}var ur={description:"\u6BB5\u306E\u4E2D\u3067\u8D77\u304D\u308B\u3053\u3068\u3002\u8D77\u304D\u308B\u9806\u306B\u4E26\u3079\u308B",type:"object",required:["type"],discriminator:{propertyName:"type"},oneOf:[{description:"\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B",type:"object",additionalProperties:!1,required:["type","from","to","carry"],properties:{type:{const:"edge"},from:{$ref:"#/definitions/id"},to:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"},carry:{$ref:"#/definitions/carry"},labelSide:{description:"\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)",enum:["above","below","left","right"]},at:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u7DDA\u3092\u5F15\u304F\u5217\u306E\u76EE\u76DB\u308A",$ref:"#/definitions/unit"},into:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u53D7\u3051\u308B\u7BB1\u3092\u9078\u3076\u5217\u306E\u76EE\u76DB\u308A\u3002\u66F8\u304B\u306A\u3051\u308C\u3070 at \u306E\u5217",$ref:"#/definitions/unit"}}},{description:"\u7BB1\u306E\u4E2D\u306E\u51E6\u7406",type:"object",additionalProperties:!1,required:["type","box","label"],properties:{type:{const:"action"},box:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"}}},{description:"\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048",type:"object",additionalProperties:!1,required:["type","box","text"],properties:{type:{const:"swap"},box:{$ref:"#/definitions/id"},text:{$ref:"#/definitions/text"},color:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u7BC0\u76EE\u306E\u4E38\u306E\u8272",$ref:"#/definitions/color"}}},{description:"commit \u3092\u7A4D\u3080\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u7A4D\u3093\u3060\u679D\u306E\u672D\u3068\u3001\u305D\u306E\u679D\u3092\u6307\u3059 HEAD \u304C\u9032\u3080\u3002\u5F53\u3066\u76F4\u3057 (copy) \u306F\u679D\u306E\u672D\u3092\u52D5\u304B\u3055\u305A\u3001merge commit (merge) \u306F\u53D6\u308A\u8FBC\u3080\u679D\u306E\u5148\u7AEF\u3082\u89AA\u306B\u6301\u3064",type:"object",additionalProperties:!1,required:["type","id","branch"],properties:{type:{const:"commit"},id:{$ref:"#/definitions/id"},branch:{$ref:"#/definitions/id"},copy:{$ref:"#/definitions/id"},merge:{$ref:"#/definitions/id"},hash:{$ref:"#/definitions/hash"},note:{$ref:"#/definitions/text"}}},{description:"\u679D\u3092\u5207\u308B\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u679D\u306E\u672D\u3092 from \u306E commit \u3078\u7F6E\u304D\u3001HEAD \u3092\u305D\u306E\u679D\u3078\u79FB\u3059",type:"object",additionalProperties:!1,required:["type","branch","from"],properties:{type:{const:"branch"},branch:{$ref:"#/definitions/id"},from:{$ref:"#/definitions/id"}}},{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u4ECA\u306E\u6642\u523B\u306E\u91DD\u3092\u3001to \u306E\u76EE\u76DB\u308A\u306E\u7D42\u308F\u308A\u307E\u3067\u9032\u3081\u308B",type:"object",additionalProperties:!1,required:["type","to"],properties:{type:{const:"now"},to:{$ref:"#/definitions/unit"}}},{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u5370\u306E\u5217 row \u306E\u3001from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306E\u5370\u306E\u8272\u3092\u5909\u3048\u308B",type:"object",additionalProperties:!1,required:["type","row","from","to","color"],properties:{type:{const:"mark"},row:{$ref:"#/definitions/id"},from:{$ref:"#/definitions/unit"},to:{$ref:"#/definitions/unit"},color:{$ref:"#/definitions/color"}}},{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306B\u3001\u62EC\u5F27\u3068\u5B57\u3092\u51FA\u3059\u3002shape \u304C box \u306A\u3089\u5370\u306E\u5217\u3092\u56F2\u307F\u3001\u5B57\u3092\u7E01\u306E\u672D\u306B\u3059\u308B",type:"object",additionalProperties:!1,required:["type","from","to","text"],properties:{type:{const:"span"},from:{$ref:"#/definitions/unit"},to:{$ref:"#/definitions/unit"},text:{$ref:"#/definitions/text"},shape:{enum:["box"]},color:{$ref:"#/definitions/color"}}},{description:"\u8449\u3092\u51FA\u3059\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u8449\u306E\u7BB1\u304C\u73FE\u308C\u308B\u3002hash \u3092\u66F8\u304F\u3068\u7BB1\u306B\u5024\u3092\u51FA\u3057\u3001\u540D\u672D\u3092\u8449\u306E\u4E0B\u306E\u672D\u306B\u51FA\u3059",type:"object",additionalProperties:!1,required:["type","id"],properties:{type:{const:"leaf"},id:{$ref:"#/definitions/id"},hash:{$ref:"#/definitions/hash"}}},{description:"1 \u3064\u4EE5\u4E0A\u306E\u5B50\u304B\u3089\u89AA\u3092\u7D44\u3080\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u89AA\u306E\u7BB1\u3068\u3001\u5B50\u304B\u3089\u89AA\u3078\u306E\u6728\u306E\u7DDA\u304C\u73FE\u308C\u308B",type:"object",additionalProperties:!1,required:["type","id","children"],properties:{type:{const:"node"},id:{$ref:"#/definitions/id"},children:{type:"array",minItems:1,items:{$ref:"#/definitions/id"}},hash:{$ref:"#/definitions/hash"}}},{description:"\u5217\u306E box \u306E\u4E26\u3073\u3092 items \u306B\u66F8\u304D\u63DB\u3048\u308B\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u30C1\u30C3\u30D7\u306F\u524D\u306B\u5C45\u305F\u5217\u304B\u3089\u6ED1\u308A\u3001\u3069\u306E\u5217\u306B\u3082\u5C45\u306A\u304B\u3063\u305F\u30C1\u30C3\u30D7\u306F\u5F3E\u3093\u3067\u73FE\u308C\u3001\u5217\u304B\u3089\u5916\u308C\u305F\u30C1\u30C3\u30D7\u306F\u6D88\u3048\u308B",type:"object",additionalProperties:!1,required:["type","box","items"],properties:{type:{const:"line"},box:{$ref:"#/definitions/id"},items:{type:"array",minItems:1,maxItems:12,items:{$ref:"#/definitions/id"}}}},{description:"\u5217 box \u306B\u5C01\u3092\u3057\u3066\u3001\u30C1\u30C3\u30D7\u3092\u96A0\u3059\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"object",additionalProperties:!1,required:["type","box"],properties:{type:{const:"seal"},box:{$ref:"#/definitions/id"}}},{description:"\u5217 box \u306E\u5C01\u3092\u958B\u3051\u308B\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"object",additionalProperties:!1,required:["type","box"],properties:{type:{const:"open"},box:{$ref:"#/definitions/id"}}},{description:"\u5217 box \u3092\u9078\u3076\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u5217\u306E\u7E01\u306B\u8272\u304C\u4ED8\u304D\u3001\u307B\u304B\u306E\u5217\u304C\u8584\u304F\u306A\u308B",type:"object",additionalProperties:!1,required:["type","box"],properties:{type:{const:"pick"},box:{$ref:"#/definitions/id"}}},{description:"\u5217 box \u306E\u53F3\u306B text \u306E\u672D\u3092\u62BC\u3059\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"object",additionalProperties:!1,required:["type","box","text"],properties:{type:{const:"stamp"},box:{$ref:"#/definitions/id"},text:{$ref:"#/definitions/text"}}},{description:"\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D",type:"object",additionalProperties:!1,required:["type","field"],anyOf:[{required:["value"]},{required:["tag"]}],properties:{type:{const:"strip"},field:{$ref:"#/definitions/text"},value:{$ref:"#/definitions/text"},tag:{$ref:"#/definitions/text"}}}]};var ns=new RegExp("^[0-9a-f]{4,40}$","u"),Yi={description:"\u7DDA\u306E\u4E0A\u3092\u8D70\u308B\u7269\u3002\u5C01\u7B52 (\u30E1\u30C3\u30BB\u30FC\u30B8\u3084\u8981\u6C42)\u3001\u672D (\u540D\u524D\u306E\u3042\u308B\u5024)\u3001\u786C\u8CA8 (\u4FA1\u5024)\u3001\u7121\u3057",type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{enum:["envelope","tag","coin","none"]},text:{$ref:"#/definitions/text"}},if:{required:["kind"],properties:{kind:{const:"tag"}}},then:{required:["text"]},else:{not:{required:["text"]}}};function gn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0,r=s,o=!0,i=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let d;if(t.kind===void 0&&(d="kind")){let u={};e===null?e=[u]:e.push(u),s++}else if(t.kind!==void 0&&t.kind!=="tag"){let u={};e===null?e=[u]:e.push(u),s++}}var c=i===s;s=r,e!==null&&(r?e.length=r:e=null);let m;if(c){let d=s;if(t&&typeof t=="object"&&!Array.isArray(t)&&t.text===void 0){let M={instancePath:n,schemaPath:"#/then/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};e===null?e=[M]:e.push(M),s++}var c=d===s;o=c,m="then"}else{let d=s,u=s,M=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let h;if(t.text===void 0&&(h="text")){let g={};e===null?e=[g]:e.push(g),s++}}var f=M===s;if(f){let h={instancePath:n,schemaPath:"#/else/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[h]:e.push(h),s++}else s=u,e!==null&&(u?e.length=u:e=null);var c=d===s;o=c,m="else"}if(!o){let d={instancePath:n,schemaPath:"#/if",keyword:"if",params:{failingKeyword:m},message:'must match "'+m+'" schema'};e===null?e=[d]:e.push(d),s++}if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.kind===void 0){let d={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"kind"},message:"must have required property 'kind'"};e===null?e=[d]:e.push(d),s++}for(let d in t)if(!(d==="kind"||d==="text")){let u={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:d},message:"must NOT have additional properties"};e===null?e=[u]:e.push(u),s++}if(t.kind!==void 0){let d=t.kind;if(!(d==="envelope"||d==="tag"||d==="coin"||d==="none")){let u={instancePath:n+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues:Yi.properties.kind.enum},message:"must be equal to one of the allowed values"};e===null?e=[u]:e.push(u),s++}}if(t.text!==void 0){let d=t.text;if(typeof d=="string"){if(Ne(d)<1){let u={instancePath:n+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[u]:e.push(u),s++}}else{let u={instancePath:n+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[u]:e.push(u),s++}}}else{let d={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[d]:e.push(d),s++}return gn.errors=e,s===0}function yn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}let o=t.type;if(typeof o=="string")if(o==="edge")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.from===void 0){let i={instancePath:n,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};e===null?e=[i]:e.push(i),s++}if(t.to===void 0){let i={instancePath:n,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};e===null?e=[i]:e.push(i),s++}if(t.carry===void 0){let i={instancePath:n,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"carry"},message:"must have required property 'carry'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="from"||i==="to"||i==="label"||i==="carry"||i==="labelSide"||i==="at"||i==="into")){let c={instancePath:n,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="edge"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/0/properties/type/const",keyword:"const",params:{allowedValue:"edge"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.from!==void 0){let i=t.from;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/from",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/from",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.to!==void 0){let i=t.to;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/to",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/to",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.label!==void 0){let i=t.label;if(typeof i=="string"){if(Ne(i)<1){let c={instancePath:n+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.carry!==void 0&&(gn(t.carry,{instancePath:n+"/carry",parentData:t,parentDataProperty:"carry",rootData:l})||(e=e===null?gn.errors:e.concat(gn.errors),s=e.length)),t.labelSide!==void 0){let i=t.labelSide;if(!(i==="above"||i==="below"||i==="left"||i==="right")){let c={instancePath:n+"/labelSide",schemaPath:"#/oneOf/0/properties/labelSide/enum",keyword:"enum",params:{allowedValues:ur.oneOf[0].properties.labelSide.enum},message:"must be equal to one of the allowed values"};e===null?e=[c]:e.push(c),s++}}if(t.at!==void 0){let i=t.at;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/at",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/at",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}if(t.into!==void 0){let i=t.into;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/into",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/into",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="action")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}if(t.label===void 0){let i={instancePath:n,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"label"},message:"must have required property 'label'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box"||i==="label")){let c={instancePath:n,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="action"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/1/properties/type/const",keyword:"const",params:{allowedValue:"action"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.label!==void 0){let i=t.label;if(typeof i=="string"){if(Ne(i)<1){let c={instancePath:n+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="swap")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}if(t.text===void 0){let i={instancePath:n,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box"||i==="text"||i==="color")){let c={instancePath:n,schemaPath:"#/oneOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="swap"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/2/properties/type/const",keyword:"const",params:{allowedValue:"swap"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.text!==void 0){let i=t.text;if(typeof i=="string"){if(Ne(i)<1){let c={instancePath:n+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.color!==void 0){let i=t.color;if(!(i==="blue"||i==="amber"||i==="green"||i==="violet"||i==="rose"||i==="slate"||i==="coin")){let c={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="commit")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.id===void 0){let i={instancePath:n,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[i]:e.push(i),s++}if(t.branch===void 0){let i={instancePath:n,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:"branch"},message:"must have required property 'branch'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="id"||i==="branch"||i==="copy"||i==="merge"||i==="hash"||i==="note")){let c={instancePath:n,schemaPath:"#/oneOf/3/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="commit"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/3/properties/type/const",keyword:"const",params:{allowedValue:"commit"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.id!==void 0){let i=t.id;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.branch!==void 0){let i=t.branch;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/branch",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/branch",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.copy!==void 0){let i=t.copy;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/copy",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/copy",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.merge!==void 0){let i=t.merge;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/merge",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/merge",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.hash!==void 0){let i=t.hash;if(typeof i=="string"){if(!ns.test(i)){let c={instancePath:n+"/hash",schemaPath:"#/definitions/hash/pattern",keyword:"pattern",params:{pattern:"^[0-9a-f]{4,40}$"},message:'must match pattern "^[0-9a-f]{4,40}$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/hash",schemaPath:"#/definitions/hash/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.note!==void 0){let i=t.note;if(typeof i=="string"){if(Ne(i)<1){let c={instancePath:n+"/note",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/note",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/3/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="branch")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/4/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.branch===void 0){let i={instancePath:n,schemaPath:"#/oneOf/4/required",keyword:"required",params:{missingProperty:"branch"},message:"must have required property 'branch'"};e===null?e=[i]:e.push(i),s++}if(t.from===void 0){let i={instancePath:n,schemaPath:"#/oneOf/4/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="branch"||i==="from")){let c={instancePath:n,schemaPath:"#/oneOf/4/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="branch"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/4/properties/type/const",keyword:"const",params:{allowedValue:"branch"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.branch!==void 0){let i=t.branch;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/branch",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/branch",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.from!==void 0){let i=t.from;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/from",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/from",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/4/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="now")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/5/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.to===void 0){let i={instancePath:n,schemaPath:"#/oneOf/5/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="to")){let c={instancePath:n,schemaPath:"#/oneOf/5/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="now"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/5/properties/type/const",keyword:"const",params:{allowedValue:"now"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.to!==void 0){let i=t.to;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/to",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/to",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/5/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="mark")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.row===void 0){let i={instancePath:n,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:"row"},message:"must have required property 'row'"};e===null?e=[i]:e.push(i),s++}if(t.from===void 0){let i={instancePath:n,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};e===null?e=[i]:e.push(i),s++}if(t.to===void 0){let i={instancePath:n,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};e===null?e=[i]:e.push(i),s++}if(t.color===void 0){let i={instancePath:n,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:"color"},message:"must have required property 'color'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="row"||i==="from"||i==="to"||i==="color")){let c={instancePath:n,schemaPath:"#/oneOf/6/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="mark"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/6/properties/type/const",keyword:"const",params:{allowedValue:"mark"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.row!==void 0){let i=t.row;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/row",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/row",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.from!==void 0){let i=t.from;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/from",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/from",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}if(t.to!==void 0){let i=t.to;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/to",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/to",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}if(t.color!==void 0){let i=t.color;if(!(i==="blue"||i==="amber"||i==="green"||i==="violet"||i==="rose"||i==="slate"||i==="coin")){let c={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/6/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="span")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/7/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.from===void 0){let i={instancePath:n,schemaPath:"#/oneOf/7/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};e===null?e=[i]:e.push(i),s++}if(t.to===void 0){let i={instancePath:n,schemaPath:"#/oneOf/7/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};e===null?e=[i]:e.push(i),s++}if(t.text===void 0){let i={instancePath:n,schemaPath:"#/oneOf/7/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="from"||i==="to"||i==="text"||i==="shape"||i==="color")){let c={instancePath:n,schemaPath:"#/oneOf/7/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="span"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/7/properties/type/const",keyword:"const",params:{allowedValue:"span"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.from!==void 0){let i=t.from;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/from",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/from",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}if(t.to!==void 0){let i=t.to;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/to",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/to",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}if(t.text!==void 0){let i=t.text;if(typeof i=="string"){if(Ne(i)<1){let c={instancePath:n+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.shape!==void 0&&t.shape!=="box"){let i={instancePath:n+"/shape",schemaPath:"#/oneOf/7/properties/shape/enum",keyword:"enum",params:{allowedValues:ur.oneOf[7].properties.shape.enum},message:"must be equal to one of the allowed values"};e===null?e=[i]:e.push(i),s++}if(t.color!==void 0){let i=t.color;if(!(i==="blue"||i==="amber"||i==="green"||i==="violet"||i==="rose"||i==="slate"||i==="coin")){let c={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/7/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="leaf")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/8/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.id===void 0){let i={instancePath:n,schemaPath:"#/oneOf/8/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="id"||i==="hash")){let c={instancePath:n,schemaPath:"#/oneOf/8/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="leaf"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/8/properties/type/const",keyword:"const",params:{allowedValue:"leaf"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.id!==void 0){let i=t.id;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.hash!==void 0){let i=t.hash;if(typeof i=="string"){if(!ns.test(i)){let c={instancePath:n+"/hash",schemaPath:"#/definitions/hash/pattern",keyword:"pattern",params:{pattern:"^[0-9a-f]{4,40}$"},message:'must match pattern "^[0-9a-f]{4,40}$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/hash",schemaPath:"#/definitions/hash/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/8/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="node")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/9/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.id===void 0){let i={instancePath:n,schemaPath:"#/oneOf/9/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[i]:e.push(i),s++}if(t.children===void 0){let i={instancePath:n,schemaPath:"#/oneOf/9/required",keyword:"required",params:{missingProperty:"children"},message:"must have required property 'children'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="id"||i==="children"||i==="hash")){let c={instancePath:n,schemaPath:"#/oneOf/9/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="node"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/9/properties/type/const",keyword:"const",params:{allowedValue:"node"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.id!==void 0){let i=t.id;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.children!==void 0){let i=t.children;if(Array.isArray(i)){if(i.length<1){let m={instancePath:n+"/children",schemaPath:"#/oneOf/9/properties/children/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[m]:e.push(m),s++}let c=i.length;for(let m=0;m<c;m++){let f=i[m];if(typeof f=="string"){if(!Te.test(f)){let d={instancePath:n+"/children/"+m,schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[d]:e.push(d),s++}}else{let d={instancePath:n+"/children/"+m,schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[d]:e.push(d),s++}}}else{let c={instancePath:n+"/children",schemaPath:"#/oneOf/9/properties/children/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[c]:e.push(c),s++}}if(t.hash!==void 0){let i=t.hash;if(typeof i=="string"){if(!ns.test(i)){let c={instancePath:n+"/hash",schemaPath:"#/definitions/hash/pattern",keyword:"pattern",params:{pattern:"^[0-9a-f]{4,40}$"},message:'must match pattern "^[0-9a-f]{4,40}$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/hash",schemaPath:"#/definitions/hash/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/9/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="line")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/10/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/10/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}if(t.items===void 0){let i={instancePath:n,schemaPath:"#/oneOf/10/required",keyword:"required",params:{missingProperty:"items"},message:"must have required property 'items'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box"||i==="items")){let c={instancePath:n,schemaPath:"#/oneOf/10/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="line"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/10/properties/type/const",keyword:"const",params:{allowedValue:"line"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.items!==void 0){let i=t.items;if(Array.isArray(i)){if(i.length>12){let m={instancePath:n+"/items",schemaPath:"#/oneOf/10/properties/items/maxItems",keyword:"maxItems",params:{limit:12},message:"must NOT have more than 12 items"};e===null?e=[m]:e.push(m),s++}if(i.length<1){let m={instancePath:n+"/items",schemaPath:"#/oneOf/10/properties/items/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[m]:e.push(m),s++}let c=i.length;for(let m=0;m<c;m++){let f=i[m];if(typeof f=="string"){if(!Te.test(f)){let d={instancePath:n+"/items/"+m,schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[d]:e.push(d),s++}}else{let d={instancePath:n+"/items/"+m,schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[d]:e.push(d),s++}}}else{let c={instancePath:n+"/items",schemaPath:"#/oneOf/10/properties/items/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/10/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="seal")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/11/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/11/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box")){let c={instancePath:n,schemaPath:"#/oneOf/11/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="seal"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/11/properties/type/const",keyword:"const",params:{allowedValue:"seal"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/11/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="open")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/12/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/12/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box")){let c={instancePath:n,schemaPath:"#/oneOf/12/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="open"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/12/properties/type/const",keyword:"const",params:{allowedValue:"open"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/12/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="pick")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/13/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/13/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box")){let c={instancePath:n,schemaPath:"#/oneOf/13/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="pick"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/13/properties/type/const",keyword:"const",params:{allowedValue:"pick"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/13/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="stamp")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/14/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/14/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}if(t.text===void 0){let i={instancePath:n,schemaPath:"#/oneOf/14/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box"||i==="text")){let c={instancePath:n,schemaPath:"#/oneOf/14/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="stamp"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/14/properties/type/const",keyword:"const",params:{allowedValue:"stamp"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.text!==void 0){let i=t.text;if(typeof i=="string"){if(Ne(i)<1){let c={instancePath:n+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/14/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="strip"){let i=s,c=!1,m=s;if(t&&typeof t=="object"&&!Array.isArray(t)&&t.value===void 0){let f={instancePath:n,schemaPath:"#/oneOf/15/anyOf/0/required",keyword:"required",params:{missingProperty:"value"},message:"must have required property 'value'"};e===null?e=[f]:e.push(f),s++}var r=m===s;if(c=c||r,!c){let f=s;if(t&&typeof t=="object"&&!Array.isArray(t)&&t.tag===void 0){let u={instancePath:n,schemaPath:"#/oneOf/15/anyOf/1/required",keyword:"required",params:{missingProperty:"tag"},message:"must have required property 'tag'"};e===null?e=[u]:e.push(u),s++}var r=f===s;c=c||r}if(c)s=i,e!==null&&(i?e.length=i:e=null);else{let f={instancePath:n,schemaPath:"#/oneOf/15/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};e===null?e=[f]:e.push(f),s++}if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let f={instancePath:n,schemaPath:"#/oneOf/15/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[f]:e.push(f),s++}if(t.field===void 0){let f={instancePath:n,schemaPath:"#/oneOf/15/required",keyword:"required",params:{missingProperty:"field"},message:"must have required property 'field'"};e===null?e=[f]:e.push(f),s++}for(let f in t)if(!(f==="type"||f==="field"||f==="value"||f==="tag")){let d={instancePath:n,schemaPath:"#/oneOf/15/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:f},message:"must NOT have additional properties"};e===null?e=[d]:e.push(d),s++}if(t.type!==void 0&&t.type!=="strip"){let f={instancePath:n+"/type",schemaPath:"#/oneOf/15/properties/type/const",keyword:"const",params:{allowedValue:"strip"},message:"must be equal to constant"};e===null?e=[f]:e.push(f),s++}if(t.field!==void 0){let f=t.field;if(typeof f=="string"){if(Ne(f)<1){let d={instancePath:n+"/field",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[d]:e.push(d),s++}}else{let d={instancePath:n+"/field",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[d]:e.push(d),s++}}if(t.value!==void 0){let f=t.value;if(typeof f=="string"){if(Ne(f)<1){let d={instancePath:n+"/value",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[d]:e.push(d),s++}}else{let d={instancePath:n+"/value",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[d]:e.push(d),s++}}if(t.tag!==void 0){let f=t.tag;if(typeof f=="string"){if(Ne(f)<1){let d={instancePath:n+"/tag",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[d]:e.push(d),s++}}else{let d={instancePath:n+"/tag",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[d]:e.push(d),s++}}}else{let f={instancePath:n,schemaPath:"#/oneOf/15/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[f]:e.push(f),s++}}else{let i={instancePath:n,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"mapping",tag:"type",tagValue:o},message:'value of tag "type" must be in oneOf'};e===null?e=[i]:e.push(i),s++}else{let i={instancePath:n,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"tag",tag:"type",tagValue:o},message:'tag "type" must be string'};e===null?e=[i]:e.push(i),s++}}else{let o={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[o]:e.push(o),s++}return yn.errors=e,s===0}function bn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.title===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};e===null?e=[r]:e.push(r),s++}if(t.body===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"body"},message:"must have required property 'body'"};e===null?e=[r]:e.push(r),s++}if(t.events===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"events"},message:"must have required property 'events'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="title"||r==="body"||r==="code"||r==="sources"||r==="events")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.title!==void 0){let r=t.title;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.body!==void 0){let r=t.body;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/body",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/body",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.code!==void 0){let r=t.code;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/code",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/code",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.sources!==void 0){let r=t.sources;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/sources",schemaPath:"#/properties/sources/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++)hn(r[i],{instancePath:n+"/sources/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?hn.errors:e.concat(hn.errors),s=e.length)}else{let o={instancePath:n+"/sources",schemaPath:"#/properties/sources/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}if(t.events!==void 0){let r=t.events;if(Array.isArray(r)){let o=r.length;for(let i=0;i<o;i++)yn(r[i],{instancePath:n+"/events/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?yn.errors:e.concat(yn.errors),s=e.length)}else{let o={instancePath:n+"/events",schemaPath:"#/properties/events/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return bn.errors=e,s===0}function xn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.lifelines===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"lifelines"},message:"must have required property 'lifelines'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(r!=="lifelines"){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.lifelines!==void 0){let r=t.lifelines;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/lifelines",schemaPath:"#/properties/lifelines/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++){let c=r[i];if(typeof c=="string"){if(!Te.test(c)){let m={instancePath:n+"/lifelines/"+i,schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[m]:e.push(m),s++}}else{let m={instancePath:n+"/lifelines/"+i,schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[m]:e.push(m),s++}}}else{let o={instancePath:n+"/lifelines",schemaPath:"#/properties/lifelines/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return xn.errors=e,s===0}function wn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.from===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};e===null?e=[r]:e.push(r),s++}if(t.to===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="from"||r==="to"||r==="label")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.from!==void 0){let r=t.from;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/from",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/from",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.to!==void 0){let r=t.to;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/to",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/to",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.label!==void 0){let r=t.label;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return wn.errors=e,s===0}function $n(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.paths===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"paths"},message:"must have required property 'paths'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(r!=="paths"){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.paths!==void 0){let r=t.paths;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/paths",schemaPath:"#/properties/paths/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++)wn(r[i],{instancePath:n+"/paths/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?wn.errors:e.concat(wn.errors),s=e.length)}else{let o={instancePath:n+"/paths",schemaPath:"#/properties/paths/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return $n.errors=e,s===0}function kn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.id===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="id"||r==="note")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.id!==void 0){let r=t.id;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.note!==void 0){let r=t.note;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/note",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/note",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return kn.errors=e,s===0}function vn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.branches===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"branches"},message:"must have required property 'branches'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(r!=="branches"){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.branches!==void 0){let r=t.branches;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/branches",schemaPath:"#/properties/branches/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++)kn(r[i],{instancePath:n+"/branches/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?kn.errors:e.concat(kn.errors),s=e.length)}else{let o={instancePath:n+"/branches",schemaPath:"#/properties/branches/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return vn.errors=e,s===0}var Vi=new RegExp("^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$","u");function Pn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.unit===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"unit"},message:"must have required property 'unit'"};e===null?e=[r]:e.push(r),s++}if(t.length===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"length"},message:"must have required property 'length'"};e===null?e=[r]:e.push(r),s++}if(t.count===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"count"},message:"must have required property 'count'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="unit"||r==="length"||r==="count"||r==="from")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.unit!==void 0){let r=t.unit;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/unit",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/unit",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.length!==void 0){let r=t.length;if(typeof r=="string"){if(!Vi.test(r)){let o={instancePath:n+"/length",schemaPath:"#/definitions/duration/pattern",keyword:"pattern",params:{pattern:"^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$"},message:'must match pattern "^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/length",schemaPath:"#/definitions/duration/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.count!==void 0){let r=t.count;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/count",schemaPath:"#/properties/count/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<1||isNaN(r))){let o={instancePath:n+"/count",schemaPath:"#/properties/count/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};e===null?e=[o]:e.push(o),s++}}if(t.from!==void 0){let r=t.from;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/from",schemaPath:"#/properties/from/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<0||isNaN(r))){let o={instancePath:n+"/from",schemaPath:"#/properties/from/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return Pn.errors=e,s===0}function Sn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.name===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};e===null?e=[r]:e.push(r),s++}if(t.length===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"length"},message:"must have required property 'length'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="name"||r==="length"||r==="from")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.name!==void 0){let r=t.name;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.length!==void 0){let r=t.length;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/length",schemaPath:"#/properties/length/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<1||isNaN(r))){let o={instancePath:n+"/length",schemaPath:"#/properties/length/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};e===null?e=[o]:e.push(o),s++}}if(t.from!==void 0){let r=t.from;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/from",schemaPath:"#/properties/from/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<0||isNaN(r))){let o={instancePath:n+"/from",schemaPath:"#/properties/from/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return Sn.errors=e,s===0}function Mn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.id===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[r]:e.push(r),s++}if(t.name===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="id"||r==="name"||r==="color"||r==="empty")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.id!==void 0){let r=t.id;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.name!==void 0){let r=t.name;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.color!==void 0){let r=t.color;if(!(r==="blue"||r==="amber"||r==="green"||r==="violet"||r==="rose"||r==="slate"||r==="coin")){let o={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[o]:e.push(o),s++}}if(t.empty!==void 0){let r=t.empty;if(Array.isArray(r)){let o=r.length;for(let i=0;i<o;i++){let c=r[i];if(!(typeof c=="number"&&!(c%1)&&!isNaN(c)&&isFinite(c))){let m={instancePath:n+"/empty/"+i,schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[m]:e.push(m),s++}if(typeof c=="number"&&isFinite(c)&&(c<0||isNaN(c))){let m={instancePath:n+"/empty/"+i,schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[m]:e.push(m),s++}}}else{let o={instancePath:n+"/empty",schemaPath:"#/properties/empty/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return Mn.errors=e,s===0}function On(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.id===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[r]:e.push(r),s++}if(t.at===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"at"},message:"must have required property 'at'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="id"||r==="at")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.id!==void 0){let r=t.id;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.at!==void 0){let r=t.at;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/at",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<0||isNaN(r))){let o={instancePath:n+"/at",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return On.errors=e,s===0}function Tn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.from===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};e===null?e=[r]:e.push(r),s++}if(t.to===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="from"||r==="to")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.from!==void 0){let r=t.from;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/from",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<0||isNaN(r))){let o={instancePath:n+"/from",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[o]:e.push(o),s++}}if(t.to!==void 0){let r=t.to;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/to",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<0||isNaN(r))){let o={instancePath:n+"/to",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return Tn.errors=e,s===0}function Nn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.scale===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"scale"},message:"must have required property 'scale'"};e===null?e=[r]:e.push(r),s++}if(t.rows===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"rows"},message:"must have required property 'rows'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="scale"||r==="period"||r==="rows"||r==="points"||r==="zoom")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.scale!==void 0&&(Pn(t.scale,{instancePath:n+"/scale",parentData:t,parentDataProperty:"scale",rootData:l})||(e=e===null?Pn.errors:e.concat(Pn.errors),s=e.length)),t.period!==void 0&&(Sn(t.period,{instancePath:n+"/period",parentData:t,parentDataProperty:"period",rootData:l})||(e=e===null?Sn.errors:e.concat(Sn.errors),s=e.length)),t.rows!==void 0){let r=t.rows;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/rows",schemaPath:"#/properties/rows/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++)Mn(r[i],{instancePath:n+"/rows/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?Mn.errors:e.concat(Mn.errors),s=e.length)}else{let o={instancePath:n+"/rows",schemaPath:"#/properties/rows/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}if(t.points!==void 0){let r=t.points;if(Array.isArray(r)){let o=r.length;for(let i=0;i<o;i++)On(r[i],{instancePath:n+"/points/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?On.errors:e.concat(On.errors),s=e.length)}else{let o={instancePath:n+"/points",schemaPath:"#/properties/points/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}t.zoom!==void 0&&(Tn(t.zoom,{instancePath:n+"/zoom",parentData:t,parentDataProperty:"zoom",rootData:l})||(e=e===null?Tn.errors:e.concat(Tn.errors),s=e.length))}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return Nn.errors=e,s===0}function En(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.id===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="id"||r==="color"||r==="label")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.id!==void 0){let r=t.id;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.color!==void 0){let r=t.color;if(!(r==="blue"||r==="amber"||r==="green"||r==="violet"||r==="rose"||r==="slate"||r==="coin")){let o={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[o]:e.push(o),s++}}if(t.label!==void 0){let r=t.label;if(typeof r=="string"){if(Ne(r)>4){let o={instancePath:n+"/label",schemaPath:"#/properties/label/maxLength",keyword:"maxLength",params:{limit:4},message:"must NOT have more than 4 characters"};e===null?e=[o]:e.push(o),s++}if(Ne(r)<1){let o={instancePath:n+"/label",schemaPath:"#/properties/label/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return En.errors=e,s===0}function Ln(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.items===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"items"},message:"must have required property 'items'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(r!=="items"){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.items!==void 0){let r=t.items;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/items",schemaPath:"#/properties/items/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++)En(r[i],{instancePath:n+"/items/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?En.errors:e.concat(En.errors),s=e.length)}else{let o={instancePath:n+"/items",schemaPath:"#/properties/items/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return Ln.errors=e,s===0}var Ki=Object.prototype.hasOwnProperty;function yr(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0,r=s,o=!0,i=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let g;if(t.kind===void 0&&(g="kind")){let L={};e===null?e=[L]:e.push(L),s++}else if(t.kind!==void 0&&t.kind!=="sequence"){let L={};e===null?e=[L]:e.push(L),s++}}var c=i===s;s=r,e!==null&&(r?e.length=r:e=null);let m;if(c){let g=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.sequence===void 0){let O={instancePath:n,schemaPath:"#/then/required",keyword:"required",params:{missingProperty:"sequence"},message:"must have required property 'sequence'"};e===null?e=[O]:e.push(O),s++}if(t.boxes!==void 0){let O=t.boxes;if(Array.isArray(O)&&O.length<1){let _={instancePath:n+"/boxes",schemaPath:"#/then/properties/boxes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[_]:e.push(_),s++}}if(t.steps!==void 0&&(ct(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?ct.errors:e.concat(ct.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let O={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[O]:e.push(O),s++}if(t.git!==void 0){let O={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[O]:e.push(O),s++}if(t.time!==void 0){let O={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[O]:e.push(O),s++}if(t.lineup!==void 0){let O={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[O]:e.push(O),s++}}var c=g===s;o=c,m="then"}else{let g=s,L=s,O=!0,_=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let $;if(t.kind===void 0&&($="kind")){let S={};e===null?e=[S]:e.push(S),s++}else if(t.kind!==void 0&&t.kind!=="state"){let S={};e===null?e=[S]:e.push(S),s++}}var f=_===s;s=L,e!==null&&(L?e.length=L:e=null);let P;if(f){let $=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.boxes!==void 0){let y=t.boxes;if(Array.isArray(y)){if(y.length<1){let C={instancePath:n+"/boxes",schemaPath:"#/else/then/properties/boxes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[C]:e.push(C),s++}let F=y.length;for(let C=0;C<F;C++){let X=y[C];if(X&&typeof X=="object"&&!Array.isArray(X)&&X.id!==void 0){let z=X.id,Q=s,B=s;if(!(z==="start"||z==="finish")){let v={};e===null?e=[v]:e.push(v),s++}var d=B===s;if(d){let v={instancePath:n+"/boxes/"+C+"/id",schemaPath:"#/else/then/properties/boxes/items/properties/id/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[v]:e.push(v),s++}else s=Q,e!==null&&(Q?e.length=Q:e=null)}}}}if(t.steps!==void 0&&(ct(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?ct.errors:e.concat(ct.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.git!==void 0){let y={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[y]:e.push(y),s++}if(t.time!==void 0){let y={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[y]:e.push(y),s++}if(t.lineup!==void 0){let y={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[y]:e.push(y),s++}}var f=$===s;O=f,P="then"}else{let $=s,S=s,y=!0,F=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let z;if(t.kind===void 0&&(z="kind")){let Q={};e===null?e=[Q]:e.push(Q),s++}else if(t.kind!==void 0&&t.kind!=="git"){let Q={};e===null?e=[Q]:e.push(Q),s++}}var u=F===s;s=S,e!==null&&(S?e.length=S:e=null);let C;if(u){let z=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.git===void 0){let B={instancePath:n,schemaPath:"#/else/else/then/required",keyword:"required",params:{missingProperty:"git"},message:"must have required property 'git'"};e===null?e=[B]:e.push(B),s++}if(t.steps!==void 0&&(an(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?an.errors:e.concat(an.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let B={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[B]:e.push(B),s++}if(t.regions!==void 0){let B={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[B]:e.push(B),s++}if(t.time!==void 0){let B={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[B]:e.push(B),s++}if(t.lineup!==void 0){let B={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[B]:e.push(B),s++}}var u=z===s;y=u,C="then"}else{let z=s,Q=s,B=!0,v=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let W;if(t.kind===void 0&&(W="kind")){let J={};e===null?e=[J]:e.push(J),s++}else if(t.kind!==void 0&&t.kind!=="time"){let J={};e===null?e=[J]:e.push(J),s++}}var M=v===s;s=Q,e!==null&&(Q?e.length=Q:e=null);let D;if(M){let W=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.time===void 0){let Z={instancePath:n,schemaPath:"#/else/else/else/then/required",keyword:"required",params:{missingProperty:"time"},message:"must have required property 'time'"};e===null?e=[Z]:e.push(Z),s++}if(t.steps!==void 0&&(ln(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?ln.errors:e.concat(ln.errors),s=e.length)),t.state!==void 0){let Z={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[Z]:e.push(Z),s++}if(t.git!==void 0){let Z={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[Z]:e.push(Z),s++}if(t.regions!==void 0){let Z={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[Z]:e.push(Z),s++}if(t.lineup!==void 0){let Z={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[Z]:e.push(Z),s++}}var M=W===s;B=M,D="then"}else{let W=s,J=s,Z=!0,ie=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let I;if(t.kind===void 0&&(I="kind")){let me={};e===null?e=[me]:e.push(me),s++}else if(t.kind!==void 0&&t.kind!=="tree"){let me={};e===null?e=[me]:e.push(me),s++}}var x=ie===s;s=J,e!==null&&(J?e.length=J:e=null);let de;if(x){let I=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.steps!==void 0&&(pn(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?pn.errors:e.concat(pn.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let ae={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ae]:e.push(ae),s++}if(t.git!==void 0){let ae={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ae]:e.push(ae),s++}if(t.time!==void 0){let ae={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ae]:e.push(ae),s++}if(t.regions!==void 0){let ae={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ae]:e.push(ae),s++}if(t.lineup!==void 0){let ae={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ae]:e.push(ae),s++}}var x=I===s;Z=x,de="then"}else{let I=s,me=s,ae=!0,ye=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let N;if(t.kind===void 0&&(N="kind")){let se={};e===null?e=[se]:e.push(se),s++}else if(t.kind!==void 0&&t.kind!=="lineup"){let se={};e===null?e=[se]:e.push(se),s++}}var h=ye===s;s=me,e!==null&&(me?e.length=me:e=null);let we;if(h){let N=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.lineup===void 0){let T={instancePath:n,schemaPath:"#/else/else/else/else/else/then/required",keyword:"required",params:{missingProperty:"lineup"},message:"must have required property 'lineup'"};e===null?e=[T]:e.push(T),s++}if(t.boxes!==void 0){let T=t.boxes;if(Array.isArray(T)){if(T.length<1){let b={instancePath:n+"/boxes",schemaPath:"#/else/else/else/else/else/then/properties/boxes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[b]:e.push(b),s++}let ee=T.length;for(let b=0;b<ee;b++){let G=T[b];if(G&&typeof G=="object"&&!Array.isArray(G)){if(G.icon!==void 0){let q={instancePath:n+"/boxes/"+b+"/icon",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[q]:e.push(q),s++}if(G.link!==void 0){let q={instancePath:n+"/boxes/"+b+"/link",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[q]:e.push(q),s++}if(G.region!==void 0){let q={instancePath:n+"/boxes/"+b+"/region",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[q]:e.push(q),s++}}}}}if(t.steps!==void 0&&(cn(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?cn.errors:e.concat(cn.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let T={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}if(t.git!==void 0){let T={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}if(t.time!==void 0){let T={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}if(t.regions!==void 0){let T={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}}var h=N===s;ae=h,we="then"}else{let N=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.boxes!==void 0){let T=t.boxes;if(Array.isArray(T)&&T.length<1){let ee={instancePath:n+"/boxes",schemaPath:"#/else/else/else/else/else/else/properties/boxes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[ee]:e.push(ee),s++}}if(t.steps!==void 0&&(ct(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?ct.errors:e.concat(ct.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let T={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}if(t.git!==void 0){let T={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}if(t.time!==void 0){let T={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}if(t.lineup!==void 0){let T={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}}var h=N===s;ae=h,we="else"}if(!ae){let N={instancePath:n,schemaPath:"#/else/else/else/else/else/if",keyword:"if",params:{failingKeyword:we},message:'must match "'+we+'" schema'};e===null?e=[N]:e.push(N),s++}var x=I===s;Z=x,de="else"}if(!Z){let I={instancePath:n,schemaPath:"#/else/else/else/else/if",keyword:"if",params:{failingKeyword:de},message:'must match "'+de+'" schema'};e===null?e=[I]:e.push(I),s++}var M=W===s;B=M,D="else"}if(!B){let W={instancePath:n,schemaPath:"#/else/else/else/if",keyword:"if",params:{failingKeyword:D},message:'must match "'+D+'" schema'};e===null?e=[W]:e.push(W),s++}var u=z===s;y=u,C="else"}if(!y){let z={instancePath:n,schemaPath:"#/else/else/if",keyword:"if",params:{failingKeyword:C},message:'must match "'+C+'" schema'};e===null?e=[z]:e.push(z),s++}var f=$===s;O=f,P="else"}if(!O){let $={instancePath:n,schemaPath:"#/else/if",keyword:"if",params:{failingKeyword:P},message:'must match "'+P+'" schema'};e===null?e=[$]:e.push($),s++}if(t&&typeof t=="object"&&!Array.isArray(t)&&t.sequence!==void 0){let $={instancePath:n+"/sequence",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}var c=g===s;o=c,m="else"}if(!o){let g={instancePath:n,schemaPath:"#/if",keyword:"if",params:{failingKeyword:m},message:'must match "'+m+'" schema'};e===null?e=[g]:e.push(g),s++}if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.version===void 0){let g={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"version"},message:"must have required property 'version'"};e===null?e=[g]:e.push(g),s++}if(t.kind===void 0){let g={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"kind"},message:"must have required property 'kind'"};e===null?e=[g]:e.push(g),s++}if(t.title===void 0){let g={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};e===null?e=[g]:e.push(g),s++}if(t.boxes===void 0){let g={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"boxes"},message:"must have required property 'boxes'"};e===null?e=[g]:e.push(g),s++}if(t.steps===void 0){let g={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"steps"},message:"must have required property 'steps'"};e===null?e=[g]:e.push(g),s++}for(let g in t)if(!Ki.call(ts.properties,g)){let L={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:g},message:"must NOT have additional properties"};e===null?e=[L]:e.push(L),s++}if(t.version!==void 0){let g=t.version;if(!(typeof g=="number"&&!(g%1)&&!isNaN(g)&&isFinite(g))){let L={instancePath:n+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[L]:e.push(L),s++}if(typeof g=="number"&&isFinite(g)&&(g<1||isNaN(g))){let L={instancePath:n+"/version",schemaPath:"#/properties/version/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};e===null?e=[L]:e.push(L),s++}}if(t.kind!==void 0){let g=t.kind;if(!(g==="sequence"||g==="architecture"||g==="state"||g==="git"||g==="time"||g==="tree"||g==="lineup")){let L={instancePath:n+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues:ts.properties.kind.enum},message:"must be equal to one of the allowed values"};e===null?e=[L]:e.push(L),s++}}if(t.title!==void 0){let g=t.title;if(typeof g=="string"){if(Ne(g)<1){let L={instancePath:n+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[L]:e.push(L),s++}}else{let L={instancePath:n+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[L]:e.push(L),s++}}if(t.view!==void 0){let g=t.view;if(!(g==="fixed"||g==="follow")){let L={instancePath:n+"/view",schemaPath:"#/properties/view/enum",keyword:"enum",params:{allowedValues:ts.properties.view.enum},message:"must be equal to one of the allowed values"};e===null?e=[L]:e.push(L),s++}}if(t.regions!==void 0){let g=t.regions;if(Array.isArray(g)){let L=g.length;for(let O=0;O<L;O++)dn(g[O],{instancePath:n+"/regions/"+O,parentData:g,parentDataProperty:O,rootData:l})||(e=e===null?dn.errors:e.concat(dn.errors),s=e.length)}else{let L={instancePath:n+"/regions",schemaPath:"#/properties/regions/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[L]:e.push(L),s++}}if(t.boxes!==void 0){let g=t.boxes;if(Array.isArray(g)){let L=g.length;for(let O=0;O<L;O++)mn(g[O],{instancePath:n+"/boxes/"+O,parentData:g,parentDataProperty:O,rootData:l})||(e=e===null?mn.errors:e.concat(mn.errors),s=e.length)}else{let L={instancePath:n+"/boxes",schemaPath:"#/properties/boxes/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[L]:e.push(L),s++}}if(t.strip!==void 0&&(un(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?un.errors:e.concat(un.errors),s=e.length)),t.steps!==void 0){let g=t.steps;if(Array.isArray(g)){if(g.length<1){let O={instancePath:n+"/steps",schemaPath:"#/properties/steps/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[O]:e.push(O),s++}let L=g.length;for(let O=0;O<L;O++)bn(g[O],{instancePath:n+"/steps/"+O,parentData:g,parentDataProperty:O,rootData:l})||(e=e===null?bn.errors:e.concat(bn.errors),s=e.length)}else{let L={instancePath:n+"/steps",schemaPath:"#/properties/steps/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[L]:e.push(L),s++}}t.sequence!==void 0&&(xn(t.sequence,{instancePath:n+"/sequence",parentData:t,parentDataProperty:"sequence",rootData:l})||(e=e===null?xn.errors:e.concat(xn.errors),s=e.length)),t.state!==void 0&&($n(t.state,{instancePath:n+"/state",parentData:t,parentDataProperty:"state",rootData:l})||(e=e===null?$n.errors:e.concat($n.errors),s=e.length)),t.git!==void 0&&(vn(t.git,{instancePath:n+"/git",parentData:t,parentDataProperty:"git",rootData:l})||(e=e===null?vn.errors:e.concat(vn.errors),s=e.length)),t.time!==void 0&&(Nn(t.time,{instancePath:n+"/time",parentData:t,parentDataProperty:"time",rootData:l})||(e=e===null?Nn.errors:e.concat(Nn.errors),s=e.length)),t.lineup!==void 0&&(Ln(t.lineup,{instancePath:n+"/lineup",parentData:t,parentDataProperty:"lineup",rootData:l})||(e=e===null?Ln.errors:e.concat(Ln.errors),s=e.length))}else{let g={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[g]:e.push(g),s++}return yr.errors=e,s===0}var kl=Object.keys(Ft),Wi=["edge","action","swap","strip","commit","branch","now","mark","span","leaf","node","line","seal","open","pick","stamp"],Hi="#/definitions/absent/not",Xi={regions:"sequence / architecture / state",at:"time",into:"time",color:"time",meters:"time",region:"sequence / architecture / state",icon:"sequence / architecture / state / git / time / tree",link:"sequence / architecture / state / git / time / tree"},zi={carry:{field:"text",kind:"tag"}},Ui=/\/boxes\/items\/properties\/id\/not$/u,Ji=/\/events\/items\/properties\/type\/not$/u,Zi=["commit","branch"],Qi=/\/events\/items\/not$/u,eo=["now","mark","span"],to=/\/events\/items\/allOf\/0\/not$/u,no=["leaf","node"],so="#/definitions/notLineupEvent/not",ro=["line","seal","open","pick","stamp"],io="#/definitions/notWiredEvent/not",oo=["edge","action"],ao=/^\^\[0-9\]\+\(\\\.\[0-9\]\+\)\?\(([a-z|]+)\)\$$/u,lo=/%\)\$$/u,rs=t=>t.replaceAll("~","~0").replaceAll("/","~1"),po="#/definitions/url/pattern",co=/^\^\[0-9a-f\]\{(\d+),(\d+)\}\$$/u;function mo(t){let n=/^\^\[\^(.+)\]\+\$$/u.exec(t)?.[1];if(n===void 0)return;let a=n.match(/\\.|[^\\]/gu)??[];return{space:a.includes("\\s"),chars:a.filter(p=>p!=="\\s").map(p=>p.replace(/^\\/u,""))}}var br=(t,n)=>n.filter(a=>a!==t&&a.schemaPath.startsWith(`${t.schemaPath}/`)&&(a.instancePath===t.instancePath||a.instancePath.startsWith(`${t.instancePath}/`)));function fo(t,n,a){let p=t.params,l=t.instancePath;switch(t.keyword){case"additionalProperties":{let e=String(p.additionalProperty);return{pointer:`${l}/${rs(e)}`,message:a.additionalProperties(e)}}case"required":{let e=String(p.missingProperty);return{pointer:`${l}/${rs(e)}`,message:a.required(e)}}case"not":{if(Ui.test(t.schemaPath))return{pointer:l,message:a.reserved(Nt)};if(Ji.test(t.schemaPath))return{pointer:l,message:a.kindOnly(Zi,"git")};if(Qi.test(t.schemaPath))return{pointer:`${l}/type`,message:a.kindOnly(eo,"time")};if(to.test(t.schemaPath))return{pointer:`${l}/type`,message:a.kindOnly(no,"tree")};if(t.schemaPath===so)return{pointer:`${l}/type`,message:a.kindOnly(ro,"lineup")};if(t.schemaPath===io)return{pointer:`${l}/type`,message:a.kindOnly(oo,"sequence / architecture / state / git / time / tree")};let e=l.slice(l.lastIndexOf("/")+1);if(t.schemaPath===Hi)return{pointer:l,message:a.not({field:e,kind:Xi[e]??e})};let s=zi[e];return{pointer:s?`${l}/${s.field}`:l,message:a.not(s)}}case"anyOf":{let e=br(t,n),s=e.every(r=>r.keyword==="required")?e.map(r=>String(r.params.missingProperty)):[];return{pointer:l,message:a.anyOf(s)}}case"discriminator":{let e=String(p.tag);return{pointer:`${l}/${rs(e)}`,message:a.discriminator(e,Wi)}}case"enum":return{pointer:l,message:a.enum(p.allowedValues.map(String))};case"type":return{pointer:l,message:a.type(String(p.type))};case"minLength":return{pointer:l,message:a.minLength(Number(p.limit))};case"maxLength":return{pointer:l,message:a.maxLength(Number(p.limit))};case"pattern":{if(t.schemaPath===po)return{pointer:l,message:a.url};let e=String(p.pattern),s=co.exec(e);if(s)return{pointer:l,message:a.hex(Number(s[1]),Number(s[2]))};let r=ao.exec(e);return r?{pointer:l,message:a.duration((r[1]??"").split("|"))}:lo.test(e)?{pointer:l,message:a.ratio}:{pointer:l,message:a.pattern(mo(e))}}case"minItems":return{pointer:l,message:a.minItems(Number(p.limit))};case"maxItems":return{pointer:l,message:a.maxItems(Number(p.limit))};case"minimum":return{pointer:l,message:a.minimum(Number(p.limit))};case"const":return{pointer:l,message:a.const(String(p.allowedValue))};case"oneOf":return{pointer:l,message:a.oneOf};default:return{pointer:l,message:t.message??t.keyword}}}function xr(t,n={}){if(ss(t))return{ok:!0};let a=ss.errors??[],p=new Set(a.filter(s=>s.keyword==="anyOf").flatMap(s=>br(s,a))),l=on[n.lang??"ja"];return{ok:!1,errors:a.filter(s=>s.keyword!=="if"&&!p.has(s)).map(s=>fo(s,a,l))}}var wr=1;function uo(t){if(typeof t!="object"||t===null)return;let n=t.version;return typeof n=="number"&&n>wr?n:void 0}var ho=(t,n)=>({pointer:"/version",message:on[n].newer(t,wr)});function $r(t,n={}){let a=uo(t);if(a!==void 0)return{ok:!1,errors:[ho(a,n.lang??"ja")]};let p=xr(t,n);return p.ok?{ok:!0,diagram:t,warnings:[]}:p}var go={line:oe.lineup.slide,seal:oe.lineup.seal,open:oe.fade,pick:oe.fade,stamp:oe.popFade};function kr(t,n){let a={edges:[],events:[],busy:0},p=oe.edgeAt,l,e=0,s=Number.NEGATIVE_INFINITY,r=(f,d,u)=>{let M=d.carry.kind!=="none",x=u+(M?oe.drawCarry:oe.draw);return a.edges.push({event:f,a:u,b:x,carries:M,coin:d.carry.kind==="coin",named:d.label!==void 0}),a.busy=Math.max(a.busy,x),x},o=n?t.events.flatMap((f,d)=>f.type==="now"?[{e:d,to:f.to}]:[]):[],i=n?.from??0,c=Math.max(i,...o.map(f=>f.to+1)),m=f=>f.type==="edge"&&f.at!==void 0&&f.at>=i&&f.at<c;return t.events.forEach((f,d)=>{if(n&&d===o[0]?.e){let u=Math.max(p,s+oe.change),M=[[u,i]],x=[];for(let h=i;h<c;h++){let g=u,L=t.events.flatMap((P,j)=>m(P)&&P.at===h?[{k:j,ev:P}]:[]),O=L.reduce((P,j,$)=>Math.max(P,r(j.k,j.ev,g+oe.stagger*$)),g),_=Math.max(g+n.speed,L.length>0?O+oe.time.wait:g);_-n.speed>g+1e-9&&M.push([_-n.speed,h]),M.push([_,h+1]),x.push({unit:h,at:_}),u=_}a.sweep={keys:M,passed:x},a.busy=Math.max(a.busy,u),p=u+oe.time.after,l=u,e=0;return}if(!(f.type==="now"||n&&m(f))){if(f.type==="line"||f.type==="seal"||f.type==="open"||f.type==="pick"||f.type==="stamp"){let u=p,M=u+go[f.type];a.edges.push({event:d,a:u,b:M,carries:!1,coin:!1,named:!1}),p=u+oe.lineup.stagger,l=M,e=0,a.busy=Math.max(a.busy,M);return}if(f.type==="commit"||f.type==="branch"||f.type==="leaf"||f.type==="node"){let u=p,M=u+oe.draw;a.edges.push({event:d,a:u,b:M,carries:!1,coin:!1,named:!1}),p=u+oe.stagger,l=M,e=0,a.busy=Math.max(a.busy,M)}else if(f.type==="edge"){let u=p;l=r(d,f,u),p=u+oe.stagger,e=0}else if(f.type==="action")a.events.push({event:d,at:p}),a.busy=Math.max(a.busy,p+oe.action),p+=oe.action,e=0;else{let u=(l??p)+oe.change*e++;a.events.push({event:d,at:u}),a.busy=Math.max(a.busy,u),s=Math.max(s,u)}}}),a.edges.sort((f,d)=>f.a-d.a),a}function vr(t,n=!1){let a=t.kind==="time"?t.time:void 0,p=oe.time,l=a?Math.min(p.unitMax,Math.max(p.unitMin,p.axis/Math.max(1,a.scale.count))):0,e=0,s=t.steps.map(S=>{if(!a)return kr(S);let y=kr(S,{from:e,speed:l});return e=y.sweep?.keys[y.sweep.keys.length-1]?.[1]??e,y}),r=[],o=oe.intro;t.steps.forEach((S,y)=>{let F=Math.min(oe.stepMax,Math.max(oe.stepMin,oe.stepBase+[...S.body].length*oe.perChar)),C=Math.max(F,(s[y]?.busy??0)+oe.dwell);r.push({start:o,end:o+C}),o+=C});let c=Math.ceil(o+oe.outro),m=c-oe.tail,f=r[r.length-1],d=n&&f?{start:f.start+(s[s.length-1]?.busy??0),end:m}:void 0,u=d?.start??m,M=[],x=[],h=[],g=[];s.forEach((S,y)=>{let F=r[y],C=[];for(let X of S.edges){let z=F.start+X.a;M.push({step:y,event:X.event,start:z,drawn:F.start+X.b,end:F.end});let Q=t.steps[y]?.events[X.event],B=t.kind==="git"&&Q?.type==="edge"&&Q.carry.kind==="tag"&&Q.carry.text===Q.from;X.carries&&!B&&g.push({step:y,event:X.event,who:X.coin?"coin":"main",a:z,b:F.start+X.b}),X.named&&C.push({step:y,event:X.event,start:z+oe.labelDelay,end:F.end})}C.forEach((X,z)=>{let Q=C[z+2];Q&&(X.end=Math.min(X.end,Q.start))});for(let X of C)d&&X.end>d.start?X.end=d.end:(t.kind==="state"&&X.end<u&&(X.after={start:X.end,end:u}),d&&(X.again=d));x.push(...C);for(let X of S.events)h.push({step:y,event:X.event,at:F.start+X.at})});let L=r[0]?.start??0,O=g.some(S=>S.who==="main"),_=[];for(let S of["main","coin"]){let y=g.filter(F=>F.who===S);y.forEach((F,C)=>{let X=y[C+1],z=C===0&&(S==="main"||!O);_.push({step:F.step,event:F.event,who:S,depart:F.a,arrive:F.b,start:z?Math.min(L,F.a):F.a,end:X?Math.max(X.a,F.b):m})})}_.sort((S,y)=>S.depart-y.depart);let P=t.kind==="state"?xo(t,M,m):void 0,j=[[0,0]],$=[];return s.forEach((S,y)=>{let F=r[y].start;for(let[C,X]of S.sweep?.keys??[])j.push([F+C,X]);for(let C of S.sweep?.passed??[])$.push({unit:C.unit,passed:F+C.at})}),j.push([c,e]),{total:c,last:m,steps:r,edges:M,carriers:_,labels:x,badges:r.map((S,y)=>({step:y,appears:S.start})),events:h,stills:r.map(S=>S.end-oe.still),...d?{whole:d}:{},...P?{states:P}:{},...a?{needle:j,units:$,meters:yo(t,s,r)}:{}}}function yo(t,n,a){let p=t.time?.period?.length;return(t.strip?.meters??[]).map(({field:l})=>{let e=[[0,0]],s=0;return n.forEach((r,o)=>{let i=a[o].start,c=(t.steps[o]?.events??[]).flatMap((M,x)=>{let h=M.type==="strip"&&M.field===l&&M.value!==void 0?_n(M.value):void 0;return h===void 0?[]:[{e:x,ratio:h}]}),m=c[c.length-1];if(!m)return;let f=r.sweep?.keys??[],d=f[0],u=f[f.length-1];if(d&&u&&u[1]>d[1]){let[M,x]=[d[1],u[1]],h=s,g=M,L=p?Math.floor((x-1e-9)/p)*p:0;if(L>0&&L>=M){let O=i+(f.find(([,P])=>P===L)?.[0]??d[0]),_=e[e.length-1][0];e.push([Math.max(_,O-oe.time.reset),s],[O,0]),h=0,g=L}for(let[O,_]of f)_>=g&&e.push([i+O,h+(m.ratio-h)*(_-g)/(x-g)])}else{let M=i+(r.events.find(x=>x.event===m.e)?.at??0);e.push([M,s],[M+oe.fade,m.ratio])}s=m.ratio}),{field:l,keys:e}})}var bo=t=>Nt.includes(t);function xo(t,n,a){let p=new Map,l=s=>{let r=p.get(s)??{box:s,lit:[]};return p.set(s,r),r},e;for(let s of n){let r=t.steps[s.step]?.events[s.event];if(!(r?.type!=="edge"||r.from===r.to)){if(e){let o=l(e.box);o.lit.push({start:e.since,end:s.start}),e.box===r.from&&o.done===void 0&&(o.done=s.start+oe.done),e=void 0}bo(r.to)||(e={box:r.to,since:s.drawn})}}return e&&l(e.box).lit.push({start:e.since,end:a}),[...p.values()]}var Pr=t=>Math.round(t*100)/100,qn=class{constructor(n,a,p){this.prefix=n;this.total=a;this.last=p}prefix;total;last;frames=[];count=0;pct(n){return+(Math.min(Math.max(n,0),this.total)/this.total*100).toFixed(3)}kf(n){let a=`${this.prefix}-${this.count++}`,p=new Map;for(let[e,s,r]of[...n].sort((o,i)=>o[0]-i[0])){let o=this.pct(e),i=p.get(o)??{props:{}};Object.assign(i.props,s),r&&(i.ease=r),p.set(o,i)}let l=[...p].map(([e,{props:s,ease:r}])=>{let o=Object.entries(s).map(([i,c])=>`${i}:${c}`);return r&&o.push(`animation-timing-function:${r}`),`${e}%{${o.join(";")}}`}).join("");return this.frames.push(`@keyframes ${a}{${l}}`),`animation-name:${a}`}vis(n,a=this.last,p={}){let l=p.f??oe.fade,e=p.on??{},s=p.off??{},r=p.within?Math.max(n+l,a-l):a;return this.kf([[0,{opacity:0,...s}],[n,{opacity:0,...s},p.ein??fe.out],[n+l,{opacity:1,...e}],[r,{opacity:1,...e},fe.inOut],[Math.min(r+l,this.total),{opacity:0,...s}],[this.total,{opacity:0,...s}]])}rise(n,a=this.last,p=!1){return this.vis(n,a,{on:{transform:"translateY(0)"},off:{transform:`translateY(${w.rise}px)`},within:p})}pop(n,a=this.last){return this.vis(n,a,{f:oe.popFade,ein:fe.pop,on:{transform:"scale(1)"},off:{transform:`scale(${w.popFrom})`}})}until(n){let a=oe.untilFade;return this.kf([[0,{opacity:1}],[n,{opacity:1},fe.inOut],[n+a,{opacity:0}],[this.last,{opacity:0}],[this.total,{opacity:1}]])}move(n,a=[]){return this.kf(n.map(([p,l,e,s=1,r])=>[p,{transform:`translate(${Pr(l)}px,${Pr(e)}px) scale(${s})`},r]).concat(a))}blink(n,a,p){return[[0,{opacity:0}],[n-.01,{opacity:0}],[n,{opacity:1}],[a,{opacity:1}],[a+p,{opacity:0}],[this.total,{opacity:0}]]}};var wo=t=>t.kind==="git",Sr=t=>t.kind==="lineup",Mr=t=>t.kind==="time",ls=t=>t.kind==="tree",he=t=>`font:${t.weight} ${t.size}px var(--${t.family})`,_e=(t,n="var(--surf)")=>`color-mix(in srgb,var(--c) ${t}%,${n})`,ge=w.stroke,Ee=w.mix,is=`color-mix(in srgb,var(--mute) ${Ee.past}%,var(--bg))`,$o=[".dg{display:block;width:100%;height:auto;overflow:visible}",".dg .dg-a{animation-duration:var(--T);animation-timing-function:linear;animation-iteration-count:infinite;animation-fill-mode:both;animation-delay:calc(var(--at,0) * -1s);animation-play-state:var(--play,running)}",".dg .dg-popc{transform-box:fill-box;transform-origin:center}",".dg-bg{fill:var(--bg)}",".dg-band{fill:color-mix(in srgb,var(--c) var(--tint),var(--bg));stroke:color-mix(in srgb,var(--c) var(--edge),transparent)}",`.dg-bi{fill:${_e(Ee.regionIcon)};stroke:${_e(Ee.regionIconEdge,"transparent")}}`,`.dg-bz{${he(A.regionName)};fill:var(--ct)}`,`.dg-bx{${he(A.regionNote)};fill:var(--mute)}`,".dg-st{fill:var(--surf);stroke:var(--hair)}",`.dg-halo{fill:none;stroke:var(--c);stroke-width:${ge.halo};stroke-opacity:.16}`,`.dg-on{fill:none;stroke:var(--c);stroke-width:${ge.on}}`,`.dg-ic{fill:${_e(Ee.icon)}}`,`.dg-slot{fill:none;stroke:${_e(Ee.slot,"transparent")};stroke-width:${ge.slot};stroke-dasharray:3 3}`,`.dg-gl{fill:none;stroke:var(--c);stroke-width:${ge.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-sn{${he(A.boxName)};fill:var(--ink)}`,`.dg-ss{${he(A.boxSub)};fill:var(--mute)}`,`.dg-ss-ok{${he(A.boxSubStrong)};fill:var(--ct)}`,`.dg-ss-act{${he(A.boxSubStrong)};fill:var(--ink)}`,`.dg-ll{stroke:var(--line);stroke-width:${ge.lifeline};stroke-dasharray:3 4}`,`.dg-e{fill:none;stroke:var(--line);stroke-width:${ge.edge};stroke-linecap:round;stroke-dasharray:0 ${w.edge.ghostDash}}`,`.dg-eh{fill:none;stroke:var(--line);stroke-width:${ge.arrow};stroke-linecap:round;stroke-linejoin:round}`,`.dg-e-on{fill:none;stroke:var(--c);stroke-width:${ge.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,`.dg-eh-on{fill:none;stroke:var(--c);stroke-width:${ge.edgeOn};stroke-linecap:round;stroke-linejoin:round}`,`.dg-flow{fill:none;stroke:var(--surf);stroke-width:${ge.flow};stroke-linecap:round;stroke-dasharray:1.5 ${w.edge.flowDash}}`,`.dg-e-past{fill:none;stroke:${is};stroke-width:${ge.edge};stroke-linecap:round}`,`.dg-eh-past{fill:none;stroke:${is};stroke-width:${ge.arrow};stroke-linecap:round;stroke-linejoin:round}`,".dg-bd{cursor:pointer}",".dg-bdf{fill:var(--c)}",`.dg-bdft{${he(A.badge)};fill:var(--on-c)}`,`.dg-bdr{fill:none;stroke:var(--c);stroke-width:${ge.badgeRing};pointer-events:none}`,`.dg-bdp{fill:${_e(Ee.badgePast)};stroke:${_e(Ee.badgePastEdge,"transparent")};stroke-width:${ge.hair}}`,`.dg-bdpt{${he(A.badge)};fill:var(--ct)}`,`.dg-bdp-g{fill:var(--surf);stroke:${is};stroke-width:${ge.hair}}`,`.dg-bdpt-g{${he(A.badge)};fill:var(--mute)}`,`.dg-cap rect,.dg-act rect{fill:${_e(Ee.cap)};stroke:${_e(Ee.capEdge,"transparent")}}`,`.dg-cap text{${he(A.label)};fill:var(--ct)}`,`.dg-capj text{${he(A.labelJa)}}`,`.dg-cap-past text{${he(A.label)};fill:var(--mute);fill-opacity:${w.state.pastLabel}}`,`.dg-cap-pastj text{${he(A.labelJa)}}`,`.dg-act text{${he(A.action)};fill:var(--ct)}`,".dg-car{fill:var(--carry,var(--ink))}",`.dg-car-t{${he(A.carrier)};fill:var(--bg)}`,`.dg-car-tj{${he(A.carrierJa)}}`,`.dg-env{fill:var(--carry,var(--ink));stroke:var(--surf);stroke-width:${ge.envelope}}`,`.dg-env-in{fill:none;stroke:var(--surf);stroke-width:${ge.flow};stroke-linejoin:round;stroke-linecap:round}`,".dg-coin{fill:var(--coin);stroke:var(--surf);stroke-width:1.2}",".dg-coin-in{fill:none;stroke:var(--coinin);stroke-width:1.1}",".dg-strip{fill:var(--surf);stroke:var(--hair)}",`.dg-sep{stroke:var(--hair);stroke-width:${ge.hair}}`,`.dg-sh{${he(A.stripTitle)};fill:var(--ink)}`,`.dg-fl{${he(A.fieldName)};fill:var(--mute)}`,`.dg-fv{${he(A.fieldValue)};fill:var(--ink)}`,`.dg-fvj{${he(A.fieldValueJa)};fill:var(--ink)}`,".dg-fv-c{fill:var(--ct)}",".dg-fl-now{fill:var(--c)}",`.dg-tr-ring{fill:none;stroke:var(--line);stroke-width:${ge.trail}}`,".dg-tr-fill{fill:var(--c)}",".dg-tg rect{fill:var(--c)}",`.dg-tg text{${he(A.tag)};fill:var(--on-c)}`,`.dg-side{fill:color-mix(in srgb,var(--c) ${Ee.side}%,var(--bg));stroke:${_e(Ee.sideEdge,"transparent")};stroke-dasharray:4 4}`,`.dg-side-t{${he(A.regionName)};fill:var(--ct)}`,`.dg-side-n{${he(A.regionNote)};fill:var(--mute)}`,`.dg-ghost{fill:var(--surf);stroke:${_e(Ee.ghostEdge,"transparent")};stroke-dasharray:4 3}`,`.dg-path{fill:none;stroke:${_e(Ee.path,"transparent")};stroke-width:${ge.path};stroke-linecap:round;stroke-dasharray:0 ${w.edge.ghostDash}}`,`.dg-path-h{fill:none;stroke:${_e(Ee.path,"transparent")};stroke-width:${ge.arrow};stroke-linecap:round;stroke-linejoin:round}`,`.dg-path-t{${he(A.label)};fill:var(--ct)}`,`.dg-path-tj{${he(A.labelJa)}}`,".dg-start{fill:var(--ink)}",`.dg-end{fill:var(--bg);stroke:var(--ink);stroke-width:${ge.end}}`,".dg-end-in{fill:var(--ink)}",`.dg-end-x{fill:var(--bg);stroke:${_e(Ee.path,"transparent")};stroke-width:${ge.arrow};stroke-dasharray:2 2.5}`,`.dg-end-xi{fill:${_e(Ee.path,"transparent")}}`,`.dg-mark{${he(A.regionNote)};fill:var(--mute)}`,`.dg-done{fill:var(--ink);stroke:var(--surf);stroke-width:${ge.done}}`,`.dg-done-ck{fill:none;stroke:var(--surf);stroke-width:${ge.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-git-l{fill:none;stroke:var(--c);stroke-width:${ge.git};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,`.dg-git-cp{fill:none;stroke:var(--c);stroke-width:${ge.gitOrphan};stroke-linecap:round;stroke-dasharray:3 3;stroke-opacity:.7}`,`.dg-git-c{fill:var(--surf);stroke:var(--c);stroke-width:${ge.git}}`,`.dg-git-id{${he(A.gitId)};fill:var(--ct)}`,`.dg-git-h{${he(A.gitHash)};fill:var(--mute)}`,`.dg-git-n{${he(A.gitNote)};fill:var(--ink2)}`,`.dg-git-old{fill:var(--surf);stroke:var(--c);stroke-width:${ge.gitOrphan};stroke-dasharray:3 3;stroke-opacity:.6}`,`.dg-git-oldl{${he(A.gitId)};fill:var(--ct);opacity:.55}`,`.dg-tree-l{fill:none;stroke:var(--line);stroke-width:${ge.tree};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,`.dg-tree-tr{fill:none;stroke:var(--c);stroke-width:${ge.treeTrail};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,`.dg-tree-h{fill:none;stroke:var(--c);stroke-width:${ge.treeTrail};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tree-con{fill:none;stroke:var(--line);stroke-width:${ge.treeCon};stroke-linecap:round;stroke-dasharray:2 3.5}`,`.dg-tree-card{fill:var(--surf);stroke:var(--hair);stroke-width:${ge.hair}}`,`.dg-tree-cg{fill:none;stroke:var(--mute);stroke-width:${ge.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tree-ct{${he(A.treeCard)};fill:var(--ink)}`,`.dg-tree-hash{${he(A.treeHash)};fill:var(--ink)}`,`.dg-tree-name{${he(A.treeName)};fill:var(--mute)}`,`.dg-tree-one{${he(A.boxName)};fill:var(--ink)}`,`.dg-tree-rh{${he(A.rootHash)};fill:var(--ink)}`,`.dg-tree-rn{${he(A.rootName)};fill:var(--mute)}`,".dg-ln-chip{fill:var(--c)}",`.dg-ln-plain{fill:color-mix(in srgb,var(--mute) ${Ee.chipPlain}%,var(--surf))}`,`.dg-ln-t{${he(A.chip)};fill:var(--on-c)}`,`.dg-ln-tp{${he(A.chip)};fill:var(--ink)}`,".dg-ln-seal{transform-box:fill-box;transform-origin:0 50%}",`.dg-ln-sd{fill:color-mix(in srgb,var(--mute) ${Ee.sealDark}%,var(--surf))}`,`.dg-ln-sl{fill:color-mix(in srgb,var(--mute) ${Ee.sealLight}%,var(--surf))}`,`.dg-ln-stamp{fill:var(--surf);stroke:var(--c);stroke-width:${ge.stamp}}`,`.dg-ln-st{${he(A.stamp)};fill:var(--ct)}`,`.dg-tm-ep{fill:color-mix(in srgb,var(--ink) ${Ee.timeShade}%,transparent)}`,`.dg-tm-sep{stroke:var(--hair);stroke-width:${ge.hair};stroke-dasharray:2 4}`,`.dg-tm-hd{${he(A.timeHead)};fill:var(--ink)}`,`.dg-tm-hdj{${he(Bt(A.timeHead))}}`,`.dg-tm-slot{fill:none;stroke:var(--line);stroke-width:${ge.timeSlot};opacity:.55}`,".dg-tm-m{fill:var(--c)}",".dg-tm-x{fill:var(--c-slate)}",`.dg-tm-fr{fill:none;stroke:var(--c-blue);stroke-width:${ge.timeFrame};stroke-dasharray:3 2}`,`.dg-tm-gd{fill:none;stroke:color-mix(in srgb,var(--c-blue) ${Ee.timeGuide}%,transparent);stroke-width:${ge.hair};stroke-dasharray:2 3}`,`.dg-tm-ax{fill:none;stroke:var(--line);stroke-width:${ge.timeAxis}}`,`.dg-tm-tk{${he(A.timeTick)};fill:var(--mute)}`,`.dg-tm-tkj{${he(Bt(A.timeTick))}}`,`.dg-tm-en{${he(A.timePeriod)};fill:var(--ink2)}`,`.dg-tm-er{${he(A.timeRange)};fill:var(--mute)}`,`.dg-tm-erj{${he(Bt(A.timeRange))}}`,`.dg-tm-rn{${he(A.timeRow)};fill:var(--ink2)}`,`.dg-tm-br{fill:none;stroke:var(--c);stroke-width:${ge.timeSpan};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tm-bt{${he(A.spanText)};fill:var(--ct)}`,`.dg-tm-bx{fill:color-mix(in srgb,var(--c) ${Ee.timeSpan}%,transparent);stroke:var(--c);stroke-width:${ge.timeSpan};stroke-dasharray:4 3}`,`.dg-tm-con{fill:none;stroke:var(--line);stroke-width:${ge.timeDrop};stroke-linecap:round;stroke-dasharray:0 3.5}`,".dg-tm-pg{fill:var(--surf);stroke:var(--line);stroke-dasharray:2 2.5}",`.dg-tm-pgl{fill:none;stroke:var(--mute);stroke-width:${ge.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tm-pc{fill:var(--surf);stroke:var(--c);stroke-width:${ge.timePoint}}`,`.dg-tm-pcg{fill:none;stroke:var(--c);stroke-width:${ge.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tm-pn{${he(A.pointName)};fill:var(--ink)}`,`.dg-tm-pnj{${he(Bt(A.pointName))}}`,".dg-tm-pn-g{fill:var(--mute)}",`.dg-tm-ps{${he(A.pointState)};fill:var(--ct)}`,`.dg-tm-ln{fill:none;stroke:var(--c);stroke-width:${ge.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,`.dg-tm-nd{stroke:var(--ink);stroke-width:${ge.timeNeedle};opacity:.55}`,".dg-tm-nh{fill:var(--ink)}",".dg-tm-ph{fill:none;stroke:var(--line);stroke-dasharray:3 3}",`.dg-tm-ex{fill:color-mix(in srgb,var(--c-slate) ${Ee.timeEmpty}%,var(--surf));stroke:var(--c-slate);stroke-width:${ge.timeFrame};stroke-dasharray:3 3}`,`.dg-tm-ext{${he(A.emptyText)};fill:var(--t-slate)}`,".dg-tm-mt{fill:var(--hair)}",".dg-tm-mf{fill:var(--c);transform-box:fill-box;transform-origin:0 50%}",`.dg-tm-mk{stroke:var(--ink2);stroke-width:${ge.timeMeter}}`,`.dg-tm-ml{${he(A.meterLine)};fill:var(--ink2)}`,".dg-vp-bg{fill:var(--bg)}",".dg-vp-frame{fill:none;stroke:var(--hair)}",".dg-hd-bg{fill:var(--bg)}",".dg-mm-bg{fill:var(--surf);stroke:var(--hair)}",`.dg-mm-t{${he(A.miniTitle)};fill:var(--mute)}`,".dg-mm-world{fill:var(--sunk);stroke:var(--hair)}",`.dg-mm-band{fill:${_e(Ee.miniBand)};stroke:${_e(Ee.miniBandEdge,"transparent")};stroke-width:.6}`,`.dg-mm-card{fill:${_e(Ee.mini)}}`,`.dg-mm-vp{fill:color-mix(in srgb,var(--ink) ${Ee.view}%,transparent);stroke:var(--ink);stroke-width:${ge.badgeRing};vector-effect:non-scaling-stroke}`].join("");function ko(t){let n=2166136261;for(let a=0;a<t.length;a++)n^=t.charCodeAt(a),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function vo(t){let n=new Map,a=(p,l)=>{n.set(p,(n.get(p)??new Set).add(l))};return t.steps.forEach((p,l)=>{for(let e of p.events)e.type==="edge"?(a(e.from,l),a(e.to,l)):(e.type==="action"||e.type==="swap")&&a(e.box,l)}),new Map([...n].map(([p,l])=>[p,[...l].sort((e,s)=>e-s)]))}function Po(t,n,a){let p=[],{whole:l}=n,e=0;for(let r of n.events){let o=t.steps[r.step]?.events[r.event];if(o?.type==="swap"&&p.push({t:r.at,order:e++,box:o.box,set:o.text}),a&&o?.type==="action"){p.push({t:r.at,order:e++,box:o.box,act:o.label});let i=n.steps[r.step].end;(!l||i<=l.start)&&p.push({t:i,order:e++,box:o.box,act:null})}}p.sort((r,o)=>r.t-o.t||r.order-o.order);let s=new Map;for(let r of t.boxes){let o=[r.sub??"","dg-ss"],i,c=o.join("|"),m=[],f=p.filter(M=>M.box===r.id),d=[...f].reverse().find(M=>M.set!==void 0||typeof M.act=="string");l&&typeof d?.act=="string"&&f.push({t:l.start,order:e++,box:r.id,act:d.act});for(let M of f){M.set!==void 0&&(o=[M.set,"dg-ss-ok"],i=void 0),M.act!==void 0&&(i=M.act??void 0);let x=i!==void 0?[i,"dg-ss-act"]:o;x.join("|")!==c&&(c=x.join("|"),m.push([M.t,x[0],x[1]]))}let u=m.filter((M,x)=>{let h=m[x+1];return h===void 0||h[0]-M[0]>=oe.minShow});s.set(r.id,u)}return s}function So(t,n,a){let p=new Map;for(let l of n.events){let e=t.steps[l.step]?.events[l.event];if(e?.type!=="strip")continue;let s=a.badges[l.step]?.color??"slate",r=p.get(e.field)??[],o=n.steps[l.step].end;r.push({at:l.at,color:s,step:l.step,until:o,...e.value!==void 0?{value:e.value}:{},...e.tag!==void 0?{tag:e.tag}:{}}),p.set(e.field,r)}return p}function Mo(t,n,a){if(t.until===void 0)return n;let{after:p,again:l,...e}=n;if(!p)return e;let s=a[t.until].start;return s>p.start?{...e,after:{start:p.start,end:Math.min(p.end,s)}}:e}function ps(t,n,a,p,l,e,s=[],r=[]){let o=Vt(p,l),i=ko(`${JSON.stringify(t)}|${o}|${e?`${e.width}|${e.lang}`:""}`),c=new qn(`dg${i}`,a.total,a.last),m={m:c,t:a,id:i,sh:`filter="url(#dg-sh-${i})"`,end:a.steps[a.steps.length-1].end,ink:s,traces:r,boxText:Ls(n.boxes)},f=vo(t),d=Po(t,a,n.kind!=="sequence"),u={band:[],base:[],lit:[],node:[],badge:[],top:[]};for(let I of n.regions)u.band.push(As(I,s));let M=n.boxes.find(I=>I.ghost)?.color??"slate";n.side&&u.band.push(Fs(n.side,M,s));let x=(I,me)=>n.boxes.find(ae=>ae.id===I&&(me===void 0||ae.ghost===me))?.color;for(let I of n.paths)u.base.push(Cs(I,x(I.to,!0)??x(I.from)??M,s,r));for(let I of n.ends)u.node.push(_s(I,M,s));let h=n.kind==="state",g=new Map((a.states??[]).flatMap(I=>I.lit[0]?[[I.box,I.lit[0].start]]:[])),L=new Map((a.meters??[]).map(I=>[I.field,I.keys])),O=I=>I.meter?nt("time").meterField({...I,meter:I.meter},L.get(I.name)??[[0,0]],m):void 0,_=I=>Vs(I,So(t,a,n),m,h,g,O);n.strip&&!e&&u.band.push(_(n.strip));for(let I of n.lifelines)u.base.push(Bs(I.x,I.y1,I.y2));if(wo(n)){let I=nt("git").drawGit(n,t,a,m);u.base.push(I.links),u.lit.push(I.lines),u.node.push(I.commits),u.top.push(I.tags)}let P=ls(n)?n:void 0,j=P?nt("tree").drawTree(P,t,a,m):void 0;j&&(u.base.push(j.links),u.lit.push(j.trails),u.node.push(j.nodes));let $=new Set((P?.runs??[]).map(I=>`${I.step}/${I.event}`)),S=Sr(n)?n:void 0;if(S){let I=nt("lineup").drawLineup(S,t,a,m,d);u.base.push(I.lanes),u.node.push(I.chips)}let y=Mr(n)?n:void 0;if(y){let I=nt("time").drawTime(y,t,a,m,d);u.base.push(I.base),u.lit.push(I.lit),u.node.push(I.node),u.top.push(I.top)}let F=new Set((y?.wires??[]).map(I=>`${I.step}/${I.event}`));for(let I of n.edges){let me=a.edges.find(we=>we.step===I.step&&we.event===I.event);if(!me||y&&!F.has(`${I.step}/${I.event}`)||$.has(`${I.step}/${I.event}`))continue;let ae=Math.max(j?.appear.get(I.from)??0,j?.appear.get(I.to)??0),ye=Gs(I,me,m,h,ae);u.base.push(ye.base),u.lit.push(ye.lit)}let C=new Map((a.states??[]).map(I=>[I.box,I])),X=new Map(t.boxes.flatMap(I=>I.link===void 0?[]:[[I.id,I.link]])),z=(I,me)=>Zt(X.get(I),me);for(let I of y||S?[]:n.boxes){if(I.ghost){u.node.push(z(I.id,Ds(I,s)));continue}let me=C.get(I.id);u.node.push(z(I.id,tn(I,m,f.get(I.id)??[],d.get(I.id)??[],h?me?.lit??[]:void 0))),me?.done!==void 0&&u.node.push(Is(I,me.done,m))}for(let I of n.badges)e&&os(n,I)||u.badge.push(Hn(I,m,h));for(let I of n.labels){let me=a.labels.find(ae=>ae.step===I.step&&ae.event===I.event);me&&u.top.push(Ys(I,Mo(I,me,a.steps),m))}let{whole:Q}=a;for(let I of n.actions){let me=a.events.find(ye=>ye.step===I.step&&ye.event===I.event);if(!me)continue;let ae=a.steps[I.step].end;u.top.push(Q&&ae>Q.start?Wn(I,me.at,Q.end,m):Wn(I,me.at,ae,m,Q))}for(let I of a.carriers){let me=n.edges.find(ae=>ae.step===I.step&&ae.event===I.event);me&&u.top.push(nn(me,P?{...I,start:I.depart,end:I.arrive+oe.fade}:I,m))}let B=Object.values(u).map(I=>I.join("")).join(""),{near:v,far:D,nearY:R,farY:W}=w.shadow,J=`<filter id="dg-sh-${i}" x="-20%" y="-30%" width="140%" height="180%"><feDropShadow dx="0" dy="${R}" stdDeviation="${v}" style="flood-color:var(--sh);flood-opacity:var(--shA)"/><feDropShadow dx="0" dy="${W}" stdDeviation="${D}" style="flood-color:var(--sh);flood-opacity:var(--shB)"/></filter>`,Z=e&&n.kind==="sequence"?n.boxes.map(I=>z(I.id,Rs(I,m,f.get(I.id)??[],d.get(I.id)??[]))).join(""):"",de=e?No(n,a,t,c,i,B,e,Z,(I,me)=>_(I)+n.badges.filter(ae=>os(n,ae)).map(ae=>Hn({...ae,x:ae.x-me.x+I.x+w.badge.r,y:ae.y-me.y+I.y},m,h)).join("")):{body:`<rect class="dg-bg" width="${n.width}" height="${n.height}" rx="${w.region.radius}"/>${B}`,w:n.width,h:n.height},ue=`.dg-${i}{${Kt};--T:${a.total}s;${o}}${$o}${c.frames.join("")}`;return`<svg xmlns="http://www.w3.org/2000/svg" class="dg dg-${i}" viewBox="0 0 ${Math.ceil(de.w)} ${Math.ceil(de.h)}" width="${Math.ceil(de.w)}" height="${Math.ceil(de.h)}" role="img" aria-label="${ve(t.title)}" data-dragon="figure" data-view="${e?"follow":"fixed"}"><style>${ue}</style><defs>${J}</defs>${de.body}</svg>`}function Or(t){let n=Math.min(...t.map(p=>p.x)),a=Math.min(...t.map(p=>p.y));return{x:n,y:a,w:Math.max(...t.map(p=>p.x+p.w))-n,h:Math.max(...t.map(p=>p.y+p.h))-a}}function os(t,n){return t.strip!==void 0&&n.y>=t.strip.y}function Oo(t,n,a){let p=as(t,n,a);return p.length===0?void 0:Or(p)}function To(t,n,a,p){let l=w.badge.r+w.follow.badgeRoom,{x:e,y:s}=t,r=i=>Math.hypot(Math.max(0,i.x-e,e-i.x-i.w),Math.max(0,i.y-s,s-i.y-i.h)),o={x:e-l,y:s-l,w:l*2,h:l*2};for(let i of[...n].sort((c,m)=>r(c)-r(m))){let c=Or([o,i]);c.w<=a&&c.h<=p&&(o=c)}return o}function as(t,n,a){let p=[];for(let l of t.edges.filter(e=>e.step===a)){let e=l.points.map(r=>r[0]),s=l.points.map(r=>r[1]);p.push({x:Math.min(...e),y:Math.min(...s),w:Math.max(...e)-Math.min(...e),h:Math.max(...s)-Math.min(...s)})}if(p.push(...t.labels.filter(l=>l.step===a),...t.actions.filter(l=>l.step===a)),ls(t)){let l=new Set((n.steps[a]?.events??[]).flatMap(e=>e.type==="edge"?[e.from,e.to]:[]));p.push(...t.nodes.filter(e=>e.step===a||l.has(e.id)));for(let e of t.links.filter(s=>s.step===a)){let s=e.points.map(o=>o[0]),r=e.points.map(o=>o[1]);p.push({x:Math.min(...s),y:Math.min(...r),w:Math.max(...s)-Math.min(...s),h:Math.max(...r)-Math.min(...r)})}}if(Sr(t)){let l=new Set((n.steps[a]?.events??[]).flatMap(e=>"box"in e?[e.box]:[]));p.push(...t.lanes.filter(e=>l.has(e.id)))}for(let l of n.steps[a]?.events??[]){let e=l.type==="edge"?[l.from,l.to]:l.type==="action"||l.type==="swap"?[l.box]:[];for(let s of e){let r=t.boxes.find(o=>o.id===s);r&&(t.kind==="architecture"||l.type==="swap")&&p.push(r)}}return p}function No(t,n,a,p,l,e,s,r,o){let i=w.follow,c=w.mini,m=Math.max(1,s.width),f=Math.min(t.width,m),d=t.strip?t.strip.y:t.height,u=Qe[s.lang].overview,M=q=>{let Y=Math.min(c.w,f*.4,q*.4/t.height*t.width),U=Y/t.width,K=d*U,H=Math.max(Y,Math.ceil(pe(u,A.miniTitle)));return{vh:q,mw:Y,k:U,mh:K,bw:H,bgW:H+c.pad*2,bgH:K+c.pad*2+c.title,beside:K>Y}},x=M(Math.min(d,Math.max(i.minH,f*i.aspect))),h=m<i.narrow&&(x.beside||t.strip!==void 0),g=t.strip?Gn(t.strip,0,0,f).h+c.inset:0,L=s.height===void 0?Number.POSITIVE_INFINITY:(x.beside||h?s.height:s.height-x.bgH-c.inset)-g,{vh:O,mw:_,k:P,mh:j,bw:$,bgW:S,bgH:y,beside:F}=L<x.vh?M(Math.max(i.fitMinH,L)):{...x,vh:Number.isFinite(L)?Math.min(d,L):x.vh},C=F&&!h?Math.min(t.width,m-S-c.inset):f,X=q=>Math.min(t.width-C/2,Math.max(C/2,q)),z=r===""?0:Math.max(...t.boxes.map(q=>q.y+q.h))+i.headRoom,Q=r===""?0:i.head.pad*2+i.head.h,B=O-Q,v=q=>Math.min(d-B/2,Math.max(z+B/2,q)),D=w.badge.r,R=[t.width/2,d/2],J=n.steps.map((q,Y)=>{if(Mr(t)){let le=nt("time").timeFocus(t,n,Y,as(t,a,Y),C,B);return R=[le.x+le.w/2,le.y+le.h/2],[X(R[0]),v(R[1])]}let U=Oo(t,a,Y);R=U?[U.x+U.w/2,U.y+U.h/2]:R;let K=[X(R[0]),v(R[1])],H=t.badges.find(le=>le.step===Y);if(!H||os(t,H)||Math.abs(H.x-K[0])<=C/2-D&&Math.abs(H.y-K[1])<=B/2-D)return K;let re=To(H,as(t,a,Y),C,B);return R=[re.x+re.w/2,re.y+re.h/2],[X(R[0]),v(R[1])]}).map(([q,Y])=>[q,Y-Q/2]),Z=J[0],ie=[[0,Z[0],Z[1]],[n.steps[0].start,Z[0],Z[1]]];J.forEach((q,Y)=>{if(Y===0)return;let U=J[Y-1],K=n.steps[Y].start;ie.push([K,U[0],U[1],1,fe.inOut],[K+i.ease,q[0],q[1]])});let de=J[J.length-1];ie.push([n.last,de[0],de[1],1,fe.inOut],[n.total,Z[0],Z[1]]);let ue=p.move(ie.map(([q,Y,U,K,H])=>[q,C/2-Y,O/2-U,K,H])),I=F?C+c.inset:C-S-c.inset,me=F?0:O+c.inset,ae=I+c.pad,ye=ae+($-_)/2,we=me+c.pad+c.title,N=h?{clip:"",body:""}:(()=>{let q=[...t.regions.map(U=>`<rect class="dg-mm-band" style="${ke(U.color)}" x="${ye+U.x*P}" y="${we+U.y*P}" width="${U.w*P}" height="${U.h*P}" rx="3"/>`),...t.boxes.map(U=>`<rect class="dg-mm-card" style="${ke(U.color)}" x="${ye+U.x*P}" y="${we+U.y*P}" width="${U.w*P}" height="${U.h*P}" rx="1.5"/>`),...(ls(t)?t.nodes:[]).map(U=>`<rect class="dg-mm-card" style="${ke(U.color)}" x="${ye+U.x*P}" y="${we+U.y*P}" width="${U.w*P}" height="${U.h*P}" rx="1.5"/>`)].join(""),Y=p.move(ie.map(([U,K,H,,re])=>[U,ye+(K-C/2)*P,we+(H-O/2)*P,1,re]));return{clip:`<clipPath id="dg-mm-${l}"><rect x="${ye}" y="${we}" width="${_}" height="${j}" rx="4"/></clipPath>`,body:`<rect class="dg-mm-bg" x="${I}" y="${me}" width="${S}" height="${y}" rx="${c.radius}"/><text class="dg-mm-t" x="${ae}" y="${we-c.pad+2}">${u}</text><g clip-path="url(#dg-mm-${l})"><rect class="dg-mm-world" x="${ye}" y="${we}" width="${_}" height="${j}"/>${q}<rect class="dg-mm-vp dg-a"${Q===0?"":` y="${Q*P}"`} width="${C*P}" height="${(O-Q)*P}" rx="2" style="${Y}"/></g>`}})(),se=Q===0?"":`<g class="dg-hd"><rect class="dg-hd-bg" width="${C}" height="${Q}"/><line class="dg-sep" x1="0" y1="${Q}" x2="${C}" y2="${Q}"/><g class="dg-a" style="${p.move(ie.map(([q,Y,,U,K])=>[q,C/2-Y,0,U,K]))}">${r}</g></g>`,T=`<defs><clipPath id="dg-vp-${l}"><rect width="${C}" height="${O}" rx="${w.region.radius}"/></clipPath>${N.clip}</defs><g clip-path="url(#dg-vp-${l})"><rect class="dg-vp-bg" width="${C}" height="${O}"/><g class="dg-a" style="${ue}">${e}</g>${se}</g><rect class="dg-vp-frame" x="0.5" y="0.5" width="${C-1}" height="${O-1}" rx="${w.region.radius}"/>${N.body}`,ee=F&&!h?C+c.inset+S:f,b=F||h?O:me+y;if(!t.strip)return{body:T,w:ee,h:b};let G=Gn(t.strip,0,b+c.inset,f);return{body:T+o(G,t.strip),w:ee,h:G.y+G.h}}function cs(t,n){let a=gs(t.palette);if(!t.colors)return a;let p=Qe[t.lang??"ja"],l=Object.entries(t.colors).flatMap(([e,s])=>ys(e)?bs(s)?[]:[p.unreadableColor(e)]:[p.unknownColor(e)]);if(l.length>0)throw new Error(p.cannotDraw(l.join(" / ")));return{...a,[n]:{...a[n],...t.colors}}}function Tr(t,n={}){let a=n.lang??"ja",p=$r(t,{lang:a});if(!p.ok)throw new Error(Qe[a].cannotDraw(p.errors.map(s=>`${s.pointer} ${s.message}`).join(" / ")));let l=p.diagram,e=l.kind==="sequence"?fr(l):l.kind==="state"?nt("state",a).layoutState(l,a):l.kind==="git"?nt("git",a).layoutGit(l):l.kind==="time"?nt("time",a).layoutTime(l,a):l.kind==="tree"?nt("tree",a).layoutTree(l):l.kind==="lineup"?nt("lineup",a).layoutLineup(l):dr(l);return Eo(l,e,vr(l,n.still===!0),n)}function Eo(t,n,a,p={}){let l=p.theme==="dark"?"dark":"light",e=cs(p,l),s=[],r=[];return{svg:ps(t,n,a,e,l,void 0,s,r),palette:e.id,theme:l,...t.view?{view:t.view}:{},fonts:{...It},layout:n,timeline:a,diagram:t,overlaps:Es(s,a.stills,r)}}function ds(t,n,a){let p=Math.max(0,n)/t.layout.width,e=(a===void 0?p:Math.min(p,Math.max(0,a)/t.layout.height))*A.boxName.size;return t.view?{mode:t.view,textPx:e}:{mode:e>=xs?"fixed":"follow",textPx:e}}var An=t=>`font:${t.weight} ${t.size}px var(--${t.family})`,Ae=t=>`${t}px`;function Lo(){let t=w.player,n=Ae(t.hidden);return[`.dg-player{display:flex;flex-direction:column;gap:${Ae(t.gap)};color:var(--ink)}`,`.dg-player .dg-frame{border-radius:${Ae(t.radius)};overflow:hidden}`,".dg-bar{container:dg-bar/inline-size}",`.dg-row{display:flex;align-items:flex-start;gap:${Ae(t.gap)}}`,`.dg-btns{display:flex;gap:${Ae(t.gap/2)};flex:none}`,`.dg-btn{width:${Ae(t.button)};height:${Ae(t.button)};border-radius:${Ae(t.radius)};border:${Ae(w.stroke.hair)} solid var(--hair);background:var(--surf);color:var(--ink);${An(A.button)};cursor:pointer}`,`.dg-btn:focus-visible{outline:${Ae(t.focus)} solid var(--c-blue);outline-offset:${Ae(t.focus)}}`,`.dg-say{display:flex;gap:${Ae(t.gap)};min-width:0}`,`.dg-no{${An(A.stepNo)};color:var(--mute);padding-top:${Ae(t.focus)}}`,".dg-txt{display:grid;grid-template-columns:minmax(0,1fr);min-width:0}",".dg-txt>*{grid-area:1/1}",".dg-room{visibility:hidden}",`.dg-tt{${An(A.stepTitle)};margin:0}`,`.dg-tb{${An(A.stepBody)};color:var(--ink2);margin:0;white-space:pre-line}`,`.dg-sr{position:absolute;width:${n};height:${n};margin:-${n};padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}`,`@container dg-bar (width < ${Ae(t.narrow)}){.dg-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:0 ${Ae(t.gap)}}.dg-say,.dg-txt,.dg-txt>*{display:contents}.dg-btns{grid-area:1/1;margin-bottom:${Ae(t.gap/2)}}.dg-btn{width:${Ae(t.touch)};height:${Ae(t.touch)}}.dg-no{grid-area:1/2;display:flex;align-items:center;min-height:${Ae(t.touch)};padding-top:0}.dg-tt{grid-area:2/1/3/3}.dg-tb{grid-area:3/1/4/3}}`,`@media (pointer: coarse){.dg-btn{width:${Ae(t.touch)};height:${Ae(t.touch)}}}`,`.dg-spot{fill:none;stroke:var(--t-amber);stroke-width:${Ae(w.stroke.mark)};stroke-dasharray:${w.mark.dash} ${w.mark.gap};pointer-events:none}`].join("")}function qo(t){if(t.getElementById("dragon-player-css"))return;let n=t.createElement("style");n.id="dragon-player-css",n.textContent=Lo(),t.head.appendChild(n)}var Gt={prev:"\u2039",pause:"\u275A\u275A",play:"\u25B6",next:"\u203A"},Nr="http://www.w3.org/2000/svg",Er=t=>String(t).padStart(2,"0"),Ao=(t,n)=>`${Er(t+1)}/${Er(n)}`;function Lr(t,n,a={}){let p=t.ownerDocument,l=p.defaultView,e=!!l?.matchMedia?.("(prefers-reduced-motion: reduce)").matches,s=Tr(n,a),r=a.lang??"ja",o=Qe[r],i=cs(a,s.theme),{timeline:c}=s,m=s.diagram.steps,f=m.length;qo(p);let d=p.createElement("div");d.className="dg-player",d.dataset.dragon="player",d.setAttribute("style",`${Kt};${Vt(i,s.theme)}`);let u=p.createElement("div");u.className="dg-frame";let M=(K,H,re)=>{let le=p.createElement("button");return le.type="button",le.className="dg-btn",le.dataset.dragon=K,le.setAttribute("aria-label",H),le.textContent=re,le},x=M("prev",o.prev,Gt.prev),h=M("toggle",o.pause,Gt.pause),g=M("next",o.next,Gt.next),L=p.createElement("div");L.className="dg-btns",L.setAttribute("lang",r),L.append(x,h,g);let O=p.createElement("div");O.className="dg-say",O.setAttribute("aria-hidden","true");let _=p.createElement("div");_.className="dg-no",_.dataset.dragon="step-no";let P=p.createElement("div");P.className="dg-txt";let j=p.createElement("p");j.className="dg-tt",j.dataset.dragon="step-title";let $=p.createElement("p");$.className="dg-tb",$.dataset.dragon="step-body";let S=p.createElement("div");S.append(j,$),P.append(S);for(let K of m){let H=p.createElement("div");H.className="dg-room",H.dataset.dragon="caption-room";let re=p.createElement("p");re.className="dg-tt",re.textContent=K.title;let le=p.createElement("p");le.className="dg-tb",le.textContent=K.body,H.append(re,le),P.append(H)}O.append(_,P);for(let K of[_,j,$])K.setAttribute("aria-hidden","true");let y=p.createElement("div");y.className="dg-row",y.append(L,O);let F=p.createElement("div");F.className="dg-bar",F.append(y);let C=p.createElement("ol");C.className="dg-sr",C.dataset.dragon="steps",C.setAttribute("aria-label",o.steps(s.diagram.title));for(let K of m){let H=p.createElement("li"),re=p.createElement("strong");re.textContent=K.title,H.append(re);for(let le of K.body.split(`
|
|
3
|
-
`)){let Se=p.createElement("p");Se.textContent=le,H.append(Se)}if(K.sources){let le=p.createElement("ul");for(let Se of K.sources){let qe=p.createElement("a");qe.href=Se.url,qe.textContent=Se.name;let Re=p.createElement("li");Re.append(qe),le.append(Re)}H.append(le)}C.append(H)}d.append(u,F,C),t.append(d);let X=()=>u.clientWidth||t.clientWidth||s.layout.width,z=()=>{if(!a.fitHeight||!l)return;let K=l.getComputedStyle(u),H=u.clientHeight-(Number.parseFloat(K.paddingTop)||0)-(Number.parseFloat(K.paddingBottom)||0);return H>0?H:void 0},Q=ds(s,X(),z()).mode,B=X(),v=z(),
|
|
1
|
+
"use strict";var DragonPlayer=(()=>{var jn=Object.defineProperty;var jr=Object.getOwnPropertyDescriptor;var Rr=Object.getOwnPropertyNames;var Ir=Object.prototype.hasOwnProperty;var Tt=(t,n)=>{for(var a in n)jn(t,a,{get:n[a],enumerable:!0})},Dr=(t,n,a,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of Rr(n))!Ir.call(t,l)&&l!==a&&jn(t,l,{get:()=>n[l],enumerable:!(p=jr(n,l))||p.enumerable});return t};var Cr=t=>Dr(jn({},"__esModule",{value:!0}),t);var Fo={};Tt(Fo,{mountDiagram:()=>qr});var Xn={};Tt(Xn,{drawGit:()=>Ws,layoutGit:()=>Ts});var us={clear:{name:"\u6F84\u3093\u3060\u8272",note:"\u767D\u3044\u5730\u306B\u3001\u4E2D\u304F\u3089\u3044\u306E\u660E\u308B\u3055\u306E\u9BAE\u3084\u304B\u306A 6 \u8272\u3002\u4ECA\u306E\u898B\u672C\u5E33\u306E\u8272",light:{page:"#f3f4f7",bg:"#ffffff",surf:"#ffffff",sunk:"#f5f6f8",ink:"#12141a",ink2:"#3f4451",mute:"#6b7180",hair:"#12141a1c",line:"#12141a40",sh:"#101828","on-c":"#ffffff","c-blue":"#467deb","t-blue":"#2e62ce","c-amber":"#d28008","t-amber":"#975b04","c-green":"#0ea886","t-green":"#07775e","c-violet":"#6c3bb2","t-violet":"#6c3bb2","c-rose":"#ba3e40","t-rose":"#b83c3f","c-slate":"#5d6677","t-slate":"#5d6677",coin:"#e9b114",coint:"#856300",coinin:"#a8740c",tint:"5%",edge:"20%",shA:".05",shB:".08",carry:"#65686f"},dark:{page:"#08090c",bg:"#0d0e12",surf:"#17191f",sunk:"#121419",ink:"#eceef3",ink2:"#c4c8d2",mute:"#9198a6",hair:"#eceef31f",line:"#eceef340",sh:"#000000","on-c":"#0d0e12","c-blue":"#7e7ef6","t-blue":"#989cfd","c-amber":"#c78135","t-amber":"#dd954b","c-green":"#20ac7a","t-green":"#35b986","c-violet":"#695b9f","t-violet":"#a79ae3","c-rose":"#bc434b","t-rose":"#fd7d81","c-slate":"#9ba3b2","t-slate":"#9da5b4",coin:"#f0c040",coint:"#f0c040",coinin:"#9a6a0c",tint:"6%",edge:"19%",shA:".45",shB:".35"}},paper:{name:"\u7D19\u3068\u58A8",note:"\u751F\u6210\u308A\u306E\u7D19\u306E\u5730\u306B\u3001\u85CD / \u9EC4\u571F / \u82D4 / \u8461\u8404 / \u6731 / \u920D\u306E\u304F\u3059\u3093\u3060 6 \u8272",light:{page:"#ece7dd",bg:"#f9f6f0",surf:"#fffcf6",sunk:"#f2ede4",ink:"#221e18",ink2:"#4b453b",mute:"#7b7366",hair:"#221e181f",line:"#221e1847",sh:"#3a2a10","on-c":"#fffcf6","c-blue":"#487dd5","t-blue":"#2d60b5","c-amber":"#c38405","t-amber":"#885a01","c-green":"#57a271","t-green":"#237143","c-violet":"#904698","t-violet":"#904698","c-rose":"#a9513e","t-rose":"#9f4836","c-slate":"#6a645a","t-slate":"#696359",coin:"#d4a52a",coint:"#7d5e05",coinin:"#9a7016",tint:"6%",edge:"22%",shA:".06",shB:".07",carry:"#68635c"},dark:{page:"#0e0d0b",bg:"#15130f",surf:"#1e1b17",sunk:"#191612",ink:"#ede6d8",ink2:"#cbc2b1",mute:"#9c9283",hair:"#ede6d81f",line:"#ede6d842",sh:"#000000","on-c":"#15130f","c-blue":"#5785d5","t-blue":"#76a6f9","c-amber":"#be8802","t-amber":"#d59e2f","c-green":"#52aa71","t-green":"#61b87e","c-violet":"#90529b","t-violet":"#d08edb","c-rose":"#bb4e3d","t-rose":"#f98672","c-slate":"#a9a295","t-slate":"#aca598",coin:"#dcb24e",coint:"#dcb24e",coinin:"#8a6a14",tint:"6%",edge:"19%",shA:".45",shB:".35"}},night:{name:"\u591C\u306E\u8A08\u5668",note:"\u9752\u307F\u306E\u9ED2\u306E\u5730\u306B\u3001\u5149\u308B\u6C34\u8272 / \u7425\u73C0 / \u82E5\u7DD1 / \u83EB / \u6843 \u306E 6 \u8272\u3002\u660E\u308B\u3044\u5074\u306F\u9752\u7070\u306E\u5730",light:{page:"#e9eef5",bg:"#f6f9fc",surf:"#ffffff",sunk:"#eef3f8",ink:"#0b1424",ink2:"#34425a",mute:"#64748b",hair:"#0b14241c",line:"#0b142440",sh:"#0b1424","on-c":"#ffffff","c-blue":"#0385cd","t-blue":"#086aa3","c-amber":"#ba8e0f","t-amber":"#7f5f04","c-green":"#0a8857","t-green":"#027449","c-violet":"#5839ba","t-violet":"#5839ba","c-rose":"#dd4a94","t-rose":"#b82375","c-slate":"#64748b","t-slate":"#56667c",coin:"#eab308",coint:"#7e6005",coinin:"#a16207",tint:"5%",edge:"22%",shA:".06",shB:".09",carry:"#596579"},dark:{page:"#060a12",bg:"#0a101c",surf:"#111a2a",sunk:"#0d1522",ink:"#e6edf7",ink2:"#b8c4d6",mute:"#8090a8",hair:"#e6edf71c",line:"#9fb3d145",sh:"#000000","on-c":"#0a101c","c-blue":"#3884b6","t-blue":"#62ace1","c-amber":"#be8533","t-amber":"#d59b4b","c-green":"#3ba774","t-green":"#4fb884","c-violet":"#7d4ecd","t-violet":"#b494fd","c-rose":"#bc3a74","t-rose":"#ff77ad","c-slate":"#96a3b5","t-slate":"#99a6b8",coin:"#facc15",coint:"#facc15",coinin:"#a16207",tint:"6%",edge:"19%",shA:".5",shB:".4"}}};var Dt={sans:"Noto Sans JP Variable",mono:"JetBrains Mono Variable"},_r={0:590,1:590,2:590,3:590,4:590,5:590,6:590,7:590,8:590,9:590," ":228,"!":371,'"':575,"#":590,$:590,"%":963,"&":740,"'":325,"(":378,")":378,"*":507,"+":590,",":325,"-":371,".":325,"/":390,":":325,";":325,"<":590,"=":590,">":590,"?":514,"@":1007,A:642,B:682,C:657,D:715,E:616,F:586,G:718,H:758,I:330,J:568,K:686,L:579,M:854,N:750,O:771,P:668,Q:771,R:682,S:624,T:626,U:748,V:619,W:915,X:627,Y:581,Z:614,"[":378,"\\":390,"]":378,"^":590,_:568,"`":626,a:591,b:644,c:528,d:645,e:581,f:372,g:598,h:640,i:305,j:306,k:605,l:315,m:964,n:641,o:626,p:645,q:645,r:437,s:495,t:421,u:638,v:576,w:863,x:562,y:575,z:512,"{":378,"|":297,"}":378,"~":590,"\u2026":1e3,"\u2212":590,"\xD7":1e3,"\u2192":1e3,"\u2190":1e3,"\u2191":1e3,"\u2193":1e3,"\u2013":545,"\u2014":908,"\u2018":325,"\u2019":325,"\u201C":575,"\u201D":575,"\xB0":404,"\xB1":1e3,"\xB7":593,"\u2022":379},Br=600,Gr=11904,Yt=1e3;function hs(t,n){return(t.codePointAt(0)??0)>=Gr?Yt:n==="mono"?Br:_r[t]??Yt}var Yr="paper",Rn=Object.fromEntries(Object.entries(us).map(([t,n])=>[t,{id:t,...n}]));function gs(t){return(t!==void 0&&Object.hasOwn(Rn,t)?Rn[t]:void 0)??Rn[Yr]}var Vr=["page","bg","surf","sunk","ink","ink2","mute","hair","line","sh","on-c","c-blue","t-blue","c-amber","t-amber","c-green","t-green","c-violet","t-violet","c-rose","t-rose","c-slate","t-slate","coin","coint","coinin","tint","edge","shA","shB","carry"],Kr=new Set(Vr),ys=t=>Kr.has(t);function bs(t){if(typeof t!="string"||!/^[\w\s#%.,()/+-]+$/u.test(t)||/url\(/iu.test(t))return!1;let n=0;for(let a of t)if(n+=a==="("?1:a===")"?-1:0,n<0)return!1;return n===0}function Vt(t,n){return Object.entries(t[n]).map(([a,p])=>`--${a}:${p}`).join(";")}var Kt=`--sans:"${Dt.sans}";--mono:"${Dt.mono}"`,bt=["blue","amber","green","violet","rose"],Pe=(t,n,a="sans")=>({size:t,weight:n,family:a}),A={boxName:Pe(13,650),boxSub:Pe(11,500),boxSubStrong:Pe(11,700),regionName:Pe(12.5,700),regionNote:Pe(11,500),label:Pe(11,600,"mono"),labelJa:Pe(11,650),action:Pe(11,650),badge:Pe(10.5,700,"mono"),carrier:Pe(10.5,700,"mono"),carrierJa:Pe(10.5,700),stripTitle:Pe(12.5,700),fieldName:Pe(10.5,600),fieldValue:Pe(12,600,"mono"),fieldValueJa:Pe(12,600),tag:Pe(10.5,700),miniTitle:Pe(10.5,700),stepTitle:Pe(15,700),stepBody:Pe(13.5,500),stepNo:Pe(13,700,"mono"),button:Pe(14,700),gitId:Pe(11,700),gitHash:Pe(10.5,600,"mono"),gitNote:Pe(10.5,650),treeHash:Pe(13.5,700,"mono"),treeName:Pe(10.5,600),rootHash:Pe(15,700,"mono"),rootName:Pe(11,700),treeCard:Pe(11.5,650),chip:Pe(10.5,700,"mono"),stamp:Pe(11,700),timeHead:Pe(11,650,"mono"),timeRow:Pe(11,600),timeTick:Pe(10.5,600,"mono"),timePeriod:Pe(11.5,650),timeRange:Pe(10.5,500,"mono"),pointName:Pe(11,700,"mono"),pointState:Pe(11.5,700),spanText:Pe(11,650),emptyText:Pe(11,700),meterLine:Pe(10.5,700,"mono")},w={gap:10,margin:14,box:{h:72,minW:92,padX:12,radius:12,icon:24,iconRadius:7,iconY:-16,iconScale:.74,nameY:12,nameMid:5,subY:27,subMid:20},region:{pad:18,gap:10,radius:14,inset:14,icon:24,iconRadius:7,iconScale:.68,nameY:58,line:16,minH:108},architecture:{columns:4,columnGap:56,maxColumnGap:160,rowGap:44,labelRoom:16},sequence:{columnGap:40,labelRoom:16,labelOffset:16,firstRow:10,rowGap:6,stepGap:6,minPitch:32,tail:10,selfW:34,selfH:18},state:{columns:4,columnGap:64,rowGap:108,labelRoom:16,start:7,end:{r:9,inner:5},drop:56,below:64,beside:38,text:16,loop:{w:24,h:34,samples:12,badgeAt:.6},side:{pad:16,gap:76,lane:30,entry:28},ghost:{h:52,pad:12,gap:10,nameY:-2,subY:14},done:{r:6.5,inset:13},pastLabel:.85},git:{x0:120,pitch:90,textGap:12,r:12,orphan:13.5,topLine:120,line:90,topBelow:30,below:82,bare:62,above:18,under:27,lineStep:13,tagTop:58,tag:30,row:22,turn:60,samples:12,boxGap:24,labelUnder:50,colors:["blue","violet","green","amber","rose"]},tree:{w:74,h:44,padX:10,radius:10,root:{w:112,h:54,radius:13,iconX:10,textX:46,padR:14,nameY:-4,hashY:14},hashY:-1,nameY:14,oneY:4.5,slotGap:12,top:16,row:102,card:{drop:78,h:30,minW:70,padX:10,icon:12,gap:6,glyph:.62,radius:9},boxGap:24,badgeAlong:22,faint:.42,color:"violet",rootColor:"green"},lineup:{padX:12,h:61,radius:10,textY:20,trackY:33,textGap:10,faint:.35,chip:{w:25,h:18,gap:4,radius:4,padX:3},seal:{over:3,radius:5,stripe:7},stamp:{h:22,padX:8,radius:5,tilt:-4,color:"green"}},time:{width:728,axisX:118,right:16,gutterGap:12,head:22,boxTop:34,boxGap:36,zoomBottom:14,sep:12,zoomGap:12,rowsTop:24,row:20,rowGap:6,markRatio:.5,markMin:1.5,markMax:18,markRadius:1.5,shade:8,frame:2.5,emptyR:1.7,point:{drop:40,r:9,text:15,nameY:-2,stateY:12,link:10,end:6,room:30,plain:12,glyph:.62},bracket:{gap:12,tick:6,text:16,lane:34},box:{pad:6,tagX:12,tagH:16,tagPadX:7},axisGap:18,major:12,minor:6,minorPx:40,tickY:18,rangeY:14,nameGap:8,ticks:6,bottom:12,needle:{over:8,head:6,dot:3.5},meter:{w:150,h:6,y:36,mark:5,textY:59,color:"amber"}},edge:{inset:3,arrow:6,arrowHalf:3.5,parallel:5,ghostDash:5,flowDash:9,bend:12},label:{h:20,padX:9,radius:10,offset:22,side:14,search:4,searchMax:400,soft:6,touch:2},action:{h:22,padX:10,radius:11},badge:{r:9.5,ring:9,inset:4,along:14,short:44},carrier:{envW:24,envH:17,coinR:6.5,coinIn:3.8,tagH:18,tagPadX:8,samples:16},slot:{gap:6,pad:3,spread:4,h:24,radius:7,clear:2,lifeline:5,mark:4},mark:{pad:3,radius:5,dash:4,gap:3},strip:{h:72,line:44,titleRow:40,pad:12,icon:24,titleX:44,fieldGap:22,sepInset:14,tagGap:6,tagH:15,tagPadX:7,nameY:22,valueY:43,trail:{r:5.4,step:16},now:{r:3,gap:7}},stroke:{git:2.25,gitOrphan:1.5,mark:1.6,slot:1.2,hair:1,edge:1.7,edgeOn:2.25,arrow:1.5,flow:1.3,halo:7,on:1.75,glyph:2,lifeline:1.2,envelope:1.5,badgeRing:1.5,path:1.6,end:1.6,done:1.2,trail:1.2,timeSlot:.6,timeFrame:1.25,timeAxis:1,timeSpan:1.5,timeDrop:1.4,timePoint:1.75,timeFlag:1.8,timeNeedle:1.25,timeMeter:1.25,tree:1.5,treeTrail:2.6,treeCon:1.3,stamp:2},shadow:{near:.8,far:4,nearY:1,farY:3},mini:{w:168,pad:8,title:14,inset:12,radius:10},follow:{aspect:.75,minH:320,fitMinH:160,ease:.6,narrow:440,badgeRoom:8,headRoom:10,head:{pad:8,h:40,nameY:17,subY:31}},mix:{slot:45,icon:14,regionIcon:16,regionIconEdge:34,cap:12,capEdge:42,badgePast:14,badgePastEdge:70,mini:62,miniBand:16,miniBandEdge:36,view:6,side:4,sideEdge:36,ghostEdge:60,path:55,past:72,timeShade:3.5,timeSpan:6,timeEmpty:8,timeGuide:50,chipPlain:34,sealDark:60,sealLight:34},baseline:{label:3.8,badge:3.5,carrier:3.7,stripTitle:4.5,tag:3.6,action:3.8,mark:4},rise:5,popFrom:.4,player:{gap:10,radius:12,button:36,touch:44,hidden:1,focus:2,narrow:440}},oe={intro:1.4,outro:4.6,tail:.6,stepBase:1.2,perChar:.025,stepMin:2.2,stepMax:5,dwell:1.2,edgeAt:.1,stagger:.5,draw:.55,drawCarry:.9,action:.9,change:.12,minShow:.8,labelDelay:.15,fade:.3,popFade:.4,untilFade:.2,still:.45,done:.3,time:{axis:11.5,unitMin:.12,unitMax:.4,wait:.15,after:.15,reset:.05},lineup:{slide:.7,seal:.6,stagger:.2,cut:.01}},xs=10.5,fe={inOut:"cubic-bezier(.65,0,.35,1)",out:"cubic-bezier(.22,1,.36,1)",pop:"cubic-bezier(.34,1.56,.64,1)"};var Wt=t=>Object.keys(t),Wo=Wt({sequence:!0,architecture:!0,state:!0,git:!0,time:!0,tree:!0,lineup:!0}),Nt=["start","finish"],Wr=["scale","period","row","point","zoom","mark","span"];var Hr=["leaf","node"],Xr=["item","line","seal","open","pick","stamp"],In=12;var Ho=["group","end","box","strip","step","say","code","source","act","note","set","branch","commit",...Wr,...Hr,...Xr];var xt="HEAD";var Xo=Wt({coin:!0,none:!0}),zo=Wt({fixed:!0,follow:!0}),Uo=Wt({above:!0,below:!0,left:!0,right:!0});var De=t=>[...t].some(n=>(n.codePointAt(0)??0)>=11904);function zr(t,n){return n==="mono"&&De(t)?"sans":n}function pe(t,n){let a=zr(t,n.family),p=0;for(let l of t)p+=hs(l,a);return p*n.size/Yt}function Ge(t,n,a,p,l="start"){let e=pe(t,p);return{x:l==="middle"?n-e/2:n,y:a-p.size*.8,w:e,h:p.size}}function $t(t){return t.steps.flatMap((n,a)=>n.events.flatMap((p,l)=>p.type==="edge"?[{step:a,event:l,edge:p}]:[]))}function He(t){let n=Cn(t),a=new Map;return t.boxes.forEach((p,l)=>{let e=p.region===void 0?void 0:n.get(p.region);a.set(p.id,p.color??e??bt[l%bt.length])}),a}function Cn(t){let n=new Map;return(t.regions??[]).forEach((a,p)=>n.set(a.id,a.color??bt[p%bt.length])),n}var at=(t,n)=>t.carry.kind==="coin"?"coin":n.get(t.from)??"slate";function tt(t,n,a){let p=t.boxes.find(e=>e.id===n);if(!p)return w.box.minW;let l=[pe(p.name,A.boxName),pe(p.sub??"",A.boxSub)];for(let e of t.steps)for(let s of e.events)s.type==="swap"&&s.box===n&&l.push(pe(s.text,A.boxSubStrong)),a&&s.type==="action"&&s.box===n&&l.push(pe(s.label,A.boxSubStrong));return Math.max(w.box.minW,Math.max(...l)+w.box.padX*2)}function lt(t){let n=w.carrier;return t.kind==="tag"?[(pe(t.text,De(t.text)?A.carrierJa:A.carrier)+n.tagPadX*2)/2,n.tagH/2]:t.kind==="coin"?[n.coinR,n.coinR]:[n.envW/2,n.envH/2]}var ws=t=>t.main+t.coin+(t.main>0&&t.coin>0?w.slot.spread:0);function kt(t){let n=new Map,a=new Set(t.boxes.map(p=>p.id));for(let p of t.steps)for(let l of p.events){if(l.type!=="edge"||l.carry.kind==="none")continue;let e=l.carry.kind==="coin"?"coin":"main",s=lt(l.carry)[0]*2;for(let r of[l.from,l.to]){if(!a.has(r))continue;let o=n.get(r)??{main:0,coin:0};o[e]=Math.max(o[e],s),n.set(r,o)}}return n}function vt(t,n,a){return t?(n?w.box.icon+w.slot.gap:0)+ws(t)+w.slot.pad*2+w.box.padX+a:0}function Pt(t,n,a=w.box.padX){if(!n)return;let p=w.box,l=w.slot,e=ws(n)+l.pad*2,s=t.icon?p.icon+l.gap:0,r=Math.max(t.x+p.padX,Math.min(t.cx-(s+e)/2,t.x+t.w-a-(s+e)));t.icon&&(t.iconX=r+p.icon/2),t.slot={x:r+s,y:t.cy+p.iconY-l.h/2,w:e,h:l.h}}function ft(t,n,a){let p=w.slot,l=(e,s)=>{let r=n.get(e),o=a.get(e);if(!r?.slot||!o)return;let i=r.slot.x+p.pad,c=r.slot.y+r.slot.h/2;return o.main>0&&o.coin>0?s.kind==="coin"?[i+o.main+p.spread+o.coin/2,c]:[i+o.main/2,c]:[r.slot.x+r.slot.w/2,c]};for(let e of t){if(e.carry.kind==="none")continue;let s=l(e.to,e.carry),r=l(e.from,e.carry);s&&(e.settle=s),r&&(e.wait=r)}}function wt(t,n){let a=Math.max(n.x-(t.x+t.w),t.x-(n.x+n.w)),p=Math.max(n.y-(t.y+t.h),t.y-(n.y+n.h));return Math.max(a,p)}function Ht(t,n,a=0){let p=n.x+a,l=n.y+a,e=n.x+n.w-a,s=n.y+n.h-a;if(e<=p||s<=l)return!1;for(let r=1;r<t.length;r++){let[o,i]=t[r-1],[c,m]=t[r],f=c-o,d=m-i,u=0,M=1,x=(h,g)=>{if(h===0)return g>0;let L=g/h;return h<0?u=Math.max(u,L):M=Math.min(M,L),u<M};if(x(-f,o-p)&&x(f,e-o)&&x(-d,i-l)&&x(d,s-i))return!0}return!1}function Ur(t){let n={a:t[0],b:t[1]??t[0],length:-1};for(let a=1;a<t.length;a++){let p=t[a-1],l=t[a],e=Math.hypot(l[0]-p[0],l[1]-p[1]);e>n.length&&(n={a:p,b:l,length:e})}return{a:n.a,b:n.b,vertical:Math.abs(n.b[0]-n.a[0])<Math.abs(n.b[1]-n.a[1])}}function et(t,n){let a=n;for(let p=1;p<t.length;p++){let l=t[p-1],e=t[p],s=Math.hypot(e[0]-l[0],e[1]-l[1]);if(a<=s&&s>0)return[l[0]+(e[0]-l[0])*a/s,l[1]+(e[1]-l[1])*a/s];a-=s}return t[t.length-1]}function ut(t){let n=0;for(let a=1;a<t.length;a++){let p=t[a-1],l=t[a];n+=Math.hypot(l[0]-p[0],l[1]-p[1])}return n}function Et(t){let{w:n,h:a,samples:p}=w.state.loop,l=t.y+t.h,e=[t.cx+n/2,l],s=[t.cx+n*3/4,l+a*4/3],r=[t.cx-n*3/4,l+a*4/3],o=[t.cx-n/2,l+w.edge.inset];return Array.from({length:p+1},(i,c)=>{let m=c/p,f=1-m,d=u=>f*f*f*e[u]+3*f*f*m*s[u]+3*f*m*m*r[u]+m*m*m*o[u];return[d(0),d(1)]})}function Xt(t){let n=Math.max(...t.map(([l])=>l)),a=t[0][1],p=Math.max(...t.map(([,l])=>l));return[n+w.badge.r+w.badge.inset,a+(p-a)*w.state.loop.badgeAt]}function zt(t,n){return{x:(t[0]?.[0]??0)-w.state.loop.w/2-n/2,y:Math.max(...t.map(([,a])=>a))+w.label.soft}}var Fn=w.state.loop.h+w.label.soft*2+w.label.h;function st(t,n=[],a=[]){let p=ut(t),l=p<w.badge.short?Math.min(w.badge.r+1,p/2):w.badge.along,e=w.badge.r*2+w.badge.inset;for(let s=l;s<=p;s+=1){let r=et(t,s);if(n.every(([o,i])=>Math.hypot(r[0]-o,r[1]-i)>=e))return r}return Jr(t,l,n,a)??et(t,l)}function Jr(t,n,a,p){let l=ut(t),[e,s]=et(t,n),[r,o]=et(t,Math.max(0,n-1)),[i,c]=et(t,Math.min(l,n+1)),m=Math.hypot(i-r,c-o);if(m===0)return;let[f,d]=[-(c-o)/m,(i-r)/m],u=w.badge.r*2;for(let M of[w.edge.arrowHalf,0])for(let x=1;x<=u+w.badge.inset;x++)for(let h of[1,-1]){let g=[e+f*x*h,s+d*x*h];if(a.every(([O,_])=>Math.max(Math.abs(g[0]-O),Math.abs(g[1]-_))>=u+1)&&p.every(O=>!Ht(O,Ye(g),-M)))return g}}var Ct=t=>t.points.map(([n,a])=>`${Math.round(n*10)},${Math.round(a*10)}`).join(" ");function ht(t,n,a=(p,l,e)=>st(p.points,l,e)){let p=new Map,l=[],e=new Map;for(let s=0;s<n;s++){let r=t.find(f=>f.step===s&&f.points.length>0);if(!r)continue;let o=Ct(r),i=e.get(o);if(i){p.set(s,{point:i,edge:r});continue}let c=t.filter(f=>f.points.length>1&&Ct(f)!==o).map(f=>f.points),m=a(r,l,c);l.push(m),e.set(o,m),p.set(s,{point:m,edge:r})}return p}function Xe(t){let n=(a,p)=>Math.hypot(a.x-p.x,a.y-p.y)<=.5;return t.map(a=>{let p=t.filter(l=>l.step>a.step&&n(l,a)).sort((l,e)=>l.step-e.step)[0];return p?{...a,until:p.step}:a})}var Ye=([t,n])=>({x:t-w.badge.r,y:n-w.badge.r,w:w.badge.r*2,h:w.badge.r*2}),Ut=t=>[t.x+w.state.text,t.y+w.baseline.mark],We=t=>De(t)?A.labelJa:A.label,Zr={above:"below",below:"above",left:"right",right:"left"};function Ze(t,n){let a=pe(t.text,We(t.text))+w.label.padX*2,p=w.label.h,l=Ur(t.points),e=(l.a[0]+l.b[0])/2,s=(l.a[1]+l.b[1])/2,r=t.side??(l.vertical?"right":"above"),{side:o}=w.label,i=t.offset??w.label.offset,c=x=>x==="above"?{x:e-a/2,y:s-i-p/2,w:a,h:p}:x==="below"?{x:e-a/2,y:s+i-p/2,w:a,h:p}:x==="left"?{x:e-o-a,y:s-p/2,w:a,h:p}:{x:e+o,y:s-p/2,w:a,h:p},m=t.base?{...t.base,w:a,h:p}:c(r),f=t.flip?[r,Zr[r]]:[r],d=x=>n.hard.every(h=>wt(x,h)>=w.gap)&&n.soft.every(h=>wt(x,h)>=w.label.soft)&&(n.touch??[]).every(h=>wt(x,h)>=w.label.touch)&&(n.lines??[]).every(h=>!Ht(h,x,-w.label.touch)),{search:u,searchMax:M}=w.label;for(let x=0;x<=M;x+=u)for(let h of f){let g=h===r?m:c(h),L=h==="above"?[0,-1]:h==="below"?[0,1]:h==="left"?[-1,0]:[1,0],O=[Math.abs(L[1]),Math.abs(L[0])],_=t.slide??(h==="above"||h==="below"?a:p*4);for(let P=0;P<=_;P+=u)for(let j of P===0?[1]:[1,-1]){let $={x:g.x+L[0]*x+O[0]*P*j,y:g.y+L[1]*x+O[1]*P*j,w:a,h:p};if(d($))return{...$,step:t.step,event:t.event,text:t.text,family:We(t.text).family,color:t.color}}}return{...m,step:t.step,event:t.event,text:t.text,family:We(t.text).family,color:t.color}}function _n(t){let n=/^([0-9]+(?:\.[0-9]+)?)%$/u.exec(t.trim());if(n)return Math.min(1,Math.max(0,Number(n[1])/100));let a=/^([0-9]+)\/([0-9]+)$/u.exec(t.trim());if(a&&Number(a[2])>0)return Math.min(1,Math.max(0,Number(a[1])/Number(a[2])))}var $s=(t,n)=>t.strip?.meters?.find(a=>a.field===n);function ks(t,n){if($s(t,n))return Math.max(pe(n,A.fieldName),w.time.meter.w);let a=0,p=0;for(let e of t.steps)for(let s of e.events)s.type!=="strip"||s.field!==n||(s.value!==void 0&&(a=Math.max(a,pe(s.value,De(s.value)?A.fieldValueJa:A.fieldValue))),s.tag!==void 0&&(p=Math.max(p,pe(s.tag,A.tag)+w.strip.tagPadX*2)));let l=a+(p>0?(a>0?w.strip.tagGap:0)+p:0);return Math.max(pe(n,A.fieldName),l)}var Dn=t=>Math.max(pe(t.title,A.fieldName),t.states.length*w.strip.trail.step);function ze(t,n){return t.strip?vs(t.strip.title,[...t.strip.fields.map(a=>ks(t,a)),...n?[Dn(n)]:[]]):0}function vs(t,n){let{fieldGap:a,pad:p}=w.strip;return Bn(t)+n.reduce((l,e)=>l+e+a,0)-a+p}function Bn(t){return w.strip.titleX+pe(t,A.stripTitle)+w.strip.fieldGap}function Ps(t,n){let{fieldGap:a,pad:p}=w.strip,l=t,e=0;return{place(s){l>t&&l+s>n-p&&(l=t,e++);let r={x:l,row:e};return l+=s+a,r},rows:()=>e}}function Ue(t,n,a,p,l){if(!t.strip)return;let{line:e,h:s}=w.strip,r=[],o=Ps(Bn(t.strip.title),p),i=m=>{let f=o.place(m);return{x:n+f.x,y:a+f.row*e}};for(let m of t.strip.fields){let f=ks(t,m),d=i(f),u=$s(t,m),M=u?_n(u.line):void 0;r.push({name:m,...d,w:f,...u&&M!==void 0?{meter:{line:M,text:u.line,x:d.x,w:w.time.meter.w}}:{}})}let c=l?{...l,...i(Dn(l)),w:Dn(l)}:void 0;return{x:n,y:a,w:p,h:s+o.rows()*e,title:t.strip.title,fields:r,...c?{trail:c}:{}}}function Gn(t,n,a,p){let{line:l,h:e,pad:s,titleRow:r}=w.strip,o=vs(t.title,[...t.fields.map(u=>u.w),...t.trail?[t.trail.w]:[]])>p,i=o?r:0,c=Ps(o?s:Bn(t.title),p),m=u=>{let M=c.place(u);return{x:n+M.x,y:a+i+M.row*l}},f=t.fields.map(u=>{let M=m(u.w);return{...u,...M,...u.meter?{meter:{...u.meter,x:M.x}}:{}}}),d=t.trail?{...t.trail,...m(t.trail.w)}:void 0;return{...t,x:n,y:a,w:p,h:e+c.rows()*l+i,fields:f,...d?{trail:d}:{}}}function Lt(t,n,a){let p=l=>{l.x+=n,l.y+=a};for(let l of t.boxes)p(l),l.cx+=n,l.cy+=a,l.slot&&p(l.slot),l.iconX!==void 0&&(l.iconX+=n);for(let l of t.regions)l.y+=a,p(l.header);for(let l of t.lifelines)l.x+=n,l.y1+=a,l.y2+=a;for(let l of t.edges)l.points=l.points.map(([e,s])=>[e+n,s+a]),l.settle&&(l.settle=[l.settle[0]+n,l.settle[1]+a]),l.wait&&(l.wait=[l.wait[0]+n,l.wait[1]+a]);for(let l of t.labels)p(l);for(let l of t.paths)l.points=l.points.map(([e,s])=>[e+n,s+a]),l.label&&p(l.label);for(let l of t.ends)l.x+=n,l.y+=a;t.side&&p(t.side);for(let l of t.actions)p(l);for(let l of t.badges)l.x+=n,l.y+=a;if(t.strip){t.strip.y+=a;for(let l of t.strip.fields)l.x+=n,l.y+=a,l.meter&&(l.meter.x+=n);t.strip.trail&&(t.strip.trail.x+=n,t.strip.trail.y+=a)}}function qt(t,n,a){let{inset:p}=w.badge;for(let e of t){let s=e.type==="swap"||e.type==="action"?e.box:void 0,r=a.boxes.find(o=>o.id===s);if(r)return{step:n,x:r.x,y:r.y,color:r.color}}if(a.strip&&t.some(e=>e.type==="strip"))return{step:n,x:a.strip.x+p,y:a.strip.y+p,color:"slate"};let l=a.boxes[0];return{step:n,x:l.x,y:l.y,color:l.color}}function Qr(t){let n=(t.git?.branches??[]).map($=>$.id),a=$=>{n.includes($)||n.push($)};for(let $ of t.steps)for(let S of $.events)(S.type==="commit"||S.type==="branch")&&a(S.branch);let p=new Map(n.map($=>[$,null])),l=null,e=null,s=[],r=new Map,o=[],i=[],c=[],m=new Map,f=new Map,d=new Map,u=[...n,xt],M=new Map(u.map($=>[$,[]])),x=[],h=$=>$===xt?e===null?l:null:p.get($)??null,g=$=>{let S=m.get($)??[],y=S.indexOf(null);return y<0?S.length:y},L=($,S,y,F)=>{let C=new Map(u.map(B=>[B,h(B)])),X=l;y();let Q=u.filter(B=>C.get(B)!==h(B)).map(B=>{let v=d.get(B);return v&&(m.get(v.commit)[v.row]=null,d.delete(B)),{ref:B,slot:v}});for(let{ref:B,slot:v}of Q){let I=v??(B===xt&&X!==null?{commit:X,row:g(X)}:void 0),R=h(B),W;if(R!==null){W={commit:R,row:g(R)};let J=m.get(R)??[];J[W.row]=B,m.set(R,J),f.set(R,Math.max(f.get(R)??0,J.filter(Z=>Z!==null).length)),d.set(B,W)}i.push({ref:B,step:$,event:S,...I?{from:I}:{},...W?{to:W}:{},line:B===F})}},O=($,S)=>{let y=new Set,F=[...p.values(),l].filter(C=>C!==null);for(;F.length>0;){let C=F.pop();y.has(C)||(y.add(C),F.push(...r.get(C)?.parents??[]))}for(let C of s)!y.has(C.id)&&C.orphan===void 0&&(C.orphan={step:$,event:S})};t.steps.forEach(($,S)=>{$.events.forEach((y,F)=>{if(y.type==="commit")P(y,S,F);else if(y.type==="branch"){if(!r.has(y.from))return;_(y.from)!==y.branch&&o.push({kind:"branch",from:y.from,to:y.branch,step:S,event:F}),L(S,F,()=>{p.set(y.branch,y.from),e=y.branch,l=y.from})}else if(y.type==="edge"){let C=y.from;if(C!==xt&&!p.has(C)||!r.has(y.to))return;L(S,F,()=>{if(C===xt){e=null,l=y.to;return}p.set(C,y.to),e===C?l=y.to:e===null&&l===y.to&&(e=C)},C)}else return;O(S,F)});for(let y of u)M.get(y)?.push(y===xt?l:p.get(y)??null);x.push(e);for(let y of u){let F=d.get(y);F&&c.push({ref:y,step:S,slot:F})}});function _($){return r.get($)?.branch}function P($,S,y){if(r.has($.id))return;let F=$.copy!==void 0&&r.has($.copy)?$.copy:void 0,C=F!==void 0&&e===null&&l!==null?l:p.get($.branch)??null,X=$.merge!==void 0&&$.merge!==$.branch?p.get($.merge)??void 0:void 0,z=[...new Set([C,X].filter(v=>v!=null))],Q={id:$.id,branch:$.branch,parents:z,...X!==void 0&&X!==C?{joined:X}:{},...F!==void 0?{copy:F}:{},...$.hash!==void 0?{hash:$.hash}:{},...$.note!==void 0?{note:$.note}:{},step:S,event:y};s.push(Q),r.set(Q.id,Q);for(let v of z)o.push({kind:"parent",from:v,to:Q.id,step:S,event:y});F!==void 0&&o.push({kind:"copy",from:F,to:Q.id,step:S,event:y});let B=e===null&&l===null;L(S,y,()=>{F===void 0?(p.set($.branch,Q.id),e===$.branch&&(l=Q.id)):e===null&&(l=Q.id),B&&(e=$.branch,l=Q.id)})}let j=u.map($=>({name:$,at:M.get($)??[],...$===xt?{attached:x}:{}}));return{branches:n,made:s,links:o,moves:i,refs:j,tags:c,rows:f}}function Jt(t,n,a,p){let l=w.git.samples;return Array.from({length:l},(e,s)=>{let r=(s+1)/l,o=1-r,i=c=>o*o*o*t[c]+3*o*o*r*n[c]+3*o*r*r*a[c]+r*r*r*p[c];return[i(0),i(1)]})}function ei(t,n){return Math.abs(t[1]-n[1])<.5?[t,n]:t[1]>n[1]?[t,[t[0],n[1]],n]:[t,[n[0],t[1]],n]}function Ss(t,n,a){let p=a>t.cy?1:-1,l=[t.cx,t.cy+p*t.r],e=Math.max(0,Math.min(w.git.turn,n-t.cx)),s=[t.cx+e,a],r=Jt(l,[l[0],l[1]+(a-l[1])*.7],[t.cx+e*.2,a],s);return[l,...r,...n>s[0]?[[n,a]]:[]]}function ti(t,n){let a=n.cy<t.cy?1:-1,p=[t.cx+t.r,t.cy],l=[n.cx,n.cy+a*n.r],e=Math.max(0,Math.min(w.git.turn,n.cx-p[0])),s=[n.cx-e,t.cy],r=Jt(s,[n.cx-e*.2,t.cy],[n.cx,l[1]+(t.cy-l[1])*.7],l);return[p,...s[0]>p[0]?[s]:[],...r]}function ni(t,n){if(Math.abs(t.cy-n.cy)<.5){let s=t.cy-t.r,r=w.git.turn*.7;return[[t.cx,s],...Jt([t.cx,s],[t.cx,s-r],[n.cx,s-r],[n.cx,s])]}let a=n.cy<t.cy?-1:1,p=[t.cx,t.cy+a*t.r],l=[n.cx,n.cy-a*n.r],e=(l[1]-p[1])*.5;return[p,...Jt(p,[p[0],p[1]+e],[l[0],l[1]-e],l)]}function Ts(t){let{margin:n,gap:a,box:p,region:l,git:e,carrier:s}=w,r=Qr(t),o=new Map((t.git?.branches??[]).map(E=>[E.id,E.note])),i=new Map(r.branches.map((E,N)=>[E,N])),c=E=>e.colors[(i.get(E)??0)%e.colors.length],m=new Map,f=new Map;for(let E of r.made){let N=Math.max(0,...E.parents.map(se=>(m.get(se)??-1)+1),(f.get(E.branch)??-1)+1);m.set(E.id,N),f.set(E.branch,N)}let d=E=>[...E.hash!==void 0?[{text:E.hash,style:A.gitHash}]:[],...E.note!==void 0?[{text:E.note,style:A.gitNote}]:[]],u=E=>Math.max(0,...d(E).map(N=>pe(N.text,N.style))),M=E=>pe(E,De(E)?A.carrierJa:A.carrier)+s.tagPadX*2,x=Math.max(0,...r.refs.map(E=>M(E.name))),h=Math.max(e.pitch,...r.made.map(E=>u(E)+e.textGap),x+e.textGap),g=r.branches.map(E=>({w:Math.max(l.icon,pe(E,A.regionName),pe(o.get(E)??"",A.regionNote))})),L=n+l.inset+Math.max(0,...g.map(E=>E.w)),O=Math.max(e.r,...r.made.filter(E=>m.get(E.id)===0&&i.get(E.branch)===0).map(E=>u(E)/2),x/2),_=Math.max(e.x0,L+a+O),P=new Set(r.moves.flatMap(E=>{let N=t.steps[E.step]?.events[E.event];return E.line&&E.to&&N?.type==="edge"&&N.label!==void 0?[r.made.find(se=>se.id===E.to?.commit)?.branch??""]:[]})),j=E=>Math.max(0,...r.made.filter(N=>N.branch===E).map(N=>(r.rows.get(N.id)??0)-2))*e.row,$=r.made.some(E=>i.get(E.branch)===0&&d(E).length>0),S=[],y=n;r.branches.forEach((E,N)=>{let se=N===0,T=se&&$?e.tagTop:e.tag,ee=y+(se?e.topLine-(e.tagTop-T):e.line)+j(E),b=ee-y+(se?e.topBelow:P.has(E)?e.below:e.bare);S.push({id:E,x:n,y,w:0,h:b,line:ee,color:c(E),tagBase:T}),y+=b+l.gap});let F=y-l.gap,C=new Map(S.map(E=>[E.id,E])),X=r.made.map(E=>{let N=C.get(E.branch),se=i.get(E.branch)===0,T=_+h*(m.get(E.id)??0)+(se?0:h/2),ee=N.line,b=d(E),G=b.map((K,H)=>se?ee-e.above-(b.length-1-H)*e.lineStep:ee+e.under+H*e.lineStep),q=b.map((K,H)=>Ge(K.text,T,G[H],K.style,"middle")),Y=q.length===0?void 0:{...si(q),lines:b.map(K=>K.text),baselines:G},U=E.copy!==void 0?c(r.made.find(K=>K.id===E.copy)?.branch??E.branch):c(E.branch);return{id:E.id,branch:E.branch,color:U,cx:T,cy:ee,r:e.r,step:E.step,event:E.event,parents:E.parents,...E.copy!==void 0?{copy:E.copy}:{},...E.hash!==void 0?{hash:E.hash}:{},...E.note!==void 0?{note:E.note}:{},...Y?{text:Y}:{},...E.orphan?{orphan:E.orphan.step,orphanEvent:E.orphan.event}:{}}}),z=new Map(X.map(E=>[E.id,E])),Q=r.links.flatMap(E=>{let N=z.get(E.from);if(!N)return[];if(E.kind==="branch"){if(!r.made.some(G=>G.branch===E.to))return[];let b=C.get(E.to);return[{...E,points:Ss(N,N.cx+e.turn,b.line),color:c(E.to)}]}let se=z.get(E.to),T=r.made.find(b=>b.id===E.to),ee;return E.kind==="copy"?ee=ni(N,se):Math.abs(N.cy-se.cy)<.5?ee=[[N.cx+N.r,N.cy],[se.cx-se.r,se.cy]]:T?.joined===E.from?ee=ti(N,se):ee=Ss(N,se.cx-se.r,se.cy),[{...E,points:ee,color:se.color}]}),B=(E,N)=>{let se=z.get(N.commit),T=C.get(se.branch)?.tagBase??e.tag,ee=M(E);return{x:se.cx-ee/2,y:se.cy-T-N.row*e.row-s.tagH/2,w:ee,h:s.tagH}},v=E=>[E.x+E.w/2,E.y+E.h/2],I=r.moves.map(E=>{let N=E.from?B(E.ref,E.from):void 0,se=E.to?B(E.ref,E.to):void 0,T=t.steps[E.step]?.events[E.event],ee=E.line&&T?.type==="edge"&&T.carry.kind!=="none"&&!(T.carry.kind==="tag"&&T.carry.text===T.from);return{ref:E.ref,step:E.step,event:E.event,...N?{from:N}:{},...se?{to:se}:{},...E.to?{target:E.to.commit}:{},...ee?{carried:!0}:{},...E.line&&N&&se?{line:ei(v(N),v(se))}:{},color:"slate"}}),R=r.tags.map(E=>({...B(E.ref,E.slot),ref:E.ref,step:E.step})),W=He(t),J=Math.max(_,...X.flatMap(E=>[E.cx+E.r,...E.text?[E.text.x+E.text.w]:[]]),...R.map(E=>E.x+E.w),...I.flatMap(E=>[E.from,E.to].flatMap(N=>N?[N.x+N.w]:[]))),Z=J+e.boxGap,ie=(S[1]??S[0])?.line??n+p.h/2,de=t.boxes.map((E,N)=>{let se=tt(t,E.id,!0),T=ie+N*(p.h+a);return{id:E.id,name:E.name,...E.sub!==void 0?{sub:E.sub}:{},...E.icon!==void 0?{icon:E.icon}:{},color:W.get(E.id)??"slate",x:Z,y:T-p.h/2,w:se,h:p.h,cx:Z+se/2,cy:T}}),ue=S.map((E,N)=>{let se=o.get(E.id);return{id:E.id,lines:[E.id],...se!==void 0?{note:se}:{},icon:"branch",color:E.color,x:E.x,y:E.y,w:0,h:E.h,header:{x:E.x+l.inset,y:E.y+l.inset,w:g[N]?.w??0,h:l.nameY-l.inset+(se!==void 0?l.line:0)+a/2}}}),D={kind:"git",width:0,height:0,regions:ue,boxes:de,lifelines:[],edges:[],labels:[],actions:[],badges:[],paths:[],ends:[],lanes:S,commits:X,links:Q,tags:R,refs:r.refs,moves:I};D.badges=Os(t,D),D.labels=oi(t,D);let me=Math.max(J,...de.map(E=>E.x+E.w),...D.labels.map(E=>E.x+E.w))+l.pad,ae=Math.max(me+n,ze(t)+n*2);for(let E of ue)E.w=ae-n*2;for(let E of S)E.w=ae-n*2;let ye=Math.max(F,...de.map(E=>E.y+E.h),...D.labels.map(E=>E.y+E.h)),we=Ue(t,n,ye+a,ae-n*2);return D.width=ae,D.height=(we?we.y+we.h:ye)+n,we&&(D.strip=we),D.badges=Os(t,D),D}function si(t){let n=Math.min(...t.map(p=>p.x)),a=Math.min(...t.map(p=>p.y));return{x:n,y:a,w:Math.max(...t.map(p=>p.x+p.w))-n,h:Math.max(...t.map(p=>p.y+p.h))-a}}function ri(t,n){return[...t.links.filter(p=>p.step===n&&p.kind!=="copy").map(p=>({event:p.event,points:p.points,color:p.color})),...t.moves.flatMap(p=>{let l=t.commits.find(e=>e.id===p.target);return p.step===n&&p.line&&l?[{event:p.event,target:l,color:l.color}]:[]})].sort((p,l)=>p.event-l.event)[0]}function Ms(t,n,a){let{r:p,inset:l}=w.badge,e=t.r+l+p,s=p*2+l;return[[t.cx+e,t.cy],[t.cx,t.cy+e],[t.cx-e,t.cy],[t.cx,t.cy-e]].find(o=>n.every(([i,c])=>Math.hypot(o[0]-i,o[1]-c)>=s)&&a.every(i=>wt(Ye(o),i)>=w.label.touch))}function ii(t,n,a){let{r:p,inset:l,along:e,short:s}=w.badge,r=ut(t),o=r<s?Math.min(p+1,r/2):e,i=p*2+l;for(let c=o;c<=r;c+=1){let m=et(t,c),f=Ye(m);if(n.every(([d,u])=>Math.hypot(m[0]-d,m[1]-u)>=i)&&a.every(d=>wt(f,d)>=w.label.touch))return m}}function Os(t,n){let{inset:a}=w.badge,p=[],l=[...n.links.map(r=>r.points),...n.moves.flatMap(r=>r.line?[r.line]:[])],e=[],s=[...n.tags,...n.commits.flatMap(r=>[{x:r.cx-r.r,y:r.cy-r.r,w:r.r*2,h:r.r*2},...r.text?[r.text]:[]])];return t.steps.forEach((r,o)=>{let i=ri(n,o),c=i?.target?Ms(i.target,p,s):void 0;if(i&&(i.points||c)){let x=i.points,h=c??(x?ii(x,p,s)??st(x,p,l.filter(g=>g!==x)):[0,0]);p.push(h),e.push({step:o,x:h[0],y:h[1],color:i.color});return}let m=r.events.flatMap(x=>x.type==="swap"||x.type==="action"?[x.box]:[]).map(x=>n.boxes.find(h=>h.id===x))[0];if(m){e.push({step:o,x:m.x,y:m.y,color:m.color});return}if(n.strip&&r.events.some(x=>x.type==="strip")){e.push({step:o,x:n.strip.x+a,y:n.strip.y+a,color:"slate"});return}let f=n.commits.find(x=>x.id===n.refs[0]?.at[o]),d=f?Ms(f,p,s):void 0;if(f&&d){p.push(d),e.push({step:o,x:d[0],y:d[1],color:f.color});return}let u=e[e.length-1],M=n.lanes[0];e.push(u?{...u,step:o}:{step:o,x:(M?.x??0)+(M?.w??0)-a-w.badge.r,y:(M?.y??0)+a+w.badge.r,color:M?.color??"slate"})}),Xe(e)}function oi(t,n){let a=w.git,p=[],l=n.commits.map(r=>({x:r.cx-r.r,y:r.cy-r.r,w:r.r*2,h:r.r*2})),e=n.commits.flatMap(r=>r.text?[r.text]:[]),s=n.regions.map(r=>r.header);for(let r of n.moves){let o=t.steps[r.step]?.events[r.event];if(o?.type!=="edge"||o.label===void 0||!r.line)continue;let i=n.commits.find(g=>g.id===o.to);if(!i)continue;let c=n.lanes[0]?.id===i.branch,m=pe(o.label,De(o.label)?A.labelJa:A.label)+w.label.padX*2,[f]=r.line.reduce((g,L)=>[g[0]+L[0]/r.line.length,0],[0,0]),d=Math.max(0,...n.tags.filter(g=>g.step===r.step&&Math.abs(g.x+g.w/2-i.cx)<.5).map(g=>i.cy-g.y)),u=o.labelSide??(c?"above":"below"),M=o.labelSide!==void 0?void 0:c?{x:f-m/2,y:i.cy-Math.max(d,(n.lanes[0]?.tagBase??a.tag)+w.carrier.tagH/2)-w.label.soft-w.label.h}:{x:f-m/2,y:i.cy+a.labelUnder},x=n.badges.filter(g=>g.step<=r.step).map(g=>Ye([g.x,g.y])),h=n.tags.filter(g=>g.step===r.step);p.push(Ze({step:r.step,event:r.event,text:o.label,points:r.line,color:r.color,side:u,...M?{base:M}:{}},{hard:[...l,...n.boxes],soft:[...e,...h,...s,...p.filter(g=>g.step===r.step)],touch:x}))}return p}var Ft={app:"M -9 -7 h18 a2 2 0 0 1 2 2 v10 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-10 a2 2 0 0 1 2 -2 z M -11 -2 h22",router:"M -9 -4 h16 M 3 -8 l4 4 l-4 4 M 9 5 h-16 M -3 1 l-4 4 l4 4",on:"M -7 7 L 7 -7 M -1 -7 h8 v8",off:"M -7 -7 L 7 7 M 7 -1 v8 h-8",pool:"M -9 -5 a9 3.5 0 1 0 18 0 a9 3.5 0 1 0 -18 0 M -9 -5 v10 a9 3.5 0 0 0 18 0 v-10 M -9 0 a9 3.5 0 0 0 18 0",db:"M -9 -5 a9 3.5 0 1 0 18 0 a9 3.5 0 1 0 -18 0 M -9 -5 v10 a9 3.5 0 0 0 18 0 v-10 M -9 0 a9 3.5 0 0 0 18 0",exe:"M -5 -8 L 7 0 L -5 8 Z",idx:"M -9 -7 h18 M -9 -2 h18 M -9 3 h18 M -9 8 h11",sign:"M -9 4 c 3 -9 5 -9 6 0 s 3 7 6 -2 s 3 -6 6 0",env:"M -8 -5.5 h16 v11 h-16 z M -8 -5.5 l8 6 l8 -6",lock:"M -5.5 -1 h11 v8 h-11 z M -3.5 -1 v-3 a3.5 3.5 0 0 1 7 0 v3",check:"M -5 0 l3.5 3.5 l6.5 -7",flag:"M -4 8 V -8 M -4 -7 H 6 L 3.5 -3.5 L 6 0 H -4",x:"M -5 -5 l10 10 M 5 -5 l-10 10",chain:"M -1.5 4.5 l-2 2 a3.5 3.5 0 0 1 -5 -5 l3 -3 a3.5 3.5 0 0 1 5 0 M 1.5 -4.5 l2 -2 a3.5 3.5 0 0 1 5 5 l-3 3 a3.5 3.5 0 0 1 -5 0 M -2.5 2.5 l5 -5",net:"M -1.3 -4.6 L -5.8 3 M 1.3 -4.6 L 5.8 3 M -4.3 5.5 H 4.3 M -2.2 -7 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0 M -9.2 5.5 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0 M 4.8 5.5 a 2.2 2.2 0 1 0 4.4 0 a 2.2 2.2 0 1 0 -4.4 0",user:"M -4 -4.5 a4 4 0 1 0 8 0 a4 4 0 1 0 -8 0 M -8 9 c0 -5 3.6 -7.5 8 -7.5 s8 2.5 8 7.5",server:"M -9 -8 h18 v7 h-18 z M -9 1 h18 v7 h-18 z M -5 -4.5 h0.01 M -5 4.5 h0.01",key:"M -9 0 a3.5 3.5 0 1 0 7 0 a3.5 3.5 0 1 0 -7 0 M -2 0 h10 M 5 0 v3.5 M 8 0 v2.5",shield:"M 0 -9 l8 3 v5 c0 5 -3.5 8 -8 10 c-4.5 -2 -8 -5 -8 -10 v-5 z",globe:"M -9 0 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0 M -9 0 h18 M 0 -9 c-4.5 4 -4.5 14 0 18 M 0 -9 c4.5 4 4.5 14 0 18",bolt:"M 2 -9 L -5 1 h5 l-2 8 l7 -10 h-5 z",doc:"M -6 -9 h8 l5 5 v13 h-13 z M 2 -9 v5 h5 M -3 1 h7 M -3 5 h5",box:"M -9 -4.5 l9 -4.5 l9 4.5 v9 l-9 4.5 l-9 -4.5 z M -9 -4.5 l9 4.5 l9 -4.5 M 0 0 v9",truck:"M -10 -6 h11 v10 h-11 z M 1 -2 h5 l3.5 3.5 v2.5 h-8.5 M -7.5 6.5 a1.8 1.8 0 1 0 3.6 0 a1.8 1.8 0 1 0 -3.6 0 M 3 6.5 a1.8 1.8 0 1 0 3.6 0 a1.8 1.8 0 1 0 -3.6 0",card:"M -9 -6.5 h18 a2 2 0 0 1 2 2 v9 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-9 a2 2 0 0 1 2 -2 z M -11 -2 h22 M -7 3 h5",cart:"M -10 -8 h3 l3 11 h11 l2.5 -8 h-15.5 M -4.5 7.5 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0 M 5 7.5 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0",clock:"M -9 0 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0 M 0 -5 v5 l3.5 2.5",branch:"M -4 -4.5 v9 M 5 0.5 c0 4 -9 3 -9 6.5 M -6.2 -7 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0 M -6.2 7 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0 M 2.8 -2 a2.2 2.2 0 1 0 4.4 0 a2.2 2.2 0 1 0 -4.4 0",cloud:"M -7 6 h13 a4.5 4.5 0 0 0 0.5 -9 a6 6 0 0 0 -11.5 -1 a4.5 4.5 0 0 0 -2 10 z",refresh:"M 7 -3 a7.5 7.5 0 1 0 0.5 5 M 7.5 -8 v5 h-5",undo:"M -7 -2 h10 a5 5 0 0 1 0 10 h-6 M -3 -6 l-4 4 l4 4",yen:"M -6 -8 l6 7 l6 -7 M 0 -1 v9 M -5 1.5 h10 M -5 5 h10",layers:"M 0 -8 l9 4.5 l-9 4.5 l-9 -4.5 z M -9 2.5 l9 4.5 l9 -4.5",code:"M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",paint:"M -8 8 c 0 -3 2 -5 4.5 -5 l 9 -9 l 3.5 3.5 l -9 9 c 0 2.5 -2 4.5 -5 4.5 z",tree:"M 0 -5 v4 M -6 -1 h12 M -6 -1 v3 M 6 -1 v3 M -9 2 h6 v6 h-6 z M 3 2 h6 v6 h-6 z M -3 -10 h6 v5 h-6 z",block:"M -9 -7 h18 a2 2 0 0 1 2 2 v10 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-10 a2 2 0 0 1 2 -2 z M -11 -2.5 h22 M -6 2.5 h8"};var Yn=t=>/[0-9A-Za-z]$/u.test(t)?`${t} `:t,ai=t=>t.charAt(0).toUpperCase()+t.slice(1),Qe={ja:{cannotDraw:t=>`\u56F3\u3092\u63CF\u3051\u306A\u3044: ${t}`,kindNotLoaded:t=>`${t} \u306E\u56F3\u306E\u90E8\u54C1\u3092\u8AAD\u3093\u3067\u3044\u306A\u3044\u3002\u63CF\u304F\u524D\u306B loadKind \u3092\u5F85\u3064`,unknownColor:t=>`colors \u306E ${t} \u306F\u8272\u5473\u306B\u7121\u3044\u8272\u306E\u540D\u524D`,unreadableColor:t=>`colors \u306E ${t} \u306E\u5024\u3092\u8272\u3068\u3057\u3066\u8AAD\u3081\u306A\u3044`,overview:"\u5168\u4F53\u56F3",prev:"\u524D\u306E\u6BB5",pause:"\u6B62\u3081\u308B",play:"\u52D5\u304B\u3059",next:"\u6B21\u306E\u6BB5",steps:t=>`${t} \u306E\u6BB5`,side:"\u8107\u9053",sideNote:"\u4ECA\u56DE\u306F\u901A\u3089\u306A\u3044",sideFrom:t=>`${t} \u3064\u306E\u72B6\u614B\u304B\u3089\u5165\u308C\u308B`,trail:"\u901A\u3063\u305F\u72B6\u614B",start:"\u59CB\u307E\u308A",end:"\u7D42\u308F\u308A",badgeName:t=>`\u6BB5\u306E\u756A\u53F7 ${t}`,quoted:t=>`\u300C${t}\u300D`,iconOf:t=>`\u300C${t} \u306E\u7D75\u67C4\u300D`,coin:"\u300C\u786C\u8CA8\u300D",envelope:"\u300C\u5C01\u7B52\u300D",textsOverlap:(t,n)=>`${Yn(t)}\u3068${Yn(n)}\u304C\u91CD\u306A\u308B`,lineCrosses:(t,n,a)=>`\u7DDA ${t} \u2192 ${n} \u304C${Yn(a)}\u3092\u6A2A\u5207\u308B`,timeUnits:{ms:"\u30DF\u30EA\u79D2",s:"\u79D2",min:"\u5206",h:"\u6642\u9593",d:"\u65E5"},zoom:"\u62E1\u5927",range:(t,n)=>`${t}\u301C${n}`,headJoin:" \u30FB ",empty:"\u7A7A\u304D"},en:{cannotDraw:t=>`Cannot draw the diagram: ${t}`,kindNotLoaded:t=>`The ${t} diagram parts are not loaded. Await loadKind before drawing`,unknownColor:t=>`colors.${t} is not a color name of the palette`,unreadableColor:t=>`colors.${t} cannot be read as a color`,overview:"Overview",prev:"Previous step",pause:"Pause",play:"Play",next:"Next step",steps:t=>`Steps of ${t}`,side:"Side path",sideNote:"Not taken this time",sideFrom:t=>`Enterable from ${t} ${t===1?"state":"states"}`,trail:"States passed",start:"Start",end:"End",badgeName:t=>`step number ${t}`,quoted:t=>`"${t}"`,iconOf:t=>`the icon of "${t}"`,coin:"the coin",envelope:"the envelope",textsOverlap:(t,n)=>ai(`${t} and ${n} overlap`),lineCrosses:(t,n,a)=>`The line ${t} \u2192 ${n} crosses ${a}`,timeUnits:{ms:"ms",s:"s",min:"min",h:"h",d:"d"},zoom:"Zoom",range:(t,n)=>`${t}\u2013${n}`,headJoin:" \xB7 ",empty:"Empty"}};var Ce=[[0,Number.POSITIVE_INFINITY]],Vn=.5,Ns=(t,n)=>t.shown.some(([a,p])=>a<=n&&n<p),Kn=t=>({text:t.text,rect:{x:t.rect.x,y:t.rect.y,w:t.rect.w,h:t.rect.h},badge:t.badge===!0,...t.part?{part:t.part}:{}});function Es(t,n,a=[]){let p=[];return n.forEach((l,e)=>{let s=t.filter(o=>Ns(o,l));s.forEach((o,i)=>{for(let c of s.slice(i+1)){let m=Math.min(o.rect.x+o.rect.w,c.rect.x+c.rect.w)-Math.max(o.rect.x,c.rect.x),f=Math.min(o.rect.y+o.rect.h,c.rect.y+c.rect.h)-Math.max(o.rect.y,c.rect.y);m>Vn&&f>Vn&&p.push({kind:"texts",step:e,texts:[o.text,c.text],spots:[Kn(o),Kn(c)]})}});let r=a.filter(o=>Ns(o,l));for(let o of s)if(!o.boxed)for(let i of r)Ht(i.points,o.rect,Vn)&&p.push({kind:"line",step:e,text:o.text,line:{from:i.from,to:i.to},spots:[Kn(o)]})}),p}var ve=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),Zt=(t,n)=>t===void 0?n:`<a href="${ve(t)}">${n}</a>`,ne=t=>Math.round(t*100)/100,ke=t=>t==="coin"?"--c:var(--coin);--ct:var(--coint)":`--c:var(--c-${t});--ct:var(--t-${t})`;function rt(t,n,a,p,l="dg-gl"){let e=t!==void 0&&_t(t)?Ft[t]:void 0;return e?`<path class="${l}" transform="translate(${ne(n)} ${ne(a)}) scale(${p})" d="${e}"/>`:""}function it(t){let n=t.filter((e,s)=>s===0||e[0]!==t[s-1][0]||e[1]!==t[s-1][1]),[a,p]=n[0],l=`M ${ne(a)} ${ne(p)}`;for(let e=1;e<n.length-1;e++){let[s,r]=n[e-1],[o,i]=n[e],[c,m]=n[e+1],f=Math.hypot(o-s,i-r),d=Math.hypot(c-o,m-i),u=Math.min(w.edge.bend,f/2,d/2);l+=` L ${ne(o-(o-s)/f*u)} ${ne(i-(i-r)/f*u)} Q ${ne(o)} ${ne(i)} ${ne(o+(c-o)/d*u)} ${ne(i+(m-i)/d*u)}`}if(n.length>1){let[e,s]=n[n.length-1];l+=` L ${ne(e)} ${ne(s)}`}return l}function At(t){let[n,a]=t[t.length-1],[p,l]=t[t.length-2],e=Math.hypot(n-p,a-l)||1,s=(n-p)/e,r=(a-l)/e,{arrow:o,arrowHalf:i}=w.edge;return`M ${ne(n-s*o-r*i)} ${ne(a-r*o+s*i)} L ${ne(n)} ${ne(a)} L ${ne(n-s*o+r*i)} ${ne(a-r*o-s*i)}`}var _t=t=>t!==void 0&&Object.hasOwn(Ft,t),Ls=t=>t.some(n=>_t(n.icon)||n.slot!==void 0)?{name:w.box.nameY,sub:w.box.subY}:{name:w.box.nameMid,sub:w.box.subMid},Bt=t=>({...t,family:"sans"});function Me(t,n,a,p,l,e,s=Ce,r){return t?.push({text:l,rect:Ge(l,a,p,e,r),shown:s}),`<text class="${n}" x="${ne(a)}" y="${ne(p)}"${r?` text-anchor="${r}"`:""}>${ve(l)}</text>`}function qs(t,n){let a=[[0,{opacity:0}]];for(let[p,l]of n)a.push([p,{opacity:0},fe.out],[p+oe.fade,{opacity:1}],[l-.1,{opacity:1},fe.inOut],[l+.25,{opacity:0}]);return a.push([t.total,{opacity:0}]),t.kf(a)}function Qt(t,n){let a=[];for(let p=0;p<n.length;){let l=p;for(;l+1<n.length&&n[l+1]===n[l]+1;)l++;a.push([t.t.steps[n[p]].start,t.t.steps[n[l]].end]),p=l+1}return qs(t.m,a)}function As(t,n){let{radius:a,icon:p,iconRadius:l,iconScale:e,nameY:s,line:r}=w.region,{x:o,y:i}=t.header,c=t.lines.map((d,u)=>Me(n,"dg-bz",o,t.y+s+u*r,d,A.regionName)).join(""),m=t.note?Me(n,"dg-bx",o,t.y+s+t.lines.length*r+1,t.note,A.regionNote):"",f=_t(t.icon)?`<rect class="dg-bi" x="${ne(o)}" y="${ne(i)}" width="${p}" height="${p}" rx="${l}"/>${rt(t.icon,o+p/2,i+p/2,e)}`:"";return`<g style="${ke(t.color)}"><rect class="dg-band" x="${ne(t.x+.5)}" y="${ne(t.y+.5)}" width="${ne(t.w-1)}" height="${ne(t.h-1)}" rx="${a}"/>${f}${c}${m}</g>`}function en(t,n,a,p,l,e){let s=[[0,t.sub??"","dg-ss"],...a];return s.map(([r,o,i],c)=>{let m=s[c+1]?.[0],f=c===0?m===void 0?"":n.until(m-oe.untilFade):m===void 0?n.rise(r):n.rise(r,m-oe.untilFade);if(o==="")return"";let d=[[c===0?0:r,m===void 0?Number.POSITIVE_INFINITY:m-oe.untilFade]],u=i==="dg-ss"?A.boxSub:A.boxSubStrong,M=e===void 0?Me(l,i,t.cx,p,o,u,d,"middle"):Me(l,i,e-pe(o,u),p,o,u,d);return`<g${f?` class="dg-a" style="${f}"`:""}>${M}</g>`}).join("")}function js(t,n,a,p,l){let e=(s,r="")=>`<rect class="${s}" x="${ne(t.x)}" y="${ne(p)}" width="${ne(t.w)}" height="${l}" rx="${w.box.radius}"${r}/>`;return`${a?`<g class="dg-a" style="${a}">${e("dg-halo")}</g>`:""}${e("dg-st",` ${n.sh}`)}${a?`<g class="dg-a" style="${a}">${e("dg-on")}</g>`:""}`}function tn(t,n,a,p,l){let{icon:e,iconRadius:s,iconScale:r,iconY:o}=w.box,i=en(t,n.m,p,t.cy+n.boxText.sub,n.ink),c=l?l.length>0?qs(n.m,l.map(u=>[u.start,u.end])):void 0:a.length>0?Qt(n,a):void 0,m=t.iconX??t.cx,f=t.slot?`<rect class="dg-slot" x="${ne(t.slot.x)}" y="${ne(t.slot.y)}" width="${ne(t.slot.w)}" height="${ne(t.slot.h)}" rx="${w.slot.radius}"/>`:"",d="";if(_t(t.icon)){let u={x:m-e/2,y:t.cy+o-e/2,w:e,h:e};n.ink.push({text:`${t.name} \u306E\u7D75\u67C4`,rect:u,shown:Ce,boxed:!0,part:{kind:"icon",box:t.name}}),d=`<rect class="dg-ic" x="${ne(u.x)}" y="${ne(u.y)}" width="${e}" height="${e}" rx="${s}"/>${rt(t.icon,m,t.cy+o,r)}`}return`<g style="${ke(t.color)}">${js(t,n,c,t.y,t.h)}${f}${d}${Me(n.ink,"dg-sn",t.cx,t.cy+n.boxText.name,t.name,A.boxName,Ce,"middle")}${i}</g>`}function Rs(t,n,a,p){let{pad:l,h:e,nameY:s,subY:r}=w.follow.head,o=en(t,n.m,p,l+r),i=a.length>0?Qt(n,a):void 0;return`<g style="${ke(t.color)}">${js(t,n,i,l,e)}<text class="dg-sn" x="${ne(t.cx)}" y="${ne(l+s)}" text-anchor="middle">${ve(t.name)}</text>${o}</g>`}function Is(t,n){let{icon:a,iconRadius:p,iconScale:l,radius:e}=w.box,s=w.state.ghost,r=t.x+s.pad+a/2,o=t.x+s.pad+a+s.gap,i=_t(t.icon)?`<rect class="dg-ic" x="${ne(r-a/2)}" y="${ne(t.cy-a/2)}" width="${a}" height="${a}" rx="${p}"/>${rt(t.icon,r,t.cy,l)}`:"",c=t.sub?s.nameY:w.baseline.mark,m=t.sub?Me(n,"dg-ss",o,t.cy+s.subY,t.sub,A.boxSub,Ce,"start"):"";return`<g data-ghost="${ve(t.id)}" style="${ke(t.color)}"><rect class="dg-ghost" x="${ne(t.x)}" y="${ne(t.y)}" width="${ne(t.w)}" height="${t.h}" rx="${e}"/>${i}${Me(n,"dg-sn",o,t.cy+c,t.name,A.boxName,Ce,"start")}${m}</g>`}function Ds(t,n,a){let{r:p,inset:l}=w.state.done,e=t.x+t.w-l,s=t.y+l;return`<g class="dg-popc dg-a" data-done="${ve(t.id)}" style="${ke(t.color)};${a.m.pop(n)}"><circle class="dg-done" cx="${ne(e)}" cy="${ne(s)}" r="${p}"/>${rt("check",e,s,.5,"dg-done-ck")}</g>`}function Cs(t,n,a,p){p.push({from:t.from,to:t.to,points:t.points,shown:Ce});let l=t.label?.family==="sans",e=t.label?Me(a,`dg-path-t${l?" dg-path-tj":""}`,t.label.x+w.label.padX,t.label.y+t.label.h/2+w.baseline.label,t.label.text,l?A.labelJa:A.label):"";return`<g data-path="${ve(`${t.from}->${t.to}`)}" style="${ke(n)}"><path class="dg-path" d="${it(t.points)}"/><path class="dg-path-h" d="${At(t.points)}"/>${e}</g>`}function Fs(t,n,a){let{pad:p}=w.state.side,l=t.y+p+A.regionName.size,e=t.notes.map((s,r)=>Me(a,"dg-side-n",t.x+p,l+w.region.line*(r+1),s,A.regionNote)).join("");return`<g style="${ke(n)}"><rect class="dg-side" x="${ne(t.x+.5)}" y="${ne(t.y+.5)}" width="${ne(t.w-1)}" height="${ne(t.h-1)}" rx="${w.region.radius}"/>${Me(a,"dg-side-t",t.x+p,l,t.title,A.regionName)}${e}</g>`}function _s(t,n,a){let{end:p}=w.state,l=Ut(t),e=t.text===""?"":Me(a,"dg-mark",l[0],l[1],t.text,A.regionNote),s=ne(t.x),r=ne(t.y);return t.kind==="start"?`<g data-end="start"><circle class="dg-start" cx="${s}" cy="${r}" r="${t.r}"/>${e}</g>`:t.ghost?`<g data-end="finish" style="${ke(n)}"><circle class="dg-end-x" cx="${s}" cy="${r}" r="${t.r}"/><circle class="dg-end-xi" cx="${s}" cy="${r}" r="${p.inner}"/>${e}</g>`:`<g data-end="finish"><circle class="dg-end" cx="${s}" cy="${r}" r="${t.r}"/><circle class="dg-end-in" cx="${s}" cy="${r}" r="${p.inner}"/>${e}</g>`}function Bs(t,n,a){return`<line class="dg-ll" x1="${ne(t)}" y1="${ne(n)}" x2="${ne(t)}" y2="${ne(a)}"/>`}function Gs(t,n,a,p=!1,l=0){let{m:e}=a;a.traces.push({from:t.from,to:t.to,points:t.points,shown:l>0?[[l,Number.POSITIVE_INFINITY]]:Ce});let s=it(t.points),r=At(t.points),{start:o,drawn:i,end:c}=n,m=p?[[c,{opacity:1},fe.inOut],[c+.4,{opacity:0}],[e.total,{opacity:0}]]:[[c,{opacity:1},fe.inOut],[c+.4,{opacity:.45}],[a.end+.3,{opacity:.45},fe.inOut],[a.end+1,{opacity:.95}],[e.last,{opacity:.95},fe.inOut],[e.total,{opacity:0}]],f=e.kf([[0,{opacity:0,"stroke-dashoffset":1}],[o,{opacity:0,"stroke-dashoffset":1},fe.inOut],[o+.05,{opacity:1}],[i,{"stroke-dashoffset":0}],[e.last,{"stroke-dashoffset":0}],[e.total,{"stroke-dashoffset":1}],...m]),d=e.kf([[0,{opacity:0}],[i-.05,{opacity:0}],[i,{opacity:1}],...m]),u=-(c-i)*26,M=e.kf([[0,{opacity:0,"stroke-dashoffset":0}],[i,{opacity:0,"stroke-dashoffset":0}],[i+.25,{opacity:.9}],[c-.1,{opacity:.9},fe.inOut],[c+.2,{opacity:0,"stroke-dashoffset":u}],[e.total,{opacity:0,"stroke-dashoffset":u}]]),x=p?e.kf([[0,{opacity:0}],[c,{opacity:0},fe.inOut],[c+.4,{opacity:1}],[e.last,{opacity:1},fe.inOut],[e.total,{opacity:0}]]):"",h=`<path class="dg-e" d="${s}"/><path class="dg-eh" d="${r}"/>`;return{base:`${l>0?`<g class="dg-a" style="${e.vis(l)}">${h}</g>`:h}${p?`<path class="dg-e-past dg-a" d="${s}" style="${x}"/><path class="dg-eh-past dg-a" d="${r}" style="${x}"/>`:""}`,lit:`<g style="${ke(t.color)}"><path class="dg-e-on dg-a" pathLength="1" d="${s}" style="${f}"/><path class="dg-eh-on dg-a" d="${r}" style="${d}"/><path class="dg-flow dg-a" d="${s}" style="${M}"/></g>`}}function Ys(t,n,a){let p=t.family==="sans"?" dg-capj":"",{radius:l}=w.label,e=n.again?[[n.start,n.end],[n.again.start,n.again.end]]:[[n.start,n.end]];a.ink.push({text:t.text,rect:t,shown:e,boxed:!0}),n.after&&a.ink.push({text:t.text,rect:Ge(t.text,t.x+t.w/2,t.y+t.h/2+w.baseline.label,t.family==="sans"?A.labelJa:A.label,"middle"),shown:[[n.after.start,n.after.end]]});let s=ne(t.x+t.w/2),r=ne(t.y+t.h/2+w.baseline.label),o=n.after?`<g class="dg-cap-past${t.family==="sans"?" dg-cap-pastj":""} dg-a" style="${a.m.vis(n.after.start,n.after.end)}"><text x="${s}" y="${r}" text-anchor="middle">${ve(t.text)}</text></g>`:"",i=e.map(([c,m])=>`<g class="dg-cap${p} dg-a" style="${ke(t.color)};${a.m.rise(c,m,!0)}"><rect x="${ne(t.x)}" y="${ne(t.y)}" width="${ne(t.w)}" height="${t.h}" rx="${l}"/><text x="${s}" y="${r}" text-anchor="middle">${ve(t.text)}</text></g>`);return`${o}${i.join("")}`}function Wn(t,n,a,p,l){let e=l?[[n,a],[l.start,l.end]]:[[n,a]];return p.ink.push({text:t.text,rect:t,shown:e,boxed:!0}),e.map(([s,r])=>`<g class="dg-act dg-a" style="${ke(t.color)};${p.m.rise(s,r,!0)}"><rect x="${ne(t.x)}" y="${ne(t.y)}" width="${ne(t.w)}" height="${t.h}" rx="${w.action.radius}"/><text x="${ne(t.x+t.w/2)}" y="${ne(t.y+t.h/2+w.baseline.action)}" text-anchor="middle">${ve(t.text)}</text></g>`).join("")}function li(t,n){let a=w.carrier;if(t.carry.kind==="coin")return`<circle class="dg-coin" r="${a.coinR}"/><circle class="dg-coin-in" r="${a.coinIn}"/>`;if(t.carry.kind==="tag"){let p=t.carry.text,l=De(p),e=pe(p,l?A.carrierJa:A.carrier)+a.tagPadX*2;return`<rect class="dg-car" x="${ne(-e/2)}" y="${-a.tagH/2}" width="${ne(e)}" height="${a.tagH}" rx="${a.tagH/2}" ${n}/><text class="dg-car-t${l?" dg-car-tj":""}" y="${w.baseline.carrier}" text-anchor="middle">${ve(p)}</text>`}return`<rect class="dg-env" x="${-a.envW/2}" y="${-a.envH/2}" width="${a.envW}" height="${a.envH}" rx="3" ${n}/><path class="dg-env-in" d="M -8 -4.5 L 0 1.5 L 8 -4.5"/>`}var pi=t=>t<.5?4*t*t*t:1-(-2*t+2)**3/2;function nn(t,n,a){let{m:p}=a,l=w.carrier.samples,e=t.wait?[t.wait,...t.points]:t.points,s=ut(e),{depart:r,arrive:o,start:i,end:c}=n,m=[];for(let P=0;P<=l;P++){let[j,$]=et(e,pi(P/l)*s);m.push([r+(o-r)*P/l,j,$])}let f=m[0],d=m[m.length-1],u=t.settle??[d[1],d[2]],M=[[0,f[1],f[2]],...m];t.settle&&M.push([Math.min(o+.3,Math.max(c,o+.01)),u[0],u[1]]),M.push([c,u[0],u[1]],[p.total,u[0],u[1]]);let[x,h]=lt(t.carry),g=t.carry.kind==="tag"?t.carry.text:t.carry.kind==="coin"?"\u786C\u8CA8":"\u5C01\u7B52",L=t.carry.kind==="tag"?{}:{part:{kind:t.carry.kind==="coin"?"coin":"envelope"}},O=P=>({x:P[0]-x,y:P[1]-h,w:x*2,h:h*2});r>i&&a.ink.push({text:g,rect:O([f[1],f[2]]),shown:[[i,r]],boxed:!0,...L}),a.ink.push({text:g,rect:O(u),shown:[[o,c]],boxed:!0,...L});let _=c<p.last?.05:.18;return`<g class="dg-a" style="${p.move(M,p.blink(i+.02,c,_))}">${li(t,a.sh)}</g>`}function Hn(t,n,a=!1){let{m:p}=n,l=n.t.steps[t.step],e=l.start,s=l.end,{r,ring:o}=w.badge,i={visibility:"visible"},c={visibility:"hidden"},m=t.until===void 0?void 0:n.t.steps[t.until].start,f=m!==void 0&&m<=s+1e-6,d=p.kf([[0,{opacity:0,transform:"scale(.5)",...c}],[e,{opacity:0,transform:"scale(.5)",...c},fe.pop],[e+.35,{opacity:1,transform:"scale(1)",...i}],[s,{opacity:1,transform:"scale(1)",...i},fe.inOut],[s+(f?oe.untilFade:.4),{opacity:0,transform:"scale(1)",...c}],[p.total,{opacity:0,transform:"scale(.5)",...c}]]),u=m??p.last,M=f?p.kf([[0,{opacity:0,...c}],[p.total,{opacity:0,...c}]]):p.kf([[0,{opacity:0,...c}],[s,{opacity:0,...c},fe.inOut],[s+.4,{opacity:1,...i}],[u,{opacity:1,...i},fe.inOut],...m===void 0?[]:[[m+oe.untilFade,{opacity:0,...c}]],[p.total,{opacity:0,...c}]]),x=p.kf([[0,{opacity:0,transform:"scale(1)"}],[e+.05,{opacity:0,transform:"scale(1)"}],[e+.1,{opacity:.7,transform:"scale(1)"},fe.out],[e+.9,{opacity:0,transform:"scale(2.3)"}],[p.total,{opacity:0,transform:"scale(1)"}]]),h=ne(t.x),g=ne(t.y),L=ne(t.y+w.baseline.badge),O=t.step+1;return n.ink.push({text:String(O),rect:{x:t.x-r,y:t.y-r,w:r*2,h:r*2},shown:[[e,u]],boxed:!0,badge:!0}),`<g class="dg-bd" data-step="${t.step}" style="${ke(t.color)}"><circle class="dg-bdr dg-popc dg-a" cx="${h}" cy="${g}" r="${o}" style="${x}"/><g class="dg-a" style="${M}"><circle class="${a?"dg-bdp-g":"dg-bdp"}" cx="${h}" cy="${g}" r="${o}"/><text class="${a?"dg-bdpt-g":"dg-bdpt"}" x="${h}" y="${L}" text-anchor="middle">${O}</text></g><g class="dg-popc dg-a" style="${d}"><circle class="dg-bdf" cx="${h}" cy="${g}" r="${r}"/><text class="dg-bdft" x="${h}" y="${L}" text-anchor="middle">${O}</text></g></g>`}function Vs(t,n,a,p=!1,l=new Map,e){let{m:s,sh:r}=a,o=w.strip,i=t.y+o.h/2,c=[`<rect class="dg-strip" x="${ne(t.x+.5)}" y="${ne(t.y+.5)}" width="${ne(t.w-1)}" height="${ne(t.h-1)}" rx="${w.region.radius}" ${r}/>`,`<g style="${ke("slate")}"><rect class="dg-bi" x="${ne(t.x+o.pad)}" y="${ne(i-o.icon/2)}" width="${o.icon}" height="${o.icon}" rx="${w.box.iconRadius}"/>${rt("env",t.x+o.pad+o.icon/2,i,.78)}</g>`,Me(a.ink,"dg-sh",t.x+o.titleX,i+w.baseline.stripTitle,t.title,A.stripTitle)];if(t.fields.forEach((m,f)=>{let d=t.fields[f-1];if(d&&d.y===m.y){let g=m.x-o.fieldGap/2;c.push(`<line class="dg-sep" x1="${ne(g)}" y1="${ne(m.y+o.sepInset)}" x2="${ne(g)}" y2="${ne(m.y+o.h-o.sepInset)}"/>`)}c.push(Me(a.ink,"dg-fl",m.x,m.y+o.nameY,m.name,A.fieldName));let u=e?.(m);if(u!==void 0){c.push(u);return}let M=n.get(m.name)??[],x=M.filter(g=>g.value!==void 0),h=M.filter(g=>g.tag!==void 0);x.forEach((g,L)=>{let O=x[L+1]?.at,_=g.value,P=De(_)?"dg-fvj":"dg-fv";a.ink.push({text:_,rect:Ge(_,m.x,m.y+o.valueY,De(_)?A.fieldValueJa:A.fieldValue),shown:[[g.at,O===void 0?Number.POSITIVE_INFINITY:O-oe.untilFade]]});let j=F=>`<text class="${F}" x="${ne(m.x)}" y="${ne(m.y+o.valueY)}">${ve(_)}</text>`,$=j(P);if(!p){let F=O===void 0?s.rise(g.at):s.rise(g.at,O-oe.untilFade);c.push(`<g class="dg-a" style="${F}">${$}</g>`);return}let S=Math.min(g.until,O??g.until),y=`<circle class="dg-fl-now" cx="${ne(m.x+pe(m.name,A.fieldName)+o.now.gap)}" cy="${ne(m.y+o.nameY-A.fieldName.size/3)}" r="${o.now.r}"/>`;c.push(`<g class="dg-fv-now dg-a" data-step="${g.step}" style="${ke(g.color)};${s.rise(g.at,S-oe.untilFade)}">${j(`${P} dg-fv-c`)}${y}</g>`),(O===void 0||O>S)&&c.push(`<g class="dg-a" style="${s.vis(S-oe.untilFade,O===void 0?s.last:O-oe.untilFade)}">${$}</g>`)}),h.forEach((g,L)=>{let O=h[L+1]?.at,_=g.tag,P=[...x].reverse().find(y=>y.at<=g.at+1e-9)?.value,j=m.x+(P?pe(P,De(P)?A.fieldValueJa:A.fieldValue)+o.tagGap:0),$=pe(_,A.tag)+o.tagPadX*2,S=m.y+o.valueY-o.tagH/2-w.baseline.tag;a.ink.push({text:_,rect:{x:j,y:S,w:$,h:o.tagH},shown:[[g.at,O===void 0?Number.POSITIVE_INFINITY:O-oe.untilFade]],boxed:!0}),c.push(`<g class="dg-tg dg-popc dg-a" style="${ke(g.color)};${O===void 0?s.pop(g.at):s.pop(g.at,O-oe.untilFade)}"><rect x="${ne(j)}" y="${ne(S)}" width="${ne($)}" height="${o.tagH}" rx="${o.tagH/2}"/><text x="${ne(j+$/2)}" y="${ne(S+o.tagH/2+w.baseline.tag)}" text-anchor="middle">${ve(_)}</text></g>`)})}),t.trail){let m=t.trail,f=t.fields[t.fields.length-1];if(f&&f.y===m.y){let u=m.x-o.fieldGap/2;c.push(`<line class="dg-sep" x1="${ne(u)}" y1="${ne(m.y+o.sepInset)}" x2="${ne(u)}" y2="${ne(m.y+o.h-o.sepInset)}"/>`)}c.push(Me(a.ink,"dg-fl",m.x,m.y+o.nameY,m.title,A.fieldName));let d=m.y+o.valueY-A.fieldValue.size/3;m.states.forEach((u,M)=>{let x=ne(m.x+o.trail.r+M*o.trail.step),h=l.get(u.box),g=h===void 0?"":`<circle class="dg-tr-fill dg-a" cx="${x}" cy="${ne(d)}" r="${o.trail.r}" style="${s.pop(h)}"/>`;c.push(`<g data-trail="${ve(u.box)}" style="${ke(u.color)}"><circle class="dg-tr-ring" cx="${x}" cy="${ne(d)}" r="${o.trail.r}"/>${g}</g>`)})}return c.join("")}var pt=t=>Math.round(t*100)/100,Ks=t=>[t.x+t.w/2,t.y+t.h/2];function ci(t,n){let a=w.carrier,p=De(t),l=pe(t,p?A.carrierJa:A.carrier)+a.tagPadX*2;return`<rect class="dg-car" x="${pt(-l/2)}" y="${-a.tagH/2}" width="${pt(l)}" height="${a.tagH}" rx="${a.tagH/2}" ${n}/><text class="dg-car-t${p?" dg-car-tj":""}" y="${w.baseline.carrier}" text-anchor="middle">${ve(t)}</text>`}function Ws(t,n,a,p){let{m:l}=p,e=w.git,s=(d,u)=>a.edges.find(M=>M.step===d&&M.event===u),r=t.links.map(d=>{let u=s(d.step,d.event);if(!u)return"";p.traces.push({from:d.from,to:d.to,points:d.points,shown:[[u.start,Number.POSITIVE_INFINITY]]});let M=it(d.points);if(d.kind==="copy")return`<g style="${ke(d.color)}"><path class="dg-git-cp dg-a" d="${M}" style="${l.vis(u.start,l.last)}"/></g>`;let x=l.kf([[0,{opacity:0,"stroke-dashoffset":1}],[u.start,{opacity:0,"stroke-dashoffset":1},fe.inOut],[u.start+.05,{opacity:1}],[u.drawn,{"stroke-dashoffset":0}],[l.last,{opacity:1,"stroke-dashoffset":0},fe.inOut],[l.total,{opacity:0,"stroke-dashoffset":0}]]);return`<g style="${ke(d.color)}"><path class="dg-git-l dg-a" pathLength="1" d="${M}" style="${x}"/></g>`}).join(""),o=t.commits.map(d=>{let u=s(d.step,d.event)?.drawn??0,M={x:d.cx-d.r,y:d.cy-d.r,w:d.r*2,h:d.r*2};p.ink.push({text:d.id,rect:M,shown:[[u,Number.POSITIVE_INFINITY]],boxed:!0});let x=(d.text?.lines??[]).map((P,j)=>{let $=j===0&&d.hash!==void 0,S=d.text?.baselines[j]??d.cy;return Me(p.ink,$?"dg-git-h":"dg-git-n",d.cx,S,P,$?A.gitHash:A.gitNote,[[u,Number.POSITIVE_INFINITY]],"middle")}).join(""),h=`<text class="dg-git-id" x="${pt(d.cx)}" y="${pt(d.cy+w.baseline.badge)}" text-anchor="middle">${ve(d.id)}</text>`,g=`<g class="dg-popc dg-a" style="${l.pop(u)}"><circle class="dg-git-c" cx="${pt(d.cx)}" cy="${pt(d.cy)}" r="${d.r}" ${p.sh}/>${h}</g>`,L=x===""?"":`<g class="dg-a" style="${l.vis(u)}">${x}</g>`,O=d.orphan===void 0?void 0:s(d.orphan,d.orphanEvent??0)?.drawn,_=O===void 0?"":`<g class="dg-a" data-orphan="${ve(d.id)}" style="${l.vis(O,l.last,{f:.5})}"><circle class="dg-git-old" cx="${pt(d.cx)}" cy="${pt(d.cy)}" r="${e.orphan}"/><text class="dg-git-oldl" x="${pt(d.cx)}" y="${pt(d.cy+w.baseline.badge)}" text-anchor="middle">${ve(d.id)}</text></g>`;return`<g data-commit="${ve(d.id)}" style="${ke(d.color)}">${g}${L}${_}</g>`}).join(""),i=t.moves.flatMap(d=>{let u=s(d.step,d.event);if(!d.line||!u)return[];let M=a.steps[d.step].end;p.traces.push({from:d.ref,to:d.target??d.ref,points:d.line,shown:[[u.start,M+.4]]});let x=l.kf([[0,{opacity:0,"stroke-dashoffset":1}],[u.start,{opacity:0,"stroke-dashoffset":1},fe.inOut],[u.start+.05,{opacity:1}],[u.drawn,{"stroke-dashoffset":0}],[M,{opacity:1},fe.inOut],[M+.4,{opacity:0}],[l.total,{opacity:0,"stroke-dashoffset":0}]]);return[`<g style="${ke(d.color)}"><path class="dg-e-on dg-a" pathLength="1" d="${it(d.line)}" style="${x}"/></g>`]}).join(""),c=a.carriers.flatMap(d=>{let u=t.moves.find(h=>h.step===d.step&&h.event===d.event&&h.line),M=n.steps[d.step]?.events[d.event];if(!u?.line||M?.type!=="edge")return[];let x={step:d.step,event:d.event,from:u.ref,to:u.target??u.ref,points:u.line,color:u.color,carry:M.carry};return[nn(x,{...d,start:d.depart,end:d.arrive+oe.fade},p)]}).join(""),f=[...new Set(t.moves.map(d=>d.ref))].map(d=>di(d,t.moves.filter(u=>u.ref===d),s,p)).join("")+c;return{links:r,lines:i,commits:o,tags:f}}function di(t,n,a,p){let{m:l}=p,e=[],s=[[0,{opacity:0}]],r=!1,o,i=d=>{o&&p.ink.push({text:t,rect:o.rect,shown:[[o.since,d]],boxed:!0}),o=void 0};for(let d of n){let u=a(d.step,d.event);if(!u)continue;let{start:M,drawn:x}=u,h=d.from?Ks(d.from):void 0,g=d.to?Ks(d.to):void 0;if(i(M),d.carried&&h&&g&&r){e.push([M+oe.fade,h[0],h[1]],[x-oe.fade,g[0],g[1]]),s.push([M,{opacity:1},fe.inOut],[M+oe.fade,{opacity:0}],[x-oe.fade,{opacity:0},fe.out],[x,{opacity:1}]),o={rect:d.to,since:x};continue}if(h&&e.push([M,h[0],h[1]]),g&&e.push([x,g[0],g[1]]),g&&!r){let L=h?M:x-oe.fade;s.push([L,{opacity:0},fe.out],[L+oe.fade,{opacity:1}]),r=!0}else!g&&r&&(s.push([x,{opacity:1},fe.inOut],[x+oe.untilFade,{opacity:0}]),r=!1);d.to&&(o={rect:d.to,since:x})}if(i(Number.POSITIVE_INFINITY),e.length===0)return"";let c=e[0],m=e[e.length-1];r?s.push([l.last,{opacity:1},fe.inOut],[l.total,{opacity:0}]):s.push([l.total,{opacity:0}]);let f=l.move([[0,c[1],c[2]],...e,[l.total,m[1],m[2]]],s);return`<g class="dg-a" data-ref="${ve(t)}" style="${f}">${ci(t,p.sh)}</g>`}var Un={};Tt(Un,{drawLineup:()=>Xs,layoutLineup:()=>Hs});function mi(t,n,a){let p=t.steps.flatMap(l=>l.events.flatMap(e=>e.type==="swap"&&e.box===n?[pe(e.text,A.boxSubStrong)]:[]));return a===void 0?p:[pe(a,A.boxSub),...p]}function Hs(t){let{margin:n,gap:a,lineup:p}=w,l=t.lineup?.items??[],e=new Set(l.map(S=>S.id)),s=Math.max(p.chip.w,...l.map(S=>S.label===void 0?0:pe(S.label,A.chip)+p.chip.padX*2)),r=s+p.chip.gap,o=r*In-p.chip.gap,i=t.boxes.map(S=>pe(S.name,A.boxName)+p.textGap+Math.max(0,...mi(t,S.id,S.sub))),c=Math.max(o+p.padX*2,...i.map(S=>S+p.padX*2),ze(t)),m=He(t),f=t.boxes.map((S,y)=>{let F=n+y*(p.h+a),C=F+p.textY,X=n+c-p.padX;return{id:S.id,name:S.name,...S.sub!==void 0?{sub:S.sub}:{},color:m.get(S.id)??"slate",x:n,y:F,w:c,h:p.h,cx:n+c/2,cy:F+p.h/2,title:{...Ge(S.name,n+p.padX,C,A.boxName),text:S.name,baseline:C},...S.sub!==void 0?{note:{...Ge(S.sub,X-pe(S.sub,A.boxSub),C,A.boxSub),text:S.sub,baseline:C}}:{},noteRight:X,track:{x:n+p.padX,y:F+p.trackY,w:o,h:p.chip.h}}}),d=new Map(f.map(S=>[S.id,S])),u=[],M=[],x=[],h=[],g=new Map,L=new Map,O;t.steps.forEach((S,y)=>{let F=[...g.values()].flat();S.events.forEach((C,X)=>{if(C.type!=="line"&&C.type!=="seal"&&C.type!=="open"&&C.type!=="pick"&&C.type!=="stamp")return;let z=d.get(C.box);if(!z)return;let Q={step:y,event:X};if(C.type==="seal"&&!L.has(z.id)){let{over:B}=p.seal,v={...Q,lane:z.id,x:z.track.x-B,y:z.track.y-B,w:z.track.w+B*2,h:z.track.h+B*2};M.push(v),L.set(z.id,v)}else if(C.type==="open"){let B=L.get(z.id);B&&(B.until=Q),L.delete(z.id)}else if(C.type==="pick"&&O!==z.id)h.push({...Q,lane:z.id}),O=z.id;else if(C.type==="stamp"){let B=pe(C.text,A.stamp)+p.stamp.padX*2;x.push({...Q,lane:z.id,text:C.text,x:z.x+z.w-p.padX-B,y:z.track.y+(z.track.h-p.stamp.h)/2,w:B,h:p.stamp.h})}else if(C.type==="line"){let B=g.get(z.id)??[],I=[...new Set(C.items)].filter(R=>e.has(R)).slice(0,In).map((R,W)=>{let J=B.find(ue=>ue.id===R);if(J?.index===W)return J;let Z=F.filter(ue=>ue.id===R),ie=J??Z.find(ue=>ue.lane===O)??Z.at(-1),de={...Q,id:R,lane:z.id,index:W,x:z.track.x+r*W,y:z.track.y,w:s,h:p.chip.h,...ie?{from:[ie.x,ie.y]}:{}};return u.push(de),de});for(let R of B)I.includes(R)||(R.until=Q);g.set(z.id,I)}})});let _={kind:"lineup",width:0,height:0,regions:[],boxes:f,lifelines:[],edges:[],labels:[],actions:[],badges:[],paths:[],ends:[],lanes:f,chips:u,seals:M,stamps:x,picks:h},P=Math.max(...f.map(S=>S.y+S.h),n),j=c+n*2,$=Ue(t,n,P+a,j-n*2);return _.width=j,_.height=($?$.y+$.h:P)+n,$&&(_.strip=$),_.badges=fi(t,_),_}function fi(t,n){let{inset:a}=w.badge,p=[],l=(e,s,r,o)=>{p.push({step:e,x:s,y:r,color:o})};return t.steps.forEach((e,s)=>{let r=e.events.flatMap(i=>"box"in i?[i.box]:[]).flatMap(i=>n.lanes.filter(c=>c.id===i))[0];if(r){l(s,r.x,r.track.y+r.track.h/2,r.color);return}let o=p[p.length-1];n.strip&&e.events.some(i=>i.type==="strip")?l(s,n.strip.x+a,n.strip.y+a,"slate"):o?p.push({...o,step:s}):l(s,w.margin,w.margin,n.lanes[0]?.color??"slate")}),Xe(p)}var Fe=t=>Math.round(t*100)/100,zn=(t,n,a=1)=>`translate(${Fe(t)}px,${Fe(n)}px) scale(${a})`,ui=(t,n)=>n.reduce((a,[p,l])=>a.flatMap(([e,s])=>l<=e||p>=s?[[e,s]]:[...e<p?[[e,p]]:[],...l<s?[[l,s]]:[]]),[t]);function Xs(t,n,a,p,l){let{m:e}=p,s=w.lineup,r=oe.lineup.cut,o=y=>a.edges.find(F=>F.step===y.step&&F.event===y.event)??{start:0,drawn:0},i=new Map((n.lineup?.items??[]).map(y=>[y.id,y])),c=new Map(t.lanes.map(y=>[y.id,[]])),m=new Set,f=(y,F,C)=>{m.has(y)!==C&&(C?m.add(y):m.delete(y),c.get(y)?.push([F,C]))};for(let y of[...a.edges].sort((F,C)=>F.start-C.start)){let F=n.steps[y.step]?.events[y.event];if(F?.type==="line"&&f(F.box,y.start,!1),F?.type==="pick")for(let C of t.lanes)f(C.id,y.start,C.id!==F.box)}let d=y=>{let F=c.get(y)??[];if(F.length===0)return;let C=[[0,{opacity:1}]],X=1;for(let[z,Q]of F){let B=Q?s.faint:1;C.push([z,{opacity:X},fe.inOut],[z+oe.fade,{opacity:B}]),X=B}return C.push([e.last,{opacity:X},fe.inOut],[e.total,{opacity:1}]),e.kf(C)},u=y=>[o(y).drawn,y.until?o(y.until).start:Number.POSITIVE_INFINITY],M=y=>{if(y.length===0)return;let F=[[0,{opacity:1}]];for(let C of y){let[X,z]=u(C);F.push([X,{opacity:1}],[X+r,{opacity:0}]),C.until&&F.push([z,{opacity:0}],[z+r,{opacity:1}])}return F.push([e.total-r,{opacity:y.at(-1)?.until?1:0}],[e.total,{opacity:1}]),e.kf(F)},x=y=>{let{start:F,drawn:C}=o(y),X={opacity:0,transform:"scaleX(0)"},z=y.until?[[o(y.until).start,{opacity:1},fe.inOut],[o(y.until).start+oe.fade,{opacity:0}],[e.total,{opacity:0}]]:[[e.last,{opacity:1},fe.inOut],[e.total,{opacity:0}]];return e.kf([[0,X],[F-r,X],[F,{opacity:1,transform:"scaleX(0)"},fe.inOut],[C,{transform:"scaleX(1)"}],...z])},h=y=>{if(!y.until)return;let F=y.until,C=t.chips.find(X=>X!==y&&X.id===y.id&&X.step===F.step&&X.from?.[0]===y.x&&X.from?.[1]===y.y);return C?{at:o(C).start,moved:!0}:{at:o(F).start,moved:!1}},g=y=>{let F=o(y).start,C=zn(0,0),X=[];if(y.from){let Q=zn(y.from[0]-y.x,y.from[1]-y.y);X.push([0,{opacity:0,transform:Q}],[F-r,{opacity:0,transform:Q}],[F,{opacity:1,transform:Q},fe.inOut],[F+oe.lineup.slide,{transform:C}])}else{let Q=zn(0,0,w.popFrom);X.push([0,{opacity:0,transform:Q}],[F,{opacity:0,transform:Q},fe.pop],[F+oe.popFade,{opacity:1,transform:C}])}let z=h(y);return z?X.push([z.at,{opacity:1},fe.inOut],[z.at+(z.moved?r:oe.fade),{opacity:0}],[e.total,{opacity:0}]):X.push([e.last,{opacity:1},fe.inOut],[e.total,{opacity:0}]),e.kf(X)},L=(y,F)=>{let C=i.get(y.id),X=C?.color,z=`<rect class="${X?"dg-ln-chip":"dg-ln-plain"}" x="${Fe(y.x)}" y="${Fe(y.y)}" width="${Fe(y.w)}" height="${y.h}" rx="${s.chip.radius}"/>`,Q=ui([o(y).start+oe.lineup.slide,h(y)?.at??Number.POSITIVE_INFINITY],F),B=C?.label===void 0?"":Me(p.ink,X?"dg-ln-t":"dg-ln-tp",y.x+y.w/2,y.y+y.h/2+w.baseline.tag,C.label,A.chip,Q,"middle");return`<g class="dg-popc dg-a" data-lineup-chip="${ve(y.id)}" data-lineup-on="${ve(y.lane)}" data-lineup-seat="${y.index}" style="${X?`${ke(X)};`:""}${g(y)}">${z}${B}</g>`},O=(y,F,C)=>`<g class="dg-a" data-lineup-ring="${ve(y.lane)}" style="${e.vis(o(y).start,F?o(F).start:e.last)}">${C}</g>`,_=new Map(t.lanes.map(y=>[y.id,d(y.id)])),P=t.lanes.map(y=>{let F=(Q,B="")=>`<rect class="${Q}" x="${Fe(y.x)}" y="${Fe(y.y)}" width="${Fe(y.w)}" height="${y.h}" rx="${s.radius}"${B}/>`,C=t.picks.flatMap((Q,B)=>Q.lane===y.id?[O(Q,t.picks[B+1],`${F("dg-halo")}${F("dg-on")}`)]:[]).join(""),X=en(y,e,l.get(y.id)??[],y.title.baseline,p.ink,y.noteRight),z=_.get(y.id);return`<g${z?' class="dg-a"':""} data-lineup-lane="${ve(y.id)}" style="${ke(y.color)}${z?`;${z}`:""}">${F("dg-st",` ${p.sh}`)}${C}${Me(p.ink,"dg-sn",y.title.x,y.title.baseline,y.name,A.boxName,Ce)}${X}</g>`}).join(""),j=s.seal.stripe,$=`<defs><pattern id="dg-seal-${p.id}" patternUnits="userSpaceOnUse" width="${j*2}" height="${j*2}" patternTransform="rotate(45)"><rect class="dg-ln-sl" width="${j*2}" height="${j*2}"/><rect class="dg-ln-sd" width="${j}" height="${j*2}"/></pattern></defs>`,S=t.lanes.map(y=>{let F=t.seals.filter(R=>R.lane===y.id),C=F.map(u),X=t.chips.filter(R=>R.lane===y.id).map(R=>L(R,C)).join(""),z=M(F),Q=`<g${z?' class="dg-a"':""} data-lineup-track="${ve(y.id)}"${z?` style="${z}"`:""}>${X}</g>`,B=F.map(R=>`<rect class="dg-ln-seal dg-a" data-lineup-seal="${ve(y.id)}" x="${Fe(R.x)}" y="${Fe(R.y)}" width="${Fe(R.w)}" height="${Fe(R.h)}" rx="${s.seal.radius}" fill="url(#dg-seal-${p.id})" style="${x(R)}"/>`).join(""),v=t.stamps.filter(R=>R.lane===y.id).map(R=>{let W=o(R).start,J=R.x+R.w/2,Z=R.y+R.h/2,ie=Me(p.ink,"dg-ln-st",J,Z+w.baseline.tag,R.text,A.stamp,[[W,Number.POSITIVE_INFINITY]],"middle");return`<g class="dg-popc dg-a" data-lineup-stamp="${ve(y.id)}" style="${ke(s.stamp.color)};${e.pop(W)}"><g transform="rotate(${s.stamp.tilt} ${Fe(J)} ${Fe(Z)})"><rect class="dg-ln-stamp" x="${Fe(R.x)}" y="${Fe(R.y)}" width="${Fe(R.w)}" height="${R.h}" rx="${s.stamp.radius}"/>${ie}</g></g>`}).join(""),I=_.get(y.id);return`<g${I?` class="dg-a" style="${I}"`:""}>${Q}${B}${v}</g>`}).join("");return{lanes:P,chips:`${$}${S}`}}var zs={};function jt(t,n){zs[t]=n}function nt(t,n="ja"){let a=zs[t];if(a===void 0)throw new Error(Qe[n].kindNotLoaded(t));return a}var Jn={};Tt(Jn,{layoutState:()=>Js});var Us=t=>Nt.includes(t);function hi(t){let n=[],a=p=>{!Us(p)&&!n.includes(p)&&n.push(p)};for(let{edge:p}of $t(t))a(p.from),a(p.to);return n}var gi=(t,n)=>t.from===n.from&&t.to===n.to;function Js(t,n){let{box:a,state:p,margin:l,gap:e}=w,s=w.edge.inset,r=Qe[n],o=He(t),i=$t(t),c=hi(t),m=t.boxes.map(k=>k.id).filter(k=>!c.includes(k)),f=(t.state?.paths??[]).filter(k=>!i.some(({edge:V})=>gi(V,k))),d=[...i.map(({edge:k})=>k),...f],u=p.ghost,M=k=>{let V=t.boxes.find(te=>te.id===k);return u.pad*2+a.icon+u.gap+Math.max(pe(V?.name??k,A.boxName),pe(V?.sub??"",A.boxSub))},x=kt(t),h=Math.max(a.padX,p.done.inset+p.done.r+w.slot.clear),g=new Map(t.boxes.map(k=>[k.id,m.includes(k.id)?M(k.id):Math.max(tt(t,k.id,!0),vt(x.get(k.id),k.icon!==void 0,h))])),L=Math.max(1,Math.min(p.columns,c.length)),O=Math.max(1,Math.ceil(c.length/p.columns)),_=new Map(c.map((k,V)=>{let te=Math.floor(V/p.columns),xe=V%p.columns;return[k,{row:te,col:te%2===0?xe:L-1-xe}]})),P=Array.from({length:L},(k,V)=>Math.max(a.minW,...c.filter(te=>_.get(te)?.col===V).map(te=>g.get(te)??a.minW))),j=Array.from({length:Math.max(0,L-1)},()=>p.columnGap);for(let k of d){let V=_.get(k.from),te=_.get(k.to);if(!V||!te||k.label===void 0||V.row!==te.row||Math.abs(V.col-te.col)!==1)continue;let xe=Math.min(V.col,te.col);j[xe]=Math.max(j[xe]??0,pe(k.label,We(k.label))+w.label.padX*2+p.labelRoom*2)}let $=[];for(let k=0;k<L;k++)$.push(k===0?l:$[k-1]+P[k-1]+j[k-1]);let S=k=>$[k]+P[k]/2,y=k=>m.includes(k),F=new Set(f.filter(k=>y(k.to)&&!y(k.from)&&!Us(k.from)).map(k=>k.from)),C=[r.sideNote,...F.size>0?[r.sideFrom(F.size)]:[]],X=Math.max(pe(r.side,A.regionName),...C.map(k=>pe(k,A.regionNote))),z=p.side.pad*2+Math.max(u.h,A.regionName.size+w.region.line*C.length+p.side.pad/4),Q=d.some(k=>k.from==="start"),B=l+(m.length>0?z+p.side.gap:Q?p.start+p.drop:0),v=k=>B+k*(a.h+p.rowGap),I=(k,V,te,xe)=>{let be=t.boxes.find(Le=>Le.id===k),$e=g.get(k)??a.minW,Je=xe?u.h:a.h;return{id:k,name:be?.name??k,...be?.sub!==void 0?{sub:be.sub}:{},...be?.icon!==void 0?{icon:be.icon}:{},color:o.get(k)??"slate",x:V-$e/2,y:te,w:$e,h:Je,cx:V,cy:te+Je/2,...xe?{ghost:!0}:{}}},R=c.map(k=>{let V=_.get(k);return I(k,S(V.col),v(V.row),!1)});for(let k of R)Pt(k,x.get(k.id),h);let W=new Map(R.map(k=>[k.id,k])),J=k=>R.some(V=>V!==k&&Math.abs(V.cx-k.cx)<.5&&V.y>k.y),Z=[],ie=R[0],de=Math.max(...R.map(k=>k.x+k.w)),ue,D=l+z+p.side.lane;if(m.length>0){let k=Le=>f.filter(Be=>Be.to===Le).flatMap(Be=>W.get(Be.from)??[]),V=m.flatMap(k),te=Math.max(l,Math.min(...V.length>0?V.map(Le=>Le.x):[l+p.side.pad])-p.side.pad),xe=te+p.side.pad+X+e*2,be=m.map(Le=>{let Be=k(Le);return{id:Le,cx:Be.length>0?Be.reduce((yt,St)=>yt+St.cx,0)/Be.length:xe}});be.sort((Le,Be)=>Le.cx-Be.cx);let $e=te;for(let{id:Le,cx:Be}of be){let yt=g.get(Le)??a.minW,St=Math.max(Be-yt/2,xe),mt=I(Le,St+yt/2,l+(z-u.h)/2,!0);R.push(mt),W.set(Le,mt);let ms=f.some(fs=>fs.from===Le&&fs.to==="finish");ms&&Z.push({kind:"finish",x:mt.x+mt.w+p.beside,y:mt.cy,r:p.end.r,ghost:!0,text:"",box:Le}),$e=ms?mt.x+mt.w+p.beside+p.end.r:mt.x+mt.w,xe=$e+e*2}let Je=Math.max($e+p.side.pad,de);ue={x:te,y:l,w:Je-te,h:z,title:r.side,notes:C}}if(ie&&Q){let k=ie.cx+p.start+p.text+pe(r.start,A.regionNote)+e,V=ue&&k<ue.x?ue.y+p.side.pad+p.start:ie.y-p.drop;Z.unshift({kind:"start",x:ie.cx,y:V,r:p.start,ghost:!1,text:r.start})}for(let k of R.filter(V=>!V.ghost&&d.some(te=>te.from===V.id&&te.to==="finish")))Z.push(J(k)?{kind:"finish",x:k.x+k.w+p.beside,y:k.cy,r:p.end.r,ghost:!1,text:r.end,box:k.id}:{kind:"finish",x:k.cx,y:k.y+k.h+p.below,r:p.end.r,ghost:!1,text:r.end,box:k.id});let me=(k,V)=>{let te=_.get(k.id),xe=_.get(V.id);if(!te||!xe)return[[k.cx,k.y+k.h],[V.cx,V.y-s]];if(te.row===xe.row&&Math.abs(te.col-xe.col)===1)return V.cx>k.cx?[[k.x+k.w,k.cy],[V.x-s,V.cy]]:[[k.x,k.cy],[V.x+V.w+s,V.cy]];if(te.row===xe.row){let $e=k.y+k.h+p.rowGap/4;return[[k.cx,k.y+k.h],[k.cx,$e],[V.cx,$e],[V.cx,V.y+V.h+s]]}if(xe.row>te.row){if(Math.abs(k.cx-V.cx)<.5)return[[k.cx,k.y+k.h],[V.cx,V.y-s]];let $e=k.y+k.h+p.rowGap/2;return[[k.cx,k.y+k.h],[k.cx,$e],[V.cx,$e],[V.cx,V.y-s]]}if(Math.abs(k.cx-V.cx)<.5)return[[k.cx,k.y],[V.cx,V.y+V.h+s]];let be=V.y+V.h+p.rowGap/2;return[[k.cx,k.y],[k.cx,be],[V.cx,be],[V.cx,V.y+V.h+s]]},ae=(k,V)=>{let te=f.filter(be=>be.to===V.id).flatMap(be=>W.get(be.from)??[]).sort((be,$e)=>be.cx-$e.cx),xe=te.findIndex(be=>be.id===k);return te.length<=1?Math.min(Math.max(te[0]?.cx??V.cx,V.x+p.side.entry),V.x+V.w-p.side.entry):V.x+p.side.entry+(V.w-p.side.entry*2)*Math.max(0,xe)/(te.length-1)},ye=k=>Q&&k===ie?k.cx+p.side.entry:k.cx,we=k=>Z.find(V=>V.kind==="finish"&&V.box===k),E=(k,V)=>{if(k==="start"){let be=Z.find(Je=>Je.kind==="start"),$e=W.get(V);return!be||!$e?[]:[[be.x,be.y+be.r],[$e.cx,$e.y-s]]}let te=W.get(k);if(!te)return[];if(V==="finish"){let be=we(k);return be?Math.abs(be.x-te.cx)<.5?[[te.cx,te.y+te.h],[te.cx,be.y-be.r-s]]:[[te.x+te.w,te.cy],[be.x-be.r-s,te.cy]]:[]}let xe=W.get(V);if(!xe)return[];if(k===V)return Et(te);if(xe.ghost&&!te.ghost){let be=ye(te),$e=ae(k,xe);return Math.abs(be-$e)<.5?[[be,te.y],[$e,xe.y+xe.h+s]]:[[be,te.y],[be,D],[$e,D],[$e,xe.y+xe.h+s]]}return te.ghost&&xe.ghost?[[te.x+te.w,te.cy],[xe.x-s,xe.cy]]:te.ghost?[[te.cx,te.y+te.h],[te.cx,D],[xe.cx,D],[xe.cx,xe.y-s]]:me(te,xe)},N=k=>{let V=k.to==="finish"?we(k.from):void 0;if(!V)return;let te=W.get(k.from);return te&&Math.abs(V.x-te.cx)<.5?[V.x-V.r-e-lt(k.carry)[0],V.y]:[V.x,V.y+V.r+e+w.carrier.tagH/2]},se=k=>{let V=k.from==="start"?Z.find(te=>te.kind==="start"):void 0;return V?[V.x-V.r-w.slot.mark-lt(k.carry)[0],V.y]:void 0},T=i.map(({step:k,event:V,edge:te})=>{let xe=N(te),be=te.carry.kind==="none"?void 0:se(te);return{step:k,event:V,from:te.from,to:te.to,points:E(te.from,te.to),color:yi(te,o),carry:te.carry,...xe?{settle:xe}:{},...be?{wait:be}:{}}});ft(T,W,x);let ee=new Map;for(let k of T){if(k.points.length!==2||!T.some($e=>$e.from===k.to&&$e.to===k.from&&$e.points.length===2))continue;let[V,te]=k.points,xe=Math.abs(te[1]-V[1])<Math.abs(te[0]-V[0]),be=(k.from<k.to?1:-1)*w.edge.parallel;k.points=k.points.map(([$e,Je])=>xe?[$e,Je+be]:[$e+be,Je]),ee.set(k,xe?be>0?"below":"above":be>0?"right":"left")}let b=f.map(k=>({from:k.from,to:k.to,points:E(k.from,k.to)})),G=(k,V,te)=>k.from===k.to?Xt(k.points):st(k.points,V,te),q=[],Y=Z.flatMap(k=>k.text===""?[]:[Ge(k.text,...Ut(k),A.regionNote)]),U=[...ht(T,t.steps.length,G).values()].map(k=>Ye(k.point)),K=[...ue?[{x:ue.x,y:ue.y,w:p.side.pad+X,h:ue.h}]:[],...Y],H=k=>[...T.map(V=>V.points),...b.map(V=>V.points)].filter(V=>V!==k);for(let k of T){let V=t.steps[k.step]?.events[k.event];if(V?.type!=="edge"||V.label===void 0)continue;let te=k.from===k.to,xe=Ct(k),be=q.filter(yt=>yt.text===V.label&&T.some(St=>St.step===yt.step&&St.event===yt.event&&Ct(St)===xe)),$e=be[be.length-1];if($e){$e.until=k.step,q.push({x:$e.x,y:$e.y,w:$e.w,h:$e.h,step:k.step,event:k.event,text:$e.text,family:$e.family,color:k.color});continue}let Je=pe(V.label,We(V.label))+w.label.padX*2,Le=te?{side:"below",base:zt(k.points,Je)}:{},Be=V.labelSide??(k.to==="finish"?"left":ee.get(k));q.push(Ze({step:k.step,event:k.event,text:V.label,points:k.points,color:k.color,...Be?{side:Be}:te?{}:{flip:!0},...Le},{hard:R,soft:[...K,...q],touch:U,lines:H(k.points)}))}let re=[];f.forEach((k,V)=>{let te=b[V];if(k.label===void 0||te.points.length===0)return;let xe=We(k.label),be=W.get(k.to)?.ghost===!0&&W.get(k.from)?.ghost!==!0,$e=te.points[0][0],Je=be?{side:"below",base:{x:$e+w.label.soft,y:D+w.label.soft},slide:Math.max(...te.points.map(([Be])=>Math.abs(Be-$e)))}:{},Le=Ze({step:-1,event:V,text:k.label,points:te.points,color:"slate",...Je},{hard:R,soft:[...K,...q,...re],touch:U,lines:H(te.points)});re.push(Le),te.label={x:Le.x,y:Le.y,w:Le.w,h:Le.h,text:k.label,family:xe.family}});let le={kind:"state",width:0,height:0,regions:[],boxes:R,lifelines:[],edges:T,labels:q,actions:[],badges:[],paths:b,ends:Z,...ue?{side:ue}:{}},Se=[...R.map(k=>k.x),...q.map(k=>k.x),...b.flatMap(k=>k.label?[k.label.x]:[])],qe=[...q.map(k=>k.y),...b.flatMap(k=>k.label?[k.label.y]:[])],Re=Math.max(0,l-Math.min(...Se)),Oe=qe.length>0?Math.max(0,l-Math.min(...qe)):0;(Re>0||Oe>0)&&Lt(le,Re,Oe);let Ie=k=>k.x+(k.text===""?k.r:p.text+pe(k.text,A.regionNote)),Ve=[...R.map(k=>k.x+k.w),...q.map(k=>k.x+k.w),...Z.map(Ie),...T.flatMap(k=>k.points.map(V=>V[0])),...b.flatMap(k=>[...k.points.map(V=>V[0]),...k.label?[k.label.x+k.label.w]:[]]),...ue?[ue.x+ue.w]:[]],Ke=[...R.map(k=>k.y+k.h),...q.map(k=>k.y+k.h),...Z.map(k=>k.y+k.r),...T.flatMap(k=>k.points.map(V=>V[1]))],gt={title:r.trail,states:c.map(k=>({box:k,color:o.get(k)??"slate"}))},dt=Math.max(Math.max(...Ve)+l,ze(t,gt)+l*2),Rt=Math.max(...Ke,v(O-1)+a.h),It=Ue(t,l,Rt+e,dt-l*2,gt);le.width=dt,le.height=(It?It.y+It.h:Rt)+l,It&&(le.strip=It);let Ar=ht(T,t.steps.length,G);return le.badges=Xe(t.steps.map((k,V)=>{let te=Ar.get(V);return te?{step:V,x:te.point[0],y:te.point[1],color:te.edge.color}:qt(k.events,V,le)})),le}function yi(t,n){return t.carry.kind==="coin"?at(t,n):n.get(t.to==="finish"?t.from:t.to)??"slate"}var Qn={};Tt(Qn,{drawTime:()=>rr,layoutTime:()=>nr,meterField:()=>ir,timeFocus:()=>or});var sn={d:86400,h:3600,min:60,s:1,ms:.001},bi=Object.keys(sn);function xi(t){let n=/^([0-9]+(?:\.[0-9]+)?)(ms|s|min|h|d)$/u.exec(t);if(!n)return{seconds:1,unit:"s"};let a=n[2];return{seconds:Number(n[1])*sn[a],unit:a}}var Zs=(t,n)=>bi.find(a=>t/sn[a]>=2-1e-9)??n,Qs=(t,n,a)=>`${Number((t/sn[n]).toFixed(2))} ${Qe[a].timeUnits[n]}`;function wi(t,n,a){let p=1;if(n)p=n*Math.max(1,Math.ceil(t/n/8));else for(let s=1;;s*=10){let r=[s,s*2,s*5].find(o=>t/o<=w.time.ticks);if(r!==void 0){p=r;break}}let l=[];for(let s=0;s<=t;s+=p)l.push(s);let e=l[l.length-1];return e!==t&&(t-e)*a>=w.time.minorPx&&l.push(t),{at:l,step:p}}function $i(t,n,a,p){let l=Array.from({length:n-1},(s,r)=>r+1).find(s=>n%s===0&&s*a>=w.time.minorPx);if(l===void 0)return[];let e=[];for(let s=l;s<t;s+=l)p.includes(s)||e.push(s);return e}function er(t){let n=0;return t.steps.map(a=>{let p=n;for(let l of a.events)l.type==="now"&&(n=Math.max(n,l.to+1));return[p,n]})}function nr(t,n="ja"){let a=w.time,{margin:p,gap:l}=w,e=w.region,s=Qe[n],r=t.time??{scale:{unit:"",length:"1s",count:1},rows:[]},{scale:o}=r,i=Math.max(1,o.count),c=xi(o.length),m=Math.max(a.width,ze(t)+p*2),f=Math.max(0,...r.rows.map(T=>pe(T.name,A.timeRow))),d=Math.max(a.axisX,p+e.inset+f+a.gutterGap),u=m-a.right-d,M=u/i,x=He(t),h=kt(t),g=[],L=[],O=[],_=[],P=new Map(r.rows.map(T=>[T.id,T])),j,$=p;if(r.zoom){let{from:T,to:ee}=r.zoom,b=ee-T+1,G=u/b,q=p,Y=Zs(ee*c.seconds,c.unit),U=[];for(let re=0;re<b;re++){let le=T+re,Se=d+re*G,qe=t.boxes.map((Oe,Ie)=>{let Ve=h.get(Oe.id),Ke=Math.max(tt(t,Oe.id,!1),vt(Ve,Oe.icon!==void 0,w.box.padX)),gt=q+a.boxTop+Ie*(w.box.h+a.boxGap),dt=P.get(Oe.id),Rt={id:Oe.id,name:Oe.name,...Oe.sub!==void 0?{sub:Oe.sub}:{},...Oe.icon!==void 0?{icon:Oe.icon}:{},color:x.get(Oe.id)??"slate",x:Se+G/2-Ke/2,y:gt,w:Ke,h:w.box.h,cx:Se+G/2,cy:gt+w.box.h/2,...dt?{row:dt.id}:{},...dt?.empty?.includes(le)?{empty:!0}:{}};return Pt(Rt,Ve),Rt});L.push(...qe);let Re=`${o.unit} ${(o.from??0)+le}${s.headJoin}${Qs(le*c.seconds,Y,n)}`;U.push({unit:le,head:Re,boxes:qe,x:Se,y:q,w:G,h:0})}let H=Math.max(q+a.boxTop,...L.map(re=>re.y+re.h))+a.zoomBottom;for(let re of U)re.h=H-q;g.push({id:"zoom",lines:[s.zoom],note:`${b} ${o.unit}`,icon:"clock",color:"blue",x:p,y:q,w:m-p*2,h:H-q,header:{x:p+e.inset,y:q+e.inset,w:Math.max(e.icon,pe(s.zoom,A.regionName)),h:e.nameY-e.inset+e.line}}),j={from:T,to:ee,frame:{x:0,y:0,w:0,h:0},guides:[],columns:U,empty:s.empty,headY:q+a.head},$=H+a.zoomGap}let S=$+a.rowsTop,y=r.rows.map((T,ee)=>({id:T.id,name:T.name,color:T.color??x.get(T.id)??bt[ee%bt.length],x:d,y:S+ee*(a.row+a.rowGap),w:u,h:a.row})),F=y.length>0?Math.max(...y.map(T=>T.y+T.h)):S,C=Math.min(a.markMax,Math.max(a.markMin,M*a.markRatio)),X=y.flatMap((T,ee)=>Array.from({length:i},(b,G)=>({row:T.id,unit:G,empty:r.rows[ee]?.empty?.includes(G)===!0,color:T.color,colors:[],x:d+(G+.5)*M-C/2,y:T.y,w:C,h:T.h})));if(t.steps.forEach((T,ee)=>T.events.forEach((b,G)=>{if(b.type==="mark")for(let q of X)q.row===b.row&&q.unit>=b.from&&q.unit<=b.to&&!q.empty&&q.colors.push({step:ee,event:G,color:b.color})})),j){let T={x:d+j.from*M-a.frame,y:S-a.frame,w:(j.to-j.from+1)*M+a.frame*2,h:F-S+a.frame*2},ee=Math.max(...j.columns.map(b=>b.y+b.h));j.frame=T,j.guides=[[[T.x,T.y],[d,ee]],[[T.x+T.w,T.y],[d+u,ee]]]}let z=F+a.point.drop,Q=(r.points??[]).map(T=>{let ee=[];t.steps.forEach((K,H)=>K.events.forEach((re,le)=>{re.type==="swap"&&re.box===T.id&&ee.push({step:H,event:le,text:re.text,...re.color?{color:re.color}:{}})}));let b=d+(T.at+.5)*M,G=b+a.point.text,q=Math.max(pe(T.id,A.pointName),...ee.map(K=>pe(K.text,A.pointState))),Y=z+a.point.nameY-A.pointName.size*.8,U=z+a.point.stateY+A.pointState.size*.2;return{id:T.id,unit:T.at,cx:b,cy:z,r:a.point.r,text:{x:G,y:Y,w:q,h:U-Y},changes:ee}}),B=new Map(Q.map(T=>[T.id,T])),v=(T,ee)=>B.get(T)?.changes.filter(G=>G.step<=ee&&G.color).at(-1)?.color;t.steps.forEach((T,ee)=>T.events.forEach((b,G)=>{if(b.type!=="edge")return;if(b.at===void 0){let U=B.get(b.from),K=B.get(b.to);if(!U||!K||U===K)return;let H=K.cx>U.cx,re=H?Math.max(U.cx+U.r,U.text.x+U.text.w+a.point.link):U.cx-U.r-a.point.end,le=H?K.cx-K.r-a.point.end:Math.min(K.cx-K.r,K.text.x+K.text.w+a.point.link),Se={step:ee,event:G,from:b.from,to:b.to,points:[[re,U.cy],[le,K.cy]],color:b.carry.kind==="coin"?"coin":v(b.to,ee)??"slate",carry:b.carry};b.carry.kind!=="none"&&(Se.settle=[le-(H?1:-1)*(w.carrier.coinR+w.edge.arrow),K.cy]),O.push(Se);return}let q=ki(b,j);if(!q)return;let Y={step:ee,event:G,from:b.from,to:b.to,points:q.points,color:at(b,x),carry:b.carry};vi(Y,q.from,q.to,h),O.push(Y),_.push({step:ee,event:G,from:q.from,to:q.to,column:b.at,into:b.into??b.at})}));let I={kind:"time",width:m,height:0,regions:g,boxes:L,lifelines:[],edges:O,labels:[],actions:[],badges:[],paths:[],ends:[],axis:{x:d,w:u,unit:M,count:i,line:0},rows:y,marks:X,ticks:[],minor:[],periods:[],points:Q,...j?{zoom:j}:{},spans:[],wires:_,needle:{y1:S-a.needle.over,y2:F+a.needle.over}},R=F,W=t.steps.some(T=>T.events.some(ee=>ee.type==="edge"&&ee.at===void 0&&ee.label!==void 0)),{r:J,inset:Z}=w.badge,ie=Q.length>0?z+a.point.r+(W?a.point.room:a.point.plain):R+(J+Z)*2,de=[],ue=t.steps.flatMap((T,ee)=>T.events.flatMap((b,G)=>b.type==="span"?[{s:ee,e:G,event:b}]:[]));for(let{s:T,e:ee,event:b}of ue){let G=b.shape==="box"?"box":"bracket",q=ue.find(re=>re.s>T&&(re.event.shape==="box"?"box":"bracket")===G&&re.event.from<=b.to&&b.from<=re.event.to),Y=b.color??"slate",U=d+b.from*M,K=d+(b.to+1)*M,H={step:T,event:ee,kind:G,from:b.from,to:b.to,text:b.text,color:Y,...q?{until:q.s}:{}};if(G==="box"){let re=a.box,le={x:U-re.pad,y:S-re.pad,w:K-U+re.pad*2,h:F-S+re.pad*2},Se=pe(b.text,A.tag)+re.tagPadX*2,qe={x:le.x+re.tagX,y:le.y-re.tagH/2,w:Se,h:re.tagH};de.push({...H,...le,textRect:qe,textY:le.y+w.baseline.tag})}else de.push({...H,x:U,y:0,w:K-U,h:a.bracket.tick,textRect:{x:0,y:0,w:0,h:0},textY:0})}I.spans=de,I.badges=tr(t,I,er(t)),I.labels=Si(t,I),ie=Math.max(ie,...I.labels.map(T=>T.y+T.h+w.label.soft));let D=[];for(let T of de.filter(ee=>ee.kind==="bracket")){let ee=pe(T.text,A.spanText),b=Math.min(d+u-ee/2,Math.max(d+ee/2,T.x+T.w/2)),G={x:Math.min(T.x,b-ee/2),w:Math.max(T.x+T.w,b+ee/2)-Math.min(T.x,b-ee/2)},q=U=>{let K=U.until===void 0||U.until>T.step,H=Math.min(U.x,U.textRect.x),re=Math.max(U.x+U.w,U.textRect.x+U.textRect.w)-H;return K&&G.x<H+re&&H<G.x+G.w},Y=D.findIndex(U=>!U.some(q));Y<0&&(D.push([]),Y=D.length-1),D[Y].push(T),T.y=ie+a.bracket.gap+Y*a.bracket.lane,T.textY=T.y+a.bracket.tick+a.bracket.text,T.textRect=Ge(T.text,b,T.textY,A.spanText,"middle")}D.length>0&&(ie=Math.max(...de.filter(T=>T.kind==="bracket").map(T=>T.textRect.y+T.textRect.h)));let me=ie+a.axisGap;I.axis.line=me;let ae=wi(i,r.period?.length,M),ye=me+a.tickY,we=Zs(i*c.seconds,c.unit);I.ticks=ae.at.map(T=>{let ee=Qs(T*c.seconds,we,n),b=pe(ee,A.timeTick),G=d+T*M,q=T===0?G:T===i?G-b:Math.min(d+u-b,Math.max(d,G-b/2));return{at:T,x:G,text:ee,left:q,y:ye}}),I.minor=$i(i,ae.step,M,ae.at);let E=ye+A.timeTick.size*.2;if(r.period){let T=r.period,ee=[];for(let q=0,Y=0;Y<i;q++,Y+=T.length){let U=Math.min(i,Y+T.length)-1,K=`${T.name} ${(T.from??0)+q}`,H=(o.from??0)+Y,re=`${o.unit} ${s.range(String(H),String((o.from??0)+U))}`;ee.push({index:q,from:Y,to:U,name:K,range:re,x:d+Y*M,y:me,w:(U-Y+1)*M,h:0,nameY:ye,rangeY:ye+a.rangeY})}let b=I.ticks.map(q=>Ge(q.text,q.left,q.y,A.timeTick)),G=ee.some(q=>{let Y=Ge(q.name,q.x+q.w/2,q.nameY,A.timePeriod,"middle");return b.some(U=>Y.x<U.x+U.w+a.nameGap&&U.x<Y.x+Y.w+a.nameGap)});for(let q of ee)G&&(q.nameY=ye+a.rangeY+2,q.rangeY=q.nameY+a.rangeY),q.h=q.rangeY+A.timeRange.size*.2-me;I.periods=ee,E=Math.max(E,...ee.map(q=>q.rangeY+A.timeRange.size*.2))}let N=E+a.bottom;g.push({id:"axis",lines:[],color:"slate",x:p,y:$,w:m-p*2,h:N-$,header:{x:p+e.inset,y:$+e.inset,w:0,h:0}});let se=Ue(t,p,N+l,m-p*2);return se&&(I.strip=se),I.height=(se?se.y+se.h:N)+p,I.badges=tr(t,I,er(t)),I}function ki(t,n){if(!n||t.at===void 0)return;let a=t.into??t.at,p=n.columns.find(d=>d.unit===t.at),l=n.columns.find(d=>d.unit===a),e=p?.boxes.find(d=>d.id===t.from),s=l?.boxes.find(d=>d.id===t.to);if(!p||!l||!e||!s||e===s)return;let r=p.boxes.indexOf(e),o=l.boxes.indexOf(s),i=o>r;if(p===l){if(Math.abs(o-r)===1)return{from:e,to:s,points:[[e.cx,i?e.y+e.h+1:e.y-1],[s.cx,i?s.y-1:s.y+s.h+1]]};let d=Math.min(p.x+p.w-w.gap,Math.max(e.x+e.w,s.x+s.w)+w.gap);return{from:e,to:s,points:[[e.x+e.w+1,e.cy],[d,e.cy],[d,s.cy],[s.x+s.w+1,s.cy]]}}let c=l.x>p.x;if(r===o)return{from:e,to:s,points:[[c?e.x+e.w+1:e.x-1,e.cy],[c?s.x-1:s.x+s.w+1,s.cy]]};let m=e.cx+(c?1:-1)*e.w/4,f=s.cx-(c?1:-1)*s.w/4;return{from:e,to:s,points:[[m,i?e.y+e.h+1:e.y-1],[f,i?s.y-1:s.y+s.h+1]]}}function vi(t,n,a,p){let l={...t};ft([l],new Map([[t.to,a]]),p);let e={...t};ft([e],new Map([[t.from,n]]),p),l.settle&&(t.settle=l.settle),e.wait&&(t.wait=e.wait)}function tr(t,n,a){let{r:p,inset:l}=w.badge,{axis:e}=n,s=[],r=[],o=Math.min(...n.rows.map(m=>m.y),n.needle.y1+w.time.needle.over),i=Math.max(...n.rows.map(m=>m.y+m.h),o),c=n.points[0]?(i+n.points[0].cy-n.points[0].r)/2:i+p+l;return t.steps.forEach((m,f)=>{let d=(g,L)=>{s.push(g),r.push({step:f,x:g[0],y:g[1],color:L})},u=n.edges.filter(g=>g.step===f).sort((g,L)=>g.event-L.event)[0];if(u){let g=u.carry.kind!=="none"&&!u.wait?[u.points[0]]:[],L=n.edges.filter(O=>O!==u).map(O=>O.points);d(st(u.points,[...s,...g],L),u.color);return}let[M,x]=a[f]??[0,0];if(x>M){let g=e.x+(M+x)/2*e.unit,L=n.points.find(O=>Math.abs(O.cx-g)<p+l);L&&(g=L.cx+p+l*2),d([g,c],"slate");return}for(let g of m.events){let L=Pi(g,f,n);if(L){d(L.at,L.color);return}}if(n.strip&&m.events.some(g=>g.type==="strip")){r.push({step:f,x:n.strip.x+l,y:n.strip.y+l,color:"slate"});return}let h=r[r.length-1];r.push(h?{...h,step:f}:{step:f,x:e.x-p-l,y:o,color:"slate"})}),Xe(r)}function Pi(t,n,a){let{r:p,inset:l}=w.badge;if(t.type==="span"){let e=a.spans.find(s=>s.step===n&&s.from===t.from&&s.to===t.to&&s.text===t.text);return e?e.kind==="box"?{at:[e.x,e.y],color:e.color}:{at:[e.x-p-l,e.y+e.h/2],color:e.color}:void 0}if(t.type==="swap"){let e=a.points.find(s=>s.id===t.box);if(e)return{at:[e.cx-e.r-l-p,e.cy],color:t.color??"slate"}}if(t.type==="mark"){let e=a.rows.find(r=>r.id===t.row),s=Math.min(...a.rows.map(r=>r.y));if(e)return{at:[a.axis.x+(t.from+t.to+1)/2*a.axis.unit,s-p-l],color:t.color}}}function Si(t,n){let a=[],p=n.points.map(s=>({x:s.cx-s.r,y:s.cy-s.r,w:s.r*2,h:s.r*2})),l=n.points.map(s=>s.text),e=(n.zoom?.columns??[]).map(s=>Ge(s.head,s.x+s.w/2,n.zoom?.headY??0,A.timeHead,"middle"));for(let s of n.edges){let r=t.steps[s.step]?.events[s.event];if(r?.type!=="edge"||r.label===void 0)continue;let o=n.badges.filter(c=>c.step<=s.step).map(c=>Ye([c.x,c.y])),i=r.labelSide??(r.at===void 0?"below":void 0);a.push(Ze({step:s.step,event:s.event,text:r.label,points:s.points,color:s.color,...i?{side:i}:{},flip:r.at!==void 0},{hard:[...p,...n.boxes],soft:[...l,...e,...a.filter(c=>c.step===s.step)],touch:o}))}return a}var ce=t=>Math.round(t*100)/100,Mt=(t,n)=>De(n)?`${t} ${t}j`:t;function sr(t){let n=[];for(let a of t){let p=n[n.length-2],l=n[n.length-1];if(p&&l){let e=l[0]===p[0]?Number.NaN:(l[1]-p[1])/(l[0]-p[0]),s=a[0]===l[0]?Number.NaN:(a[1]-l[1])/(a[0]-l[0]);Number.isFinite(e)&&Number.isFinite(s)&&Math.abs(e-s)<1e-9?n[n.length-1]=a:n.push(a)}else n.push(a)}return n}function Zn(t,n){let a=t[0];if(!a)return 0;if(n<=a[0])return a[1];for(let p=1;p<t.length;p++){let[l,e]=t[p],[s,r]=t[p-1];if(n<=l)return l===s?e:r+(e-r)*(n-s)/(l-s)}return t[t.length-1][1]}function rr(t,n,a,p,l){let{m:e,ink:s}=p,r=w.time,{axis:o}=t,i=new Map((a.units??[]).map(v=>[v.unit,v.passed])),c=(v,I)=>a.events.find(R=>R.step===v&&R.event===I)?.at,m=(v,I)=>a.edges.find(R=>R.step===v&&R.event===I)?.drawn,f=[],d=[],u=[],M=[],x=Math.min(...t.rows.map(v=>v.y)),h=Math.max(...t.rows.map(v=>v.y+v.h)),g=new Map;for(let v of t.wires){let I=m(v.step,v.event);I!==void 0&&g.set(v.to,Math.min(g.get(v.to)??Number.POSITIVE_INFINITY,I))}let L=(v,I)=>{let R=t.zoom?.columns.find(J=>J.unit===I)?.boxes.find(J=>J.id===v),W=[i.get(I),R?g.get(R):void 0].filter(J=>J!==void 0);return W.length>0?Math.min(...W):void 0};for(let v of t.periods)v.index%2===1&&f.push(`<rect class="dg-tm-ep" x="${ce(v.x)}" y="${ce(x-r.shade)}" width="${ce(v.w)}" height="${ce(h-x+r.shade*2)}" rx="4"/>`);if(t.zoom){let v=t.zoom;v.columns.forEach((I,R)=>{R>0&&f.push(`<line class="dg-tm-sep" x1="${ce(I.x)}" y1="${ce(I.y+r.sep)}" x2="${ce(I.x)}" y2="${ce(I.y+I.h-r.sep)}"/>`),f.push(Me(s,Mt("dg-tm-hd",I.head),I.x+I.w/2,v.headY,I.head,A.timeHead,Ce,"middle"));for(let W of I.boxes)u.push(O(W,I.unit))})}function O(v,I){let R=[...new Set(t.wires.filter(ie=>ie.from===v||ie.to===v).map(ie=>ie.step))].sort((ie,de)=>ie-de),W=ie=>`<rect class="${ie}" x="${ce(v.x)}" y="${ce(v.y)}" width="${ce(v.w)}" height="${v.h}" rx="${w.box.radius}"/>`;if(v.empty){let ie=i.get(I),de=t.zoom?.empty??"",ue=ie===void 0?"":`<g class="dg-a" style="${e.vis(ie)}">${W("dg-tm-ex")}${Me(s,"dg-tm-ext",v.cx,v.cy+w.baseline.mark,de,A.emptyText,[[ie,Number.POSITIVE_INFINITY]],"middle")}</g>`;return`<g data-empty="${ve(v.id)}">${W("dg-tm-ph")}${ue}</g>`}let J=Zt(n.boxes.find(ie=>ie.id===v.id)?.link,tn(v,p,R,l.get(v.id)??[]));if(!v.row)return J;let Z=L(v.row,I);return Z===void 0?W("dg-tm-ph"):`<g class="dg-a" style="${e.until(Z)}">${W("dg-tm-ph")}</g><g class="dg-popc dg-a" style="${e.pop(Z)}">${J}</g>`}for(let v of t.rows){let I=[];for(let R of t.marks.filter(W=>W.row===v.id)){let W=(Z,ie="")=>`<rect class="${Z}" x="${ce(R.x)}" y="${ce(R.y)}" width="${ce(R.w)}" height="${ce(R.h)}" rx="${r.markRadius}"${ie}/>`;if(I.push(W("dg-tm-slot")),R.empty){let Z=i.get(R.unit);Z!==void 0&&I.push(`<circle class="dg-tm-x dg-a" cx="${ce(R.x+R.w/2)}" cy="${ce(R.y+R.h/2)}" r="${r.emptyR}" style="${e.vis(Z,e.last,{f:.2})}"/>`);continue}let J=L(v.id,R.unit);J!==void 0&&I.push(W("dg-tm-m dg-a",` style="${e.vis(J,e.last,{f:.2})}"`)),R.colors.forEach((Z,ie)=>{let de=c(Z.step,Z.event);if(de===void 0)return;let ue=R.colors[ie+1],D=ue?c(ue.step,ue.event):void 0;I.push(`<g style="${ke(Z.color)}">${W("dg-tm-m dg-a",` style="${e.vis(de,D??e.last,{f:.35})}"`)}</g>`)})}f.push(`<g data-row="${ve(v.id)}" style="${ke(v.color)}">${I.join("")}</g>`),f.push(Me(s,"dg-tm-rn",w.margin+w.region.inset,v.y+v.h/2+w.baseline.mark,v.name,A.timeRow))}if(t.zoom){let v=t.zoom,I=t.spans.filter(J=>J.kind==="box"&&J.from<=v.to&&v.from<=J.to).map(J=>c(J.step,J.event)).filter(J=>J!==void 0).sort((J,Z)=>J-Z)[0],R=v.guides.map(J=>`<path class="dg-tm-gd" d="${it(J)}"/>`).join(""),W=`<rect class="dg-tm-fr" x="${ce(v.frame.x)}" y="${ce(v.frame.y)}" width="${ce(v.frame.w)}" height="${ce(v.frame.h)}" rx="4"/>${R}`;f.push(I===void 0?W:`<g class="dg-a" style="${e.until(I)}">${W}</g>`)}let _=v=>ce(o.x+v*o.unit),P=t.ticks.map(v=>`M ${_(v.at)} ${ce(o.line-r.major/2)} V ${ce(o.line+r.major/2)}`),j=t.minor.map(v=>`M ${_(v)} ${ce(o.line-r.minor/2)} V ${ce(o.line+r.minor/2)}`);f.push(`<path class="dg-tm-ax" d="M ${_(0)} ${ce(o.line)} H ${_(o.count)} ${[...P,...j].join(" ")}"/>`);for(let v of t.ticks)f.push(Me(s,Mt("dg-tm-tk",v.text),v.left,v.y,v.text,A.timeTick));for(let v of t.periods)f.push(Me(s,Mt("dg-tm-en",v.name),v.x+v.w/2,v.nameY,v.name,A.timePeriod,Ce,"middle")),f.push(Me(s,Mt("dg-tm-er",v.range),v.x+v.w/2,v.rangeY,v.range,A.timeRange,Ce,"middle"));for(let v of t.spans){let I=c(v.step,v.event);if(I===void 0)continue;let R=v.until===void 0?void 0:a.steps[v.until].start,W=[[I,R??Number.POSITIVE_INFINITY]],J=R===void 0?e.vis(I):e.vis(I,R,{within:!0});if(v.kind==="bracket"){let[ie,de,ue,D]=[ce(v.x+1),ce(v.x+v.w-1),ce(v.y),ce(v.y+v.h)],me=Me(s,Mt("dg-tm-bt",v.text),v.textRect.x+v.textRect.w/2,v.textY,v.text,A.spanText,W,"middle");f.push(`<g class="dg-a" data-span="${v.step}" style="${ke(v.color)};${J}"><path class="dg-tm-br" d="M ${ie} ${ue} L ${ie} ${D} L ${de} ${D} L ${de} ${ue}"/>${me}</g>`);continue}f.push(`<g class="dg-a" data-span="${v.step}" style="${ke(v.color)};${J}"><rect class="dg-tm-bx" x="${ce(v.x)}" y="${ce(v.y)}" width="${ce(v.w)}" height="${ce(v.h)}" rx="6"/></g>`);let Z=v.textRect;s.push({text:v.text,rect:Z,shown:W,boxed:!0}),M.push(`<g class="dg-tg dg-popc dg-a" style="${ke(v.color)};${R===void 0?e.pop(I):e.pop(I,R)}"><rect x="${ce(Z.x)}" y="${ce(Z.y)}" width="${ce(Z.w)}" height="${Z.h}" rx="${Z.h/2}"/><text x="${ce(Z.x+Z.w/2)}" y="${ce(v.textY)}" text-anchor="middle">${ve(v.text)}</text></g>`)}let $=r.point;for(let v of t.points){let{cx:I,cy:R,r:W}=v,J=v.changes.map(ye=>c(ye.step,ye.event)??Number.POSITIVE_INFINITY),Z=J[0];f.push(`<path class="dg-tm-con" d="M ${ce(I)} ${ce(h+3)} L ${ce(I)} ${ce(R-W-2)}"/>`);let ie=v.text.x,de=Me(s,Mt("dg-tm-pn",v.id),ie,R+$.nameY,v.id,A.pointName),ue=de.replace(/class="([^"]*)"/u,'class="$1 dg-tm-pn-g"'),D=Z===void 0||!Number.isFinite(Z)?ue:`<g class="dg-a" style="${e.until(Z)}">${ue}</g><g class="dg-a" style="${e.vis(Z)}">${de}</g>`,me=v.changes.map((ye,we)=>{let E=J[we];if(!Number.isFinite(E))return"";let N=J[we+1],se=N!==void 0&&Number.isFinite(N)?N-oe.untilFade:void 0,T=Me(s,Mt("dg-tm-ps",ye.text),ie,R+$.stateY,ye.text,A.pointState,[[E,se??Number.POSITIVE_INFINITY]]);return`<g class="dg-a" style="${ke(ye.color??"slate")};${se===void 0?e.rise(E):e.rise(E,se)}">${T}</g>`}).join(""),ae=v.changes.map((ye,we)=>{let E=J[we];return!ye.color||!Number.isFinite(E)?"":`<g class="dg-popc dg-a" style="${ke(ye.color)};${e.pop(E)}"><circle class="dg-tm-pc" cx="${ce(I)}" cy="${ce(R)}" r="${W+.5}"/>${rt("flag",I,R,$.glyph,"dg-tm-pcg")}</g>`}).join("");u.push(`<g data-point="${ve(v.id)}"><circle class="dg-tm-pg" cx="${ce(I)}" cy="${ce(R)}" r="${W}"/>${rt("flag",I,R,$.glyph,"dg-tm-pgl")}${ae}${D}${me}</g>`)}let S=new Set(t.wires.map(v=>`${v.step}/${v.event}`));for(let v of t.edges){if(S.has(`${v.step}/${v.event}`))continue;let I=a.edges.find(J=>J.step===v.step&&J.event===v.event);if(!I)continue;p.traces.push({from:v.from,to:v.to,points:v.points,shown:[[I.start,Number.POSITIVE_INFINITY]]});let R=e.kf([[0,{opacity:0,"stroke-dashoffset":1}],[I.start,{opacity:0,"stroke-dashoffset":1},fe.inOut],[I.start+.05,{opacity:1}],[I.drawn,{"stroke-dashoffset":0}],[e.last,{opacity:1,"stroke-dashoffset":0},fe.inOut],[e.total,{opacity:0,"stroke-dashoffset":0}]]),W=e.kf([[0,{opacity:0}],[I.drawn-.05,{opacity:0}],[I.drawn,{opacity:1}],[e.last,{opacity:1},fe.inOut],[e.total,{opacity:0}]]);d.push(`<g data-link="${ve(`${v.from}->${v.to}`)}" style="${ke(v.color)}"><path class="dg-tm-ln dg-a" pathLength="1" d="${it(v.points)}" style="${R}"/><path class="dg-eh-on dg-a" d="${At(v.points)}" style="${W}"/></g>`)}let y=a.needle??[],F=sr(y.filter(([v])=>v<e.total)),C=F[F.length-1]?.[1]??0,X=[...F.map(([v,I])=>[v,o.x+I*o.unit,0]),[e.last,o.x+C*o.unit,0],[e.total,o.x,0]],{y1:z,y2:Q}=t.needle,B=r.needle;return M.push(`<g class="dg-a" data-needle="" style="${e.move(X)}"><line class="dg-tm-nd" x1="0" y1="${ce(z)}" x2="0" y2="${ce(Q)}"/><path class="dg-tm-nh" d="M ${-B.head*.75} ${ce(z-B.head)} L ${B.head*.75} ${ce(z-B.head)} L 0 ${ce(z)} Z"/><circle class="dg-tm-nh" cy="${ce(o.line)}" r="${B.dot}"/></g>`),{base:f.join(""),lit:d.join(""),node:u.join(""),top:M.join("")}}function ir(t,n,a){let{m:p}=a,l=w.time.meter,{x:e,w:s,line:r,text:o}=t.meter,i=t.y+l.y,c=p.kf([...sr(n).map(([f,d])=>[f,{transform:`scaleX(${ce(d*1e3)/1e3})`}]),[p.last,{transform:`scaleX(${ce(Zn(n,p.last)*1e3)/1e3})`},fe.inOut],[p.total,{transform:"scaleX(0)"}]]),m=e+s*r;return`<rect class="dg-tm-mt" x="${ce(e)}" y="${ce(i)}" width="${ce(s)}" height="${l.h}" rx="${l.h/2}"/><rect class="dg-tm-mf dg-a" x="${ce(e)}" y="${ce(i)}" width="${ce(s)}" height="${l.h}" rx="${l.h/2}" style="${ke(l.color)};${c}"/><line class="dg-tm-mk" x1="${ce(m)}" y1="${ce(i-l.mark)}" x2="${ce(m)}" y2="${ce(i+l.h+l.mark)}"/>`+Me(a.ink,"dg-tm-ml",m,t.y+l.textY,o,A.meterLine,Ce,"middle")}function or(t,n,a,p,l,e){let s=n.steps[a],r=Zn(n.needle??[],s.end-oe.still),o=t.badges.find(h=>h.step===a),c=o&&Zn(n.needle??[],s.start)===r&&!(t.strip&&o.y>=t.strip.y)?o.x:t.axis.x+r*t.axis.unit,m=Math.min(...t.rows.map(h=>h.y)),f=Math.max(...t.rows.map(h=>h.y+h.h)),d={x:c-1,y:m,w:2,h:f-m},u=h=>Math.hypot(Math.max(0,h.x-c,c-h.x-h.w),Math.max(0,h.y-m,m-h.y-h.h)),M=t.points.filter(h=>h.changes.some(g=>g.step===a)).map(h=>({x:h.cx-h.r,y:h.cy-h.r,w:h.text.x+h.text.w-h.cx+h.r,h:h.r*2})),x=[...o?[{x:o.x-w.badge.r,y:o.y-w.badge.r,w:w.badge.r*2,h:w.badge.r*2}]:[],...[...p,...M].sort((h,g)=>u(h)-u(g))];for(let h of x){let g=Math.min(d.x,h.x),L=Math.min(d.y,h.y),O={x:g,y:L,w:Math.max(d.x+d.w,h.x+h.w)-g,h:Math.max(d.y+d.h,h.y+h.h)-L};O.w<=l&&O.h<=e&&(d=O)}return d}var es={};Tt(es,{drawTree:()=>pr,layoutTree:()=>lr});function Mi(t){let n=new Set(t.boxes.map(e=>e.id)),a=new Set,p=new Map,l=[];return t.steps.forEach((e,s)=>{e.events.forEach((r,o)=>{if(r.type!=="leaf"&&r.type!=="node"||a.has(r.id)||n.has(r.id))return;let i=r.type==="node"?[...new Set(r.children)].filter(c=>a.has(c)&&!p.has(c)):[];for(let c of i)p.set(c,r.id);l.push({id:r.id,kind:r.type,children:i,step:s,event:o,...r.hash!==void 0?{hash:r.hash}:{}}),a.add(r.id)})}),{grown:l,parents:p}}function Oi(t,n){return t.hash===void 0?[{text:t.id,style:A.boxName}]:n?[{text:t.id,style:A.rootName},{text:t.hash,style:A.rootHash}]:t.kind==="leaf"?[{text:t.hash,style:A.treeHash}]:[{text:t.hash,style:A.treeHash},{text:t.id,style:A.treeName}]}function Ti(t,n){let a=w.edge.inset,p=Math.max(t.y,n.y),l=Math.min(t.y+t.h,n.y+n.h);if(l>p){let i=(p+l)/2;return n.x>=t.x+t.w?[[t.x+t.w+a,i],[n.x-a,i]]:[[t.x-a,i],[n.x+n.w+a,i]]}let e=Math.max(t.x,n.x),s=Math.min(t.x+t.w,n.x+n.w);if(s>e){let i=(e+s)/2;return n.y>=t.y+t.h?[[i,t.y+t.h+a],[i,n.y-a]]:[[i,t.y-a],[i,n.y+n.h+a]]}let r=t.x+t.w/2,o=n.y+n.h/2;return[[r,n.y>t.y?t.y+t.h+a:t.y-a],[r,o],[n.x>r?n.x-a:n.x+n.w+a,o]]}function lr(t){let{margin:n,gap:a,box:p,tree:l,badge:e}=w,{grown:s,parents:r}=Mi(t),o=s.filter(N=>!r.has(N.id)),i=o[o.length-1]?.id,c=new Map(s.map(N=>[N.id,N])),m=new Map,f=(N,se)=>{m.set(N,se);for(let T of c.get(N)?.children??[])f(T,se+1)};for(let N of o)f(N.id,0);let d=new Map(s.map(N=>[N.id,Oi(N,N.id===i)])),u=N=>Math.max(0,...(d.get(N)??[]).map(se=>pe(se.text,se.style))),M=N=>N.id===i?Math.max(l.root.w,l.root.textX+u(N.id)+l.root.padR):Math.max(l.w,u(N.id)+l.padX*2),x=N=>Math.max(l.card.minW,l.card.padX*2+l.card.icon+l.card.gap+pe(N.id,A.treeCard)),h=N=>N.kind==="leaf"&&N.hash!==void 0,g=s.filter(N=>N.children.length===0),L=Math.max(...s.filter(N=>N.id!==i||N.children.length===0).map(N=>Math.max(M(N),h(N)?x(N):0)),l.w)+l.slotGap,O=n+e.r*2+e.inset,_=new Map;g.forEach((N,se)=>_.set(N.id,O+L*(se+.5)));let P=N=>{let se=_.get(N);if(se!==void 0)return se;let T=c.get(N)?.children??[],ee=(P(T[0])+P(T[T.length-1]))/2;return _.set(N,ee),ee},j=n+l.top,$=N=>j+l.root.h/2+N*l.row,S=He(t),y=s.map(N=>{let se=N.id===i,T=m.get(N.id)??0,ee=P(N.id),b=$(T),G=M(N),q=se?l.root.h:l.h,Y=d.get(N.id)??[],U=Y.length===1?[b+l.oneY]:se?[b+l.root.nameY,b+l.root.hashY]:[b+l.hashY,b+l.nameY],K=r.get(N.id),H=se?l.rootColor:l.color;S.set(N.id,H);let re=x(N);return{id:N.id,kind:N.kind,depth:T,...K!==void 0?{parent:K}:{},children:N.children,step:N.step,event:N.event,...N.hash!==void 0?{hash:N.hash}:{},root:se,x:ee-G/2,y:b-q/2,w:G,h:q,cx:ee,cy:b,color:H,lines:Y.map(le=>le.text),baselines:U,styles:Y.map(le=>le.style),...h(N)?{card:{x:ee-re/2,y:b+l.card.drop-l.card.h/2,w:re,h:l.card.h,text:N.id}}:{}}}),F=new Map(y.map(N=>[N.id,N])),C=y.flatMap(N=>N.children.flatMap(se=>{let T=F.get(se);if(!T)return[];let ee=(T.y+N.y+N.h)/2,b=[[T.cx,T.y-w.edge.inset],[T.cx,ee],[N.cx,ee],[N.cx,N.y+N.h+w.edge.inset]];return[{from:T.id,to:N.id,step:N.step,event:N.event,points:b}]})),X=kt(t),z=Math.max(O,...y.flatMap(N=>[N.x+N.w,...N.card?[N.card.x+N.card.w]:[]])),Q=y.find(N=>N.root),B=new Set(t.boxes.map(N=>N.id)),v=$t(t).flatMap(({edge:N})=>N.label!==void 0&&(B.has(N.from)||B.has(N.to))?[pe(N.label,We(N.label))+w.label.padX*2]:[]),I=Math.max(z+l.boxGap,(Q?Q.x+Q.w:O)+Math.max(0,...v)+a*2),R=Q?.y??j,W=t.boxes.map(N=>{let se=Math.max(tt(t,N.id,!0),vt(X.get(N.id),N.icon!==void 0,p.padX)),T=R;R+=p.h+a;let ee={id:N.id,name:N.name,...N.sub!==void 0?{sub:N.sub}:{},...N.icon!==void 0?{icon:N.icon}:{},color:S.get(N.id)??"slate",x:I,y:T,w:se,h:p.h,cx:I+se/2,cy:T+p.h/2};return Pt(ee,X.get(N.id)),ee}),J=new Map(W.map(N=>[N.id,N])),Z=[],ie=t.steps.flatMap((N,se)=>N.events.flatMap((T,ee)=>{if(T.type!=="edge")return[];let b=F.get(T.from)??J.get(T.from),G=F.get(T.to)??J.get(T.to);if(!b||!G)return[];let q=C.find(H=>H.from===T.from&&H.to===T.to),Y=C.find(H=>H.from===T.to&&H.to===T.from),U=q??Y;U&&Z.push({step:se,event:ee,link:U.from});let K=q?q.points:Y?[...Y.points].reverse():T.from===T.to?Et({cx:b.x+b.w/2,y:b.y,h:b.h}):Ti(b,G);return[{step:se,event:ee,from:T.from,to:T.to,points:K,color:at(T,S),carry:T.carry}]}));ft(ie,J,X);let de={kind:"tree",width:0,height:0,regions:[],boxes:W,lifelines:[],edges:ie,labels:[],actions:[],badges:[],paths:[],ends:[],nodes:y,links:C,runs:Z};de.badges=ar(t,de),de.labels=Li(t,de);let ue=y.flatMap(N=>N.card?[N.card]:[]),D=[...y,...ue,...W,...de.labels],me=ie.flatMap(N=>N.points),ae=Math.max(...D.map(N=>N.x+N.w),...me.map(([N])=>N),O),ye=Math.max(...D.map(N=>N.y+N.h),...me.map(([,N])=>N),j),we=Math.max(ae+n,ze(t)+n*2),E=Ue(t,n,ye+a,we-n*2);return de.width=we,de.height=(E?E.y+E.h:ye)+n,E&&(de.strip=E),de.badges=ar(t,de),de}function ar(t,n){let{r:a,inset:p}=w.badge,l=a*2+p,e=[],s=[],r=[...n.nodes,...n.nodes.flatMap(m=>m.card?[m.card]:[]),...n.boxes],o=m=>e.every(([f,d])=>Math.hypot(m[0]-f,m[1]-d)>=l)&&r.every(f=>wt(Ye(m),f)>=w.label.touch),i=(m,f,d)=>{e.push(f),s.push({step:m,x:f[0],y:f[1],color:d})},c=new Map;return t.steps.forEach((m,f)=>{let d=m.events.findIndex(O=>O.type==="leaf"||O.type==="node"||O.type==="edge"),u=m.events[d],M=n.nodes.find(O=>O.step===f&&O.event===d);if(u&&u.type!=="edge"&&M){let O=[[M.x-p-a,M.cy],[M.x,M.y],[M.x+M.w+p+a,M.cy],[M.x+M.w,M.y]];i(f,O.find(o)??O[0],M.color);return}let x=n.edges.find(O=>O.step===f&&O.event===d);if(u?.type==="edge"&&x){let O=[x.from,x.to].sort().join(`
|
|
2
|
+
`),_=n.runs.some($=>$.step===f&&$.event===d),P=n.edges.filter($=>$!==x).map($=>$.points),j=c.get(O)??(_?Ni(x.points,o):Ei(x,o))??st(x.points,e,P);c.set(O,j),i(f,j,x.color);return}let h=m.events.flatMap(O=>O.type==="swap"||O.type==="action"?[O.box]:[]).flatMap(O=>n.boxes.filter(_=>_.id===O))[0];if(h){s.push({step:f,x:h.x,y:h.y,color:h.color});return}if(n.strip&&m.events.some(O=>O.type==="strip")){s.push({step:f,x:n.strip.x+p,y:n.strip.y+p,color:"slate"});return}let g=s[s.length-1],L=n.nodes.find(O=>O.root);s.push(g?{...g,step:f}:{step:f,x:L?.x??w.margin,y:L?.y??w.margin,color:L?.color??"slate"})}),Xe(s)}function Ni(t,n){let[a,p,l]=t,e=Math.abs(l[0]-p[0]),{r:s,inset:r}=w.badge;if(e>=w.tree.badgeAlong+s){let i=et(t,ut([a,p])+w.tree.badgeAlong);if(n(i))return i}let o=[p[0]+s+r,p[1]];return n(o)?o:void 0}function Ei(t,n){let a=ut(t.points),p=lt(t.carry)[0]+w.badge.r+w.badge.inset;for(let l=0;l<=a/2-p;l+=1)for(let e of[a/2-l,a/2+l]){let s=et(t.points,e);if(n(s))return s}}function Li(t,n){let a=[],p=n.nodes.flatMap(l=>l.card?[l.card]:[]);for(let l of n.edges){let e=t.steps[l.step]?.events[l.event];if(e?.type!=="edge"||e.label===void 0)continue;let s=n.badges.filter(r=>r.step<=l.step).map(r=>Ye([r.x,r.y]));a.push(Ze({step:l.step,event:l.event,text:e.label,points:l.points,color:l.color,...e.labelSide?{side:e.labelSide}:{},flip:!0},{hard:[...n.nodes,...n.boxes],soft:[...p,...a.filter(r=>r.step===l.step)],touch:s}))}return a}var ot=t=>Math.round(t*100)/100;function pr(t,n,a,p){let{m:l}=p,e=w.tree,s=w.box,r=(P,j)=>a.edges.find($=>$.step===P&&$.event===j),o=new Map,i=new Map;n.steps.forEach((P,j)=>{for(let $ of P.events)if($.type==="edge")for(let S of[$.from,$.to])o.set(S,(o.get(S)??new Set).add(j)),$.carry.kind!=="none"&&!i.has(S)&&i.set(S,j)});let c=(P,j)=>{let $=n.steps[P]?.events[j];return $?.type==="edge"&&$.carry.kind!=="none"},m=t.runs.filter(P=>c(P.step,P.event)).reduce((P,j)=>P===void 0?j.step:Math.min(P,j.step),void 0),f=m===void 0?void 0:a.steps[m]?.start,d=P=>{if(m===void 0||f===void 0)return;let j=i.get(P);if(j!==void 0&&j<=m)return;let $=j===void 0?void 0:a.steps[j]?.start,S=[[0,{opacity:1}],[f,{opacity:1},fe.inOut],[f+oe.fade,{opacity:e.faint}]];return $!==void 0&&S.push([$,{opacity:e.faint},fe.inOut],[$+oe.fade,{opacity:1}]),S.push([l.last,{opacity:$===void 0?e.faint:1},fe.inOut],[l.total,{opacity:1}]),l.kf(S)},u=(P,j,$="")=>{let S=d(P);return S?`<g class="dg-a"${$} style="${S}">${j}</g>`:$===""?j:`<g${$}>${j}</g>`},M=new Map(t.nodes.map(P=>[P.id,r(P.step,P.event)?.drawn??0])),x=t.links.map(P=>{let j=r(P.step,P.event);if(!j)return"";p.traces.push({from:P.from,to:P.to,points:P.points,shown:[[j.start,Number.POSITIVE_INFINITY]]});let $=l.kf([[0,{opacity:0,"stroke-dashoffset":1}],[j.start,{opacity:0,"stroke-dashoffset":1},fe.inOut],[j.start+.05,{opacity:1}],[j.drawn,{"stroke-dashoffset":0}],[l.last,{opacity:1,"stroke-dashoffset":0},fe.inOut],[l.total,{opacity:0,"stroke-dashoffset":0}]]);return u(P.from,`<path class="dg-tree-l dg-a" data-tree-link="${ve(P.from)}" pathLength="1" d="${it(P.points)}" style="${$}"/>`)}).join(""),h=t.nodes.flatMap(P=>{if(!P.card)return[];let j=M.get(P.id)??0,$=`M ${ot(P.cx)} ${ot(P.y+P.h+w.edge.inset)} V ${ot(P.card.y-w.edge.inset)}`;return[u(P.id,`<path class="dg-tree-con dg-a" d="${$}" style="${l.vis(j)}"/>`)]}).join(""),g=new Set,L=t.runs.flatMap(P=>{let j=t.edges.find(z=>z.step===P.step&&z.event===P.event);if(!j||g.has(P.link))return[];let $=a.carriers.find(z=>z.step===P.step&&z.event===P.event),S=r(P.step,P.event),y=$?.depart??S?.start,F=$?.arrive??S?.drawn;if(y===void 0||F===void 0)return[];g.add(P.link);let C=l.kf([[0,{opacity:0,"stroke-dashoffset":1}],[y,{opacity:0,"stroke-dashoffset":1},fe.inOut],[y+.05,{opacity:1}],[F,{"stroke-dashoffset":0}],[l.last,{opacity:1,"stroke-dashoffset":0},fe.inOut],[l.total,{opacity:0,"stroke-dashoffset":0}]]),X=it(j.points);return[`<g style="${ke(j.color)}"><path class="dg-tree-tr dg-a" data-tree-trail="${ve(P.link)}" pathLength="1" d="${X}" style="${C}"/><path class="dg-tree-h dg-a" d="${At(j.points)}" style="${l.vis(F)}"/></g>`]}).join(""),O=t.nodes.flatMap(P=>{let j=P.card;if(!j)return[];let $=j.x+e.card.padX+e.card.icon/2,S=j.y+j.h/2,y=Me(p.ink,"dg-tree-ct",j.x+e.card.padX+e.card.icon+e.card.gap,S+w.baseline.label,j.text,A.treeCard,Ce);return[u(P.id,`<rect class="dg-tree-card" x="${ot(j.x)}" y="${ot(j.y)}" width="${ot(j.w)}" height="${j.h}" rx="${e.card.radius}"/>${rt("doc",$,S,e.card.glyph,"dg-tree-cg")}${y}`,` data-tree-card="${ve(P.id)}"`)]}).join(""),_=t.nodes.map(P=>{let j=M.get(P.id)??0,$=[...o.get(P.id)??[]].sort((I,R)=>I-R),S=$.length>0?Qt(p,$):void 0,y=P.root?e.root.radius:e.radius,F=(I,R="")=>`<rect class="${I}" x="${ot(P.x)}" y="${ot(P.y)}" width="${ot(P.w)}" height="${P.h}" rx="${y}"${R}/>`,C=`${S?`<g class="dg-a" style="${S}">${F("dg-halo")}</g>`:""}${F("dg-st",` ${p.sh}`)}${S?`<g class="dg-a" style="${S}">${F("dg-on")}</g>`:""}`,X=P.x+e.root.iconX+s.icon/2,z=P.root?`<rect class="dg-ic" x="${ot(X-s.icon/2)}" y="${ot(P.cy-s.icon/2)}" width="${s.icon}" height="${s.icon}" rx="${s.iconRadius}"/>${rt("tree",X,P.cy,s.iconScale)}`:"",Q=[[j,Number.POSITIVE_INFINITY]],B=P.lines.map((I,R)=>{let W=P.styles[R]??A.boxName,J=W===A.treeHash?"dg-tree-hash":W===A.treeName?"dg-tree-name":W===A.rootHash?"dg-tree-rh":W===A.rootName?"dg-tree-rn":"dg-tree-one",Z=P.baselines[R]??P.cy;return P.root?Me(p.ink,J,P.x+e.root.textX,Z,I,W,Q):Me(p.ink,J,P.cx,Z,I,W,Q,"middle")}).join(""),v=u(P.id,`${C}${z}${B}`,` data-tree-node="${ve(P.id)}"${P.root?` data-tree-root="${ve(P.id)}"`:""}`);return`<g class="dg-popc dg-a" style="${ke(P.color)};${l.pop(j)}">${v}</g>`}).join("");return{links:x+h,trails:L,nodes:O+_,appear:M}}jt("git",Xn);jt("lineup",Un);jt("state",Jn);jt("time",Qn);jt("tree",es);function dr(t){let n=qi(t),a=Ai(t,n),p=n.map(()=>({top:0,bottom:0})),l=cr(t,n,a,p);for(let e=0;e<3&&Ii(l,n,a,p);e++)l=cr(t,n,a,p);return l}function qi(t){let n=t.regions??[],a=new Set(n.map(e=>e.id)),p=n.map(e=>({region:e,members:t.boxes.filter(s=>s.region===e.id).map(s=>s.id)})),l=t.boxes.filter(e=>e.region===void 0||!a.has(e.region)).map(e=>e.id);return l.length>0&&p.push({members:l}),p}var mr=t=>t==="left"||t==="right";function Ai(t,n){let a=w.architecture.columns,p=$t(t).map(s=>s.edge),l=new Map;n.forEach((s,r)=>{let o=new Set(s.members),i=new Set,c=(h,g)=>h>=0&&h<a&&!i.has(`${h},${g}`),m=(h,g)=>{let L=Math.min(a-1,Math.max(0,h));for(let O=g;;O++)for(let _=0;_<a;_++)for(let P of[L+_,L-_])if(c(P,O))return[P,O]},f=(h,g,L)=>{l.set(h,{group:r,col:g,row:L}),i.add(`${g},${L}`)},d=1,u=h=>{for(let g of p){let L=g.from===h?g.to:g.to===h?g.from:void 0;if(L===void 0||!o.has(L)||l.has(L))continue;let O=l.get(h),[_,P]=mr(g.labelSide)?m(O.col,O.row+1):c(O.col+d,O.row)?[O.col+d,O.row]:m(O.col+d,O.row);f(L,_,P),u(L)}},M=h=>{for(let g=0;g<p.length;g++){let L=p[g],O=L?.from===h?L.to:L?.to===h?L.from:void 0,_=O===void 0?void 0:l.get(O);if(_&&_.group<r)return{order:g,col:_.col}}},x=0;for(;;){let h=s.members.filter(j=>!l.has(j));if(h.length===0)break;let g=h.map(j=>({id:j,anchor:M(j)})).filter(j=>j.anchor!==void 0);g.sort((j,$)=>(j.anchor?.order??0)-($.anchor?.order??0));let L=g[0]??{id:h[0],anchor:void 0},O=L.anchor?.col??0;x===0&&(d=O>=(a-1)/2?-1:1);let[_,P]=c(O,0)?[O,0]:m(O,0);f(L.id,_,P),u(L.id),x++}});let e=[...new Set([...l.values()].map(s=>s.col))].sort((s,r)=>s-r);for(let s of l.values())s.col=e.indexOf(s.col);return l}function ji(t){let n=[...t.matchAll(/ /g)].map(p=>p.index);if(n.length===0)return[t];let a=n.reduce((p,l)=>Math.abs(l-t.length/2)<Math.abs(p-t.length/2)?l:p);return[t.slice(0,a),t.slice(a+1)]}function Ri(t){let{icon:n,nameY:a,line:p,inset:l}=w.region,e=ji(t.name),s=Math.max(n,...e.map(o=>pe(o,A.regionName)),pe(t.note??"",A.regionNote)),r=a-l+(e.length-1)*p+(t.note?p:0)+w.gap/2;return{w:s,h:r,lines:e}}function cr(t,n,a,p){let{box:l,region:e,architecture:s,margin:r,gap:o}=w,i=He(t),c=Cn(t),m=$t(t),f=Math.max(1,...[...a.values()].map(b=>b.col+1)),d=kt(t),u=new Map(t.boxes.map(b=>[b.id,Math.max(tt(t,b.id,!0),vt(d.get(b.id),b.icon!==void 0,l.padX))])),M=Array.from({length:f},(b,G)=>Math.max(l.minW,...[...a].filter(([,q])=>q.col===G).map(([q])=>u.get(q)??l.minW))),x=Array.from({length:Math.max(0,f-1)},()=>s.columnGap);for(let{edge:b}of m){let G=a.get(b.from),q=a.get(b.to);if(!G||!q||b.label===void 0||G.group!==q.group||G.row!==q.row||Math.abs(G.col-q.col)!==1||mr(b.labelSide))continue;let Y=pe(b.label,We(b.label))+w.label.padX*2+s.labelRoom*2,U=Math.min(G.col,q.col);Y<=s.maxColumnGap&&(x[U]=Math.max(x[U]??0,Y))}let h=n.map(b=>b.region?Ri(b.region):void 0),g=Math.max(0,...h.map(b=>b?b.w+e.inset*2:0)),L=[];for(let b=0;b<f;b++)L.push(b===0?r+(g>0?g:e.pad):L[b-1]+M[b-1]+x[b-1]);let O=b=>L[b]+M[b]/2,_=new Set(m.filter(({edge:b})=>b.from===b.to).map(({edge:b})=>b.from)),P=new Set([..._].flatMap(b=>{let G=a.get(b);return G?[`${G.group}:${G.row}`]:[]})),j=(b,G)=>P.has(`${b}:${G}`)?Fn:0,$=[],S=[],y=r;n.forEach((b,G)=>{let q=Math.max(1,...b.members.map(Se=>(a.get(Se)?.row??0)+1)),Y=p[G],U=y+e.pad+Y.top,K=[0];for(let Se=1;Se<q;Se++)K.push(K[Se-1]+l.h+s.rowGap+j(G,Se-1));for(let Se of b.members){let qe=a.get(Se),Re=t.boxes.find(Ke=>Ke.id===Se),Oe=u.get(Se)??l.minW,Ie=O(qe.col),Ve=U+K[qe.row];$.push({id:Se,name:Re?.name??Se,...Re?.sub!==void 0?{sub:Re.sub}:{},...Re?.icon!==void 0?{icon:Re.icon}:{},color:i.get(Se)??"slate",x:Ie-Oe/2,y:Ve,w:Oe,h:l.h,cx:Ie,cy:Ve+l.h/2})}let H=U+K[q-1]+l.h+j(G,q-1),re=h[G],le=Math.max(H+e.pad+Y.bottom-y,re?re.h+e.inset*2:0,b.region?e.minH:0);S.push({group:G,y,h:le,rows:q}),y+=le+e.gap});let F=y-e.gap;for(let b of $)Pt(b,d.get(b.id));let C=new Map($.map(b=>[b.id,b])),X=b=>S[a.get(b)?.group??0],z=(b,G,q)=>{for(let Y=1;Y<b.length;Y++){let[U,K]=b[Y-1],[H,re]=b[Y];if(Math.min(U,H)<=G.x+G.w+q&&Math.max(U,H)>=G.x-q&&Math.min(K,re)<=G.y+G.h+q&&Math.max(K,re)>=G.y-q)return!0}return!1},Q=[..._].flatMap(b=>{let G=C.get(b);return G?[{x:G.x,y:G.y+G.h,w:G.w,h:Fn}]:[]}),B=b=>Q.some(G=>z(b,G,0)),v=(b,G,q)=>$.some(Y=>Y.id!==G&&Y.id!==q&&z(b,Y,w.label.search))||B(b),I=b=>{let G=C.get(b),q=X(b),Y=a.get(b),U=G.y+G.h+(Y?j(Y.group,Y.row):0);return(Y?.row??0)<q.rows-1?U+s.rowGap/2:Math.min(U+e.pad/2,q.y+q.h-w.edge.inset)},R=b=>{let G=C.get(b),q=X(b);return(a.get(b)?.row??0)>0?G.y-s.rowGap/2:Math.max(G.y-e.pad/2,q.y+w.edge.inset)},W=w.edge.inset,J=(b,G)=>G?L[b]+M[b]+(x[b]??s.columnGap)/2:L[b]-(x[b-1]??s.columnGap)/2,Z=(b,G)=>{let q=C.get(b),Y=C.get(G);if(b===G)return Et(q);let U=a.get(b),K=a.get(G);if(U.group===K.group&&U.row===K.row){let Oe=Y.cx>q.cx,Ie=[[Oe?q.x+q.w:q.x,q.cy],[Oe?Y.x-W:Y.x+Y.w+W,Y.cy]];if(!v(Ie,b,G))return Ie;let Ve=I(b),Ke=[[q.cx,q.y+q.h],[q.cx,Ve],[Y.cx,Ve],[Y.cx,Y.y+Y.h+W]];if(!B(Ke))return Ke;let gt=R(b),dt=[[q.cx,q.y],[q.cx,gt],[Y.cx,gt],[Y.cx,Y.y-W]];return B(dt)?Ke:dt}let H=Y.cy>q.cy,re=[q.cx,H?q.y+q.h:q.y],le=[Y.cx,H?Y.y-W:Y.y+Y.h+W];if(U.col===K.col){let Oe=[re,le];if(!v(Oe,b,G))return Oe;let Ie=J(U.col,!0);return[[q.x+q.w,q.cy],[Ie,q.cy],[Ie,Y.cy],[Y.x+Y.w+W,Y.cy]]}let Se=Y.cx>q.cx,qe=H?I(b):R(b),Re=[[re,[q.cx,Y.cy],[Se?Y.x-W:Y.x+Y.w+W,Y.cy]],[[Se?q.x+q.w:q.x,q.cy],[Y.cx,q.cy],le],[re,[q.cx,qe],[Y.cx,qe],le]];if(_.has(b)||_.has(G)){let Oe=J(U.col,Se),Ie=J(K.col,!Se),Ve=[[Se?q.x+q.w:q.x,q.cy],[Oe,q.cy]],Ke=[Se?Y.x-W:Y.x+Y.w+W,Y.cy];Re.push([...Ve,[Oe,Y.cy],Ke],[...Ve,[Oe,qe],[Y.cx,qe],le],[re,[q.cx,qe],[Ie,qe],[Ie,Y.cy],Ke],[...Ve,[Oe,qe],[Ie,qe],[Ie,Y.cy],Ke])}return Re.find(Oe=>!v(Oe,b,G))??Re[2]},ie=m.map(({step:b,event:G,edge:q})=>({step:b,event:G,from:q.from,to:q.to,points:Z(q.from,q.to),color:at(q,i),carry:q.carry}));ft(ie,C,d);let de=new Map;for(let b of ie){if(b.points.length!==2||!ie.some(H=>H.from===b.to&&H.to===b.from&&H.points.length===2))continue;let[q,Y]=b.points,U=Math.abs(Y[1]-q[1])<Math.abs(Y[0]-q[0]),K=(b.from<b.to?1:-1)*w.edge.parallel;b.points=b.points.map(([H,re])=>U?[H,re+K]:[H+K,re]),de.set(b,U?K>0?"below":"above":K>0?"right":"left")}let ue=[];n.forEach((b,G)=>{let q=S[G],Y=h[G];!b.region||!Y||ue.push({id:b.region.id,lines:Y.lines,...b.region.note!==void 0?{note:b.region.note}:{},...b.region.icon!==void 0?{icon:b.region.icon}:{},color:c.get(b.region.id)??"slate",x:r,y:q.y,w:0,h:q.h,header:{x:r+e.inset,y:q.y+e.inset,w:Y.w,h:Y.h}})});let D=(b,G,q)=>b.from===b.to?Xt(b.points):st(b.points,G,q),me=ht(ie,t.steps.length,D),ae=[];for(let b of ie){let G=t.steps[b.step]?.events[b.event];if(G?.type!=="edge"||G.label===void 0)continue;let q=[...me].filter(([H])=>H<=b.step).map(([,H])=>Ye(H.point)),Y=[...ue.map(H=>H.header),...ae.filter(H=>H.step===b.step)],U=G.labelSide??de.get(b),K=b.from===b.to?{side:"below",base:zt(b.points,pe(G.label,We(G.label))+w.label.padX*2)}:void 0;ae.push(Ze({step:b.step,event:b.event,text:G.label,points:b.points,color:b.color,...K??(U?{side:U}:{flip:!0})},{hard:$,soft:Y,touch:q}))}let ye={kind:"architecture",width:0,height:0,regions:ue,boxes:$,lifelines:[],edges:ie,labels:ae,actions:[],badges:[],paths:[],ends:[]},we=ae.length>0?Math.max(0,r+w.label.soft-Math.min(...ae.map(b=>b.x))):0;we>0&&Lt(ye,we,0);let E=Math.max(...$.map(b=>b.x+b.w+e.pad),...ae.map(b=>b.x+b.w+w.label.soft),...ie.flatMap(b=>b.points.map(G=>G[0]+e.pad))),N=Math.max(E+r,ze(t)+r*2);for(let b of ue)b.w=N-r*2;let se=Math.max(F,...ae.map(b=>b.y+b.h)),T=Ue(t,r,se+o,N-r*2);ye.width=N,ye.height=(T?T.y+T.h:se)+r,T&&(ye.strip=T);let ee=ht(ie,t.steps.length,D);return ye.badges=Xe(t.steps.map((b,G)=>{let q=ee.get(G);return q?{step:G,x:q.point[0],y:q.point[1],color:q.edge.color}:qt(b.events,G,ye)})),ye}function Ii(t,n,a,p){let l=!1,e=w.label.soft;for(let s of t.labels){let r=t.edges.find(u=>u.step===s.step&&u.event===s.event),o=r&&a.get(r.from),i=r&&a.get(r.to);if(!o||!i||o.group!==i.group||!n[o.group]?.region)continue;let c=t.regions.find(u=>u.id===n[o.group]?.region?.id),m=p[o.group];if(!c||!m)continue;let f=c.y+e-s.y,d=s.y+s.h-(c.y+c.h-e);f>0&&(m.top+=f,l=!0),d>0&&(m.bottom+=d,l=!0)}return l}function fr(t){let{box:n,sequence:a,label:p,margin:l,gap:e}=w,s=He(t),r=t.sequence?.lifelines??[],o=[...r,...t.boxes.map(B=>B.id).filter(B=>!r.includes(B))],i=new Map(o.map((B,v)=>[B,v])),c=o.map(B=>tt(t,B,!1)),m=c.slice(1).map((B,v)=>c[v]/2+B/2+a.columnGap),f=[];for(let B of t.steps)for(let v of B.events){if(v.type!=="edge"||v.label===void 0)continue;let I=i.get(v.from)??0,R=i.get(v.to)??0,W=pe(v.label,We(v.label))+p.padX*2;I===R?I<m.length&&f.push({from:I,to:I+1,need:a.selfW+p.side+W+a.labelRoom}):f.push({from:Math.min(I,R),to:Math.max(I,R),need:W+a.labelRoom*2})}f.sort((B,v)=>B.to-B.from-(v.to-v.from));for(let{from:B,to:v,need:I}of f){let R=0;for(let J=B;J<v;J++)R+=m[J]??0;if(R>=I)continue;let W=(I-R)/(v-B);for(let J=B;J<v;J++)m[J]=(m[J]??0)+W}let d=[];o.forEach((B,v)=>d.push(v===0?l+c[0]/2:d[v-1]+m[v-1]));let u=o.map((B,v)=>{let I=t.boxes.find(J=>J.id===B),R=c[v],W=d[v];return{id:B,name:I?.name??B,...I?.sub!==void 0?{sub:I.sub}:{},...I?.icon!==void 0?{icon:I.icon}:{},color:s.get(B)??"slate",x:W-R/2,y:l,w:R,h:n.h,cx:W,cy:l+n.h/2}}),M=l+n.h,x=[],h=[],g=[],L=M+a.firstRow,O=0,_=!0;t.steps.forEach((B,v)=>{B.events.forEach((I,R)=>{if(I.type!=="edge"&&I.type!=="action")return;let W,J;if(I.type==="edge"){let Z=I.labelSide??"above",ie=I.from===I.to,de=I.label!==void 0;W=de&&Z==="above"?a.labelOffset+p.h/2:e,J=ie?a.selfH+e:de&&Z==="below"?a.labelOffset+p.h/2:e}else W=w.action.h/2,J=w.action.h/2;if(L=_?L+W:L+Math.max(a.minPitch,O+a.rowGap+W)+(R===0&&v>0?a.stepGap:0),_=!1,O=J,I.type==="edge"){let Z=d[i.get(I.from)??0],ie=d[i.get(I.to)??0],de=Math.sign(ie-Z)||1,ue=Z===ie?[[Z,L],[Z+a.selfW,L],[Z+a.selfW,L+a.selfH],[Z+w.edge.inset,L+a.selfH]]:[[Z,L],[ie-de*w.edge.inset,L]],D=at(I,s),me={};if(I.carry.kind!=="none"){let ae=w.slot.lifeline+lt(I.carry)[0],[ye,we]=ue,[E,N]=ue.slice(-2),se=Math.sign(we[0]-ye[0])||1,T=Math.sign(N[0]-E[0])||-1;me.wait=[Z-se*ae,ye[1]],me.settle=[ie+T*ae,N[1]]}x.push({step:v,event:R,from:I.from,to:I.to,points:ue,color:D,carry:I.carry,...me}),I.label!==void 0&&g.push({step:v,event:R,text:I.label,points:ue,color:D,...I.labelSide?{side:I.labelSide}:Z===ie?{side:"right"}:{},offset:a.labelOffset})}else{let Z=d[i.get(I.box)??0],ie=pe(I.label,A.action)+w.action.padX*2;h.push({step:v,event:R,box:I.box,text:I.label,color:s.get(I.box)??"slate",x:Z+w.badge.r+4,y:L-w.action.h/2,w:ie,h:w.action.h})}})});let P=(_?M:L+O)+a.tail,j=o.map((B,v)=>({id:B,x:d[v],y1:M,y2:P})),$=ht(x,t.steps.length),S=[];for(let B of g){let v=[...$].filter(([R])=>R<=B.step).map(([,R])=>Ye(R.point)),I=[...S.filter(R=>R.step===B.step),...h];S.push(Ze(B,{hard:u,soft:I,touch:v}))}let y={kind:"sequence",width:0,height:0,regions:[],boxes:u,lifelines:j,edges:x,labels:S,actions:h,badges:[],paths:[],ends:[]},F=[...u.map(B=>B.x),...S.map(B=>B.x),...h.map(B=>B.x)],C=Math.max(0,l-Math.min(...F));C>0&&Lt(y,C,0);let X=[...u.map(B=>B.x+B.w),...S.map(B=>B.x+B.w),...h.map(B=>B.x+B.w),...x.flatMap(B=>B.points.map(v=>v[0]))],z=Math.max(Math.max(...X)+l,ze(t)+l*2),Q=Ue(t,l,P+e,z-l*2);return y.width=z,y.height=(Q?Q.y+Q.h:P)+l,Q&&(y.strip=Q),y.badges=Di(t,y),y}function Di(t,n){let a=ht(n.edges,t.steps.length),p=t.steps.map((l,e)=>{let s=a.get(e);if(s)return{step:e,x:s.point[0],y:s.point[1],color:s.edge.color};let r=n.actions.find(i=>i.step===e),o=r&&n.lifelines.find(i=>i.id===r.box);return r&&o?{step:e,x:o.x,y:r.y+r.h/2,color:r.color}:qt(l.events,e,n)});return Xe(p)}var Ci={string:"\u6587\u5B57\u5217\u306B\u3059\u308B",integer:"\u6574\u6570\u306B\u3059\u308B",number:"\u6570\u306B\u3059\u308B",object:"\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306B\u3059\u308B",array:"\u914D\u5217\u306B\u3059\u308B",boolean:"true \u304B false \u306B\u3059\u308B",null:"null \u306B\u3059\u308B"},Fi={string:"Use a string",integer:"Use an integer",number:"Use a number",object:"Use an object",array:"Use an array",boolean:"Use true or false",null:"Use null"},rn=(t,n)=>`${t} ${n}${t===1?"":"s"}`,_i={additionalProperties:t=>`${t} \u3068\u3044\u3046\u6B04\u306F\u66F8\u3051\u306A\u3044`,required:t=>`${t} \u306E\u6B04\u304C\u8981\u308B`,enum:t=>`${t.join(" / ")} \u306E\u3069\u308C\u304B\u306B\u3059\u308B`,unknownIcon:(t,n)=>`${t} \u3068\u3044\u3046 icon \u306F\u7121\u3044\u3002\u8FD1\u3044\u540D\u524D\u306F ${n}`,type:t=>Ci[t]??`${t} \u306B\u3059\u308B`,minLength:t=>`${t} \u5B57\u4EE5\u4E0A\u66F8\u304F`,maxLength:t=>`${t} \u5B57\u307E\u3067\u306B\u3059\u308B`,pattern:t=>t?`${t.space?"\u7A7A\u767D\u3068 ":""}${t.chars.join(" ")} \u306F\u4F7F\u3048\u306A\u3044`:"\u4F7F\u3048\u306A\u3044\u5B57\u304C\u5165\u3063\u3066\u3044\u308B",minItems:t=>`${t} \u3064\u4EE5\u4E0A\u66F8\u304F`,maxItems:t=>`${t} \u3064\u307E\u3067\u306B\u3059\u308B`,minimum:t=>`${t} \u4EE5\u4E0A\u306B\u3059\u308B`,const:t=>`${t} \u306B\u3059\u308B`,not:t=>t?`${t.field} \u306E\u6B04\u306F kind \u304C ${t.kind} \u306E\u6642\u3060\u3051\u66F8\u3051\u308B`:"\u3053\u306E\u6B04\u306E\u7D44\u307F\u5408\u308F\u305B\u306F\u66F8\u3051\u306A\u3044",reserved:t=>`${t.join(" \u3068 ")} \u306F\u72B6\u614B\u9077\u79FB\u56F3\u306E\u59CB\u307E\u308A\u3068\u7D42\u308F\u308A\u306E\u5370\u306E\u540D\u524D\u3067\u3001\u7BB1\u306E\u540D\u672D\u306B\u4F7F\u3048\u306A\u3044`,kindOnly:(t,n)=>`${t.join(" \u3068 ")} \u306E\u51FA\u6765\u4E8B\u306F kind \u304C ${n} \u306E\u6642\u3060\u3051\u66F8\u3051\u308B`,hex:(t,n)=>`0 \u304B\u3089 9 \u3068 a \u304B\u3089 f \u306E\u5B57\u3067 ${t} \u304B\u3089 ${n} \u5B57\u306B\u3059\u308B`,duration:t=>`\u6570\u3068\u5358\u4F4D (${t.join(" / ")}) \u306E\u7D44\u3067\u66F8\u304F (12s \u306A\u3069)`,ratio:"\u5206\u6570 (2/3) \u304B\u767E\u5206\u7387 (97%) \u3067\u66F8\u304F",url:"/ \u3067\u59CB\u307E\u308B path \u304B\u3001http:// \u304B https:// \u3067\u59CB\u307E\u308B URL \u306B\u3059\u308B",anyOf:t=>t.length>0?`${t.join(" \u304B ")} \u306E${t.length===2?"\u3069\u3061\u3089\u304B":"\u3069\u308C\u304B"}\u306E\u6B04\u304C\u8981\u308B`:"\u66F8\u3051\u308B\u5F62\u306E\u3069\u308C\u306B\u3082\u5408\u308F\u306A\u3044",oneOf:"\u66F8\u3051\u308B\u5F62\u306E\u3069\u308C\u304B 1 \u3064\u3060\u3051\u306B\u5408\u308F\u305B\u308B",discriminator:(t,n)=>`${t} \u306F ${n.join(" / ")} \u306E\u3069\u308C\u304B\u306B\u3059\u308B`,newer:(t,n)=>`\u7248 ${t} \u306E\u56F3\u306F\u3001\u3053\u306E\u9053\u5177 (\u7248 ${n}) \u3088\u308A\u65B0\u3057\u3044\u306E\u3067\u8AAD\u3081\u306A\u3044\u3002\u9053\u5177\u3092\u65B0\u3057\u304F\u3059\u308B`},Bi={additionalProperties:t=>`The ${t} field is not allowed`,required:t=>`The ${t} field is required`,enum:t=>`Use one of ${t.join(" / ")}`,unknownIcon:(t,n)=>`There is no icon named ${t}. The closest is ${n}`,type:t=>Fi[t]??`Use ${t}`,minLength:t=>`Write at least ${rn(t,"character")}`,maxLength:t=>`Write at most ${rn(t,"character")}`,pattern:t=>t?`Cannot contain ${t.space?"spaces or ":""}${t.chars.join(" ")}`:"Contains characters that are not allowed",minItems:t=>`Write at least ${rn(t,"item")}`,maxItems:t=>`Write at most ${rn(t,"item")}`,minimum:t=>`Use ${t} or greater`,const:t=>`Use ${t}`,not:t=>t?`The ${t.field} field is allowed only when kind is ${t.kind}`:"This combination of fields is not allowed",reserved:t=>`${t.join(" and ")} name the start and end marks of a state diagram and cannot be box ids`,kindOnly:(t,n)=>`${t.join(" and ")} events are allowed only when kind is ${n}`,hex:(t,n)=>`Use ${t} to ${n} characters of 0-9 and a-f`,duration:t=>`Write a number and a unit (${t.join(" / ")}), such as 12s`,ratio:"Write a fraction (2/3) or a percentage (97%)",url:"Use a path that starts with / or a URL that starts with http:// or https://",anyOf:t=>t.length>0?`Write one of the ${t.join(" or ")} fields`:"Does not match any of the allowed shapes",oneOf:"Match exactly one of the allowed shapes",discriminator:(t,n)=>`${t} is one of ${n.join(" / ")}`,newer:(t,n)=>`Version ${t} diagrams are newer than this tool (version ${n}) and cannot be read. Update the tool`},on={ja:_i,en:Bi};function ur(t,n){let a=[...t.toLowerCase()],p=Math.min(2,a.length-1),l;for(let e of n){let s=Gi(a,[...e.toLowerCase()]);s>p||(l=e,p=s-1)}return l}function Gi(t,n){let a=Array.from({length:n.length+1},(p,l)=>l);for(let p=1;p<=t.length;p++){let l=[p];for(let e=1;e<=n.length;e++){let s=a[e-1]+(t[p-1]===n[e-1]?0:1);l.push(Math.min(a[e]+1,l[e-1]+1,s))}a=l}return a[n.length]}function Yi(t){let n=0;for(let a of t)n++;return n}var ss=br,ts={title:"dragon \u306E\u56F3\u306E\u539F\u672C",description:"\u533A\u753B\u3001\u7BB1\u3001\u7DDA\u3001\u904B\u3076\u7269\u3001\u6BB5\u3001\u4E2D\u8EAB\u306E\u5E2F\u306E 6 \u90E8\u54C1\u3092\u5171\u901A\u306E\u9AA8\u7D44\u307F\u306B\u7F6E\u304D\u3001\u56F3\u306E\u7A2E\u985E\u3060\u3051\u306E\u7269\u306F\u7A2E\u985E\u306E\u6B04\u306B\u7F6E\u304F\u3002\u5EA7\u6A19\u306F\u6301\u305F\u306A\u3044\u3002\u7BB1\u306F\u679D\u5206\u304B\u308C\u306E\u56F3\u3068\u6642\u9593\u8EF8\u306E\u56F3\u3068\u6728\u306E\u56F3\u3060\u3051\u304C\u6301\u305F\u306A\u304F\u3066\u3088\u3044\u3002\u5217\u306E\u56F3\u306E\u7BB1\u306F\u5217\u306B\u306A\u308B\u3002",type:"object",additionalProperties:!1,required:["version","kind","title","boxes","steps"],properties:{version:{description:"\u5F62\u5F0F\u306E\u7248",type:"integer",minimum:1},kind:{description:"\u56F3\u306E\u7A2E\u985E",enum:["sequence","architecture","state","git","time","tree","lineup"]},title:{$ref:"#/definitions/text"},view:{description:"\u898B\u305B\u65B9\u3002\u66F8\u304B\u306A\u3051\u308C\u3070\u5B57\u306E\u5927\u304D\u3055\u3067\u9078\u3076\u3002fixed \u306F\u5168\u4F53\u3092\u6B62\u3081\u3066\u4E2D\u3060\u3051\u52D5\u304B\u3057\u3001follow \u306F\u5BC4\u3063\u3066\u52D5\u304B\u3057\u5168\u4F53\u56F3\u3067\u4ECA\u3069\u3053\u304B\u3092\u793A\u3059",enum:["fixed","follow"]},regions:{type:"array",items:{$ref:"#/definitions/region"}},boxes:{type:"array",items:{$ref:"#/definitions/box"}},strip:{$ref:"#/definitions/strip"},steps:{type:"array",minItems:1,items:{$ref:"#/definitions/step"}},sequence:{$ref:"#/definitions/sequence"},state:{$ref:"#/definitions/state"},git:{$ref:"#/definitions/git"},time:{$ref:"#/definitions/time"},lineup:{$ref:"#/definitions/lineup"}},if:{required:["kind"],properties:{kind:{const:"sequence"}}},then:{required:["sequence"],properties:{boxes:{minItems:1},steps:{$ref:"#/definitions/plainSteps"},strip:{$ref:"#/definitions/plainStrip"},state:{$ref:"#/definitions/absent"},git:{$ref:"#/definitions/absent"},time:{$ref:"#/definitions/absent"},lineup:{$ref:"#/definitions/absent"}}},else:{properties:{sequence:{$ref:"#/definitions/absent"}},if:{required:["kind"],properties:{kind:{const:"state"}}},then:{properties:{boxes:{minItems:1,items:{properties:{id:{description:"\u59CB\u307E\u308A\u3068\u7D42\u308F\u308A\u306E\u5370\u306E\u540D\u524D\u306F\u7BB1\u306E\u540D\u672D\u306B\u4F7F\u3048\u306A\u3044",not:{enum:["start","finish"]}}}}},steps:{$ref:"#/definitions/plainSteps"},strip:{$ref:"#/definitions/plainStrip"},git:{$ref:"#/definitions/absent"},time:{$ref:"#/definitions/absent"},lineup:{$ref:"#/definitions/absent"}}},else:{if:{required:["kind"],properties:{kind:{const:"git"}}},then:{required:["git"],properties:{steps:{$ref:"#/definitions/gitSteps"},strip:{$ref:"#/definitions/plainStrip"},state:{$ref:"#/definitions/absent"},regions:{$ref:"#/definitions/absent"},time:{$ref:"#/definitions/absent"},lineup:{$ref:"#/definitions/absent"}}},else:{if:{required:["kind"],properties:{kind:{const:"time"}}},then:{required:["time"],properties:{steps:{$ref:"#/definitions/timeSteps"},state:{$ref:"#/definitions/absent"},git:{$ref:"#/definitions/absent"},regions:{$ref:"#/definitions/absent"},lineup:{$ref:"#/definitions/absent"}}},else:{if:{required:["kind"],properties:{kind:{const:"tree"}}},then:{properties:{steps:{$ref:"#/definitions/treeSteps"},strip:{$ref:"#/definitions/plainStrip"},state:{$ref:"#/definitions/absent"},git:{$ref:"#/definitions/absent"},time:{$ref:"#/definitions/absent"},regions:{$ref:"#/definitions/absent"},lineup:{$ref:"#/definitions/absent"}}},else:{if:{required:["kind"],properties:{kind:{const:"lineup"}}},then:{required:["lineup"],properties:{boxes:{minItems:1,items:{properties:{icon:{$ref:"#/definitions/absent"},link:{$ref:"#/definitions/absent"},region:{$ref:"#/definitions/absent"}}}},steps:{$ref:"#/definitions/lineupSteps"},strip:{$ref:"#/definitions/plainStrip"},state:{$ref:"#/definitions/absent"},git:{$ref:"#/definitions/absent"},time:{$ref:"#/definitions/absent"},regions:{$ref:"#/definitions/absent"}}},else:{properties:{boxes:{minItems:1},steps:{$ref:"#/definitions/plainSteps"},strip:{$ref:"#/definitions/plainStrip"},state:{$ref:"#/definitions/absent"},git:{$ref:"#/definitions/absent"},time:{$ref:"#/definitions/absent"},lineup:{$ref:"#/definitions/absent"}}}}}}}},definitions:{text:{type:"string",minLength:1},absent:{description:"\u3053\u306E\u56F3\u306E\u7A2E\u985E\u3067\u306F\u66F8\u3051\u306A\u3044\u6B04",not:{}},plainSteps:{description:"\u679D\u5206\u304B\u308C\u306E\u56F3\u3067\u3082\u6642\u9593\u8EF8\u306E\u56F3\u3067\u3082\u6728\u306E\u56F3\u3067\u3082\u5217\u306E\u56F3\u3067\u3082\u306A\u3044\u56F3\u306E\u6BB5\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (commit \u3068 branch) \u3068\u3001\u6642\u9593\u8EF8\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (now \u3068 mark \u3068 span) \u3068\u6B04 (at \u3068 into \u3068 color) \u3068\u3001\u6728\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (leaf \u3068 node) \u3068\u3001\u5217\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (line \u3068 seal \u3068 open \u3068 pick \u3068 stamp) \u3092\u66F8\u3051\u306A\u3044",items:{properties:{events:{items:{not:{$ref:"#/definitions/timeEvent"},allOf:[{not:{$ref:"#/definitions/treeEvent"}},{$ref:"#/definitions/notLineupEvent"}],properties:{type:{not:{enum:["commit","branch"]}},at:{$ref:"#/definitions/absent"},into:{$ref:"#/definitions/absent"},color:{$ref:"#/definitions/absent"}}}}}}},gitSteps:{description:"\u679D\u5206\u304B\u308C\u306E\u56F3\u306E\u6BB5\u3002\u6642\u9593\u8EF8\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (now \u3068 mark \u3068 span) \u3068\u6B04 (at \u3068 into \u3068 color) \u3068\u3001\u6728\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (leaf \u3068 node) \u3068\u3001\u5217\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (line \u3068 seal \u3068 open \u3068 pick \u3068 stamp) \u3092\u66F8\u3051\u306A\u3044",items:{properties:{events:{items:{not:{$ref:"#/definitions/timeEvent"},allOf:[{not:{$ref:"#/definitions/treeEvent"}},{$ref:"#/definitions/notLineupEvent"}],properties:{at:{$ref:"#/definitions/absent"},into:{$ref:"#/definitions/absent"},color:{$ref:"#/definitions/absent"}}}}}}},timeSteps:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u6BB5\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (commit \u3068 branch) \u3068\u3001\u6728\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (leaf \u3068 node) \u3068\u3001\u5217\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (line \u3068 seal \u3068 open \u3068 pick \u3068 stamp) \u3092\u66F8\u3051\u306A\u3044",items:{properties:{events:{items:{allOf:[{not:{$ref:"#/definitions/treeEvent"}},{$ref:"#/definitions/notLineupEvent"}],properties:{type:{not:{enum:["commit","branch"]}}}}}}}},treeSteps:{description:"\u6728\u306E\u56F3\u306E\u6BB5\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (commit \u3068 branch) \u3068\u3001\u6642\u9593\u8EF8\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (now \u3068 mark \u3068 span) \u3068\u6B04 (at \u3068 into \u3068 color) \u3068\u3001\u5217\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (line \u3068 seal \u3068 open \u3068 pick \u3068 stamp) \u3092\u66F8\u3051\u306A\u3044",items:{properties:{events:{items:{not:{$ref:"#/definitions/timeEvent"},allOf:[{$ref:"#/definitions/notLineupEvent"}],properties:{type:{not:{enum:["commit","branch"]}},at:{$ref:"#/definitions/absent"},into:{$ref:"#/definitions/absent"},color:{$ref:"#/definitions/absent"}}}}}}},lineupSteps:{description:"\u5217\u306E\u56F3\u306E\u6BB5\u3002\u7DDA\u3068\u51E6\u7406\u3068\u3001\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (commit \u3068 branch) \u3068\u3001\u6642\u9593\u8EF8\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (now \u3068 mark \u3068 span) \u3068\u6B04 (color) \u3068\u3001\u6728\u306E\u56F3\u3060\u3051\u306E\u51FA\u6765\u4E8B (leaf \u3068 node) \u3092\u66F8\u3051\u306A\u3044",items:{properties:{events:{items:{not:{$ref:"#/definitions/timeEvent"},allOf:[{not:{$ref:"#/definitions/treeEvent"}},{$ref:"#/definitions/notWiredEvent"}],properties:{type:{not:{enum:["commit","branch"]}},color:{$ref:"#/definitions/absent"}}}}}}},treeEvent:{description:"\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u51FA\u6765\u4E8B",required:["type"],properties:{type:{enum:["leaf","node"]}}},notLineupEvent:{description:"\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u51FA\u6765\u4E8B\u3092\u66F8\u3051\u306A\u3044",not:{required:["type"],properties:{type:{enum:["line","seal","open","pick","stamp"]}}}},notWiredEvent:{description:"\u7BB1\u3068\u7DDA\u306E\u56F3\u306E\u51FA\u6765\u4E8B\u3092\u66F8\u3051\u306A\u3044",not:{required:["type"],properties:{type:{enum:["edge","action"]}}}},timeEvent:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u51FA\u6765\u4E8B",required:["type"],properties:{type:{enum:["now","mark","span"]}}},plainStrip:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u3067\u306A\u3044\u56F3\u306E\u4E2D\u8EAB\u306E\u5E2F\u3002\u7269\u5DEE\u3057\u3092\u66F8\u3051\u306A\u3044",properties:{meters:{$ref:"#/definitions/absent"}}},id:{type:"string",pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},color:{enum:["blue","amber","green","violet","rose","slate","coin"]},icon:{description:"\u7BB1\u3068\u533A\u753B\u306E\u30A2\u30A4\u30B3\u30F3\u540D\u3002\u63CF\u304F\u90E8\u54C1\u306E\u30A2\u30A4\u30B3\u30F3\u306E\u8868 (ICONS) \u306B\u5728\u308B\u540D\u524D\u3060\u3051",enum:["app","router","on","off","pool","db","exe","idx","sign","env","lock","check","flag","x","chain","net","user","server","key","shield","globe","bolt","doc","box","truck","card","cart","clock","branch","cloud","refresh","undo","yen","layers","code","paint","tree","block"]},region:{type:"object",additionalProperties:!1,required:["id","name"],properties:{id:{$ref:"#/definitions/id"},name:{$ref:"#/definitions/text"},note:{$ref:"#/definitions/text"},color:{$ref:"#/definitions/color"},icon:{$ref:"#/definitions/icon"}}},box:{type:"object",additionalProperties:!1,required:["id","name"],properties:{id:{$ref:"#/definitions/id"},name:{$ref:"#/definitions/text"},sub:{$ref:"#/definitions/text"},color:{$ref:"#/definitions/color"},icon:{$ref:"#/definitions/icon"},region:{$ref:"#/definitions/id"},link:{description:"\u98DB\u3073\u5148\u3002\u63CF\u3044\u305F\u56F3\u3067\u306F\u3053\u306E\u7BB1\u304C\u3053\u3053\u3078\u306E link \u306B\u306A\u308B",$ref:"#/definitions/url"}}},strip:{type:"object",additionalProperties:!1,required:["title","fields"],properties:{title:{$ref:"#/definitions/text"},fields:{type:"array",minItems:1,items:{$ref:"#/definitions/text"}},meters:{description:"\u7269\u5DEE\u3057\u306B\u3059\u308B\u6B04\u3002\u6642\u9593\u8EF8\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"array",minItems:1,items:{$ref:"#/definitions/meter"}}}},meter:{description:"\u7269\u5DEE\u3057\u306E\u6B04\u3002line \u306E\u5272\u5408\u306E\u6240\u306B\u7DDA\u3092\u5F15\u304D\u3001set \u306E\u5024\u307E\u3067\u91DD\u3068\u4E00\u7DD2\u306B\u6E80\u3061\u308B",type:"object",additionalProperties:!1,required:["field","line"],properties:{field:{$ref:"#/definitions/text"},line:{$ref:"#/definitions/ratio"}}},ratio:{description:"\u5272\u5408\u3002\u5206\u6570 (2/3) \u304B\u767E\u5206\u7387 (97%)",type:"string",pattern:"^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$"},step:{type:"object",additionalProperties:!1,required:["title","body","events"],properties:{title:{$ref:"#/definitions/text"},body:{$ref:"#/definitions/text"},code:{$ref:"#/definitions/text"},sources:{description:"\u6BB5\u306E\u51FA\u5178\u3002\u8AAD\u307F\u4E0A\u3052\u306E\u6BB5\u306E\u4E00\u89A7\u306B\u3001\u540D\u524D\u3092 URL \u3078\u306E link \u306B\u3057\u3066\u66F8\u3044\u305F\u9806\u306B\u51FA\u3059",type:"array",minItems:1,items:{$ref:"#/definitions/source"}},events:{type:"array",items:{$ref:"#/definitions/event"}}}},source:{type:"object",additionalProperties:!1,required:["name","url"],properties:{name:{$ref:"#/definitions/text"},url:{$ref:"#/definitions/url"}}},url:{description:"\u9801\u3092\u79FB\u308B\u5F62\u3002/ \u3067\u59CB\u307E\u308B path \u304B\u3001http:// \u304B https:// \u3067\u59CB\u307E\u308B URL",type:"string",pattern:"^(/|https?://)"},event:{description:"\u6BB5\u306E\u4E2D\u3067\u8D77\u304D\u308B\u3053\u3068\u3002\u8D77\u304D\u308B\u9806\u306B\u4E26\u3079\u308B",type:"object",required:["type"],discriminator:{propertyName:"type"},oneOf:[{description:"\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B",type:"object",additionalProperties:!1,required:["type","from","to","carry"],properties:{type:{const:"edge"},from:{$ref:"#/definitions/id"},to:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"},carry:{$ref:"#/definitions/carry"},labelSide:{description:"\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)",enum:["above","below","left","right"]},at:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u7DDA\u3092\u5F15\u304F\u5217\u306E\u76EE\u76DB\u308A",$ref:"#/definitions/unit"},into:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u53D7\u3051\u308B\u7BB1\u3092\u9078\u3076\u5217\u306E\u76EE\u76DB\u308A\u3002\u66F8\u304B\u306A\u3051\u308C\u3070 at \u306E\u5217",$ref:"#/definitions/unit"}}},{description:"\u7BB1\u306E\u4E2D\u306E\u51E6\u7406",type:"object",additionalProperties:!1,required:["type","box","label"],properties:{type:{const:"action"},box:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"}}},{description:"\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048",type:"object",additionalProperties:!1,required:["type","box","text"],properties:{type:{const:"swap"},box:{$ref:"#/definitions/id"},text:{$ref:"#/definitions/text"},color:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u7BC0\u76EE\u306E\u4E38\u306E\u8272",$ref:"#/definitions/color"}}},{description:"commit \u3092\u7A4D\u3080\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u7A4D\u3093\u3060\u679D\u306E\u672D\u3068\u3001\u305D\u306E\u679D\u3092\u6307\u3059 HEAD \u304C\u9032\u3080\u3002\u5F53\u3066\u76F4\u3057 (copy) \u306F\u679D\u306E\u672D\u3092\u52D5\u304B\u3055\u305A\u3001merge commit (merge) \u306F\u53D6\u308A\u8FBC\u3080\u679D\u306E\u5148\u7AEF\u3082\u89AA\u306B\u6301\u3064",type:"object",additionalProperties:!1,required:["type","id","branch"],properties:{type:{const:"commit"},id:{$ref:"#/definitions/id"},branch:{$ref:"#/definitions/id"},copy:{$ref:"#/definitions/id"},merge:{$ref:"#/definitions/id"},hash:{$ref:"#/definitions/hash"},note:{$ref:"#/definitions/text"}}},{description:"\u679D\u3092\u5207\u308B\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u679D\u306E\u672D\u3092 from \u306E commit \u3078\u7F6E\u304D\u3001HEAD \u3092\u305D\u306E\u679D\u3078\u79FB\u3059",type:"object",additionalProperties:!1,required:["type","branch","from"],properties:{type:{const:"branch"},branch:{$ref:"#/definitions/id"},from:{$ref:"#/definitions/id"}}},{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u4ECA\u306E\u6642\u523B\u306E\u91DD\u3092\u3001to \u306E\u76EE\u76DB\u308A\u306E\u7D42\u308F\u308A\u307E\u3067\u9032\u3081\u308B",type:"object",additionalProperties:!1,required:["type","to"],properties:{type:{const:"now"},to:{$ref:"#/definitions/unit"}}},{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u5370\u306E\u5217 row \u306E\u3001from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306E\u5370\u306E\u8272\u3092\u5909\u3048\u308B",type:"object",additionalProperties:!1,required:["type","row","from","to","color"],properties:{type:{const:"mark"},row:{$ref:"#/definitions/id"},from:{$ref:"#/definitions/unit"},to:{$ref:"#/definitions/unit"},color:{$ref:"#/definitions/color"}}},{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306B\u3001\u62EC\u5F27\u3068\u5B57\u3092\u51FA\u3059\u3002shape \u304C box \u306A\u3089\u5370\u306E\u5217\u3092\u56F2\u307F\u3001\u5B57\u3092\u7E01\u306E\u672D\u306B\u3059\u308B",type:"object",additionalProperties:!1,required:["type","from","to","text"],properties:{type:{const:"span"},from:{$ref:"#/definitions/unit"},to:{$ref:"#/definitions/unit"},text:{$ref:"#/definitions/text"},shape:{enum:["box"]},color:{$ref:"#/definitions/color"}}},{description:"\u8449\u3092\u51FA\u3059\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u8449\u306E\u7BB1\u304C\u73FE\u308C\u308B\u3002hash \u3092\u66F8\u304F\u3068\u7BB1\u306B\u5024\u3092\u51FA\u3057\u3001\u540D\u672D\u3092\u8449\u306E\u4E0B\u306E\u672D\u306B\u51FA\u3059",type:"object",additionalProperties:!1,required:["type","id"],properties:{type:{const:"leaf"},id:{$ref:"#/definitions/id"},hash:{$ref:"#/definitions/hash"}}},{description:"1 \u3064\u4EE5\u4E0A\u306E\u5B50\u304B\u3089\u89AA\u3092\u7D44\u3080\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u89AA\u306E\u7BB1\u3068\u3001\u5B50\u304B\u3089\u89AA\u3078\u306E\u6728\u306E\u7DDA\u304C\u73FE\u308C\u308B",type:"object",additionalProperties:!1,required:["type","id","children"],properties:{type:{const:"node"},id:{$ref:"#/definitions/id"},children:{type:"array",minItems:1,items:{$ref:"#/definitions/id"}},hash:{$ref:"#/definitions/hash"}}},{description:"\u5217\u306E box \u306E\u4E26\u3073\u3092 items \u306B\u66F8\u304D\u63DB\u3048\u308B\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u30C1\u30C3\u30D7\u306F\u524D\u306B\u5C45\u305F\u5217\u304B\u3089\u6ED1\u308A\u3001\u3069\u306E\u5217\u306B\u3082\u5C45\u306A\u304B\u3063\u305F\u30C1\u30C3\u30D7\u306F\u5F3E\u3093\u3067\u73FE\u308C\u3001\u5217\u304B\u3089\u5916\u308C\u305F\u30C1\u30C3\u30D7\u306F\u6D88\u3048\u308B",type:"object",additionalProperties:!1,required:["type","box","items"],properties:{type:{const:"line"},box:{$ref:"#/definitions/id"},items:{type:"array",minItems:1,maxItems:12,items:{$ref:"#/definitions/id"}}}},{description:"\u5217 box \u306B\u5C01\u3092\u3057\u3066\u3001\u30C1\u30C3\u30D7\u3092\u96A0\u3059\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"object",additionalProperties:!1,required:["type","box"],properties:{type:{const:"seal"},box:{$ref:"#/definitions/id"}}},{description:"\u5217 box \u306E\u5C01\u3092\u958B\u3051\u308B\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"object",additionalProperties:!1,required:["type","box"],properties:{type:{const:"open"},box:{$ref:"#/definitions/id"}}},{description:"\u5217 box \u3092\u9078\u3076\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u5217\u306E\u7E01\u306B\u8272\u304C\u4ED8\u304D\u3001\u307B\u304B\u306E\u5217\u304C\u8584\u304F\u306A\u308B",type:"object",additionalProperties:!1,required:["type","box"],properties:{type:{const:"pick"},box:{$ref:"#/definitions/id"}}},{description:"\u5217 box \u306E\u53F3\u306B text \u306E\u672D\u3092\u62BC\u3059\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"object",additionalProperties:!1,required:["type","box","text"],properties:{type:{const:"stamp"},box:{$ref:"#/definitions/id"},text:{$ref:"#/definitions/text"}}},{description:"\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D",type:"object",additionalProperties:!1,required:["type","field"],anyOf:[{required:["value"]},{required:["tag"]}],properties:{type:{const:"strip"},field:{$ref:"#/definitions/text"},value:{$ref:"#/definitions/text"},tag:{$ref:"#/definitions/text"}}}]},carry:{description:"\u7DDA\u306E\u4E0A\u3092\u8D70\u308B\u7269\u3002\u5C01\u7B52 (\u30E1\u30C3\u30BB\u30FC\u30B8\u3084\u8981\u6C42)\u3001\u672D (\u540D\u524D\u306E\u3042\u308B\u5024)\u3001\u786C\u8CA8 (\u4FA1\u5024)\u3001\u7121\u3057",type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{enum:["envelope","tag","coin","none"]},text:{$ref:"#/definitions/text"}},if:{required:["kind"],properties:{kind:{const:"tag"}}},then:{required:["text"]},else:{not:{required:["text"]}}},sequence:{description:"\u6642\u7CFB\u5217\u56F3\u306E\u7A2E\u985E\u306E\u6B04\u3002\u751F\u5B58\u7DDA\u3092\u5DE6\u304B\u3089\u4E26\u3079\u308B\u9806",type:"object",additionalProperties:!1,required:["lifelines"],properties:{lifelines:{type:"array",minItems:1,items:{$ref:"#/definitions/id"}}}},state:{description:"\u72B6\u614B\u9077\u79FB\u56F3\u306E\u7A2E\u985E\u306E\u6B04\u3002\u6700\u521D\u306E\u6BB5\u3088\u308A\u524D\u306B\u66F8\u3044\u305F\u3001\u79FB\u308C\u308B\u304C\u6BB5\u3067\u901A\u308B\u3068\u306F\u9650\u3089\u306A\u3044\u7DDA",type:"object",additionalProperties:!1,required:["paths"],properties:{paths:{type:"array",minItems:1,items:{$ref:"#/definitions/path"}}}},git:{description:"\u679D\u5206\u304B\u308C\u306E\u56F3\u306E\u7A2E\u985E\u306E\u6B04\u3002\u679D\u3092\u4E0A\u304B\u3089\u5E2F\u306B\u4E26\u3079\u308B\u9806",type:"object",additionalProperties:!1,required:["branches"],properties:{branches:{type:"array",minItems:1,items:{$ref:"#/definitions/branch"}}}},branch:{description:"\u679D\u3002\u5E2F\u306E\u5DE6\u306B\u540D\u672D\u3068\u6DFB\u3048\u66F8\u304D\u3092\u7F6E\u304F",type:"object",additionalProperties:!1,required:["id"],properties:{id:{$ref:"#/definitions/id"},note:{$ref:"#/definitions/text"}}},hash:{description:"commit \u3068\u6728\u306E\u7BB1\u306E hash\u300216 \u9032\u306E\u5B57\u3067 4 \u304B\u3089 40 \u5B57",type:"string",pattern:"^[0-9a-f]{4,40}$"},lineup:{description:"\u5217\u306E\u56F3\u306E\u7A2E\u985E\u306E\u6B04\u3002\u5217\u306B\u4E26\u3079\u308B\u30C1\u30C3\u30D7",type:"object",additionalProperties:!1,required:["items"],properties:{items:{type:"array",minItems:1,items:{$ref:"#/definitions/item"}}}},item:{description:"\u30C1\u30C3\u30D7\u3002color \u3092\u66F8\u304B\u306A\u3044\u30C1\u30C3\u30D7\u306F\u8584\u3044\u8272\u3067\u3001label \u3092\u66F8\u304B\u306A\u3044\u30C1\u30C3\u30D7\u306F\u8272\u3060\u3051\u3067\u51FA\u3059",type:"object",additionalProperties:!1,required:["id"],properties:{id:{$ref:"#/definitions/id"},color:{$ref:"#/definitions/color"},label:{description:"\u30C1\u30C3\u30D7\u306B\u8F09\u305B\u308B\u5B57",type:"string",minLength:1,maxLength:4}}},time:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u7A2E\u985E\u306E\u6B04\u3002\u76EE\u76DB\u308A\u3001\u533A\u5207\u308A\u3001\u5370\u306E\u5217\u3001\u7BC0\u76EE\u3001\u62E1\u5927\u306E\u7BC4\u56F2",type:"object",additionalProperties:!1,required:["scale","rows"],properties:{scale:{$ref:"#/definitions/scale"},period:{$ref:"#/definitions/period"},rows:{type:"array",minItems:1,items:{$ref:"#/definitions/row"}},points:{type:"array",items:{$ref:"#/definitions/point"}},zoom:{$ref:"#/definitions/zoom"}}},scale:{description:"\u76EE\u76DB\u308A\u3002unit \u306E\u540D\u524D\u306E\u76EE\u76DB\u308A\u3092 length \u306E\u9577\u3055\u3067 count \u500B\u4E26\u3079\u3001\u6700\u521D\u306E\u76EE\u76DB\u308A\u306E\u756A\u53F7\u3092 from \u306B\u3059\u308B",type:"object",additionalProperties:!1,required:["unit","length","count"],properties:{unit:{$ref:"#/definitions/text"},length:{$ref:"#/definitions/duration"},count:{type:"integer",minimum:1},from:{type:"integer",minimum:0}}},duration:{description:"\u9577\u3055\u3002\u6570\u3068\u5358\u4F4D (ms\u3001s\u3001min\u3001h\u3001d) \u306E\u7D44",type:"string",pattern:"^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$"},unit:{description:"\u76EE\u76DB\u308A\u306E\u4F4D\u7F6E\u30020 \u304B\u3089\u6570\u3048\u308B",type:"integer",minimum:0},period:{description:"\u533A\u5207\u308A\u3002\u76EE\u76DB\u308A length \u500B\u3054\u3068\u306B name \u306E\u533A\u5207\u308A\u3092\u7F6E\u304D\u3001\u6700\u521D\u306E\u533A\u5207\u308A\u306E\u756A\u53F7\u3092 from \u306B\u3059\u308B",type:"object",additionalProperties:!1,required:["name","length"],properties:{name:{$ref:"#/definitions/text"},length:{type:"integer",minimum:1},from:{type:"integer",minimum:0}}},row:{description:"\u5370\u306E\u5217\u3002\u76EE\u76DB\u308A\u3054\u3068\u306B\u5370\u3092 1 \u3064\u7F6E\u304D\u3001empty \u306E\u76EE\u76DB\u308A\u306F\u7A7A\u304D\u306E\u5370\u306B\u3059\u308B",type:"object",additionalProperties:!1,required:["id","name"],properties:{id:{$ref:"#/definitions/id"},name:{$ref:"#/definitions/text"},color:{$ref:"#/definitions/color"},empty:{type:"array",items:{$ref:"#/definitions/unit"}}}},point:{description:"\u7BC0\u76EE\u3002at \u306E\u76EE\u76DB\u308A\u306E\u5370\u306E\u4E0B\u306B\u65D7\u306E\u4E38\u3068\u540D\u672D\u3092\u7F6E\u304F",type:"object",additionalProperties:!1,required:["id","at"],properties:{id:{$ref:"#/definitions/id"},at:{$ref:"#/definitions/unit"}}},zoom:{description:"\u62E1\u5927\u306E\u7BC4\u56F2\u3002from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u3054\u3068\u306B\u62E1\u5927\u306E\u5E2F\u306B\u5217\u3092\u4F5C\u308B",type:"object",additionalProperties:!1,required:["from","to"],properties:{from:{$ref:"#/definitions/unit"},to:{$ref:"#/definitions/unit"}}},path:{description:"\u79FB\u308C\u308B\u9053\u3002\u9001\u308B\u5074\u306B\u59CB\u307E\u308A\u306E\u5370 start\u3001\u53D7\u3051\u308B\u5074\u306B\u7D42\u308F\u308A\u306E\u5370 finish \u3092\u66F8\u3051\u308B\u3002\u3069\u306E\u6BB5\u306B\u3082\u51FA\u306A\u3044\u9053\u306F\u70B9\u7DDA\u3067\u63CF\u304D\u3001\u904B\u3076\u7269\u3092\u8D70\u3089\u305B\u306A\u3044",type:"object",additionalProperties:!1,required:["from","to"],properties:{from:{$ref:"#/definitions/id"},to:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"}}}}};function ct(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(Array.isArray(t)){let m=t.length;for(let f=0;f<m;f++){let d=t[f];if(d&&typeof d=="object"&&!Array.isArray(d)&&d.events!==void 0){let u=d.events;if(Array.isArray(u)){let M=u.length;for(let x=0;x<M;x++){let h=u[x],g=s,L=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let $;if(h.type===void 0&&($="type")){let S={};e===null?e=[S]:e.push(S),s++}else if(h.type!==void 0){let S=h.type;if(!(S==="now"||S==="mark"||S==="span")){let y={};e===null?e=[y]:e.push(y),s++}}}var r=L===s;if(r){let $={instancePath:n+"/"+f+"/events/"+x,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=g,e!==null&&(g?e.length=g:e=null);let O=s,_=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let $;if(h.type===void 0&&($="type")){let S={};e===null?e=[S]:e.push(S),s++}else if(h.type!==void 0){let S=h.type;if(!(S==="leaf"||S==="node")){let y={};e===null?e=[y]:e.push(y),s++}}}var o=_===s;if(o){let $={instancePath:n+"/"+f+"/events/"+x,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=O,e!==null&&(O?e.length=O:e=null);let P=s,j=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let $;if(h.type===void 0&&($="type")){let S={};e===null?e=[S]:e.push(S),s++}else if(h.type!==void 0){let S=h.type;if(!(S==="line"||S==="seal"||S==="open"||S==="pick"||S==="stamp")){let y={};e===null?e=[y]:e.push(y),s++}}}var i=j===s;if(i){let $={instancePath:n+"/"+f+"/events/"+x,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=P,e!==null&&(P?e.length=P:e=null);if(h&&typeof h=="object"&&!Array.isArray(h)){if(h.type!==void 0){let $=h.type,S=s,y=s;if(!($==="commit"||$==="branch")){let F={};e===null?e=[F]:e.push(F),s++}var c=y===s;if(c){let F={instancePath:n+"/"+f+"/events/"+x+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}else s=S,e!==null&&(S?e.length=S:e=null)}if(h.at!==void 0){let $={instancePath:n+"/"+f+"/events/"+x+"/at",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}if(h.into!==void 0){let $={instancePath:n+"/"+f+"/events/"+x+"/into",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}if(h.color!==void 0){let $={instancePath:n+"/"+f+"/events/"+x+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}}}}}}}return ct.errors=e,s===0}function je(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)&&t.meters!==void 0){let r={instancePath:n+"/meters",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[r]:e.push(r),s++}return je.errors=e,s===0}function an(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(Array.isArray(t)){let c=t.length;for(let m=0;m<c;m++){let f=t[m];if(f&&typeof f=="object"&&!Array.isArray(f)&&f.events!==void 0){let d=f.events;if(Array.isArray(d)){let u=d.length;for(let M=0;M<u;M++){let x=d[M],h=s,g=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let j;if(x.type===void 0&&(j="type")){let $={};e===null?e=[$]:e.push($),s++}else if(x.type!==void 0){let $=x.type;if(!($==="now"||$==="mark"||$==="span")){let S={};e===null?e=[S]:e.push(S),s++}}}var r=g===s;if(r){let j={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}else s=h,e!==null&&(h?e.length=h:e=null);let L=s,O=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let j;if(x.type===void 0&&(j="type")){let $={};e===null?e=[$]:e.push($),s++}else if(x.type!==void 0){let $=x.type;if(!($==="leaf"||$==="node")){let S={};e===null?e=[S]:e.push(S),s++}}}var o=O===s;if(o){let j={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}else s=L,e!==null&&(L?e.length=L:e=null);let _=s,P=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let j;if(x.type===void 0&&(j="type")){let $={};e===null?e=[$]:e.push($),s++}else if(x.type!==void 0){let $=x.type;if(!($==="line"||$==="seal"||$==="open"||$==="pick"||$==="stamp")){let S={};e===null?e=[S]:e.push(S),s++}}}var i=P===s;if(i){let j={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}else s=_,e!==null&&(_?e.length=_:e=null);if(x&&typeof x=="object"&&!Array.isArray(x)){if(x.at!==void 0){let j={instancePath:n+"/"+m+"/events/"+M+"/at",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}if(x.into!==void 0){let j={instancePath:n+"/"+m+"/events/"+M+"/into",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}if(x.color!==void 0){let j={instancePath:n+"/"+m+"/events/"+M+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}}}}}}}return an.errors=e,s===0}function ln(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(Array.isArray(t)){let c=t.length;for(let m=0;m<c;m++){let f=t[m];if(f&&typeof f=="object"&&!Array.isArray(f)&&f.events!==void 0){let d=f.events;if(Array.isArray(d)){let u=d.length;for(let M=0;M<u;M++){let x=d[M],h=s,g=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let _;if(x.type===void 0&&(_="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(x.type!==void 0){let P=x.type;if(!(P==="leaf"||P==="node")){let j={};e===null?e=[j]:e.push(j),s++}}}var r=g===s;if(r){let _={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}else s=h,e!==null&&(h?e.length=h:e=null);let L=s,O=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let _;if(x.type===void 0&&(_="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(x.type!==void 0){let P=x.type;if(!(P==="line"||P==="seal"||P==="open"||P==="pick"||P==="stamp")){let j={};e===null?e=[j]:e.push(j),s++}}}var o=O===s;if(o){let _={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}else s=L,e!==null&&(L?e.length=L:e=null);if(x&&typeof x=="object"&&!Array.isArray(x)&&x.type!==void 0){let _=x.type,P=s,j=s;if(!(_==="commit"||_==="branch")){let $={};e===null?e=[$]:e.push($),s++}var i=j===s;if(i){let $={instancePath:n+"/"+m+"/events/"+M+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=P,e!==null&&(P?e.length=P:e=null)}}}}}}return ln.errors=e,s===0}function pn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(Array.isArray(t)){let c=t.length;for(let m=0;m<c;m++){let f=t[m];if(f&&typeof f=="object"&&!Array.isArray(f)&&f.events!==void 0){let d=f.events;if(Array.isArray(d)){let u=d.length;for(let M=0;M<u;M++){let x=d[M],h=s,g=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let _;if(x.type===void 0&&(_="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(x.type!==void 0){let P=x.type;if(!(P==="now"||P==="mark"||P==="span")){let j={};e===null?e=[j]:e.push(j),s++}}}var r=g===s;if(r){let _={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}else s=h,e!==null&&(h?e.length=h:e=null);let L=s,O=s;if(x&&typeof x=="object"&&!Array.isArray(x)){let _;if(x.type===void 0&&(_="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(x.type!==void 0){let P=x.type;if(!(P==="line"||P==="seal"||P==="open"||P==="pick"||P==="stamp")){let j={};e===null?e=[j]:e.push(j),s++}}}var o=O===s;if(o){let _={instancePath:n+"/"+m+"/events/"+M,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}else s=L,e!==null&&(L?e.length=L:e=null);if(x&&typeof x=="object"&&!Array.isArray(x)){if(x.type!==void 0){let _=x.type,P=s,j=s;if(!(_==="commit"||_==="branch")){let $={};e===null?e=[$]:e.push($),s++}var i=j===s;if(i){let $={instancePath:n+"/"+m+"/events/"+M+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=P,e!==null&&(P?e.length=P:e=null)}if(x.at!==void 0){let _={instancePath:n+"/"+m+"/events/"+M+"/at",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}if(x.into!==void 0){let _={instancePath:n+"/"+m+"/events/"+M+"/into",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}if(x.color!==void 0){let _={instancePath:n+"/"+m+"/events/"+M+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[_]:e.push(_),s++}}}}}}}return pn.errors=e,s===0}function cn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(Array.isArray(t)){let m=t.length;for(let f=0;f<m;f++){let d=t[f];if(d&&typeof d=="object"&&!Array.isArray(d)&&d.events!==void 0){let u=d.events;if(Array.isArray(u)){let M=u.length;for(let x=0;x<M;x++){let h=u[x],g=s,L=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let $;if(h.type===void 0&&($="type")){let S={};e===null?e=[S]:e.push(S),s++}else if(h.type!==void 0){let S=h.type;if(!(S==="now"||S==="mark"||S==="span")){let y={};e===null?e=[y]:e.push(y),s++}}}var r=L===s;if(r){let $={instancePath:n+"/"+f+"/events/"+x,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=g,e!==null&&(g?e.length=g:e=null);let O=s,_=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let $;if(h.type===void 0&&($="type")){let S={};e===null?e=[S]:e.push(S),s++}else if(h.type!==void 0){let S=h.type;if(!(S==="leaf"||S==="node")){let y={};e===null?e=[y]:e.push(y),s++}}}var o=_===s;if(o){let $={instancePath:n+"/"+f+"/events/"+x,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=O,e!==null&&(O?e.length=O:e=null);let P=s,j=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let $;if(h.type===void 0&&($="type")){let S={};e===null?e=[S]:e.push(S),s++}else if(h.type!==void 0){let S=h.type;if(!(S==="edge"||S==="action")){let y={};e===null?e=[y]:e.push(y),s++}}}var i=j===s;if(i){let $={instancePath:n+"/"+f+"/events/"+x,schemaPath:"#/definitions/notWiredEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}else s=P,e!==null&&(P?e.length=P:e=null);if(h&&typeof h=="object"&&!Array.isArray(h)){if(h.type!==void 0){let $=h.type,S=s,y=s;if(!($==="commit"||$==="branch")){let F={};e===null?e=[F]:e.push(F),s++}var c=y===s;if(c){let F={instancePath:n+"/"+f+"/events/"+x+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}else s=S,e!==null&&(S?e.length=S:e=null)}if(h.color!==void 0){let $={instancePath:n+"/"+f+"/events/"+x+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}}}}}}}return cn.errors=e,s===0}var Ot={enum:["blue","amber","green","violet","rose","slate","coin"]},gr={description:"\u7BB1\u3068\u533A\u753B\u306E\u30A2\u30A4\u30B3\u30F3\u540D\u3002\u63CF\u304F\u90E8\u54C1\u306E\u30A2\u30A4\u30B3\u30F3\u306E\u8868 (ICONS) \u306B\u5728\u308B\u540D\u524D\u3060\u3051",enum:["app","router","on","off","pool","db","exe","idx","sign","env","lock","check","flag","x","chain","net","user","server","key","shield","globe","bolt","doc","box","truck","card","cart","clock","branch","cloud","refresh","undo","yen","layers","code","paint","tree","block"]},Te=new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$","u"),Ne=Yi;function dn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.id===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[r]:e.push(r),s++}if(t.name===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="id"||r==="name"||r==="note"||r==="color"||r==="icon")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.id!==void 0){let r=t.id;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.name!==void 0){let r=t.name;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.note!==void 0){let r=t.note;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/note",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/note",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.color!==void 0){let r=t.color;if(!(r==="blue"||r==="amber"||r==="green"||r==="violet"||r==="rose"||r==="slate"||r==="coin")){let o={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[o]:e.push(o),s++}}if(t.icon!==void 0){let r=t.icon;if(!(r==="app"||r==="router"||r==="on"||r==="off"||r==="pool"||r==="db"||r==="exe"||r==="idx"||r==="sign"||r==="env"||r==="lock"||r==="check"||r==="flag"||r==="x"||r==="chain"||r==="net"||r==="user"||r==="server"||r==="key"||r==="shield"||r==="globe"||r==="bolt"||r==="doc"||r==="box"||r==="truck"||r==="card"||r==="cart"||r==="clock"||r==="branch"||r==="cloud"||r==="refresh"||r==="undo"||r==="yen"||r==="layers"||r==="code"||r==="paint"||r==="tree"||r==="block")){let o={instancePath:n+"/icon",schemaPath:"#/definitions/icon/enum",keyword:"enum",params:{allowedValues:gr.enum},message:"must be equal to one of the allowed values"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return dn.errors=e,s===0}var yr=new RegExp("^(/|https?://)","u");function mn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.id===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[r]:e.push(r),s++}if(t.name===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="id"||r==="name"||r==="sub"||r==="color"||r==="icon"||r==="region"||r==="link")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.id!==void 0){let r=t.id;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.name!==void 0){let r=t.name;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.sub!==void 0){let r=t.sub;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/sub",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/sub",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.color!==void 0){let r=t.color;if(!(r==="blue"||r==="amber"||r==="green"||r==="violet"||r==="rose"||r==="slate"||r==="coin")){let o={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[o]:e.push(o),s++}}if(t.icon!==void 0){let r=t.icon;if(!(r==="app"||r==="router"||r==="on"||r==="off"||r==="pool"||r==="db"||r==="exe"||r==="idx"||r==="sign"||r==="env"||r==="lock"||r==="check"||r==="flag"||r==="x"||r==="chain"||r==="net"||r==="user"||r==="server"||r==="key"||r==="shield"||r==="globe"||r==="bolt"||r==="doc"||r==="box"||r==="truck"||r==="card"||r==="cart"||r==="clock"||r==="branch"||r==="cloud"||r==="refresh"||r==="undo"||r==="yen"||r==="layers"||r==="code"||r==="paint"||r==="tree"||r==="block")){let o={instancePath:n+"/icon",schemaPath:"#/definitions/icon/enum",keyword:"enum",params:{allowedValues:gr.enum},message:"must be equal to one of the allowed values"};e===null?e=[o]:e.push(o),s++}}if(t.region!==void 0){let r=t.region;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/region",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/region",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.link!==void 0){let r=t.link;if(typeof r=="string"){if(!yr.test(r)){let o={instancePath:n+"/link",schemaPath:"#/definitions/url/pattern",keyword:"pattern",params:{pattern:"^(/|https?://)"},message:'must match pattern "^(/|https?://)"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/link",schemaPath:"#/definitions/url/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return mn.errors=e,s===0}var Vi=new RegExp("^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$","u");function fn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.field===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"field"},message:"must have required property 'field'"};e===null?e=[r]:e.push(r),s++}if(t.line===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"line"},message:"must have required property 'line'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="field"||r==="line")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.field!==void 0){let r=t.field;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/field",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/field",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.line!==void 0){let r=t.line;if(typeof r=="string"){if(!Vi.test(r)){let o={instancePath:n+"/line",schemaPath:"#/definitions/ratio/pattern",keyword:"pattern",params:{pattern:"^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$"},message:'must match pattern "^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/line",schemaPath:"#/definitions/ratio/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return fn.errors=e,s===0}function un(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.title===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};e===null?e=[r]:e.push(r),s++}if(t.fields===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"fields"},message:"must have required property 'fields'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="title"||r==="fields"||r==="meters")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.title!==void 0){let r=t.title;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.fields!==void 0){let r=t.fields;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/fields",schemaPath:"#/properties/fields/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++){let c=r[i];if(typeof c=="string"){if(Ne(c)<1){let m={instancePath:n+"/fields/"+i,schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[m]:e.push(m),s++}}else{let m={instancePath:n+"/fields/"+i,schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[m]:e.push(m),s++}}}else{let o={instancePath:n+"/fields",schemaPath:"#/properties/fields/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}if(t.meters!==void 0){let r=t.meters;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/meters",schemaPath:"#/properties/meters/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++)fn(r[i],{instancePath:n+"/meters/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?fn.errors:e.concat(fn.errors),s=e.length)}else{let o={instancePath:n+"/meters",schemaPath:"#/properties/meters/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return un.errors=e,s===0}function hn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.name===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};e===null?e=[r]:e.push(r),s++}if(t.url===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"url"},message:"must have required property 'url'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="name"||r==="url")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.name!==void 0){let r=t.name;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.url!==void 0){let r=t.url;if(typeof r=="string"){if(!yr.test(r)){let o={instancePath:n+"/url",schemaPath:"#/definitions/url/pattern",keyword:"pattern",params:{pattern:"^(/|https?://)"},message:'must match pattern "^(/|https?://)"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/url",schemaPath:"#/definitions/url/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return hn.errors=e,s===0}var hr={description:"\u6BB5\u306E\u4E2D\u3067\u8D77\u304D\u308B\u3053\u3068\u3002\u8D77\u304D\u308B\u9806\u306B\u4E26\u3079\u308B",type:"object",required:["type"],discriminator:{propertyName:"type"},oneOf:[{description:"\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B",type:"object",additionalProperties:!1,required:["type","from","to","carry"],properties:{type:{const:"edge"},from:{$ref:"#/definitions/id"},to:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"},carry:{$ref:"#/definitions/carry"},labelSide:{description:"\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)",enum:["above","below","left","right"]},at:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u7DDA\u3092\u5F15\u304F\u5217\u306E\u76EE\u76DB\u308A",$ref:"#/definitions/unit"},into:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u53D7\u3051\u308B\u7BB1\u3092\u9078\u3076\u5217\u306E\u76EE\u76DB\u308A\u3002\u66F8\u304B\u306A\u3051\u308C\u3070 at \u306E\u5217",$ref:"#/definitions/unit"}}},{description:"\u7BB1\u306E\u4E2D\u306E\u51E6\u7406",type:"object",additionalProperties:!1,required:["type","box","label"],properties:{type:{const:"action"},box:{$ref:"#/definitions/id"},label:{$ref:"#/definitions/text"}}},{description:"\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048",type:"object",additionalProperties:!1,required:["type","box","text"],properties:{type:{const:"swap"},box:{$ref:"#/definitions/id"},text:{$ref:"#/definitions/text"},color:{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u7BC0\u76EE\u306E\u4E38\u306E\u8272",$ref:"#/definitions/color"}}},{description:"commit \u3092\u7A4D\u3080\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u7A4D\u3093\u3060\u679D\u306E\u672D\u3068\u3001\u305D\u306E\u679D\u3092\u6307\u3059 HEAD \u304C\u9032\u3080\u3002\u5F53\u3066\u76F4\u3057 (copy) \u306F\u679D\u306E\u672D\u3092\u52D5\u304B\u3055\u305A\u3001merge commit (merge) \u306F\u53D6\u308A\u8FBC\u3080\u679D\u306E\u5148\u7AEF\u3082\u89AA\u306B\u6301\u3064",type:"object",additionalProperties:!1,required:["type","id","branch"],properties:{type:{const:"commit"},id:{$ref:"#/definitions/id"},branch:{$ref:"#/definitions/id"},copy:{$ref:"#/definitions/id"},merge:{$ref:"#/definitions/id"},hash:{$ref:"#/definitions/hash"},note:{$ref:"#/definitions/text"}}},{description:"\u679D\u3092\u5207\u308B\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u679D\u306E\u672D\u3092 from \u306E commit \u3078\u7F6E\u304D\u3001HEAD \u3092\u305D\u306E\u679D\u3078\u79FB\u3059",type:"object",additionalProperties:!1,required:["type","branch","from"],properties:{type:{const:"branch"},branch:{$ref:"#/definitions/id"},from:{$ref:"#/definitions/id"}}},{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u4ECA\u306E\u6642\u523B\u306E\u91DD\u3092\u3001to \u306E\u76EE\u76DB\u308A\u306E\u7D42\u308F\u308A\u307E\u3067\u9032\u3081\u308B",type:"object",additionalProperties:!1,required:["type","to"],properties:{type:{const:"now"},to:{$ref:"#/definitions/unit"}}},{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E\u5370\u306E\u5217 row \u306E\u3001from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306E\u5370\u306E\u8272\u3092\u5909\u3048\u308B",type:"object",additionalProperties:!1,required:["type","row","from","to","color"],properties:{type:{const:"mark"},row:{$ref:"#/definitions/id"},from:{$ref:"#/definitions/unit"},to:{$ref:"#/definitions/unit"},color:{$ref:"#/definitions/color"}}},{description:"\u6642\u9593\u8EF8\u306E\u56F3\u306E from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306B\u3001\u62EC\u5F27\u3068\u5B57\u3092\u51FA\u3059\u3002shape \u304C box \u306A\u3089\u5370\u306E\u5217\u3092\u56F2\u307F\u3001\u5B57\u3092\u7E01\u306E\u672D\u306B\u3059\u308B",type:"object",additionalProperties:!1,required:["type","from","to","text"],properties:{type:{const:"span"},from:{$ref:"#/definitions/unit"},to:{$ref:"#/definitions/unit"},text:{$ref:"#/definitions/text"},shape:{enum:["box"]},color:{$ref:"#/definitions/color"}}},{description:"\u8449\u3092\u51FA\u3059\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u8449\u306E\u7BB1\u304C\u73FE\u308C\u308B\u3002hash \u3092\u66F8\u304F\u3068\u7BB1\u306B\u5024\u3092\u51FA\u3057\u3001\u540D\u672D\u3092\u8449\u306E\u4E0B\u306E\u672D\u306B\u51FA\u3059",type:"object",additionalProperties:!1,required:["type","id"],properties:{type:{const:"leaf"},id:{$ref:"#/definitions/id"},hash:{$ref:"#/definitions/hash"}}},{description:"1 \u3064\u4EE5\u4E0A\u306E\u5B50\u304B\u3089\u89AA\u3092\u7D44\u3080\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u89AA\u306E\u7BB1\u3068\u3001\u5B50\u304B\u3089\u89AA\u3078\u306E\u6728\u306E\u7DDA\u304C\u73FE\u308C\u308B",type:"object",additionalProperties:!1,required:["type","id","children"],properties:{type:{const:"node"},id:{$ref:"#/definitions/id"},children:{type:"array",minItems:1,items:{$ref:"#/definitions/id"}},hash:{$ref:"#/definitions/hash"}}},{description:"\u5217\u306E box \u306E\u4E26\u3073\u3092 items \u306B\u66F8\u304D\u63DB\u3048\u308B\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u30C1\u30C3\u30D7\u306F\u524D\u306B\u5C45\u305F\u5217\u304B\u3089\u6ED1\u308A\u3001\u3069\u306E\u5217\u306B\u3082\u5C45\u306A\u304B\u3063\u305F\u30C1\u30C3\u30D7\u306F\u5F3E\u3093\u3067\u73FE\u308C\u3001\u5217\u304B\u3089\u5916\u308C\u305F\u30C1\u30C3\u30D7\u306F\u6D88\u3048\u308B",type:"object",additionalProperties:!1,required:["type","box","items"],properties:{type:{const:"line"},box:{$ref:"#/definitions/id"},items:{type:"array",minItems:1,maxItems:12,items:{$ref:"#/definitions/id"}}}},{description:"\u5217 box \u306B\u5C01\u3092\u3057\u3066\u3001\u30C1\u30C3\u30D7\u3092\u96A0\u3059\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"object",additionalProperties:!1,required:["type","box"],properties:{type:{const:"seal"},box:{$ref:"#/definitions/id"}}},{description:"\u5217 box \u306E\u5C01\u3092\u958B\u3051\u308B\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"object",additionalProperties:!1,required:["type","box"],properties:{type:{const:"open"},box:{$ref:"#/definitions/id"}}},{description:"\u5217 box \u3092\u9078\u3076\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u5217\u306E\u7E01\u306B\u8272\u304C\u4ED8\u304D\u3001\u307B\u304B\u306E\u5217\u304C\u8584\u304F\u306A\u308B",type:"object",additionalProperties:!1,required:["type","box"],properties:{type:{const:"pick"},box:{$ref:"#/definitions/id"}}},{description:"\u5217 box \u306E\u53F3\u306B text \u306E\u672D\u3092\u62BC\u3059\u3002\u5217\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B",type:"object",additionalProperties:!1,required:["type","box","text"],properties:{type:{const:"stamp"},box:{$ref:"#/definitions/id"},text:{$ref:"#/definitions/text"}}},{description:"\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D",type:"object",additionalProperties:!1,required:["type","field"],anyOf:[{required:["value"]},{required:["tag"]}],properties:{type:{const:"strip"},field:{$ref:"#/definitions/text"},value:{$ref:"#/definitions/text"},tag:{$ref:"#/definitions/text"}}}]};var ns=new RegExp("^[0-9a-f]{4,40}$","u"),Ki={description:"\u7DDA\u306E\u4E0A\u3092\u8D70\u308B\u7269\u3002\u5C01\u7B52 (\u30E1\u30C3\u30BB\u30FC\u30B8\u3084\u8981\u6C42)\u3001\u672D (\u540D\u524D\u306E\u3042\u308B\u5024)\u3001\u786C\u8CA8 (\u4FA1\u5024)\u3001\u7121\u3057",type:"object",additionalProperties:!1,required:["kind"],properties:{kind:{enum:["envelope","tag","coin","none"]},text:{$ref:"#/definitions/text"}},if:{required:["kind"],properties:{kind:{const:"tag"}}},then:{required:["text"]},else:{not:{required:["text"]}}};function gn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0,r=s,o=!0,i=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let d;if(t.kind===void 0&&(d="kind")){let u={};e===null?e=[u]:e.push(u),s++}else if(t.kind!==void 0&&t.kind!=="tag"){let u={};e===null?e=[u]:e.push(u),s++}}var c=i===s;s=r,e!==null&&(r?e.length=r:e=null);let m;if(c){let d=s;if(t&&typeof t=="object"&&!Array.isArray(t)&&t.text===void 0){let M={instancePath:n,schemaPath:"#/then/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};e===null?e=[M]:e.push(M),s++}var c=d===s;o=c,m="then"}else{let d=s,u=s,M=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let h;if(t.text===void 0&&(h="text")){let g={};e===null?e=[g]:e.push(g),s++}}var f=M===s;if(f){let h={instancePath:n,schemaPath:"#/else/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[h]:e.push(h),s++}else s=u,e!==null&&(u?e.length=u:e=null);var c=d===s;o=c,m="else"}if(!o){let d={instancePath:n,schemaPath:"#/if",keyword:"if",params:{failingKeyword:m},message:'must match "'+m+'" schema'};e===null?e=[d]:e.push(d),s++}if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.kind===void 0){let d={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"kind"},message:"must have required property 'kind'"};e===null?e=[d]:e.push(d),s++}for(let d in t)if(!(d==="kind"||d==="text")){let u={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:d},message:"must NOT have additional properties"};e===null?e=[u]:e.push(u),s++}if(t.kind!==void 0){let d=t.kind;if(!(d==="envelope"||d==="tag"||d==="coin"||d==="none")){let u={instancePath:n+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues:Ki.properties.kind.enum},message:"must be equal to one of the allowed values"};e===null?e=[u]:e.push(u),s++}}if(t.text!==void 0){let d=t.text;if(typeof d=="string"){if(Ne(d)<1){let u={instancePath:n+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[u]:e.push(u),s++}}else{let u={instancePath:n+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[u]:e.push(u),s++}}}else{let d={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[d]:e.push(d),s++}return gn.errors=e,s===0}function yn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}let o=t.type;if(typeof o=="string")if(o==="edge")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.from===void 0){let i={instancePath:n,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};e===null?e=[i]:e.push(i),s++}if(t.to===void 0){let i={instancePath:n,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};e===null?e=[i]:e.push(i),s++}if(t.carry===void 0){let i={instancePath:n,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"carry"},message:"must have required property 'carry'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="from"||i==="to"||i==="label"||i==="carry"||i==="labelSide"||i==="at"||i==="into")){let c={instancePath:n,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="edge"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/0/properties/type/const",keyword:"const",params:{allowedValue:"edge"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.from!==void 0){let i=t.from;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/from",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/from",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.to!==void 0){let i=t.to;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/to",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/to",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.label!==void 0){let i=t.label;if(typeof i=="string"){if(Ne(i)<1){let c={instancePath:n+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.carry!==void 0&&(gn(t.carry,{instancePath:n+"/carry",parentData:t,parentDataProperty:"carry",rootData:l})||(e=e===null?gn.errors:e.concat(gn.errors),s=e.length)),t.labelSide!==void 0){let i=t.labelSide;if(!(i==="above"||i==="below"||i==="left"||i==="right")){let c={instancePath:n+"/labelSide",schemaPath:"#/oneOf/0/properties/labelSide/enum",keyword:"enum",params:{allowedValues:hr.oneOf[0].properties.labelSide.enum},message:"must be equal to one of the allowed values"};e===null?e=[c]:e.push(c),s++}}if(t.at!==void 0){let i=t.at;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/at",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/at",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}if(t.into!==void 0){let i=t.into;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/into",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/into",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="action")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}if(t.label===void 0){let i={instancePath:n,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"label"},message:"must have required property 'label'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box"||i==="label")){let c={instancePath:n,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="action"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/1/properties/type/const",keyword:"const",params:{allowedValue:"action"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.label!==void 0){let i=t.label;if(typeof i=="string"){if(Ne(i)<1){let c={instancePath:n+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="swap")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}if(t.text===void 0){let i={instancePath:n,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box"||i==="text"||i==="color")){let c={instancePath:n,schemaPath:"#/oneOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="swap"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/2/properties/type/const",keyword:"const",params:{allowedValue:"swap"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.text!==void 0){let i=t.text;if(typeof i=="string"){if(Ne(i)<1){let c={instancePath:n+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.color!==void 0){let i=t.color;if(!(i==="blue"||i==="amber"||i==="green"||i==="violet"||i==="rose"||i==="slate"||i==="coin")){let c={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="commit")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.id===void 0){let i={instancePath:n,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[i]:e.push(i),s++}if(t.branch===void 0){let i={instancePath:n,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:"branch"},message:"must have required property 'branch'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="id"||i==="branch"||i==="copy"||i==="merge"||i==="hash"||i==="note")){let c={instancePath:n,schemaPath:"#/oneOf/3/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="commit"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/3/properties/type/const",keyword:"const",params:{allowedValue:"commit"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.id!==void 0){let i=t.id;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.branch!==void 0){let i=t.branch;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/branch",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/branch",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.copy!==void 0){let i=t.copy;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/copy",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/copy",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.merge!==void 0){let i=t.merge;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/merge",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/merge",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.hash!==void 0){let i=t.hash;if(typeof i=="string"){if(!ns.test(i)){let c={instancePath:n+"/hash",schemaPath:"#/definitions/hash/pattern",keyword:"pattern",params:{pattern:"^[0-9a-f]{4,40}$"},message:'must match pattern "^[0-9a-f]{4,40}$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/hash",schemaPath:"#/definitions/hash/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.note!==void 0){let i=t.note;if(typeof i=="string"){if(Ne(i)<1){let c={instancePath:n+"/note",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/note",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/3/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="branch")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/4/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.branch===void 0){let i={instancePath:n,schemaPath:"#/oneOf/4/required",keyword:"required",params:{missingProperty:"branch"},message:"must have required property 'branch'"};e===null?e=[i]:e.push(i),s++}if(t.from===void 0){let i={instancePath:n,schemaPath:"#/oneOf/4/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="branch"||i==="from")){let c={instancePath:n,schemaPath:"#/oneOf/4/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="branch"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/4/properties/type/const",keyword:"const",params:{allowedValue:"branch"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.branch!==void 0){let i=t.branch;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/branch",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/branch",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.from!==void 0){let i=t.from;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/from",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/from",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/4/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="now")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/5/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.to===void 0){let i={instancePath:n,schemaPath:"#/oneOf/5/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="to")){let c={instancePath:n,schemaPath:"#/oneOf/5/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="now"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/5/properties/type/const",keyword:"const",params:{allowedValue:"now"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.to!==void 0){let i=t.to;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/to",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/to",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/5/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="mark")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.row===void 0){let i={instancePath:n,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:"row"},message:"must have required property 'row'"};e===null?e=[i]:e.push(i),s++}if(t.from===void 0){let i={instancePath:n,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};e===null?e=[i]:e.push(i),s++}if(t.to===void 0){let i={instancePath:n,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};e===null?e=[i]:e.push(i),s++}if(t.color===void 0){let i={instancePath:n,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:"color"},message:"must have required property 'color'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="row"||i==="from"||i==="to"||i==="color")){let c={instancePath:n,schemaPath:"#/oneOf/6/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="mark"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/6/properties/type/const",keyword:"const",params:{allowedValue:"mark"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.row!==void 0){let i=t.row;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/row",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/row",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.from!==void 0){let i=t.from;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/from",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/from",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}if(t.to!==void 0){let i=t.to;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/to",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/to",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}if(t.color!==void 0){let i=t.color;if(!(i==="blue"||i==="amber"||i==="green"||i==="violet"||i==="rose"||i==="slate"||i==="coin")){let c={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/6/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="span")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/7/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.from===void 0){let i={instancePath:n,schemaPath:"#/oneOf/7/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};e===null?e=[i]:e.push(i),s++}if(t.to===void 0){let i={instancePath:n,schemaPath:"#/oneOf/7/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};e===null?e=[i]:e.push(i),s++}if(t.text===void 0){let i={instancePath:n,schemaPath:"#/oneOf/7/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="from"||i==="to"||i==="text"||i==="shape"||i==="color")){let c={instancePath:n,schemaPath:"#/oneOf/7/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="span"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/7/properties/type/const",keyword:"const",params:{allowedValue:"span"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.from!==void 0){let i=t.from;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/from",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/from",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}if(t.to!==void 0){let i=t.to;if(!(typeof i=="number"&&!(i%1)&&!isNaN(i)&&isFinite(i))){let c={instancePath:n+"/to",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[c]:e.push(c),s++}if(typeof i=="number"&&isFinite(i)&&(i<0||isNaN(i))){let c={instancePath:n+"/to",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[c]:e.push(c),s++}}if(t.text!==void 0){let i=t.text;if(typeof i=="string"){if(Ne(i)<1){let c={instancePath:n+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.shape!==void 0&&t.shape!=="box"){let i={instancePath:n+"/shape",schemaPath:"#/oneOf/7/properties/shape/enum",keyword:"enum",params:{allowedValues:hr.oneOf[7].properties.shape.enum},message:"must be equal to one of the allowed values"};e===null?e=[i]:e.push(i),s++}if(t.color!==void 0){let i=t.color;if(!(i==="blue"||i==="amber"||i==="green"||i==="violet"||i==="rose"||i==="slate"||i==="coin")){let c={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/7/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="leaf")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/8/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.id===void 0){let i={instancePath:n,schemaPath:"#/oneOf/8/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="id"||i==="hash")){let c={instancePath:n,schemaPath:"#/oneOf/8/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="leaf"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/8/properties/type/const",keyword:"const",params:{allowedValue:"leaf"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.id!==void 0){let i=t.id;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.hash!==void 0){let i=t.hash;if(typeof i=="string"){if(!ns.test(i)){let c={instancePath:n+"/hash",schemaPath:"#/definitions/hash/pattern",keyword:"pattern",params:{pattern:"^[0-9a-f]{4,40}$"},message:'must match pattern "^[0-9a-f]{4,40}$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/hash",schemaPath:"#/definitions/hash/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/8/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="node")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/9/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.id===void 0){let i={instancePath:n,schemaPath:"#/oneOf/9/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[i]:e.push(i),s++}if(t.children===void 0){let i={instancePath:n,schemaPath:"#/oneOf/9/required",keyword:"required",params:{missingProperty:"children"},message:"must have required property 'children'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="id"||i==="children"||i==="hash")){let c={instancePath:n,schemaPath:"#/oneOf/9/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="node"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/9/properties/type/const",keyword:"const",params:{allowedValue:"node"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.id!==void 0){let i=t.id;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.children!==void 0){let i=t.children;if(Array.isArray(i)){if(i.length<1){let m={instancePath:n+"/children",schemaPath:"#/oneOf/9/properties/children/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[m]:e.push(m),s++}let c=i.length;for(let m=0;m<c;m++){let f=i[m];if(typeof f=="string"){if(!Te.test(f)){let d={instancePath:n+"/children/"+m,schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[d]:e.push(d),s++}}else{let d={instancePath:n+"/children/"+m,schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[d]:e.push(d),s++}}}else{let c={instancePath:n+"/children",schemaPath:"#/oneOf/9/properties/children/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[c]:e.push(c),s++}}if(t.hash!==void 0){let i=t.hash;if(typeof i=="string"){if(!ns.test(i)){let c={instancePath:n+"/hash",schemaPath:"#/definitions/hash/pattern",keyword:"pattern",params:{pattern:"^[0-9a-f]{4,40}$"},message:'must match pattern "^[0-9a-f]{4,40}$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/hash",schemaPath:"#/definitions/hash/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/9/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="line")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/10/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/10/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}if(t.items===void 0){let i={instancePath:n,schemaPath:"#/oneOf/10/required",keyword:"required",params:{missingProperty:"items"},message:"must have required property 'items'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box"||i==="items")){let c={instancePath:n,schemaPath:"#/oneOf/10/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="line"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/10/properties/type/const",keyword:"const",params:{allowedValue:"line"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.items!==void 0){let i=t.items;if(Array.isArray(i)){if(i.length>12){let m={instancePath:n+"/items",schemaPath:"#/oneOf/10/properties/items/maxItems",keyword:"maxItems",params:{limit:12},message:"must NOT have more than 12 items"};e===null?e=[m]:e.push(m),s++}if(i.length<1){let m={instancePath:n+"/items",schemaPath:"#/oneOf/10/properties/items/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[m]:e.push(m),s++}let c=i.length;for(let m=0;m<c;m++){let f=i[m];if(typeof f=="string"){if(!Te.test(f)){let d={instancePath:n+"/items/"+m,schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[d]:e.push(d),s++}}else{let d={instancePath:n+"/items/"+m,schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[d]:e.push(d),s++}}}else{let c={instancePath:n+"/items",schemaPath:"#/oneOf/10/properties/items/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/10/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="seal")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/11/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/11/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box")){let c={instancePath:n,schemaPath:"#/oneOf/11/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="seal"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/11/properties/type/const",keyword:"const",params:{allowedValue:"seal"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/11/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="open")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/12/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/12/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box")){let c={instancePath:n,schemaPath:"#/oneOf/12/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="open"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/12/properties/type/const",keyword:"const",params:{allowedValue:"open"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/12/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="pick")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/13/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/13/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box")){let c={instancePath:n,schemaPath:"#/oneOf/13/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="pick"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/13/properties/type/const",keyword:"const",params:{allowedValue:"pick"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/13/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="stamp")if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let i={instancePath:n,schemaPath:"#/oneOf/14/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[i]:e.push(i),s++}if(t.box===void 0){let i={instancePath:n,schemaPath:"#/oneOf/14/required",keyword:"required",params:{missingProperty:"box"},message:"must have required property 'box'"};e===null?e=[i]:e.push(i),s++}if(t.text===void 0){let i={instancePath:n,schemaPath:"#/oneOf/14/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};e===null?e=[i]:e.push(i),s++}for(let i in t)if(!(i==="type"||i==="box"||i==="text")){let c={instancePath:n,schemaPath:"#/oneOf/14/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"};e===null?e=[c]:e.push(c),s++}if(t.type!==void 0&&t.type!=="stamp"){let i={instancePath:n+"/type",schemaPath:"#/oneOf/14/properties/type/const",keyword:"const",params:{allowedValue:"stamp"},message:"must be equal to constant"};e===null?e=[i]:e.push(i),s++}if(t.box!==void 0){let i=t.box;if(typeof i=="string"){if(!Te.test(i)){let c={instancePath:n+"/box",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/box",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}if(t.text!==void 0){let i=t.text;if(typeof i=="string"){if(Ne(i)<1){let c={instancePath:n+"/text",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[c]:e.push(c),s++}}else{let c={instancePath:n+"/text",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[c]:e.push(c),s++}}}else{let i={instancePath:n,schemaPath:"#/oneOf/14/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[i]:e.push(i),s++}else if(o==="strip"){let i=s,c=!1,m=s;if(t&&typeof t=="object"&&!Array.isArray(t)&&t.value===void 0){let f={instancePath:n,schemaPath:"#/oneOf/15/anyOf/0/required",keyword:"required",params:{missingProperty:"value"},message:"must have required property 'value'"};e===null?e=[f]:e.push(f),s++}var r=m===s;if(c=c||r,!c){let f=s;if(t&&typeof t=="object"&&!Array.isArray(t)&&t.tag===void 0){let u={instancePath:n,schemaPath:"#/oneOf/15/anyOf/1/required",keyword:"required",params:{missingProperty:"tag"},message:"must have required property 'tag'"};e===null?e=[u]:e.push(u),s++}var r=f===s;c=c||r}if(c)s=i,e!==null&&(i?e.length=i:e=null);else{let f={instancePath:n,schemaPath:"#/oneOf/15/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};e===null?e=[f]:e.push(f),s++}if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.type===void 0){let f={instancePath:n,schemaPath:"#/oneOf/15/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};e===null?e=[f]:e.push(f),s++}if(t.field===void 0){let f={instancePath:n,schemaPath:"#/oneOf/15/required",keyword:"required",params:{missingProperty:"field"},message:"must have required property 'field'"};e===null?e=[f]:e.push(f),s++}for(let f in t)if(!(f==="type"||f==="field"||f==="value"||f==="tag")){let d={instancePath:n,schemaPath:"#/oneOf/15/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:f},message:"must NOT have additional properties"};e===null?e=[d]:e.push(d),s++}if(t.type!==void 0&&t.type!=="strip"){let f={instancePath:n+"/type",schemaPath:"#/oneOf/15/properties/type/const",keyword:"const",params:{allowedValue:"strip"},message:"must be equal to constant"};e===null?e=[f]:e.push(f),s++}if(t.field!==void 0){let f=t.field;if(typeof f=="string"){if(Ne(f)<1){let d={instancePath:n+"/field",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[d]:e.push(d),s++}}else{let d={instancePath:n+"/field",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[d]:e.push(d),s++}}if(t.value!==void 0){let f=t.value;if(typeof f=="string"){if(Ne(f)<1){let d={instancePath:n+"/value",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[d]:e.push(d),s++}}else{let d={instancePath:n+"/value",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[d]:e.push(d),s++}}if(t.tag!==void 0){let f=t.tag;if(typeof f=="string"){if(Ne(f)<1){let d={instancePath:n+"/tag",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[d]:e.push(d),s++}}else{let d={instancePath:n+"/tag",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[d]:e.push(d),s++}}}else{let f={instancePath:n,schemaPath:"#/oneOf/15/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[f]:e.push(f),s++}}else{let i={instancePath:n,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"mapping",tag:"type",tagValue:o},message:'value of tag "type" must be in oneOf'};e===null?e=[i]:e.push(i),s++}else{let i={instancePath:n,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"tag",tag:"type",tagValue:o},message:'tag "type" must be string'};e===null?e=[i]:e.push(i),s++}}else{let o={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[o]:e.push(o),s++}return yn.errors=e,s===0}function bn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.title===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};e===null?e=[r]:e.push(r),s++}if(t.body===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"body"},message:"must have required property 'body'"};e===null?e=[r]:e.push(r),s++}if(t.events===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"events"},message:"must have required property 'events'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="title"||r==="body"||r==="code"||r==="sources"||r==="events")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.title!==void 0){let r=t.title;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.body!==void 0){let r=t.body;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/body",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/body",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.code!==void 0){let r=t.code;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/code",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/code",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.sources!==void 0){let r=t.sources;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/sources",schemaPath:"#/properties/sources/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++)hn(r[i],{instancePath:n+"/sources/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?hn.errors:e.concat(hn.errors),s=e.length)}else{let o={instancePath:n+"/sources",schemaPath:"#/properties/sources/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}if(t.events!==void 0){let r=t.events;if(Array.isArray(r)){let o=r.length;for(let i=0;i<o;i++)yn(r[i],{instancePath:n+"/events/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?yn.errors:e.concat(yn.errors),s=e.length)}else{let o={instancePath:n+"/events",schemaPath:"#/properties/events/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return bn.errors=e,s===0}function xn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.lifelines===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"lifelines"},message:"must have required property 'lifelines'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(r!=="lifelines"){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.lifelines!==void 0){let r=t.lifelines;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/lifelines",schemaPath:"#/properties/lifelines/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++){let c=r[i];if(typeof c=="string"){if(!Te.test(c)){let m={instancePath:n+"/lifelines/"+i,schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[m]:e.push(m),s++}}else{let m={instancePath:n+"/lifelines/"+i,schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[m]:e.push(m),s++}}}else{let o={instancePath:n+"/lifelines",schemaPath:"#/properties/lifelines/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return xn.errors=e,s===0}function wn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.from===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};e===null?e=[r]:e.push(r),s++}if(t.to===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="from"||r==="to"||r==="label")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.from!==void 0){let r=t.from;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/from",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/from",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.to!==void 0){let r=t.to;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/to",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/to",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.label!==void 0){let r=t.label;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/label",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/label",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return wn.errors=e,s===0}function $n(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.paths===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"paths"},message:"must have required property 'paths'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(r!=="paths"){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.paths!==void 0){let r=t.paths;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/paths",schemaPath:"#/properties/paths/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++)wn(r[i],{instancePath:n+"/paths/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?wn.errors:e.concat(wn.errors),s=e.length)}else{let o={instancePath:n+"/paths",schemaPath:"#/properties/paths/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return $n.errors=e,s===0}function kn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.id===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="id"||r==="note")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.id!==void 0){let r=t.id;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.note!==void 0){let r=t.note;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/note",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/note",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return kn.errors=e,s===0}function vn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.branches===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"branches"},message:"must have required property 'branches'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(r!=="branches"){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.branches!==void 0){let r=t.branches;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/branches",schemaPath:"#/properties/branches/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++)kn(r[i],{instancePath:n+"/branches/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?kn.errors:e.concat(kn.errors),s=e.length)}else{let o={instancePath:n+"/branches",schemaPath:"#/properties/branches/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return vn.errors=e,s===0}var Wi=new RegExp("^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$","u");function Pn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.unit===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"unit"},message:"must have required property 'unit'"};e===null?e=[r]:e.push(r),s++}if(t.length===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"length"},message:"must have required property 'length'"};e===null?e=[r]:e.push(r),s++}if(t.count===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"count"},message:"must have required property 'count'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="unit"||r==="length"||r==="count"||r==="from")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.unit!==void 0){let r=t.unit;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/unit",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/unit",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.length!==void 0){let r=t.length;if(typeof r=="string"){if(!Wi.test(r)){let o={instancePath:n+"/length",schemaPath:"#/definitions/duration/pattern",keyword:"pattern",params:{pattern:"^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$"},message:'must match pattern "^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/length",schemaPath:"#/definitions/duration/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.count!==void 0){let r=t.count;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/count",schemaPath:"#/properties/count/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<1||isNaN(r))){let o={instancePath:n+"/count",schemaPath:"#/properties/count/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};e===null?e=[o]:e.push(o),s++}}if(t.from!==void 0){let r=t.from;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/from",schemaPath:"#/properties/from/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<0||isNaN(r))){let o={instancePath:n+"/from",schemaPath:"#/properties/from/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return Pn.errors=e,s===0}function Sn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.name===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};e===null?e=[r]:e.push(r),s++}if(t.length===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"length"},message:"must have required property 'length'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="name"||r==="length"||r==="from")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.name!==void 0){let r=t.name;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.length!==void 0){let r=t.length;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/length",schemaPath:"#/properties/length/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<1||isNaN(r))){let o={instancePath:n+"/length",schemaPath:"#/properties/length/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};e===null?e=[o]:e.push(o),s++}}if(t.from!==void 0){let r=t.from;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/from",schemaPath:"#/properties/from/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<0||isNaN(r))){let o={instancePath:n+"/from",schemaPath:"#/properties/from/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return Sn.errors=e,s===0}function Mn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.id===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[r]:e.push(r),s++}if(t.name===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="id"||r==="name"||r==="color"||r==="empty")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.id!==void 0){let r=t.id;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.name!==void 0){let r=t.name;if(typeof r=="string"){if(Ne(r)<1){let o={instancePath:n+"/name",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/name",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.color!==void 0){let r=t.color;if(!(r==="blue"||r==="amber"||r==="green"||r==="violet"||r==="rose"||r==="slate"||r==="coin")){let o={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[o]:e.push(o),s++}}if(t.empty!==void 0){let r=t.empty;if(Array.isArray(r)){let o=r.length;for(let i=0;i<o;i++){let c=r[i];if(!(typeof c=="number"&&!(c%1)&&!isNaN(c)&&isFinite(c))){let m={instancePath:n+"/empty/"+i,schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[m]:e.push(m),s++}if(typeof c=="number"&&isFinite(c)&&(c<0||isNaN(c))){let m={instancePath:n+"/empty/"+i,schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[m]:e.push(m),s++}}}else{let o={instancePath:n+"/empty",schemaPath:"#/properties/empty/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return Mn.errors=e,s===0}function On(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.id===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[r]:e.push(r),s++}if(t.at===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"at"},message:"must have required property 'at'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="id"||r==="at")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.id!==void 0){let r=t.id;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.at!==void 0){let r=t.at;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/at",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<0||isNaN(r))){let o={instancePath:n+"/at",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return On.errors=e,s===0}function Tn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.from===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"from"},message:"must have required property 'from'"};e===null?e=[r]:e.push(r),s++}if(t.to===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"to"},message:"must have required property 'to'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="from"||r==="to")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.from!==void 0){let r=t.from;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/from",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<0||isNaN(r))){let o={instancePath:n+"/from",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[o]:e.push(o),s++}}if(t.to!==void 0){let r=t.to;if(!(typeof r=="number"&&!(r%1)&&!isNaN(r)&&isFinite(r))){let o={instancePath:n+"/to",schemaPath:"#/definitions/unit/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[o]:e.push(o),s++}if(typeof r=="number"&&isFinite(r)&&(r<0||isNaN(r))){let o={instancePath:n+"/to",schemaPath:"#/definitions/unit/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return Tn.errors=e,s===0}function Nn(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.scale===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"scale"},message:"must have required property 'scale'"};e===null?e=[r]:e.push(r),s++}if(t.rows===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"rows"},message:"must have required property 'rows'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="scale"||r==="period"||r==="rows"||r==="points"||r==="zoom")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.scale!==void 0&&(Pn(t.scale,{instancePath:n+"/scale",parentData:t,parentDataProperty:"scale",rootData:l})||(e=e===null?Pn.errors:e.concat(Pn.errors),s=e.length)),t.period!==void 0&&(Sn(t.period,{instancePath:n+"/period",parentData:t,parentDataProperty:"period",rootData:l})||(e=e===null?Sn.errors:e.concat(Sn.errors),s=e.length)),t.rows!==void 0){let r=t.rows;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/rows",schemaPath:"#/properties/rows/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++)Mn(r[i],{instancePath:n+"/rows/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?Mn.errors:e.concat(Mn.errors),s=e.length)}else{let o={instancePath:n+"/rows",schemaPath:"#/properties/rows/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}if(t.points!==void 0){let r=t.points;if(Array.isArray(r)){let o=r.length;for(let i=0;i<o;i++)On(r[i],{instancePath:n+"/points/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?On.errors:e.concat(On.errors),s=e.length)}else{let o={instancePath:n+"/points",schemaPath:"#/properties/points/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}t.zoom!==void 0&&(Tn(t.zoom,{instancePath:n+"/zoom",parentData:t,parentDataProperty:"zoom",rootData:l})||(e=e===null?Tn.errors:e.concat(Tn.errors),s=e.length))}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return Nn.errors=e,s===0}function En(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.id===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(!(r==="id"||r==="color"||r==="label")){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.id!==void 0){let r=t.id;if(typeof r=="string"){if(!Te.test(r)){let o={instancePath:n+"/id",schemaPath:"#/definitions/id/pattern",keyword:"pattern",params:{pattern:"^[^\\s\\[\\]\u300C\u300D=:]+$"},message:'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"'};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/id",schemaPath:"#/definitions/id/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.color!==void 0){let r=t.color;if(!(r==="blue"||r==="amber"||r==="green"||r==="violet"||r==="rose"||r==="slate"||r==="coin")){let o={instancePath:n+"/color",schemaPath:"#/definitions/color/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"};e===null?e=[o]:e.push(o),s++}}if(t.label!==void 0){let r=t.label;if(typeof r=="string"){if(Ne(r)>4){let o={instancePath:n+"/label",schemaPath:"#/properties/label/maxLength",keyword:"maxLength",params:{limit:4},message:"must NOT have more than 4 characters"};e===null?e=[o]:e.push(o),s++}if(Ne(r)<1){let o={instancePath:n+"/label",schemaPath:"#/properties/label/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[o]:e.push(o),s++}}else{let o={instancePath:n+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return En.errors=e,s===0}function Ln(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.items===void 0){let r={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"items"},message:"must have required property 'items'"};e===null?e=[r]:e.push(r),s++}for(let r in t)if(r!=="items"){let o={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:r},message:"must NOT have additional properties"};e===null?e=[o]:e.push(o),s++}if(t.items!==void 0){let r=t.items;if(Array.isArray(r)){if(r.length<1){let i={instancePath:n+"/items",schemaPath:"#/properties/items/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[i]:e.push(i),s++}let o=r.length;for(let i=0;i<o;i++)En(r[i],{instancePath:n+"/items/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?En.errors:e.concat(En.errors),s=e.length)}else{let o={instancePath:n+"/items",schemaPath:"#/properties/items/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[o]:e.push(o),s++}}}else{let r={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[r]:e.push(r),s++}return Ln.errors=e,s===0}var Hi=Object.prototype.hasOwnProperty;function br(t,{instancePath:n="",parentData:a,parentDataProperty:p,rootData:l=t}={}){let e=null,s=0,r=s,o=!0,i=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let g;if(t.kind===void 0&&(g="kind")){let L={};e===null?e=[L]:e.push(L),s++}else if(t.kind!==void 0&&t.kind!=="sequence"){let L={};e===null?e=[L]:e.push(L),s++}}var c=i===s;s=r,e!==null&&(r?e.length=r:e=null);let m;if(c){let g=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.sequence===void 0){let O={instancePath:n,schemaPath:"#/then/required",keyword:"required",params:{missingProperty:"sequence"},message:"must have required property 'sequence'"};e===null?e=[O]:e.push(O),s++}if(t.boxes!==void 0){let O=t.boxes;if(Array.isArray(O)&&O.length<1){let _={instancePath:n+"/boxes",schemaPath:"#/then/properties/boxes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[_]:e.push(_),s++}}if(t.steps!==void 0&&(ct(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?ct.errors:e.concat(ct.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let O={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[O]:e.push(O),s++}if(t.git!==void 0){let O={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[O]:e.push(O),s++}if(t.time!==void 0){let O={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[O]:e.push(O),s++}if(t.lineup!==void 0){let O={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[O]:e.push(O),s++}}var c=g===s;o=c,m="then"}else{let g=s,L=s,O=!0,_=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let $;if(t.kind===void 0&&($="kind")){let S={};e===null?e=[S]:e.push(S),s++}else if(t.kind!==void 0&&t.kind!=="state"){let S={};e===null?e=[S]:e.push(S),s++}}var f=_===s;s=L,e!==null&&(L?e.length=L:e=null);let P;if(f){let $=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.boxes!==void 0){let y=t.boxes;if(Array.isArray(y)){if(y.length<1){let C={instancePath:n+"/boxes",schemaPath:"#/else/then/properties/boxes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[C]:e.push(C),s++}let F=y.length;for(let C=0;C<F;C++){let X=y[C];if(X&&typeof X=="object"&&!Array.isArray(X)&&X.id!==void 0){let z=X.id,Q=s,B=s;if(!(z==="start"||z==="finish")){let v={};e===null?e=[v]:e.push(v),s++}var d=B===s;if(d){let v={instancePath:n+"/boxes/"+C+"/id",schemaPath:"#/else/then/properties/boxes/items/properties/id/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[v]:e.push(v),s++}else s=Q,e!==null&&(Q?e.length=Q:e=null)}}}}if(t.steps!==void 0&&(ct(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?ct.errors:e.concat(ct.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.git!==void 0){let y={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[y]:e.push(y),s++}if(t.time!==void 0){let y={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[y]:e.push(y),s++}if(t.lineup!==void 0){let y={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[y]:e.push(y),s++}}var f=$===s;O=f,P="then"}else{let $=s,S=s,y=!0,F=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let z;if(t.kind===void 0&&(z="kind")){let Q={};e===null?e=[Q]:e.push(Q),s++}else if(t.kind!==void 0&&t.kind!=="git"){let Q={};e===null?e=[Q]:e.push(Q),s++}}var u=F===s;s=S,e!==null&&(S?e.length=S:e=null);let C;if(u){let z=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.git===void 0){let B={instancePath:n,schemaPath:"#/else/else/then/required",keyword:"required",params:{missingProperty:"git"},message:"must have required property 'git'"};e===null?e=[B]:e.push(B),s++}if(t.steps!==void 0&&(an(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?an.errors:e.concat(an.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let B={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[B]:e.push(B),s++}if(t.regions!==void 0){let B={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[B]:e.push(B),s++}if(t.time!==void 0){let B={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[B]:e.push(B),s++}if(t.lineup!==void 0){let B={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[B]:e.push(B),s++}}var u=z===s;y=u,C="then"}else{let z=s,Q=s,B=!0,v=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let W;if(t.kind===void 0&&(W="kind")){let J={};e===null?e=[J]:e.push(J),s++}else if(t.kind!==void 0&&t.kind!=="time"){let J={};e===null?e=[J]:e.push(J),s++}}var M=v===s;s=Q,e!==null&&(Q?e.length=Q:e=null);let I;if(M){let W=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.time===void 0){let Z={instancePath:n,schemaPath:"#/else/else/else/then/required",keyword:"required",params:{missingProperty:"time"},message:"must have required property 'time'"};e===null?e=[Z]:e.push(Z),s++}if(t.steps!==void 0&&(ln(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?ln.errors:e.concat(ln.errors),s=e.length)),t.state!==void 0){let Z={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[Z]:e.push(Z),s++}if(t.git!==void 0){let Z={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[Z]:e.push(Z),s++}if(t.regions!==void 0){let Z={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[Z]:e.push(Z),s++}if(t.lineup!==void 0){let Z={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[Z]:e.push(Z),s++}}var M=W===s;B=M,I="then"}else{let W=s,J=s,Z=!0,ie=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let D;if(t.kind===void 0&&(D="kind")){let me={};e===null?e=[me]:e.push(me),s++}else if(t.kind!==void 0&&t.kind!=="tree"){let me={};e===null?e=[me]:e.push(me),s++}}var x=ie===s;s=J,e!==null&&(J?e.length=J:e=null);let de;if(x){let D=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.steps!==void 0&&(pn(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?pn.errors:e.concat(pn.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let ae={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ae]:e.push(ae),s++}if(t.git!==void 0){let ae={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ae]:e.push(ae),s++}if(t.time!==void 0){let ae={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ae]:e.push(ae),s++}if(t.regions!==void 0){let ae={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ae]:e.push(ae),s++}if(t.lineup!==void 0){let ae={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ae]:e.push(ae),s++}}var x=D===s;Z=x,de="then"}else{let D=s,me=s,ae=!0,ye=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let N;if(t.kind===void 0&&(N="kind")){let se={};e===null?e=[se]:e.push(se),s++}else if(t.kind!==void 0&&t.kind!=="lineup"){let se={};e===null?e=[se]:e.push(se),s++}}var h=ye===s;s=me,e!==null&&(me?e.length=me:e=null);let we;if(h){let N=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.lineup===void 0){let T={instancePath:n,schemaPath:"#/else/else/else/else/else/then/required",keyword:"required",params:{missingProperty:"lineup"},message:"must have required property 'lineup'"};e===null?e=[T]:e.push(T),s++}if(t.boxes!==void 0){let T=t.boxes;if(Array.isArray(T)){if(T.length<1){let b={instancePath:n+"/boxes",schemaPath:"#/else/else/else/else/else/then/properties/boxes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[b]:e.push(b),s++}let ee=T.length;for(let b=0;b<ee;b++){let G=T[b];if(G&&typeof G=="object"&&!Array.isArray(G)){if(G.icon!==void 0){let q={instancePath:n+"/boxes/"+b+"/icon",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[q]:e.push(q),s++}if(G.link!==void 0){let q={instancePath:n+"/boxes/"+b+"/link",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[q]:e.push(q),s++}if(G.region!==void 0){let q={instancePath:n+"/boxes/"+b+"/region",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[q]:e.push(q),s++}}}}}if(t.steps!==void 0&&(cn(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?cn.errors:e.concat(cn.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let T={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}if(t.git!==void 0){let T={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}if(t.time!==void 0){let T={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}if(t.regions!==void 0){let T={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}}var h=N===s;ae=h,we="then"}else{let N=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.boxes!==void 0){let T=t.boxes;if(Array.isArray(T)&&T.length<1){let ee={instancePath:n+"/boxes",schemaPath:"#/else/else/else/else/else/else/properties/boxes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[ee]:e.push(ee),s++}}if(t.steps!==void 0&&(ct(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?ct.errors:e.concat(ct.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let T={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}if(t.git!==void 0){let T={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}if(t.time!==void 0){let T={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}if(t.lineup!==void 0){let T={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[T]:e.push(T),s++}}var h=N===s;ae=h,we="else"}if(!ae){let N={instancePath:n,schemaPath:"#/else/else/else/else/else/if",keyword:"if",params:{failingKeyword:we},message:'must match "'+we+'" schema'};e===null?e=[N]:e.push(N),s++}var x=D===s;Z=x,de="else"}if(!Z){let D={instancePath:n,schemaPath:"#/else/else/else/else/if",keyword:"if",params:{failingKeyword:de},message:'must match "'+de+'" schema'};e===null?e=[D]:e.push(D),s++}var M=W===s;B=M,I="else"}if(!B){let W={instancePath:n,schemaPath:"#/else/else/else/if",keyword:"if",params:{failingKeyword:I},message:'must match "'+I+'" schema'};e===null?e=[W]:e.push(W),s++}var u=z===s;y=u,C="else"}if(!y){let z={instancePath:n,schemaPath:"#/else/else/if",keyword:"if",params:{failingKeyword:C},message:'must match "'+C+'" schema'};e===null?e=[z]:e.push(z),s++}var f=$===s;O=f,P="else"}if(!O){let $={instancePath:n,schemaPath:"#/else/if",keyword:"if",params:{failingKeyword:P},message:'must match "'+P+'" schema'};e===null?e=[$]:e.push($),s++}if(t&&typeof t=="object"&&!Array.isArray(t)&&t.sequence!==void 0){let $={instancePath:n+"/sequence",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[$]:e.push($),s++}var c=g===s;o=c,m="else"}if(!o){let g={instancePath:n,schemaPath:"#/if",keyword:"if",params:{failingKeyword:m},message:'must match "'+m+'" schema'};e===null?e=[g]:e.push(g),s++}if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.version===void 0){let g={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"version"},message:"must have required property 'version'"};e===null?e=[g]:e.push(g),s++}if(t.kind===void 0){let g={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"kind"},message:"must have required property 'kind'"};e===null?e=[g]:e.push(g),s++}if(t.title===void 0){let g={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};e===null?e=[g]:e.push(g),s++}if(t.boxes===void 0){let g={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"boxes"},message:"must have required property 'boxes'"};e===null?e=[g]:e.push(g),s++}if(t.steps===void 0){let g={instancePath:n,schemaPath:"#/required",keyword:"required",params:{missingProperty:"steps"},message:"must have required property 'steps'"};e===null?e=[g]:e.push(g),s++}for(let g in t)if(!Hi.call(ts.properties,g)){let L={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:g},message:"must NOT have additional properties"};e===null?e=[L]:e.push(L),s++}if(t.version!==void 0){let g=t.version;if(!(typeof g=="number"&&!(g%1)&&!isNaN(g)&&isFinite(g))){let L={instancePath:n+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[L]:e.push(L),s++}if(typeof g=="number"&&isFinite(g)&&(g<1||isNaN(g))){let L={instancePath:n+"/version",schemaPath:"#/properties/version/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};e===null?e=[L]:e.push(L),s++}}if(t.kind!==void 0){let g=t.kind;if(!(g==="sequence"||g==="architecture"||g==="state"||g==="git"||g==="time"||g==="tree"||g==="lineup")){let L={instancePath:n+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues:ts.properties.kind.enum},message:"must be equal to one of the allowed values"};e===null?e=[L]:e.push(L),s++}}if(t.title!==void 0){let g=t.title;if(typeof g=="string"){if(Ne(g)<1){let L={instancePath:n+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[L]:e.push(L),s++}}else{let L={instancePath:n+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[L]:e.push(L),s++}}if(t.view!==void 0){let g=t.view;if(!(g==="fixed"||g==="follow")){let L={instancePath:n+"/view",schemaPath:"#/properties/view/enum",keyword:"enum",params:{allowedValues:ts.properties.view.enum},message:"must be equal to one of the allowed values"};e===null?e=[L]:e.push(L),s++}}if(t.regions!==void 0){let g=t.regions;if(Array.isArray(g)){let L=g.length;for(let O=0;O<L;O++)dn(g[O],{instancePath:n+"/regions/"+O,parentData:g,parentDataProperty:O,rootData:l})||(e=e===null?dn.errors:e.concat(dn.errors),s=e.length)}else{let L={instancePath:n+"/regions",schemaPath:"#/properties/regions/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[L]:e.push(L),s++}}if(t.boxes!==void 0){let g=t.boxes;if(Array.isArray(g)){let L=g.length;for(let O=0;O<L;O++)mn(g[O],{instancePath:n+"/boxes/"+O,parentData:g,parentDataProperty:O,rootData:l})||(e=e===null?mn.errors:e.concat(mn.errors),s=e.length)}else{let L={instancePath:n+"/boxes",schemaPath:"#/properties/boxes/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[L]:e.push(L),s++}}if(t.strip!==void 0&&(un(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?un.errors:e.concat(un.errors),s=e.length)),t.steps!==void 0){let g=t.steps;if(Array.isArray(g)){if(g.length<1){let O={instancePath:n+"/steps",schemaPath:"#/properties/steps/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[O]:e.push(O),s++}let L=g.length;for(let O=0;O<L;O++)bn(g[O],{instancePath:n+"/steps/"+O,parentData:g,parentDataProperty:O,rootData:l})||(e=e===null?bn.errors:e.concat(bn.errors),s=e.length)}else{let L={instancePath:n+"/steps",schemaPath:"#/properties/steps/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[L]:e.push(L),s++}}t.sequence!==void 0&&(xn(t.sequence,{instancePath:n+"/sequence",parentData:t,parentDataProperty:"sequence",rootData:l})||(e=e===null?xn.errors:e.concat(xn.errors),s=e.length)),t.state!==void 0&&($n(t.state,{instancePath:n+"/state",parentData:t,parentDataProperty:"state",rootData:l})||(e=e===null?$n.errors:e.concat($n.errors),s=e.length)),t.git!==void 0&&(vn(t.git,{instancePath:n+"/git",parentData:t,parentDataProperty:"git",rootData:l})||(e=e===null?vn.errors:e.concat(vn.errors),s=e.length)),t.time!==void 0&&(Nn(t.time,{instancePath:n+"/time",parentData:t,parentDataProperty:"time",rootData:l})||(e=e===null?Nn.errors:e.concat(Nn.errors),s=e.length)),t.lineup!==void 0&&(Ln(t.lineup,{instancePath:n+"/lineup",parentData:t,parentDataProperty:"lineup",rootData:l})||(e=e===null?Ln.errors:e.concat(Ln.errors),s=e.length))}else{let g={instancePath:n,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};e===null?e=[g]:e.push(g),s++}return br.errors=e,s===0}var Xi=Object.keys(Ft),zi=["edge","action","swap","strip","commit","branch","now","mark","span","leaf","node","line","seal","open","pick","stamp"],Ui="#/definitions/absent/not",Ji={regions:"sequence / architecture / state",at:"time",into:"time",color:"time",meters:"time",region:"sequence / architecture / state",icon:"sequence / architecture / state / git / time / tree",link:"sequence / architecture / state / git / time / tree"},Zi={carry:{field:"text",kind:"tag"}},Qi=/\/boxes\/items\/properties\/id\/not$/u,eo=/\/events\/items\/properties\/type\/not$/u,to=["commit","branch"],no=/\/events\/items\/not$/u,so=["now","mark","span"],ro=/\/events\/items\/allOf\/0\/not$/u,io=["leaf","node"],oo="#/definitions/notLineupEvent/not",ao=["line","seal","open","pick","stamp"],lo="#/definitions/notWiredEvent/not",po=["edge","action"],co=/^\^\[0-9\]\+\(\\\.\[0-9\]\+\)\?\(([a-z|]+)\)\$$/u,mo=/%\)\$$/u,rs=t=>t.replaceAll("~","~0").replaceAll("/","~1");function fo(t,n){let a=t;for(let p of n.split("/").slice(1)){if(typeof a!="object"||a===null)return;a=a[p.replaceAll("~1","/").replaceAll("~0","~")]}return a}var uo="#/definitions/url/pattern",ho="#/definitions/icon/enum",go=/^\^\[0-9a-f\]\{(\d+),(\d+)\}\$$/u;function yo(t){let n=/^\^\[\^(.+)\]\+\$$/u.exec(t)?.[1];if(n===void 0)return;let a=n.match(/\\.|[^\\]/gu)??[];return{space:a.includes("\\s"),chars:a.filter(p=>p!=="\\s").map(p=>p.replace(/^\\/u,""))}}var xr=(t,n)=>n.filter(a=>a!==t&&a.schemaPath.startsWith(`${t.schemaPath}/`)&&(a.instancePath===t.instancePath||a.instancePath.startsWith(`${t.instancePath}/`)));function bo(t,n,a,p){let l=t.params,e=t.instancePath;switch(t.keyword){case"additionalProperties":{let s=String(l.additionalProperty);return{pointer:`${e}/${rs(s)}`,message:a.additionalProperties(s)}}case"required":{let s=String(l.missingProperty);return{pointer:`${e}/${rs(s)}`,message:a.required(s)}}case"not":{if(Qi.test(t.schemaPath))return{pointer:e,message:a.reserved(Nt)};if(eo.test(t.schemaPath))return{pointer:e,message:a.kindOnly(to,"git")};if(no.test(t.schemaPath))return{pointer:`${e}/type`,message:a.kindOnly(so,"time")};if(ro.test(t.schemaPath))return{pointer:`${e}/type`,message:a.kindOnly(io,"tree")};if(t.schemaPath===oo)return{pointer:`${e}/type`,message:a.kindOnly(ao,"lineup")};if(t.schemaPath===lo)return{pointer:`${e}/type`,message:a.kindOnly(po,"sequence / architecture / state / git / time / tree")};let s=e.slice(e.lastIndexOf("/")+1);if(t.schemaPath===Ui)return{pointer:e,message:a.not({field:s,kind:Ji[s]??s})};let r=Zi[s];return{pointer:r?`${e}/${r.field}`:e,message:a.not(r)}}case"anyOf":{let s=xr(t,n),r=s.every(o=>o.keyword==="required")?s.map(o=>String(o.params.missingProperty)):[];return{pointer:e,message:a.anyOf(r)}}case"discriminator":{let s=String(l.tag);return{pointer:`${e}/${rs(s)}`,message:a.discriminator(s,zi)}}case"enum":{let s=t.schemaPath===ho?fo(p,e):void 0,r=typeof s=="string"?ur(s,Xi):void 0;return typeof s=="string"&&r!==void 0?{pointer:e,message:a.unknownIcon(s,r)}:{pointer:e,message:a.enum(l.allowedValues.map(String))}}case"type":return{pointer:e,message:a.type(String(l.type))};case"minLength":return{pointer:e,message:a.minLength(Number(l.limit))};case"maxLength":return{pointer:e,message:a.maxLength(Number(l.limit))};case"pattern":{if(t.schemaPath===uo)return{pointer:e,message:a.url};let s=String(l.pattern),r=go.exec(s);if(r)return{pointer:e,message:a.hex(Number(r[1]),Number(r[2]))};let o=co.exec(s);return o?{pointer:e,message:a.duration((o[1]??"").split("|"))}:mo.test(s)?{pointer:e,message:a.ratio}:{pointer:e,message:a.pattern(yo(s))}}case"minItems":return{pointer:e,message:a.minItems(Number(l.limit))};case"maxItems":return{pointer:e,message:a.maxItems(Number(l.limit))};case"minimum":return{pointer:e,message:a.minimum(Number(l.limit))};case"const":return{pointer:e,message:a.const(String(l.allowedValue))};case"oneOf":return{pointer:e,message:a.oneOf};default:return{pointer:e,message:t.message??t.keyword}}}function wr(t,n={}){if(ss(t))return{ok:!0};let a=ss.errors??[],p=new Set(a.filter(s=>s.keyword==="anyOf").flatMap(s=>xr(s,a))),l=on[n.lang??"ja"];return{ok:!1,errors:a.filter(s=>s.keyword!=="if"&&!p.has(s)).map(s=>bo(s,a,l,t))}}var $r=1;function xo(t){if(typeof t!="object"||t===null)return;let n=t.version;return typeof n=="number"&&n>$r?n:void 0}var wo=(t,n)=>({pointer:"/version",message:on[n].newer(t,$r)});function kr(t,n={}){let a=xo(t);if(a!==void 0)return{ok:!1,errors:[wo(a,n.lang??"ja")]};let p=wr(t,n);return p.ok?{ok:!0,diagram:t,warnings:[]}:p}var $o={line:oe.lineup.slide,seal:oe.lineup.seal,open:oe.fade,pick:oe.fade,stamp:oe.popFade};function vr(t,n){let a={edges:[],events:[],busy:0},p=oe.edgeAt,l,e=0,s=Number.NEGATIVE_INFINITY,r=(f,d,u)=>{let M=d.carry.kind!=="none",x=u+(M?oe.drawCarry:oe.draw);return a.edges.push({event:f,a:u,b:x,carries:M,coin:d.carry.kind==="coin",named:d.label!==void 0}),a.busy=Math.max(a.busy,x),x},o=n?t.events.flatMap((f,d)=>f.type==="now"?[{e:d,to:f.to}]:[]):[],i=n?.from??0,c=Math.max(i,...o.map(f=>f.to+1)),m=f=>f.type==="edge"&&f.at!==void 0&&f.at>=i&&f.at<c;return t.events.forEach((f,d)=>{if(n&&d===o[0]?.e){let u=Math.max(p,s+oe.change),M=[[u,i]],x=[];for(let h=i;h<c;h++){let g=u,L=t.events.flatMap((P,j)=>m(P)&&P.at===h?[{k:j,ev:P}]:[]),O=L.reduce((P,j,$)=>Math.max(P,r(j.k,j.ev,g+oe.stagger*$)),g),_=Math.max(g+n.speed,L.length>0?O+oe.time.wait:g);_-n.speed>g+1e-9&&M.push([_-n.speed,h]),M.push([_,h+1]),x.push({unit:h,at:_}),u=_}a.sweep={keys:M,passed:x},a.busy=Math.max(a.busy,u),p=u+oe.time.after,l=u,e=0;return}if(!(f.type==="now"||n&&m(f))){if(f.type==="line"||f.type==="seal"||f.type==="open"||f.type==="pick"||f.type==="stamp"){let u=p,M=u+$o[f.type];a.edges.push({event:d,a:u,b:M,carries:!1,coin:!1,named:!1}),p=u+oe.lineup.stagger,l=M,e=0,a.busy=Math.max(a.busy,M);return}if(f.type==="commit"||f.type==="branch"||f.type==="leaf"||f.type==="node"){let u=p,M=u+oe.draw;a.edges.push({event:d,a:u,b:M,carries:!1,coin:!1,named:!1}),p=u+oe.stagger,l=M,e=0,a.busy=Math.max(a.busy,M)}else if(f.type==="edge"){let u=p;l=r(d,f,u),p=u+oe.stagger,e=0}else if(f.type==="action")a.events.push({event:d,at:p}),a.busy=Math.max(a.busy,p+oe.action),p+=oe.action,e=0;else{let u=(l??p)+oe.change*e++;a.events.push({event:d,at:u}),a.busy=Math.max(a.busy,u),s=Math.max(s,u)}}}),a.edges.sort((f,d)=>f.a-d.a),a}function Pr(t,n=!1){let a=t.kind==="time"?t.time:void 0,p=oe.time,l=a?Math.min(p.unitMax,Math.max(p.unitMin,p.axis/Math.max(1,a.scale.count))):0,e=0,s=t.steps.map(S=>{if(!a)return vr(S);let y=vr(S,{from:e,speed:l});return e=y.sweep?.keys[y.sweep.keys.length-1]?.[1]??e,y}),r=[],o=oe.intro;t.steps.forEach((S,y)=>{let F=Math.min(oe.stepMax,Math.max(oe.stepMin,oe.stepBase+[...S.body].length*oe.perChar)),C=Math.max(F,(s[y]?.busy??0)+oe.dwell);r.push({start:o,end:o+C}),o+=C});let c=Math.ceil(o+oe.outro),m=c-oe.tail,f=r[r.length-1],d=n&&f?{start:f.start+(s[s.length-1]?.busy??0),end:m}:void 0,u=d?.start??m,M=[],x=[],h=[],g=[];s.forEach((S,y)=>{let F=r[y],C=[];for(let X of S.edges){let z=F.start+X.a;M.push({step:y,event:X.event,start:z,drawn:F.start+X.b,end:F.end});let Q=t.steps[y]?.events[X.event],B=t.kind==="git"&&Q?.type==="edge"&&Q.carry.kind==="tag"&&Q.carry.text===Q.from;X.carries&&!B&&g.push({step:y,event:X.event,who:X.coin?"coin":"main",a:z,b:F.start+X.b}),X.named&&C.push({step:y,event:X.event,start:z+oe.labelDelay,end:F.end})}C.forEach((X,z)=>{let Q=C[z+2];Q&&(X.end=Math.min(X.end,Q.start))});for(let X of C)d&&X.end>d.start?X.end=d.end:(t.kind==="state"&&X.end<u&&(X.after={start:X.end,end:u}),d&&(X.again=d));x.push(...C);for(let X of S.events)h.push({step:y,event:X.event,at:F.start+X.at})});let L=r[0]?.start??0,O=g.some(S=>S.who==="main"),_=[];for(let S of["main","coin"]){let y=g.filter(F=>F.who===S);y.forEach((F,C)=>{let X=y[C+1],z=C===0&&(S==="main"||!O);_.push({step:F.step,event:F.event,who:S,depart:F.a,arrive:F.b,start:z?Math.min(L,F.a):F.a,end:X?Math.max(X.a,F.b):m})})}_.sort((S,y)=>S.depart-y.depart);let P=t.kind==="state"?Po(t,M,m):void 0,j=[[0,0]],$=[];return s.forEach((S,y)=>{let F=r[y].start;for(let[C,X]of S.sweep?.keys??[])j.push([F+C,X]);for(let C of S.sweep?.passed??[])$.push({unit:C.unit,passed:F+C.at})}),j.push([c,e]),{total:c,last:m,steps:r,edges:M,carriers:_,labels:x,badges:r.map((S,y)=>({step:y,appears:S.start})),events:h,stills:r.map(S=>S.end-oe.still),...d?{whole:d}:{},...P?{states:P}:{},...a?{needle:j,units:$,meters:ko(t,s,r)}:{}}}function ko(t,n,a){let p=t.time?.period?.length;return(t.strip?.meters??[]).map(({field:l})=>{let e=[[0,0]],s=0;return n.forEach((r,o)=>{let i=a[o].start,c=(t.steps[o]?.events??[]).flatMap((M,x)=>{let h=M.type==="strip"&&M.field===l&&M.value!==void 0?_n(M.value):void 0;return h===void 0?[]:[{e:x,ratio:h}]}),m=c[c.length-1];if(!m)return;let f=r.sweep?.keys??[],d=f[0],u=f[f.length-1];if(d&&u&&u[1]>d[1]){let[M,x]=[d[1],u[1]],h=s,g=M,L=p?Math.floor((x-1e-9)/p)*p:0;if(L>0&&L>=M){let O=i+(f.find(([,P])=>P===L)?.[0]??d[0]),_=e[e.length-1][0];e.push([Math.max(_,O-oe.time.reset),s],[O,0]),h=0,g=L}for(let[O,_]of f)_>=g&&e.push([i+O,h+(m.ratio-h)*(_-g)/(x-g)])}else{let M=i+(r.events.find(x=>x.event===m.e)?.at??0);e.push([M,s],[M+oe.fade,m.ratio])}s=m.ratio}),{field:l,keys:e}})}var vo=t=>Nt.includes(t);function Po(t,n,a){let p=new Map,l=s=>{let r=p.get(s)??{box:s,lit:[]};return p.set(s,r),r},e;for(let s of n){let r=t.steps[s.step]?.events[s.event];if(!(r?.type!=="edge"||r.from===r.to)){if(e){let o=l(e.box);o.lit.push({start:e.since,end:s.start}),e.box===r.from&&o.done===void 0&&(o.done=s.start+oe.done),e=void 0}vo(r.to)||(e={box:r.to,since:s.drawn})}}return e&&l(e.box).lit.push({start:e.since,end:a}),[...p.values()]}var Sr=t=>Math.round(t*100)/100,qn=class{constructor(n,a,p){this.prefix=n;this.total=a;this.last=p}prefix;total;last;frames=[];count=0;pct(n){return+(Math.min(Math.max(n,0),this.total)/this.total*100).toFixed(3)}kf(n){let a=`${this.prefix}-${this.count++}`,p=new Map;for(let[e,s,r]of[...n].sort((o,i)=>o[0]-i[0])){let o=this.pct(e),i=p.get(o)??{props:{}};Object.assign(i.props,s),r&&(i.ease=r),p.set(o,i)}let l=[...p].map(([e,{props:s,ease:r}])=>{let o=Object.entries(s).map(([i,c])=>`${i}:${c}`);return r&&o.push(`animation-timing-function:${r}`),`${e}%{${o.join(";")}}`}).join("");return this.frames.push(`@keyframes ${a}{${l}}`),`animation-name:${a}`}vis(n,a=this.last,p={}){let l=p.f??oe.fade,e=p.on??{},s=p.off??{},r=p.within?Math.max(n+l,a-l):a;return this.kf([[0,{opacity:0,...s}],[n,{opacity:0,...s},p.ein??fe.out],[n+l,{opacity:1,...e}],[r,{opacity:1,...e},fe.inOut],[Math.min(r+l,this.total),{opacity:0,...s}],[this.total,{opacity:0,...s}]])}rise(n,a=this.last,p=!1){return this.vis(n,a,{on:{transform:"translateY(0)"},off:{transform:`translateY(${w.rise}px)`},within:p})}pop(n,a=this.last){return this.vis(n,a,{f:oe.popFade,ein:fe.pop,on:{transform:"scale(1)"},off:{transform:`scale(${w.popFrom})`}})}until(n){let a=oe.untilFade;return this.kf([[0,{opacity:1}],[n,{opacity:1},fe.inOut],[n+a,{opacity:0}],[this.last,{opacity:0}],[this.total,{opacity:1}]])}move(n,a=[]){return this.kf(n.map(([p,l,e,s=1,r])=>[p,{transform:`translate(${Sr(l)}px,${Sr(e)}px) scale(${s})`},r]).concat(a))}blink(n,a,p){return[[0,{opacity:0}],[n-.01,{opacity:0}],[n,{opacity:1}],[a,{opacity:1}],[a+p,{opacity:0}],[this.total,{opacity:0}]]}};var So=t=>t.kind==="git",Mr=t=>t.kind==="lineup",Or=t=>t.kind==="time",ls=t=>t.kind==="tree",he=t=>`font:${t.weight} ${t.size}px var(--${t.family})`,_e=(t,n="var(--surf)")=>`color-mix(in srgb,var(--c) ${t}%,${n})`,ge=w.stroke,Ee=w.mix,is=`color-mix(in srgb,var(--mute) ${Ee.past}%,var(--bg))`,Mo=[".dg{display:block;width:100%;height:auto;overflow:visible}",".dg .dg-a{animation-duration:var(--T);animation-timing-function:linear;animation-iteration-count:infinite;animation-fill-mode:both;animation-delay:calc(var(--at,0) * -1s);animation-play-state:var(--play,running)}",".dg .dg-popc{transform-box:fill-box;transform-origin:center}",".dg-bg{fill:var(--bg)}",".dg-band{fill:color-mix(in srgb,var(--c) var(--tint),var(--bg));stroke:color-mix(in srgb,var(--c) var(--edge),transparent)}",`.dg-bi{fill:${_e(Ee.regionIcon)};stroke:${_e(Ee.regionIconEdge,"transparent")}}`,`.dg-bz{${he(A.regionName)};fill:var(--ct)}`,`.dg-bx{${he(A.regionNote)};fill:var(--mute)}`,".dg-st{fill:var(--surf);stroke:var(--hair)}",`.dg-halo{fill:none;stroke:var(--c);stroke-width:${ge.halo};stroke-opacity:.16}`,`.dg-on{fill:none;stroke:var(--c);stroke-width:${ge.on}}`,`.dg-ic{fill:${_e(Ee.icon)}}`,`.dg-slot{fill:none;stroke:${_e(Ee.slot,"transparent")};stroke-width:${ge.slot};stroke-dasharray:3 3}`,`.dg-gl{fill:none;stroke:var(--c);stroke-width:${ge.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-sn{${he(A.boxName)};fill:var(--ink)}`,`.dg-ss{${he(A.boxSub)};fill:var(--mute)}`,`.dg-ss-ok{${he(A.boxSubStrong)};fill:var(--ct)}`,`.dg-ss-act{${he(A.boxSubStrong)};fill:var(--ink)}`,`.dg-ll{stroke:var(--line);stroke-width:${ge.lifeline};stroke-dasharray:3 4}`,`.dg-e{fill:none;stroke:var(--line);stroke-width:${ge.edge};stroke-linecap:round;stroke-dasharray:0 ${w.edge.ghostDash}}`,`.dg-eh{fill:none;stroke:var(--line);stroke-width:${ge.arrow};stroke-linecap:round;stroke-linejoin:round}`,`.dg-e-on{fill:none;stroke:var(--c);stroke-width:${ge.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,`.dg-eh-on{fill:none;stroke:var(--c);stroke-width:${ge.edgeOn};stroke-linecap:round;stroke-linejoin:round}`,`.dg-flow{fill:none;stroke:var(--surf);stroke-width:${ge.flow};stroke-linecap:round;stroke-dasharray:1.5 ${w.edge.flowDash}}`,`.dg-e-past{fill:none;stroke:${is};stroke-width:${ge.edge};stroke-linecap:round}`,`.dg-eh-past{fill:none;stroke:${is};stroke-width:${ge.arrow};stroke-linecap:round;stroke-linejoin:round}`,".dg-bd{cursor:pointer}",".dg-bdf{fill:var(--c)}",`.dg-bdft{${he(A.badge)};fill:var(--on-c)}`,`.dg-bdr{fill:none;stroke:var(--c);stroke-width:${ge.badgeRing};pointer-events:none}`,`.dg-bdp{fill:${_e(Ee.badgePast)};stroke:${_e(Ee.badgePastEdge,"transparent")};stroke-width:${ge.hair}}`,`.dg-bdpt{${he(A.badge)};fill:var(--ct)}`,`.dg-bdp-g{fill:var(--surf);stroke:${is};stroke-width:${ge.hair}}`,`.dg-bdpt-g{${he(A.badge)};fill:var(--mute)}`,`.dg-cap rect,.dg-act rect{fill:${_e(Ee.cap)};stroke:${_e(Ee.capEdge,"transparent")}}`,`.dg-cap text{${he(A.label)};fill:var(--ct)}`,`.dg-capj text{${he(A.labelJa)}}`,`.dg-cap-past text{${he(A.label)};fill:var(--mute);fill-opacity:${w.state.pastLabel}}`,`.dg-cap-pastj text{${he(A.labelJa)}}`,`.dg-act text{${he(A.action)};fill:var(--ct)}`,".dg-car{fill:var(--carry,var(--ink))}",`.dg-car-t{${he(A.carrier)};fill:var(--bg)}`,`.dg-car-tj{${he(A.carrierJa)}}`,`.dg-env{fill:var(--carry,var(--ink));stroke:var(--surf);stroke-width:${ge.envelope}}`,`.dg-env-in{fill:none;stroke:var(--surf);stroke-width:${ge.flow};stroke-linejoin:round;stroke-linecap:round}`,".dg-coin{fill:var(--coin);stroke:var(--surf);stroke-width:1.2}",".dg-coin-in{fill:none;stroke:var(--coinin);stroke-width:1.1}",".dg-strip{fill:var(--surf);stroke:var(--hair)}",`.dg-sep{stroke:var(--hair);stroke-width:${ge.hair}}`,`.dg-sh{${he(A.stripTitle)};fill:var(--ink)}`,`.dg-fl{${he(A.fieldName)};fill:var(--mute)}`,`.dg-fv{${he(A.fieldValue)};fill:var(--ink)}`,`.dg-fvj{${he(A.fieldValueJa)};fill:var(--ink)}`,".dg-fv-c{fill:var(--ct)}",".dg-fl-now{fill:var(--c)}",`.dg-tr-ring{fill:none;stroke:var(--line);stroke-width:${ge.trail}}`,".dg-tr-fill{fill:var(--c)}",".dg-tg rect{fill:var(--c)}",`.dg-tg text{${he(A.tag)};fill:var(--on-c)}`,`.dg-side{fill:color-mix(in srgb,var(--c) ${Ee.side}%,var(--bg));stroke:${_e(Ee.sideEdge,"transparent")};stroke-dasharray:4 4}`,`.dg-side-t{${he(A.regionName)};fill:var(--ct)}`,`.dg-side-n{${he(A.regionNote)};fill:var(--mute)}`,`.dg-ghost{fill:var(--surf);stroke:${_e(Ee.ghostEdge,"transparent")};stroke-dasharray:4 3}`,`.dg-path{fill:none;stroke:${_e(Ee.path,"transparent")};stroke-width:${ge.path};stroke-linecap:round;stroke-dasharray:0 ${w.edge.ghostDash}}`,`.dg-path-h{fill:none;stroke:${_e(Ee.path,"transparent")};stroke-width:${ge.arrow};stroke-linecap:round;stroke-linejoin:round}`,`.dg-path-t{${he(A.label)};fill:var(--ct)}`,`.dg-path-tj{${he(A.labelJa)}}`,".dg-start{fill:var(--ink)}",`.dg-end{fill:var(--bg);stroke:var(--ink);stroke-width:${ge.end}}`,".dg-end-in{fill:var(--ink)}",`.dg-end-x{fill:var(--bg);stroke:${_e(Ee.path,"transparent")};stroke-width:${ge.arrow};stroke-dasharray:2 2.5}`,`.dg-end-xi{fill:${_e(Ee.path,"transparent")}}`,`.dg-mark{${he(A.regionNote)};fill:var(--mute)}`,`.dg-done{fill:var(--ink);stroke:var(--surf);stroke-width:${ge.done}}`,`.dg-done-ck{fill:none;stroke:var(--surf);stroke-width:${ge.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-git-l{fill:none;stroke:var(--c);stroke-width:${ge.git};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,`.dg-git-cp{fill:none;stroke:var(--c);stroke-width:${ge.gitOrphan};stroke-linecap:round;stroke-dasharray:3 3;stroke-opacity:.7}`,`.dg-git-c{fill:var(--surf);stroke:var(--c);stroke-width:${ge.git}}`,`.dg-git-id{${he(A.gitId)};fill:var(--ct)}`,`.dg-git-h{${he(A.gitHash)};fill:var(--mute)}`,`.dg-git-n{${he(A.gitNote)};fill:var(--ink2)}`,`.dg-git-old{fill:var(--surf);stroke:var(--c);stroke-width:${ge.gitOrphan};stroke-dasharray:3 3;stroke-opacity:.6}`,`.dg-git-oldl{${he(A.gitId)};fill:var(--ct);opacity:.55}`,`.dg-tree-l{fill:none;stroke:var(--line);stroke-width:${ge.tree};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,`.dg-tree-tr{fill:none;stroke:var(--c);stroke-width:${ge.treeTrail};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,`.dg-tree-h{fill:none;stroke:var(--c);stroke-width:${ge.treeTrail};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tree-con{fill:none;stroke:var(--line);stroke-width:${ge.treeCon};stroke-linecap:round;stroke-dasharray:2 3.5}`,`.dg-tree-card{fill:var(--surf);stroke:var(--hair);stroke-width:${ge.hair}}`,`.dg-tree-cg{fill:none;stroke:var(--mute);stroke-width:${ge.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tree-ct{${he(A.treeCard)};fill:var(--ink)}`,`.dg-tree-hash{${he(A.treeHash)};fill:var(--ink)}`,`.dg-tree-name{${he(A.treeName)};fill:var(--mute)}`,`.dg-tree-one{${he(A.boxName)};fill:var(--ink)}`,`.dg-tree-rh{${he(A.rootHash)};fill:var(--ink)}`,`.dg-tree-rn{${he(A.rootName)};fill:var(--mute)}`,".dg-ln-chip{fill:var(--c)}",`.dg-ln-plain{fill:color-mix(in srgb,var(--mute) ${Ee.chipPlain}%,var(--surf))}`,`.dg-ln-t{${he(A.chip)};fill:var(--on-c)}`,`.dg-ln-tp{${he(A.chip)};fill:var(--ink)}`,".dg-ln-seal{transform-box:fill-box;transform-origin:0 50%}",`.dg-ln-sd{fill:color-mix(in srgb,var(--mute) ${Ee.sealDark}%,var(--surf))}`,`.dg-ln-sl{fill:color-mix(in srgb,var(--mute) ${Ee.sealLight}%,var(--surf))}`,`.dg-ln-stamp{fill:var(--surf);stroke:var(--c);stroke-width:${ge.stamp}}`,`.dg-ln-st{${he(A.stamp)};fill:var(--ct)}`,`.dg-tm-ep{fill:color-mix(in srgb,var(--ink) ${Ee.timeShade}%,transparent)}`,`.dg-tm-sep{stroke:var(--hair);stroke-width:${ge.hair};stroke-dasharray:2 4}`,`.dg-tm-hd{${he(A.timeHead)};fill:var(--ink)}`,`.dg-tm-hdj{${he(Bt(A.timeHead))}}`,`.dg-tm-slot{fill:none;stroke:var(--line);stroke-width:${ge.timeSlot};opacity:.55}`,".dg-tm-m{fill:var(--c)}",".dg-tm-x{fill:var(--c-slate)}",`.dg-tm-fr{fill:none;stroke:var(--c-blue);stroke-width:${ge.timeFrame};stroke-dasharray:3 2}`,`.dg-tm-gd{fill:none;stroke:color-mix(in srgb,var(--c-blue) ${Ee.timeGuide}%,transparent);stroke-width:${ge.hair};stroke-dasharray:2 3}`,`.dg-tm-ax{fill:none;stroke:var(--line);stroke-width:${ge.timeAxis}}`,`.dg-tm-tk{${he(A.timeTick)};fill:var(--mute)}`,`.dg-tm-tkj{${he(Bt(A.timeTick))}}`,`.dg-tm-en{${he(A.timePeriod)};fill:var(--ink2)}`,`.dg-tm-er{${he(A.timeRange)};fill:var(--mute)}`,`.dg-tm-erj{${he(Bt(A.timeRange))}}`,`.dg-tm-rn{${he(A.timeRow)};fill:var(--ink2)}`,`.dg-tm-br{fill:none;stroke:var(--c);stroke-width:${ge.timeSpan};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tm-bt{${he(A.spanText)};fill:var(--ct)}`,`.dg-tm-bx{fill:color-mix(in srgb,var(--c) ${Ee.timeSpan}%,transparent);stroke:var(--c);stroke-width:${ge.timeSpan};stroke-dasharray:4 3}`,`.dg-tm-con{fill:none;stroke:var(--line);stroke-width:${ge.timeDrop};stroke-linecap:round;stroke-dasharray:0 3.5}`,".dg-tm-pg{fill:var(--surf);stroke:var(--line);stroke-dasharray:2 2.5}",`.dg-tm-pgl{fill:none;stroke:var(--mute);stroke-width:${ge.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tm-pc{fill:var(--surf);stroke:var(--c);stroke-width:${ge.timePoint}}`,`.dg-tm-pcg{fill:none;stroke:var(--c);stroke-width:${ge.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tm-pn{${he(A.pointName)};fill:var(--ink)}`,`.dg-tm-pnj{${he(Bt(A.pointName))}}`,".dg-tm-pn-g{fill:var(--mute)}",`.dg-tm-ps{${he(A.pointState)};fill:var(--ct)}`,`.dg-tm-ln{fill:none;stroke:var(--c);stroke-width:${ge.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,`.dg-tm-nd{stroke:var(--ink);stroke-width:${ge.timeNeedle};opacity:.55}`,".dg-tm-nh{fill:var(--ink)}",".dg-tm-ph{fill:none;stroke:var(--line);stroke-dasharray:3 3}",`.dg-tm-ex{fill:color-mix(in srgb,var(--c-slate) ${Ee.timeEmpty}%,var(--surf));stroke:var(--c-slate);stroke-width:${ge.timeFrame};stroke-dasharray:3 3}`,`.dg-tm-ext{${he(A.emptyText)};fill:var(--t-slate)}`,".dg-tm-mt{fill:var(--hair)}",".dg-tm-mf{fill:var(--c);transform-box:fill-box;transform-origin:0 50%}",`.dg-tm-mk{stroke:var(--ink2);stroke-width:${ge.timeMeter}}`,`.dg-tm-ml{${he(A.meterLine)};fill:var(--ink2)}`,".dg-vp-bg{fill:var(--bg)}",".dg-vp-frame{fill:none;stroke:var(--hair)}",".dg-hd-bg{fill:var(--bg)}",".dg-mm-bg{fill:var(--surf);stroke:var(--hair)}",`.dg-mm-t{${he(A.miniTitle)};fill:var(--mute)}`,".dg-mm-world{fill:var(--sunk);stroke:var(--hair)}",`.dg-mm-band{fill:${_e(Ee.miniBand)};stroke:${_e(Ee.miniBandEdge,"transparent")};stroke-width:.6}`,`.dg-mm-card{fill:${_e(Ee.mini)}}`,`.dg-mm-vp{fill:color-mix(in srgb,var(--ink) ${Ee.view}%,transparent);stroke:var(--ink);stroke-width:${ge.badgeRing};vector-effect:non-scaling-stroke}`].join("");function Oo(t){let n=2166136261;for(let a=0;a<t.length;a++)n^=t.charCodeAt(a),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function To(t){let n=new Map,a=(p,l)=>{n.set(p,(n.get(p)??new Set).add(l))};return t.steps.forEach((p,l)=>{for(let e of p.events)e.type==="edge"?(a(e.from,l),a(e.to,l)):(e.type==="action"||e.type==="swap")&&a(e.box,l)}),new Map([...n].map(([p,l])=>[p,[...l].sort((e,s)=>e-s)]))}function No(t,n,a){let p=[],{whole:l}=n,e=0;for(let r of n.events){let o=t.steps[r.step]?.events[r.event];if(o?.type==="swap"&&p.push({t:r.at,order:e++,box:o.box,set:o.text}),a&&o?.type==="action"){p.push({t:r.at,order:e++,box:o.box,act:o.label});let i=n.steps[r.step].end;(!l||i<=l.start)&&p.push({t:i,order:e++,box:o.box,act:null})}}p.sort((r,o)=>r.t-o.t||r.order-o.order);let s=new Map;for(let r of t.boxes){let o=[r.sub??"","dg-ss"],i,c=o.join("|"),m=[],f=p.filter(M=>M.box===r.id),d=[...f].reverse().find(M=>M.set!==void 0||typeof M.act=="string");l&&typeof d?.act=="string"&&f.push({t:l.start,order:e++,box:r.id,act:d.act});for(let M of f){M.set!==void 0&&(o=[M.set,"dg-ss-ok"],i=void 0),M.act!==void 0&&(i=M.act??void 0);let x=i!==void 0?[i,"dg-ss-act"]:o;x.join("|")!==c&&(c=x.join("|"),m.push([M.t,x[0],x[1]]))}let u=m.filter((M,x)=>{let h=m[x+1];return h===void 0||h[0]-M[0]>=oe.minShow});s.set(r.id,u)}return s}function Eo(t,n,a){let p=new Map;for(let l of n.events){let e=t.steps[l.step]?.events[l.event];if(e?.type!=="strip")continue;let s=a.badges[l.step]?.color??"slate",r=p.get(e.field)??[],o=n.steps[l.step].end;r.push({at:l.at,color:s,step:l.step,until:o,...e.value!==void 0?{value:e.value}:{},...e.tag!==void 0?{tag:e.tag}:{}}),p.set(e.field,r)}return p}function Lo(t,n,a){if(t.until===void 0)return n;let{after:p,again:l,...e}=n;if(!p)return e;let s=a[t.until].start;return s>p.start?{...e,after:{start:p.start,end:Math.min(p.end,s)}}:e}function ps(t,n,a,p,l,e,s=[],r=[]){let o=Vt(p,l),i=Oo(`${JSON.stringify(t)}|${o}|${e?`${e.width}|${e.lang}`:""}`),c=new qn(`dg${i}`,a.total,a.last),m={m:c,t:a,id:i,sh:`filter="url(#dg-sh-${i})"`,end:a.steps[a.steps.length-1].end,ink:s,traces:r,boxText:Ls(n.boxes)},f=To(t),d=No(t,a,n.kind!=="sequence"),u={band:[],base:[],lit:[],node:[],badge:[],top:[]};for(let D of n.regions)u.band.push(As(D,s));let M=n.boxes.find(D=>D.ghost)?.color??"slate";n.side&&u.band.push(Fs(n.side,M,s));let x=(D,me)=>n.boxes.find(ae=>ae.id===D&&(me===void 0||ae.ghost===me))?.color;for(let D of n.paths)u.base.push(Cs(D,x(D.to,!0)??x(D.from)??M,s,r));for(let D of n.ends)u.node.push(_s(D,M,s));let h=n.kind==="state",g=new Map((a.states??[]).flatMap(D=>D.lit[0]?[[D.box,D.lit[0].start]]:[])),L=new Map((a.meters??[]).map(D=>[D.field,D.keys])),O=D=>D.meter?nt("time").meterField({...D,meter:D.meter},L.get(D.name)??[[0,0]],m):void 0,_=D=>Vs(D,Eo(t,a,n),m,h,g,O);n.strip&&!e&&u.band.push(_(n.strip));for(let D of n.lifelines)u.base.push(Bs(D.x,D.y1,D.y2));if(So(n)){let D=nt("git").drawGit(n,t,a,m);u.base.push(D.links),u.lit.push(D.lines),u.node.push(D.commits),u.top.push(D.tags)}let P=ls(n)?n:void 0,j=P?nt("tree").drawTree(P,t,a,m):void 0;j&&(u.base.push(j.links),u.lit.push(j.trails),u.node.push(j.nodes));let $=new Set((P?.runs??[]).map(D=>`${D.step}/${D.event}`)),S=Mr(n)?n:void 0;if(S){let D=nt("lineup").drawLineup(S,t,a,m,d);u.base.push(D.lanes),u.node.push(D.chips)}let y=Or(n)?n:void 0;if(y){let D=nt("time").drawTime(y,t,a,m,d);u.base.push(D.base),u.lit.push(D.lit),u.node.push(D.node),u.top.push(D.top)}let F=new Set((y?.wires??[]).map(D=>`${D.step}/${D.event}`));for(let D of n.edges){let me=a.edges.find(we=>we.step===D.step&&we.event===D.event);if(!me||y&&!F.has(`${D.step}/${D.event}`)||$.has(`${D.step}/${D.event}`))continue;let ae=Math.max(j?.appear.get(D.from)??0,j?.appear.get(D.to)??0),ye=Gs(D,me,m,h,ae);u.base.push(ye.base),u.lit.push(ye.lit)}let C=new Map((a.states??[]).map(D=>[D.box,D])),X=new Map(t.boxes.flatMap(D=>D.link===void 0?[]:[[D.id,D.link]])),z=(D,me)=>Zt(X.get(D),me);for(let D of y||S?[]:n.boxes){if(D.ghost){u.node.push(z(D.id,Is(D,s)));continue}let me=C.get(D.id);u.node.push(z(D.id,tn(D,m,f.get(D.id)??[],d.get(D.id)??[],h?me?.lit??[]:void 0))),me?.done!==void 0&&u.node.push(Ds(D,me.done,m))}for(let D of n.badges)e&&os(n,D)||u.badge.push(Hn(D,m,h));for(let D of n.labels){let me=a.labels.find(ae=>ae.step===D.step&&ae.event===D.event);me&&u.top.push(Ys(D,Lo(D,me,a.steps),m))}let{whole:Q}=a;for(let D of n.actions){let me=a.events.find(ye=>ye.step===D.step&&ye.event===D.event);if(!me)continue;let ae=a.steps[D.step].end;u.top.push(Q&&ae>Q.start?Wn(D,me.at,Q.end,m):Wn(D,me.at,ae,m,Q))}for(let D of a.carriers){let me=n.edges.find(ae=>ae.step===D.step&&ae.event===D.event);me&&u.top.push(nn(me,P?{...D,start:D.depart,end:D.arrive+oe.fade}:D,m))}let B=Object.values(u).map(D=>D.join("")).join(""),{near:v,far:I,nearY:R,farY:W}=w.shadow,J=`<filter id="dg-sh-${i}" x="-20%" y="-30%" width="140%" height="180%"><feDropShadow dx="0" dy="${R}" stdDeviation="${v}" style="flood-color:var(--sh);flood-opacity:var(--shA)"/><feDropShadow dx="0" dy="${W}" stdDeviation="${I}" style="flood-color:var(--sh);flood-opacity:var(--shB)"/></filter>`,Z=e&&n.kind==="sequence"?n.boxes.map(D=>z(D.id,Rs(D,m,f.get(D.id)??[],d.get(D.id)??[]))).join(""):"",de=e?jo(n,a,t,c,i,B,e,Z,(D,me)=>_(D)+n.badges.filter(ae=>os(n,ae)).map(ae=>Hn({...ae,x:ae.x-me.x+D.x+w.badge.r,y:ae.y-me.y+D.y},m,h)).join("")):{body:`<rect class="dg-bg" width="${n.width}" height="${n.height}" rx="${w.region.radius}"/>${B}`,w:n.width,h:n.height},ue=`.dg-${i}{${Kt};--T:${a.total}s;${o}}${Mo}${c.frames.join("")}`;return`<svg xmlns="http://www.w3.org/2000/svg" class="dg dg-${i}" viewBox="0 0 ${Math.ceil(de.w)} ${Math.ceil(de.h)}" width="${Math.ceil(de.w)}" height="${Math.ceil(de.h)}" role="img" aria-label="${ve(t.title)}" data-dragon="figure" data-view="${e?"follow":"fixed"}"><style>${ue}</style><defs>${J}</defs>${de.body}</svg>`}function Tr(t){let n=Math.min(...t.map(p=>p.x)),a=Math.min(...t.map(p=>p.y));return{x:n,y:a,w:Math.max(...t.map(p=>p.x+p.w))-n,h:Math.max(...t.map(p=>p.y+p.h))-a}}function os(t,n){return t.strip!==void 0&&n.y>=t.strip.y}function qo(t,n,a){let p=as(t,n,a);return p.length===0?void 0:Tr(p)}function Ao(t,n,a,p){let l=w.badge.r+w.follow.badgeRoom,{x:e,y:s}=t,r=i=>Math.hypot(Math.max(0,i.x-e,e-i.x-i.w),Math.max(0,i.y-s,s-i.y-i.h)),o={x:e-l,y:s-l,w:l*2,h:l*2};for(let i of[...n].sort((c,m)=>r(c)-r(m))){let c=Tr([o,i]);c.w<=a&&c.h<=p&&(o=c)}return o}function as(t,n,a){let p=[];for(let l of t.edges.filter(e=>e.step===a)){let e=l.points.map(r=>r[0]),s=l.points.map(r=>r[1]);p.push({x:Math.min(...e),y:Math.min(...s),w:Math.max(...e)-Math.min(...e),h:Math.max(...s)-Math.min(...s)})}if(p.push(...t.labels.filter(l=>l.step===a),...t.actions.filter(l=>l.step===a)),ls(t)){let l=new Set((n.steps[a]?.events??[]).flatMap(e=>e.type==="edge"?[e.from,e.to]:[]));p.push(...t.nodes.filter(e=>e.step===a||l.has(e.id)));for(let e of t.links.filter(s=>s.step===a)){let s=e.points.map(o=>o[0]),r=e.points.map(o=>o[1]);p.push({x:Math.min(...s),y:Math.min(...r),w:Math.max(...s)-Math.min(...s),h:Math.max(...r)-Math.min(...r)})}}if(Mr(t)){let l=new Set((n.steps[a]?.events??[]).flatMap(e=>"box"in e?[e.box]:[]));p.push(...t.lanes.filter(e=>l.has(e.id)))}for(let l of n.steps[a]?.events??[]){let e=l.type==="edge"?[l.from,l.to]:l.type==="action"||l.type==="swap"?[l.box]:[];for(let s of e){let r=t.boxes.find(o=>o.id===s);r&&(t.kind==="architecture"||l.type==="swap")&&p.push(r)}}return p}function jo(t,n,a,p,l,e,s,r,o){let i=w.follow,c=w.mini,m=Math.max(1,s.width),f=Math.min(t.width,m),d=t.strip?t.strip.y:t.height,u=Qe[s.lang].overview,M=q=>{let Y=Math.min(c.w,f*.4,q*.4/t.height*t.width),U=Y/t.width,K=d*U,H=Math.max(Y,Math.ceil(pe(u,A.miniTitle)));return{vh:q,mw:Y,k:U,mh:K,bw:H,bgW:H+c.pad*2,bgH:K+c.pad*2+c.title,beside:K>Y}},x=M(Math.min(d,Math.max(i.minH,f*i.aspect))),h=m<i.narrow&&(x.beside||t.strip!==void 0),g=t.strip?Gn(t.strip,0,0,f).h+c.inset:0,L=s.height===void 0?Number.POSITIVE_INFINITY:(x.beside||h?s.height:s.height-x.bgH-c.inset)-g,{vh:O,mw:_,k:P,mh:j,bw:$,bgW:S,bgH:y,beside:F}=L<x.vh?M(Math.max(i.fitMinH,L)):{...x,vh:Number.isFinite(L)?Math.min(d,L):x.vh},C=F&&!h?Math.min(t.width,m-S-c.inset):f,X=q=>Math.min(t.width-C/2,Math.max(C/2,q)),z=r===""?0:Math.max(...t.boxes.map(q=>q.y+q.h))+i.headRoom,Q=r===""?0:i.head.pad*2+i.head.h,B=O-Q,v=q=>Math.min(d-B/2,Math.max(z+B/2,q)),I=w.badge.r,R=[t.width/2,d/2],J=n.steps.map((q,Y)=>{if(Or(t)){let le=nt("time").timeFocus(t,n,Y,as(t,a,Y),C,B);return R=[le.x+le.w/2,le.y+le.h/2],[X(R[0]),v(R[1])]}let U=qo(t,a,Y);R=U?[U.x+U.w/2,U.y+U.h/2]:R;let K=[X(R[0]),v(R[1])],H=t.badges.find(le=>le.step===Y);if(!H||os(t,H)||Math.abs(H.x-K[0])<=C/2-I&&Math.abs(H.y-K[1])<=B/2-I)return K;let re=Ao(H,as(t,a,Y),C,B);return R=[re.x+re.w/2,re.y+re.h/2],[X(R[0]),v(R[1])]}).map(([q,Y])=>[q,Y-Q/2]),Z=J[0],ie=[[0,Z[0],Z[1]],[n.steps[0].start,Z[0],Z[1]]];J.forEach((q,Y)=>{if(Y===0)return;let U=J[Y-1],K=n.steps[Y].start;ie.push([K,U[0],U[1],1,fe.inOut],[K+i.ease,q[0],q[1]])});let de=J[J.length-1];ie.push([n.last,de[0],de[1],1,fe.inOut],[n.total,Z[0],Z[1]]);let ue=p.move(ie.map(([q,Y,U,K,H])=>[q,C/2-Y,O/2-U,K,H])),D=F?C+c.inset:C-S-c.inset,me=F?0:O+c.inset,ae=D+c.pad,ye=ae+($-_)/2,we=me+c.pad+c.title,N=h?{clip:"",body:""}:(()=>{let q=[...t.regions.map(U=>`<rect class="dg-mm-band" style="${ke(U.color)}" x="${ye+U.x*P}" y="${we+U.y*P}" width="${U.w*P}" height="${U.h*P}" rx="3"/>`),...t.boxes.map(U=>`<rect class="dg-mm-card" style="${ke(U.color)}" x="${ye+U.x*P}" y="${we+U.y*P}" width="${U.w*P}" height="${U.h*P}" rx="1.5"/>`),...(ls(t)?t.nodes:[]).map(U=>`<rect class="dg-mm-card" style="${ke(U.color)}" x="${ye+U.x*P}" y="${we+U.y*P}" width="${U.w*P}" height="${U.h*P}" rx="1.5"/>`)].join(""),Y=p.move(ie.map(([U,K,H,,re])=>[U,ye+(K-C/2)*P,we+(H-O/2)*P,1,re]));return{clip:`<clipPath id="dg-mm-${l}"><rect x="${ye}" y="${we}" width="${_}" height="${j}" rx="4"/></clipPath>`,body:`<rect class="dg-mm-bg" x="${D}" y="${me}" width="${S}" height="${y}" rx="${c.radius}"/><text class="dg-mm-t" x="${ae}" y="${we-c.pad+2}">${u}</text><g clip-path="url(#dg-mm-${l})"><rect class="dg-mm-world" x="${ye}" y="${we}" width="${_}" height="${j}"/>${q}<rect class="dg-mm-vp dg-a"${Q===0?"":` y="${Q*P}"`} width="${C*P}" height="${(O-Q)*P}" rx="2" style="${Y}"/></g>`}})(),se=Q===0?"":`<g class="dg-hd"><rect class="dg-hd-bg" width="${C}" height="${Q}"/><line class="dg-sep" x1="0" y1="${Q}" x2="${C}" y2="${Q}"/><g class="dg-a" style="${p.move(ie.map(([q,Y,,U,K])=>[q,C/2-Y,0,U,K]))}">${r}</g></g>`,T=`<defs><clipPath id="dg-vp-${l}"><rect width="${C}" height="${O}" rx="${w.region.radius}"/></clipPath>${N.clip}</defs><g clip-path="url(#dg-vp-${l})"><rect class="dg-vp-bg" width="${C}" height="${O}"/><g class="dg-a" style="${ue}">${e}</g>${se}</g><rect class="dg-vp-frame" x="0.5" y="0.5" width="${C-1}" height="${O-1}" rx="${w.region.radius}"/>${N.body}`,ee=F&&!h?C+c.inset+S:f,b=F||h?O:me+y;if(!t.strip)return{body:T,w:ee,h:b};let G=Gn(t.strip,0,b+c.inset,f);return{body:T+o(G,t.strip),w:ee,h:G.y+G.h}}function cs(t,n){let a=gs(t.palette);if(!t.colors)return a;let p=Qe[t.lang??"ja"],l=Object.entries(t.colors).flatMap(([e,s])=>ys(e)?bs(s)?[]:[p.unreadableColor(e)]:[p.unknownColor(e)]);if(l.length>0)throw new Error(p.cannotDraw(l.join(" / ")));return{...a,[n]:{...a[n],...t.colors}}}function Nr(t,n={}){let a=n.lang??"ja",p=kr(t,{lang:a});if(!p.ok)throw new Error(Qe[a].cannotDraw(p.errors.map(s=>`${s.pointer} ${s.message}`).join(" / ")));let l=p.diagram,e=l.kind==="sequence"?fr(l):l.kind==="state"?nt("state",a).layoutState(l,a):l.kind==="git"?nt("git",a).layoutGit(l):l.kind==="time"?nt("time",a).layoutTime(l,a):l.kind==="tree"?nt("tree",a).layoutTree(l):l.kind==="lineup"?nt("lineup",a).layoutLineup(l):dr(l);return Ro(l,e,Pr(l,n.still===!0),n)}function Ro(t,n,a,p={}){let l=p.theme==="dark"?"dark":"light",e=cs(p,l),s=[],r=[];return{svg:ps(t,n,a,e,l,void 0,s,r),palette:e.id,theme:l,...t.view?{view:t.view}:{},fonts:{...Dt},layout:n,timeline:a,diagram:t,overlaps:Es(s,a.stills,r)}}function ds(t,n,a){let p=Math.max(0,n)/t.layout.width,e=(a===void 0?p:Math.min(p,Math.max(0,a)/t.layout.height))*A.boxName.size;return t.view?{mode:t.view,textPx:e}:{mode:e>=xs?"fixed":"follow",textPx:e}}var An=t=>`font:${t.weight} ${t.size}px var(--${t.family})`,Ae=t=>`${t}px`;function Io(){let t=w.player,n=Ae(t.hidden);return[`.dg-player{display:flex;flex-direction:column;gap:${Ae(t.gap)};color:var(--ink)}`,`.dg-player .dg-frame{border-radius:${Ae(t.radius)};overflow:hidden}`,".dg-bar{container:dg-bar/inline-size}",`.dg-row{display:flex;align-items:flex-start;gap:${Ae(t.gap)}}`,`.dg-btns{display:flex;gap:${Ae(t.gap/2)};flex:none}`,`.dg-btn{width:${Ae(t.button)};height:${Ae(t.button)};border-radius:${Ae(t.radius)};border:${Ae(w.stroke.hair)} solid var(--hair);background:var(--surf);color:var(--ink);${An(A.button)};cursor:pointer}`,`.dg-btn:focus-visible{outline:${Ae(t.focus)} solid var(--c-blue);outline-offset:${Ae(t.focus)}}`,`.dg-say{display:flex;gap:${Ae(t.gap)};min-width:0}`,`.dg-no{${An(A.stepNo)};color:var(--mute);padding-top:${Ae(t.focus)}}`,".dg-txt{display:grid;grid-template-columns:minmax(0,1fr);min-width:0}",".dg-txt>*{grid-area:1/1}",".dg-room{visibility:hidden}",`.dg-tt{${An(A.stepTitle)};margin:0}`,`.dg-tb{${An(A.stepBody)};color:var(--ink2);margin:0;white-space:pre-line}`,`.dg-sr{position:absolute;width:${n};height:${n};margin:-${n};padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}`,`@container dg-bar (width < ${Ae(t.narrow)}){.dg-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:0 ${Ae(t.gap)}}.dg-say,.dg-txt,.dg-txt>*{display:contents}.dg-btns{grid-area:1/1;margin-bottom:${Ae(t.gap/2)}}.dg-btn{width:${Ae(t.touch)};height:${Ae(t.touch)}}.dg-no{grid-area:1/2;display:flex;align-items:center;min-height:${Ae(t.touch)};padding-top:0}.dg-tt{grid-area:2/1/3/3}.dg-tb{grid-area:3/1/4/3}}`,`@media (pointer: coarse){.dg-btn{width:${Ae(t.touch)};height:${Ae(t.touch)}}}`,`.dg-spot{fill:none;stroke:var(--t-amber);stroke-width:${Ae(w.stroke.mark)};stroke-dasharray:${w.mark.dash} ${w.mark.gap};pointer-events:none}`].join("")}function Do(t){if(t.getElementById("dragon-player-css"))return;let n=t.createElement("style");n.id="dragon-player-css",n.textContent=Io(),t.head.appendChild(n)}var Gt={prev:"\u2039",pause:"\u275A\u275A",play:"\u25B6",next:"\u203A"},Er="http://www.w3.org/2000/svg",Lr=t=>String(t).padStart(2,"0"),Co=(t,n)=>`${Lr(t+1)}/${Lr(n)}`;function qr(t,n,a={}){let p=t.ownerDocument,l=p.defaultView,e=!!l?.matchMedia?.("(prefers-reduced-motion: reduce)").matches,s=Nr(n,a),r=a.lang??"ja",o=Qe[r],i=cs(a,s.theme),{timeline:c}=s,m=s.diagram.steps,f=m.length;Do(p);let d=p.createElement("div");d.className="dg-player",d.dataset.dragon="player",d.setAttribute("style",`${Kt};${Vt(i,s.theme)}`);let u=p.createElement("div");u.className="dg-frame";let M=(K,H,re)=>{let le=p.createElement("button");return le.type="button",le.className="dg-btn",le.dataset.dragon=K,le.setAttribute("aria-label",H),le.textContent=re,le},x=M("prev",o.prev,Gt.prev),h=M("toggle",o.pause,Gt.pause),g=M("next",o.next,Gt.next),L=p.createElement("div");L.className="dg-btns",L.setAttribute("lang",r),L.append(x,h,g);let O=p.createElement("div");O.className="dg-say",O.setAttribute("aria-hidden","true");let _=p.createElement("div");_.className="dg-no",_.dataset.dragon="step-no";let P=p.createElement("div");P.className="dg-txt";let j=p.createElement("p");j.className="dg-tt",j.dataset.dragon="step-title";let $=p.createElement("p");$.className="dg-tb",$.dataset.dragon="step-body";let S=p.createElement("div");S.append(j,$),P.append(S);for(let K of m){let H=p.createElement("div");H.className="dg-room",H.dataset.dragon="caption-room";let re=p.createElement("p");re.className="dg-tt",re.textContent=K.title;let le=p.createElement("p");le.className="dg-tb",le.textContent=K.body,H.append(re,le),P.append(H)}O.append(_,P);for(let K of[_,j,$])K.setAttribute("aria-hidden","true");let y=p.createElement("div");y.className="dg-row",y.append(L,O);let F=p.createElement("div");F.className="dg-bar",F.append(y);let C=p.createElement("ol");C.className="dg-sr",C.dataset.dragon="steps",C.setAttribute("aria-label",o.steps(s.diagram.title));for(let K of m){let H=p.createElement("li"),re=p.createElement("strong");re.textContent=K.title,H.append(re);for(let le of K.body.split(`
|
|
3
|
+
`)){let Se=p.createElement("p");Se.textContent=le,H.append(Se)}if(K.sources){let le=p.createElement("ul");for(let Se of K.sources){let qe=p.createElement("a");qe.href=Se.url,qe.textContent=Se.name;let Re=p.createElement("li");Re.append(qe),le.append(Re)}H.append(le)}C.append(H)}d.append(u,F,C),t.append(d);let X=()=>u.clientWidth||t.clientWidth||s.layout.width,z=()=>{if(!a.fitHeight||!l)return;let K=l.getComputedStyle(u),H=u.clientHeight-(Number.parseFloat(K.paddingTop)||0)-(Number.parseFloat(K.paddingBottom)||0);return H>0?H:void 0},Q=ds(s,X(),z()).mode,B=X(),v=z(),I=null,R=a.pausedAt===void 0?0:Math.min(f-1,Math.max(0,a.pausedAt)),W=!e&&a.pausedAt===void 0,J=W?0:c.stills[R]??0,Z=c.stills[f-1]??0,ie=Date.now(),de=[],ue=()=>{if(!I)return;for(let re of I.querySelectorAll(".dg-spots"))re.remove();if(de.length===0)return;let K=w.mark,H=p.createElementNS(Er,"g");H.setAttribute("class","dg-spots");for(let re of de){let le=p.createElementNS(Er,"rect");le.setAttribute("class","dg-spot"),le.setAttribute("x",String(re.x-K.pad)),le.setAttribute("y",String(re.y-K.pad)),le.setAttribute("width",String(re.w+K.pad*2)),le.setAttribute("height",String(re.h+K.pad*2)),le.setAttribute("rx",String(K.radius)),H.append(le)}(I.querySelector('g[clip-path^="url(#dg-vp-"] > g.dg-a')??I).append(H)},D=K=>{let H;if(K!==void 0){let re=p.createElement("div");re.innerHTML=K,H=re.querySelector("svg")}else H=I?I.cloneNode(!0):null;H&&(H.setAttribute("aria-hidden","true"),H.removeAttribute("role"),H.removeAttribute("aria-label"),H.style.setProperty("--at",String(J)),H.style.setProperty("--play",W?"running":"paused"),H.dataset.motion=W?"play":"still",I?I.replaceWith(H):u.append(H),I=H,ie=Date.now(),ue())},me=()=>Q==="follow"?ps(s.diagram,s.layout,c,i,s.theme,{width:B,...v===void 0?{}:{height:v},lang:r}):s.svg,ae=()=>W?(J+(Date.now()-ie)/1e3)%c.total:J,ye=K=>{let H=0;return c.steps.forEach((re,le)=>{re.start<=K&&(H=le)}),H},we=()=>{let K=m[R];_.textContent=Co(R,f),j.textContent=K?.title??"",$.textContent=K?.body??"",h.setAttribute("aria-label",W?o.pause:o.play),h.textContent=W?Gt.pause:Gt.play,a.onStep?.(R)},E=(K,H)=>{J=K,W=H,D(),we()},N=K=>{R=Math.min(f-1,Math.max(0,K));let H=c.steps[R];E(W?H.start:c.stills[R]??H.start,W)},se=()=>{a.playOnce&&J>=Z&&(R=0,J=0),E(J,!0)};D(me()),we();let T=l?.setInterval(()=>{if(!W)return;if(a.playOnce&&J+(Date.now()-ie)/1e3>=Z){R=f-1,E(Z,!1);return}let K=ye(ae());K!==R&&(R=K,we())},120),ee=()=>N(R-1),b=()=>N(R+1),G=()=>W?E(ae(),!1):se(),q=K=>{let H=K.target?.closest?.("[data-step]"),re=H?Number(H.getAttribute("data-step")):Number.NaN;Number.isInteger(re)&&N(re)};x.addEventListener("click",ee),g.addEventListener("click",b),h.addEventListener("click",G),u.addEventListener("click",q);let Y=l?.ResizeObserver,U=Y?new Y(()=>{let K=X(),H=z(),re=ds(s,K,H).mode;if(re===Q&&(Q==="fixed"||K===B&&H===v))return;let le=ae();Q=re,B=K,v=H,J=le,D(me())}):void 0;return U?.observe(u),{get step(){return R},get playing(){return W},next:b,prev:ee,play:()=>{W||se()},pause:()=>{W&&E(ae(),!1)},goTo:K=>{W=!1,N(K)},mark:K=>{de=K,ue()},destroy:()=>{T!==void 0&&l?.clearInterval(T),U?.disconnect(),x.removeEventListener("click",ee),g.removeEventListener("click",b),h.removeEventListener("click",G),u.removeEventListener("click",q),d.remove()}}}return Cr(Fo);})();
|