@cardenelabs/dragon 0.44.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +21 -0
  2. package/dist/cli.cjs +3603 -3541
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +3603 -3541
  5. package/dist/cli.js.map +1 -1
  6. package/dist/export.cjs +3462 -3400
  7. package/dist/export.cjs.map +1 -1
  8. package/dist/export.js +3461 -3401
  9. package/dist/export.js.map +1 -1
  10. package/dist/index.cjs +12239 -12177
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.js +12239 -12177
  13. package/dist/index.js.map +1 -1
  14. package/dist/light/chunk-6ZUKJ3VO.js +489 -0
  15. package/dist/light/chunk-6ZUKJ3VO.js.map +1 -0
  16. package/dist/light/chunk-CLS6JVKK.cjs +84 -0
  17. package/dist/light/chunk-CLS6JVKK.cjs.map +1 -0
  18. package/dist/light/chunk-JNSHZTPF.js +1141 -0
  19. package/dist/light/chunk-JNSHZTPF.js.map +1 -0
  20. package/dist/light/chunk-OUQ44P45.cjs +489 -0
  21. package/dist/light/chunk-OUQ44P45.cjs.map +1 -0
  22. package/dist/light/chunk-VRAW7VAQ.cjs +1141 -0
  23. package/dist/light/chunk-VRAW7VAQ.cjs.map +1 -0
  24. package/dist/light/chunk-YDKPEKGZ.js +84 -0
  25. package/dist/light/chunk-YDKPEKGZ.js.map +1 -0
  26. package/dist/light/git-C4RVNFT6.js +637 -0
  27. package/dist/light/git-C4RVNFT6.js.map +1 -0
  28. package/dist/light/git-I7D7RIW2.cjs +637 -0
  29. package/dist/light/git-I7D7RIW2.cjs.map +1 -0
  30. package/dist/light/index.cjs +9885 -0
  31. package/dist/light/index.cjs.map +1 -0
  32. package/dist/light/index.d.cts +976 -0
  33. package/dist/light/index.d.ts +976 -0
  34. package/dist/light/index.js +9885 -0
  35. package/dist/light/index.js.map +1 -0
  36. package/dist/light/lineup-FAIKTH3Y.cjs +283 -0
  37. package/dist/light/lineup-FAIKTH3Y.cjs.map +1 -0
  38. package/dist/light/lineup-YEG4HHEI.js +283 -0
  39. package/dist/light/lineup-YEG4HHEI.js.map +1 -0
  40. package/dist/light/state-P3LIVI3K.js +335 -0
  41. package/dist/light/state-P3LIVI3K.js.map +1 -0
  42. package/dist/light/state-ZZUK6AQT.cjs +335 -0
  43. package/dist/light/state-ZZUK6AQT.cjs.map +1 -0
  44. package/dist/light/time-64DJKYAL.cjs +719 -0
  45. package/dist/light/time-64DJKYAL.cjs.map +1 -0
  46. package/dist/light/time-B5WUQOFP.js +719 -0
  47. package/dist/light/time-B5WUQOFP.js.map +1 -0
  48. package/dist/light/tree-5HPREYW2.js +478 -0
  49. package/dist/light/tree-5HPREYW2.js.map +1 -0
  50. package/dist/light/tree-66EH4QVI.cjs +478 -0
  51. package/dist/light/tree-66EH4QVI.cjs.map +1 -0
  52. package/dist/player.global.js +3 -3
  53. package/package.json +14 -2
  54. package/src/api.ts +71 -0
  55. package/src/figure-text.ts +4 -0
  56. package/src/index.ts +6 -69
  57. package/src/kinds/all.ts +16 -0
  58. package/src/kinds/git.ts +3 -0
  59. package/src/kinds/lineup.ts +3 -0
  60. package/src/kinds/registry.ts +46 -0
  61. package/src/kinds/state.ts +2 -0
  62. package/src/kinds/time.ts +3 -0
  63. package/src/kinds/tree.ts +3 -0
  64. package/src/layout/git.ts +0 -1
  65. package/src/layout/lineup.ts +0 -1
  66. package/src/layout/time.ts +0 -1
  67. package/src/layout/tree.ts +0 -1
  68. package/src/light.ts +31 -0
  69. package/src/player-global.ts +3 -0
  70. package/src/player.ts +1 -1
  71. package/src/render/draw.ts +731 -0
  72. package/src/render/parts.ts +3 -0
  73. package/src/render/svg.ts +4 -725
  74. package/src/render/time.ts +1 -4
  75. package/src/view.ts +1 -1
@@ -1,3 +1,3 @@
1
- "use strict";var DragonPlayer=(()=>{var Ln=Object.defineProperty;var yr=Object.getOwnPropertyDescriptor;var br=Object.getOwnPropertyNames;var xr=Object.prototype.hasOwnProperty;var wr=(t,n)=>{for(var l in n)Ln(t,l,{get:n[l],enumerable:!0})},$r=(t,n,l,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of br(n))!xr.call(t,a)&&a!==l&&Ln(t,a,{get:()=>n[a],enumerable:!(p=yr(n,a))||p.enumerable});return t};var kr=t=>$r(Ln({},"__esModule",{value:!0}),t);var bo={};wr(bo,{mountDiagram:()=>hr});var qn=t=>/[0-9A-Za-z]$/u.test(t)?`${t} `:t,vr=t=>t.charAt(0).toUpperCase()+t.slice(1),tt={ja:{cannotDraw:t=>`\u56F3\u3092\u63CF\u3051\u306A\u3044: ${t}`,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)=>`${qn(t)}\u3068${qn(n)}\u304C\u91CD\u306A\u308B`,lineCrosses:(t,n,l)=>`\u7DDA ${t} \u2192 ${n} \u304C${qn(l)}\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}`,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)=>vr(`${t} and ${n} overlap`),lineCrosses:(t,n,l)=>`The line ${t} \u2192 ${n} crosses ${l}`,timeUnits:{ms:"ms",s:"s",min:"min",h:"h",d:"d"},zoom:"Zoom",range:(t,n)=>`${t}\u2013${n}`,headJoin:" \xB7 ",empty:"Empty"}};var ns={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 jt={sans:"Noto Sans JP Variable",mono:"JetBrains Mono Variable"},Sr={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},Mr=600,Or=11904,Ft=1e3;function ss(t,n){return(t.codePointAt(0)??0)>=Or?Ft:n==="mono"?Mr:Sr[t]??Ft}var Tr="paper",An=Object.fromEntries(Object.entries(ns).map(([t,n])=>[t,{id:t,...n}]));function rs(t){return(t!==void 0&&Object.hasOwn(An,t)?An[t]:void 0)??An[Tr]}var Nr=["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"],Er=new Set(Nr),is=t=>Er.has(t);function os(t){if(typeof t!="string"||!/^[\w\s#%.,()/+-]+$/u.test(t)||/url\(/iu.test(t))return!1;let n=0;for(let l of t)if(n+=l==="("?1:l===")"?-1:0,n<0)return!1;return n===0}function _t(t,n){return Object.entries(t[n]).map(([l,p])=>`--${l}:${p}`).join(";")}var Bt=`--sans:"${jt.sans}";--mono:"${jt.mono}"`,yt=["blue","amber","green","violet","rose"],ve=(t,n,l="sans")=>({size:t,weight:n,family:l}),q={boxName:ve(13,650),boxSub:ve(11,500),boxSubStrong:ve(11,700),regionName:ve(12.5,700),regionNote:ve(11,500),label:ve(11,600,"mono"),labelJa:ve(11,650),action:ve(11,650),badge:ve(10.5,700,"mono"),carrier:ve(10.5,700,"mono"),carrierJa:ve(10.5,700),stripTitle:ve(12.5,700),fieldName:ve(10.5,600),fieldValue:ve(12,600,"mono"),fieldValueJa:ve(12,600),tag:ve(10.5,700),miniTitle:ve(10.5,700),stepTitle:ve(15,700),stepBody:ve(13.5,500),stepNo:ve(13,700,"mono"),button:ve(14,700),gitId:ve(11,700),gitHash:ve(10.5,600,"mono"),gitNote:ve(10.5,650),treeHash:ve(13.5,700,"mono"),treeName:ve(10.5,600),rootHash:ve(15,700,"mono"),rootName:ve(11,700),treeCard:ve(11.5,650),chip:ve(10.5,700,"mono"),stamp:ve(11,700),timeHead:ve(11,650,"mono"),timeRow:ve(11,600),timeTick:ve(10.5,600,"mono"),timePeriod:ve(11.5,650),timeRange:ve(10.5,500,"mono"),pointName:ve(11,700,"mono"),pointState:ve(11.5,700),spanText:ve(11,650),emptyText:ve(11,700),meterLine:ve(10.5,700,"mono")},v={gap:10,margin:14,box:{h:72,minW:92,padX:12,radius:12,icon:24,iconRadius:7,iconY:-16,iconScale:.74,nameY:12,subY:27},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,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}},ie={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}},as=10.5,me={inOut:"cubic-bezier(.65,0,.35,1)",out:"cubic-bezier(.22,1,.36,1)",pop:"cubic-bezier(.34,1.56,.64,1)"};var Ie=t=>[...t].some(n=>(n.codePointAt(0)??0)>=11904);function Lr(t,n){return n==="mono"&&Ie(t)?"sans":n}function pe(t,n){let l=Lr(t,n.family),p=0;for(let a of t)p+=ss(a,l);return p*n.size/Ft}function Ge(t,n,l,p,a="start"){let e=pe(t,p);return{x:a==="middle"?n-e/2:n,y:l-p.size*.8,w:e,h:p.size}}function xt(t){return t.steps.flatMap((n,l)=>n.events.flatMap((p,a)=>p.type==="edge"?[{step:l,event:a,edge:p}]:[]))}function Ke(t){let n=Rn(t),l=new Map;return t.boxes.forEach((p,a)=>{let e=p.region===void 0?void 0:n.get(p.region);l.set(p.id,p.color??e??yt[a%yt.length])}),l}function Rn(t){let n=new Map;return(t.regions??[]).forEach((l,p)=>n.set(l.id,l.color??yt[p%yt.length])),n}var ot=(t,n)=>t.carry.kind==="coin"?"coin":n.get(t.from)??"slate";function et(t,n,l){let p=t.boxes.find(e=>e.id===n);if(!p)return v.box.minW;let a=[pe(p.name,q.boxName),pe(p.sub??"",q.boxSub)];for(let e of t.steps)for(let s of e.events)s.type==="swap"&&s.box===n&&a.push(pe(s.text,q.boxSubStrong)),l&&s.type==="action"&&s.box===n&&a.push(pe(s.label,q.boxSubStrong));return Math.max(v.box.minW,Math.max(...a)+v.box.padX*2)}function at(t){let n=v.carrier;return t.kind==="tag"?[(pe(t.text,Ie(t.text)?q.carrierJa:q.carrier)+n.tagPadX*2)/2,n.tagH/2]:t.kind==="coin"?[n.coinR,n.coinR]:[n.envW/2,n.envH/2]}var ls=t=>t.main+t.coin+(t.main>0&&t.coin>0?v.slot.spread:0);function wt(t){let n=new Map,l=new Set(t.boxes.map(p=>p.id));for(let p of t.steps)for(let a of p.events){if(a.type!=="edge"||a.carry.kind==="none")continue;let e=a.carry.kind==="coin"?"coin":"main",s=at(a.carry)[0]*2;for(let r of[a.from,a.to]){if(!l.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 $t(t,n,l){return t?(n?v.box.icon+v.slot.gap:0)+ls(t)+v.slot.pad*2+v.box.padX+l:0}function kt(t,n,l=v.box.padX){if(!n)return;let p=v.box,a=v.slot,e=ls(n)+a.pad*2,s=t.icon?p.icon+a.gap:0,r=Math.max(t.x+p.padX,Math.min(t.cx-(s+e)/2,t.x+t.w-l-(s+e)));t.icon&&(t.iconX=r+p.icon/2),t.slot={x:r+s,y:t.cy+p.iconY-a.h/2,w:e,h:a.h}}function mt(t,n,l){let p=v.slot,a=(e,s)=>{let r=n.get(e),o=l.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=a(e.to,e.carry),r=a(e.from,e.carry);s&&(e.settle=s),r&&(e.wait=r)}}function bt(t,n){let l=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(l,p)}function Gt(t,n,l=0){let p=n.x+l,a=n.y+l,e=n.x+n.w-l,s=n.y+n.h-l;if(e<=p||s<=a)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,k=1,h=(w,g)=>{if(w===0)return g>0;let N=g/w;return w<0?u=Math.max(u,N):k=Math.min(k,N),u<k};if(h(-f,o-p)&&h(f,e-o)&&h(-d,i-a)&&h(d,s-i))return!0}return!1}function qr(t){let n={a:t[0],b:t[1]??t[0],length:-1};for(let l=1;l<t.length;l++){let p=t[l-1],a=t[l],e=Math.hypot(a[0]-p[0],a[1]-p[1]);e>n.length&&(n={a:p,b:a,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 Qe(t,n){let l=n;for(let p=1;p<t.length;p++){let a=t[p-1],e=t[p],s=Math.hypot(e[0]-a[0],e[1]-a[1]);if(l<=s&&s>0)return[a[0]+(e[0]-a[0])*l/s,a[1]+(e[1]-a[1])*l/s];l-=s}return t[t.length-1]}function ft(t){let n=0;for(let l=1;l<t.length;l++){let p=t[l-1],a=t[l];n+=Math.hypot(a[0]-p[0],a[1]-p[1])}return n}function Ot(t){let{w:n,h:l,samples:p}=v.state.loop,a=t.y+t.h,e=[t.cx+n/2,a],s=[t.cx+n*3/4,a+l*4/3],r=[t.cx-n*3/4,a+l*4/3],o=[t.cx-n/2,a+v.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 Yt(t){let n=Math.max(...t.map(([a])=>a)),l=t[0][1],p=Math.max(...t.map(([,a])=>a));return[n+v.badge.r+v.badge.inset,l+(p-l)*v.state.loop.badgeAt]}function Vt(t,n){return{x:(t[0]?.[0]??0)-v.state.loop.w/2-n/2,y:Math.max(...t.map(([,l])=>l))+v.label.soft}}var Dn=v.state.loop.h+v.label.soft*2+v.label.h;function nt(t,n=[],l=[]){let p=ft(t),a=p<v.badge.short?Math.min(v.badge.r+1,p/2):v.badge.along,e=v.badge.r*2+v.badge.inset;for(let s=a;s<=p;s+=1){let r=Qe(t,s);if(n.every(([o,i])=>Math.hypot(r[0]-o,r[1]-i)>=e))return r}return Ar(t,a,n,l)??Qe(t,a)}function Ar(t,n,l,p){let a=ft(t),[e,s]=Qe(t,n),[r,o]=Qe(t,Math.max(0,n-1)),[i,c]=Qe(t,Math.min(a,n+1)),m=Math.hypot(i-r,c-o);if(m===0)return;let[f,d]=[-(c-o)/m,(i-r)/m],u=v.badge.r*2;for(let k of[v.edge.arrowHalf,0])for(let h=1;h<=u+v.badge.inset;h++)for(let w of[1,-1]){let g=[e+f*h*w,s+d*h*w];if(l.every(([L,F])=>Math.max(Math.abs(g[0]-L),Math.abs(g[1]-F))>=u+1)&&p.every(L=>!Gt(L,Ye(g),-k)))return g}}var Rt=t=>t.points.map(([n,l])=>`${Math.round(n*10)},${Math.round(l*10)}`).join(" ");function ut(t,n,l=(p,a,e)=>nt(p.points,a,e)){let p=new Map,a=[],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=Rt(r),i=e.get(o);if(i){p.set(s,{point:i,edge:r});continue}let c=t.filter(f=>f.points.length>1&&Rt(f)!==o).map(f=>f.points),m=l(r,a,c);a.push(m),e.set(o,m),p.set(s,{point:m,edge:r})}return p}function Xe(t){let n=(l,p)=>Math.hypot(l.x-p.x,l.y-p.y)<=.5;return t.map(l=>{let p=t.filter(a=>a.step>l.step&&n(a,l)).sort((a,e)=>a.step-e.step)[0];return p?{...l,until:p.step}:l})}var Ye=([t,n])=>({x:t-v.badge.r,y:n-v.badge.r,w:v.badge.r*2,h:v.badge.r*2}),Wt=t=>[t.x+v.state.text,t.y+v.baseline.mark],He=t=>Ie(t)?q.labelJa:q.label,jr={above:"below",below:"above",left:"right",right:"left"};function Ze(t,n){let l=pe(t.text,He(t.text))+v.label.padX*2,p=v.label.h,a=qr(t.points),e=(a.a[0]+a.b[0])/2,s=(a.a[1]+a.b[1])/2,r=t.side??(a.vertical?"right":"above"),{side:o}=v.label,i=t.offset??v.label.offset,c=h=>h==="above"?{x:e-l/2,y:s-i-p/2,w:l,h:p}:h==="below"?{x:e-l/2,y:s+i-p/2,w:l,h:p}:h==="left"?{x:e-o-l,y:s-p/2,w:l,h:p}:{x:e+o,y:s-p/2,w:l,h:p},m=t.base?{...t.base,w:l,h:p}:c(r),f=t.flip?[r,jr[r]]:[r],d=h=>n.hard.every(w=>bt(h,w)>=v.gap)&&n.soft.every(w=>bt(h,w)>=v.label.soft)&&(n.touch??[]).every(w=>bt(h,w)>=v.label.touch)&&(n.lines??[]).every(w=>!Gt(w,h,-v.label.touch)),{search:u,searchMax:k}=v.label;for(let h=0;h<=k;h+=u)for(let w of f){let g=w===r?m:c(w),N=w==="above"?[0,-1]:w==="below"?[0,1]:w==="left"?[-1,0]:[1,0],L=[Math.abs(N[1]),Math.abs(N[0])],F=t.slide??(w==="above"||w==="below"?l:p*4);for(let T=0;T<=F;T+=u)for(let j of T===0?[1]:[1,-1]){let x={x:g.x+N[0]*h+L[0]*T*j,y:g.y+N[1]*h+L[1]*T*j,w:l,h:p};if(d(x))return{...x,step:t.step,event:t.event,text:t.text,family:He(t.text).family,color:t.color}}}return{...m,step:t.step,event:t.event,text:t.text,family:He(t.text).family,color:t.color}}function In(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 l=/^([0-9]+)\/([0-9]+)$/u.exec(t.trim());if(l&&Number(l[2])>0)return Math.min(1,Math.max(0,Number(l[1])/Number(l[2])))}var ps=(t,n)=>t.strip?.meters?.find(l=>l.field===n);function cs(t,n){if(ps(t,n))return Math.max(pe(n,q.fieldName),v.time.meter.w);let l=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&&(l=Math.max(l,pe(s.value,Ie(s.value)?q.fieldValueJa:q.fieldValue))),s.tag!==void 0&&(p=Math.max(p,pe(s.tag,q.tag)+v.strip.tagPadX*2)));let a=l+(p>0?(l>0?v.strip.tagGap:0)+p:0);return Math.max(pe(n,q.fieldName),a)}var jn=t=>Math.max(pe(t.title,q.fieldName),t.states.length*v.strip.trail.step);function ze(t,n){if(!t.strip)return 0;let{titleX:l,fieldGap:p,pad:a}=v.strip,e=l+pe(t.strip.title,q.stripTitle)+p,s=[...t.strip.fields.map(r=>cs(t,r)),...n?[jn(n)]:[]];return e+s.reduce((r,o)=>r+o+p,0)-p+a}function Ue(t,n,l,p,a){if(!t.strip)return;let{titleX:e,fieldGap:s,pad:r,line:o,h:i}=v.strip,c=e+pe(t.strip.title,q.stripTitle)+s,m=[],f=c,d=0,u=h=>{f>c&&f+h>p-r&&(f=c,d++);let w={x:n+f,y:l+d*o};return f+=h+s,w};for(let h of t.strip.fields){let w=cs(t,h),g=u(w),N=ps(t,h),L=N?In(N.line):void 0;m.push({name:h,...g,w,...N&&L!==void 0?{meter:{line:L,text:N.line,x:g.x,w:v.time.meter.w}}:{}})}let k=a?{...a,...u(jn(a)),w:jn(a)}:void 0;return{x:n,y:l,w:p,h:i+d*o,title:t.strip.title,fields:m,...k?{trail:k}:{}}}function Tt(t,n,l){let p=a=>{a.x+=n,a.y+=l};for(let a of t.boxes)p(a),a.cx+=n,a.cy+=l,a.slot&&p(a.slot),a.iconX!==void 0&&(a.iconX+=n);for(let a of t.regions)a.y+=l,p(a.header);for(let a of t.lifelines)a.x+=n,a.y1+=l,a.y2+=l;for(let a of t.edges)a.points=a.points.map(([e,s])=>[e+n,s+l]),a.settle&&(a.settle=[a.settle[0]+n,a.settle[1]+l]),a.wait&&(a.wait=[a.wait[0]+n,a.wait[1]+l]);for(let a of t.labels)p(a);for(let a of t.paths)a.points=a.points.map(([e,s])=>[e+n,s+l]),a.label&&p(a.label);for(let a of t.ends)a.x+=n,a.y+=l;t.side&&p(t.side);for(let a of t.actions)p(a);for(let a of t.badges)a.x+=n,a.y+=l;if(t.strip){t.strip.y+=l;for(let a of t.strip.fields)a.x+=n,a.y+=l,a.meter&&(a.meter.x+=n);t.strip.trail&&(t.strip.trail.x+=n,t.strip.trail.y+=l)}}function Nt(t,n,l){let{inset:p}=v.badge;for(let e of t){let s=e.type==="swap"||e.type==="action"?e.box:void 0,r=l.boxes.find(o=>o.id===s);if(r)return{step:n,x:r.x,y:r.y,color:r.color}}if(l.strip&&t.some(e=>e.type==="strip"))return{step:n,x:l.strip.x+p,y:l.strip.y+p,color:"slate"};let a=l.boxes[0];return{step:n,x:a.x,y:a.y,color:a.color}}function ms(t){let n=Rr(t),l=Dr(t,n),p=n.map(()=>({top:0,bottom:0})),a=ds(t,n,l,p);for(let e=0;e<3&&Fr(a,n,l,p);e++)a=ds(t,n,l,p);return a}function Rr(t){let n=t.regions??[],l=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)})),a=t.boxes.filter(e=>e.region===void 0||!l.has(e.region)).map(e=>e.id);return a.length>0&&p.push({members:a}),p}var fs=t=>t==="left"||t==="right";function Dr(t,n){let l=v.architecture.columns,p=xt(t).map(s=>s.edge),a=new Map;n.forEach((s,r)=>{let o=new Set(s.members),i=new Set,c=(w,g)=>w>=0&&w<l&&!i.has(`${w},${g}`),m=(w,g)=>{let N=Math.min(l-1,Math.max(0,w));for(let L=g;;L++)for(let F=0;F<l;F++)for(let T of[N+F,N-F])if(c(T,L))return[T,L]},f=(w,g,N)=>{a.set(w,{group:r,col:g,row:N}),i.add(`${g},${N}`)},d=1,u=w=>{for(let g of p){let N=g.from===w?g.to:g.to===w?g.from:void 0;if(N===void 0||!o.has(N)||a.has(N))continue;let L=a.get(w),[F,T]=fs(g.labelSide)?m(L.col,L.row+1):c(L.col+d,L.row)?[L.col+d,L.row]:m(L.col+d,L.row);f(N,F,T),u(N)}},k=w=>{for(let g=0;g<p.length;g++){let N=p[g],L=N?.from===w?N.to:N?.to===w?N.from:void 0,F=L===void 0?void 0:a.get(L);if(F&&F.group<r)return{order:g,col:F.col}}},h=0;for(;;){let w=s.members.filter(j=>!a.has(j));if(w.length===0)break;let g=w.map(j=>({id:j,anchor:k(j)})).filter(j=>j.anchor!==void 0);g.sort((j,x)=>(j.anchor?.order??0)-(x.anchor?.order??0));let N=g[0]??{id:w[0],anchor:void 0},L=N.anchor?.col??0;h===0&&(d=L>=(l-1)/2?-1:1);let[F,T]=c(L,0)?[L,0]:m(L,0);f(N.id,F,T),u(N.id),h++}});let e=[...new Set([...a.values()].map(s=>s.col))].sort((s,r)=>s-r);for(let s of a.values())s.col=e.indexOf(s.col);return a}function Ir(t){let n=[...t.matchAll(/ /g)].map(p=>p.index);if(n.length===0)return[t];let l=n.reduce((p,a)=>Math.abs(a-t.length/2)<Math.abs(p-t.length/2)?a:p);return[t.slice(0,l),t.slice(l+1)]}function Cr(t){let{icon:n,nameY:l,line:p,inset:a}=v.region,e=Ir(t.name),s=Math.max(n,...e.map(o=>pe(o,q.regionName)),pe(t.note??"",q.regionNote)),r=l-a+(e.length-1)*p+(t.note?p:0)+v.gap/2;return{w:s,h:r,lines:e}}function ds(t,n,l,p){let{box:a,region:e,architecture:s,margin:r,gap:o}=v,i=Ke(t),c=Rn(t),m=xt(t),f=Math.max(1,...[...l.values()].map(y=>y.col+1)),d=wt(t),u=new Map(t.boxes.map(y=>[y.id,Math.max(et(t,y.id,!0),$t(d.get(y.id),y.icon!==void 0,a.padX))])),k=Array.from({length:f},(y,G)=>Math.max(a.minW,...[...l].filter(([,A])=>A.col===G).map(([A])=>u.get(A)??a.minW))),h=Array.from({length:Math.max(0,f-1)},()=>s.columnGap);for(let{edge:y}of m){let G=l.get(y.from),A=l.get(y.to);if(!G||!A||y.label===void 0||G.group!==A.group||G.row!==A.row||Math.abs(G.col-A.col)!==1||fs(y.labelSide))continue;let z=pe(y.label,He(y.label))+v.label.padX*2+s.labelRoom*2,ae=Math.min(G.col,A.col);z<=s.maxColumnGap&&(h[ae]=Math.max(h[ae]??0,z))}let w=n.map(y=>y.region?Cr(y.region):void 0),g=Math.max(0,...w.map(y=>y?y.w+e.inset*2:0)),N=[];for(let y=0;y<f;y++)N.push(y===0?r+(g>0?g:e.pad):N[y-1]+k[y-1]+h[y-1]);let L=y=>N[y]+k[y]/2,F=new Set(m.filter(({edge:y})=>y.from===y.to).map(({edge:y})=>y.from)),T=new Set([...F].flatMap(y=>{let G=l.get(y);return G?[`${G.group}:${G.row}`]:[]})),j=(y,G)=>T.has(`${y}:${G}`)?Dn:0,x=[],P=[],b=r;n.forEach((y,G)=>{let A=Math.max(1,...y.members.map(Pe=>(l.get(Pe)?.row??0)+1)),z=p[G],ae=b+e.pad+z.top,Z=[0];for(let Pe=1;Pe<A;Pe++)Z.push(Z[Pe-1]+a.h+s.rowGap+j(G,Pe-1));for(let Pe of y.members){let qe=l.get(Pe),Re=t.boxes.find(We=>We.id===Pe),Te=u.get(Pe)??a.minW,De=L(qe.col),Ve=ae+Z[qe.row];x.push({id:Pe,name:Re?.name??Pe,...Re?.sub!==void 0?{sub:Re.sub}:{},...Re?.icon!==void 0?{icon:Re.icon}:{},color:i.get(Pe)??"slate",x:De-Te/2,y:Ve,w:Te,h:a.h,cx:De,cy:Ve+a.h/2})}let J=ae+Z[A-1]+a.h+j(G,A-1),se=w[G],de=Math.max(J+e.pad+z.bottom-b,se?se.h+e.inset*2:0,y.region?e.minH:0);P.push({group:G,y:b,h:de,rows:A}),b+=de+e.gap});let B=b-e.gap;for(let y of x)kt(y,d.get(y.id));let _=new Map(x.map(y=>[y.id,y])),W=y=>P[l.get(y)?.group??0],H=(y,G,A)=>{for(let z=1;z<y.length;z++){let[ae,Z]=y[z-1],[J,se]=y[z];if(Math.min(ae,J)<=G.x+G.w+A&&Math.max(ae,J)>=G.x-A&&Math.min(Z,se)<=G.y+G.h+A&&Math.max(Z,se)>=G.y-A)return!0}return!1},ee=[...F].flatMap(y=>{let G=_.get(y);return G?[{x:G.x,y:G.y+G.h,w:G.w,h:Dn}]:[]}),C=y=>ee.some(G=>H(y,G,0)),M=(y,G,A)=>x.some(z=>z.id!==G&&z.id!==A&&H(y,z,v.label.search))||C(y),R=y=>{let G=_.get(y),A=W(y),z=l.get(y),ae=G.y+G.h+(z?j(z.group,z.row):0);return(z?.row??0)<A.rows-1?ae+s.rowGap/2:Math.min(ae+e.pad/2,A.y+A.h-v.edge.inset)},D=y=>{let G=_.get(y),A=W(y);return(l.get(y)?.row??0)>0?G.y-s.rowGap/2:Math.max(G.y-e.pad/2,A.y+v.edge.inset)},V=v.edge.inset,Q=(y,G)=>G?N[y]+k[y]+(h[y]??s.columnGap)/2:N[y]-(h[y-1]??s.columnGap)/2,U=(y,G)=>{let A=_.get(y),z=_.get(G);if(y===G)return Ot(A);let ae=l.get(y),Z=l.get(G);if(ae.group===Z.group&&ae.row===Z.row){let Te=z.cx>A.cx,De=[[Te?A.x+A.w:A.x,A.cy],[Te?z.x-V:z.x+z.w+V,z.cy]];if(!M(De,y,G))return De;let Ve=R(y),We=[[A.cx,A.y+A.h],[A.cx,Ve],[z.cx,Ve],[z.cx,z.y+z.h+V]];if(!C(We))return We;let ht=D(y),ct=[[A.cx,A.y],[A.cx,ht],[z.cx,ht],[z.cx,z.y-V]];return C(ct)?We:ct}let J=z.cy>A.cy,se=[A.cx,J?A.y+A.h:A.y],de=[z.cx,J?z.y-V:z.y+z.h+V];if(ae.col===Z.col){let Te=[se,de];if(!M(Te,y,G))return Te;let De=Q(ae.col,!0);return[[A.x+A.w,A.cy],[De,A.cy],[De,z.cy],[z.x+z.w+V,z.cy]]}let Pe=z.cx>A.cx,qe=J?R(y):D(y),Re=[[se,[A.cx,z.cy],[Pe?z.x-V:z.x+z.w+V,z.cy]],[[Pe?A.x+A.w:A.x,A.cy],[z.cx,A.cy],de],[se,[A.cx,qe],[z.cx,qe],de]];if(F.has(y)||F.has(G)){let Te=Q(ae.col,Pe),De=Q(Z.col,!Pe),Ve=[[Pe?A.x+A.w:A.x,A.cy],[Te,A.cy]],We=[Pe?z.x-V:z.x+z.w+V,z.cy];Re.push([...Ve,[Te,z.cy],We],[...Ve,[Te,qe],[z.cx,qe],de],[se,[A.cx,qe],[De,qe],[De,z.cy],We],[...Ve,[Te,qe],[De,qe],[De,z.cy],We])}return Re.find(Te=>!M(Te,y,G))??Re[2]},re=m.map(({step:y,event:G,edge:A})=>({step:y,event:G,from:A.from,to:A.to,points:U(A.from,A.to),color:ot(A,i),carry:A.carry}));mt(re,_,d);let I=new Map;for(let y of re){if(y.points.length!==2||!re.some(J=>J.from===y.to&&J.to===y.from&&J.points.length===2))continue;let[A,z]=y.points,ae=Math.abs(z[1]-A[1])<Math.abs(z[0]-A[0]),Z=(y.from<y.to?1:-1)*v.edge.parallel;y.points=y.points.map(([J,se])=>ae?[J,se+Z]:[J+Z,se]),I.set(y,ae?Z>0?"below":"above":Z>0?"right":"left")}let oe=[];n.forEach((y,G)=>{let A=P[G],z=w[G];!y.region||!z||oe.push({id:y.region.id,lines:z.lines,...y.region.note!==void 0?{note:y.region.note}:{},...y.region.icon!==void 0?{icon:y.region.icon}:{},color:c.get(y.region.id)??"slate",x:r,y:A.y,w:0,h:A.h,header:{x:r+e.inset,y:A.y+e.inset,w:z.w,h:z.h}})});let le=(y,G,A)=>y.from===y.to?Yt(y.points):nt(y.points,G,A),ye=ut(re,t.steps.length,le),ue=[];for(let y of re){let G=t.steps[y.step]?.events[y.event];if(G?.type!=="edge"||G.label===void 0)continue;let A=[...ye].filter(([J])=>J<=y.step).map(([,J])=>Ye(J.point)),z=[...oe.map(J=>J.header),...ue.filter(J=>J.step===y.step)],ae=G.labelSide??I.get(y),Z=y.from===y.to?{side:"below",base:Vt(y.points,pe(G.label,He(G.label))+v.label.padX*2)}:void 0;ue.push(Ze({step:y.step,event:y.event,text:G.label,points:y.points,color:y.color,...Z??(ae?{side:ae}:{flip:!0})},{hard:x,soft:z,touch:A}))}let ke={kind:"architecture",width:0,height:0,regions:oe,boxes:x,lifelines:[],edges:re,labels:ue,actions:[],badges:[],paths:[],ends:[]},Me=ue.length>0?Math.max(0,r+v.label.soft-Math.min(...ue.map(y=>y.x))):0;Me>0&&Tt(ke,Me,0);let E=Math.max(...x.map(y=>y.x+y.w+e.pad),...ue.map(y=>y.x+y.w+v.label.soft),...re.flatMap(y=>y.points.map(G=>G[0]+e.pad))),O=Math.max(E+r,ze(t)+r*2);for(let y of oe)y.w=O-r*2;let X=Math.max(B,...ue.map(y=>y.y+y.h)),S=Ue(t,r,X+o,O-r*2);ke.width=O,ke.height=(S?S.y+S.h:X)+r,S&&(ke.strip=S);let K=ut(re,t.steps.length,le);return ke.badges=Xe(t.steps.map((y,G)=>{let A=K.get(G);return A?{step:G,x:A.point[0],y:A.point[1],color:A.edge.color}:Nt(y.events,G,ke)})),ke}function Fr(t,n,l,p){let a=!1,e=v.label.soft;for(let s of t.labels){let r=t.edges.find(u=>u.step===s.step&&u.event===s.event),o=r&&l.get(r.from),i=r&&l.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,a=!0),d>0&&(m.bottom+=d,a=!0)}return a}var Ht=t=>Object.keys(t),Ro=Ht({sequence:!0,architecture:!0,state:!0,git:!0,time:!0,tree:!0,lineup:!0}),Et=["start","finish"],_r=["scale","period","row","point","zoom","mark","span"];var Br=["leaf","node"],Gr=["item","line","seal","open","pick","stamp"],Cn=12;var Do=["group","end","box","strip","step","say","code","source","act","note","set","branch","commit",..._r,...Br,...Gr];var vt="HEAD";var Io=Ht({coin:!0,none:!0}),Co=Ht({fixed:!0,follow:!0}),Fo=Ht({above:!0,below:!0,left:!0,right:!0});var ys=t=>t.kind==="git";function Yr(t){let n=(t.git?.branches??[]).map(x=>x.id),l=x=>{n.includes(x)||n.push(x)};for(let x of t.steps)for(let P of x.events)(P.type==="commit"||P.type==="branch")&&l(P.branch);let p=new Map(n.map(x=>[x,null])),a=null,e=null,s=[],r=new Map,o=[],i=[],c=[],m=new Map,f=new Map,d=new Map,u=[...n,vt],k=new Map(u.map(x=>[x,[]])),h=[],w=x=>x===vt?e===null?a:null:p.get(x)??null,g=x=>{let P=m.get(x)??[],b=P.indexOf(null);return b<0?P.length:b},N=(x,P,b,B)=>{let _=new Map(u.map(C=>[C,w(C)])),W=a;b();let ee=u.filter(C=>_.get(C)!==w(C)).map(C=>{let M=d.get(C);return M&&(m.get(M.commit)[M.row]=null,d.delete(C)),{ref:C,slot:M}});for(let{ref:C,slot:M}of ee){let R=M??(C===vt&&W!==null?{commit:W,row:g(W)}:void 0),D=w(C),V;if(D!==null){V={commit:D,row:g(D)};let Q=m.get(D)??[];Q[V.row]=C,m.set(D,Q),f.set(D,Math.max(f.get(D)??0,Q.filter(U=>U!==null).length)),d.set(C,V)}i.push({ref:C,step:x,event:P,...R?{from:R}:{},...V?{to:V}:{},line:C===B})}},L=(x,P)=>{let b=new Set,B=[...p.values(),a].filter(_=>_!==null);for(;B.length>0;){let _=B.pop();b.has(_)||(b.add(_),B.push(...r.get(_)?.parents??[]))}for(let _ of s)!b.has(_.id)&&_.orphan===void 0&&(_.orphan={step:x,event:P})};t.steps.forEach((x,P)=>{x.events.forEach((b,B)=>{if(b.type==="commit")T(b,P,B);else if(b.type==="branch"){if(!r.has(b.from))return;F(b.from)!==b.branch&&o.push({kind:"branch",from:b.from,to:b.branch,step:P,event:B}),N(P,B,()=>{p.set(b.branch,b.from),e=b.branch,a=b.from})}else if(b.type==="edge"){let _=b.from;if(_!==vt&&!p.has(_)||!r.has(b.to))return;N(P,B,()=>{if(_===vt){e=null,a=b.to;return}p.set(_,b.to),e===_?a=b.to:e===null&&a===b.to&&(e=_)},_)}else return;L(P,B)});for(let b of u)k.get(b)?.push(b===vt?a:p.get(b)??null);h.push(e);for(let b of u){let B=d.get(b);B&&c.push({ref:b,step:P,slot:B})}});function F(x){return r.get(x)?.branch}function T(x,P,b){if(r.has(x.id))return;let B=x.copy!==void 0&&r.has(x.copy)?x.copy:void 0,_=B!==void 0&&e===null&&a!==null?a:p.get(x.branch)??null,W=x.merge!==void 0&&x.merge!==x.branch?p.get(x.merge)??void 0:void 0,H=[...new Set([_,W].filter(M=>M!=null))],ee={id:x.id,branch:x.branch,parents:H,...W!==void 0&&W!==_?{joined:W}:{},...B!==void 0?{copy:B}:{},...x.hash!==void 0?{hash:x.hash}:{},...x.note!==void 0?{note:x.note}:{},step:P,event:b};s.push(ee),r.set(ee.id,ee);for(let M of H)o.push({kind:"parent",from:M,to:ee.id,step:P,event:b});B!==void 0&&o.push({kind:"copy",from:B,to:ee.id,step:P,event:b});let C=e===null&&a===null;N(P,b,()=>{B===void 0?(p.set(x.branch,ee.id),e===x.branch&&(a=ee.id)):e===null&&(a=ee.id),C&&(e=x.branch,a=ee.id)})}let j=u.map(x=>({name:x,at:k.get(x)??[],...x===vt?{attached:h}:{}}));return{branches:n,made:s,links:o,moves:i,refs:j,tags:c,rows:f}}function Kt(t,n,l,p){let a=v.git.samples;return Array.from({length:a},(e,s)=>{let r=(s+1)/a,o=1-r,i=c=>o*o*o*t[c]+3*o*o*r*n[c]+3*o*r*r*l[c]+r*r*r*p[c];return[i(0),i(1)]})}function Vr(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 us(t,n,l){let p=l>t.cy?1:-1,a=[t.cx,t.cy+p*t.r],e=Math.max(0,Math.min(v.git.turn,n-t.cx)),s=[t.cx+e,l],r=Kt(a,[a[0],a[1]+(l-a[1])*.7],[t.cx+e*.2,l],s);return[a,...r,...n>s[0]?[[n,l]]:[]]}function Wr(t,n){let l=n.cy<t.cy?1:-1,p=[t.cx+t.r,t.cy],a=[n.cx,n.cy+l*n.r],e=Math.max(0,Math.min(v.git.turn,n.cx-p[0])),s=[n.cx-e,t.cy],r=Kt(s,[n.cx-e*.2,t.cy],[n.cx,a[1]+(t.cy-a[1])*.7],a);return[p,...s[0]>p[0]?[s]:[],...r]}function Hr(t,n){if(Math.abs(t.cy-n.cy)<.5){let s=t.cy-t.r,r=v.git.turn*.7;return[[t.cx,s],...Kt([t.cx,s],[t.cx,s-r],[n.cx,s-r],[n.cx,s])]}let l=n.cy<t.cy?-1:1,p=[t.cx,t.cy+l*t.r],a=[n.cx,n.cy-l*n.r],e=(a[1]-p[1])*.5;return[p,...Kt(p,[p[0],p[1]+e],[a[0],a[1]-e],a)]}function bs(t){let{margin:n,gap:l,box:p,region:a,git:e,carrier:s}=v,r=Yr(t),o=new Map((t.git?.branches??[]).map(E=>[E.id,E.note])),i=new Map(r.branches.map((E,O)=>[E,O])),c=E=>e.colors[(i.get(E)??0)%e.colors.length],m=new Map,f=new Map;for(let E of r.made){let O=Math.max(0,...E.parents.map(X=>(m.get(X)??-1)+1),(f.get(E.branch)??-1)+1);m.set(E.id,O),f.set(E.branch,O)}let d=E=>[...E.hash!==void 0?[{text:E.hash,style:q.gitHash}]:[],...E.note!==void 0?[{text:E.note,style:q.gitNote}]:[]],u=E=>Math.max(0,...d(E).map(O=>pe(O.text,O.style))),k=E=>pe(E,Ie(E)?q.carrierJa:q.carrier)+s.tagPadX*2,h=Math.max(0,...r.refs.map(E=>k(E.name))),w=Math.max(e.pitch,...r.made.map(E=>u(E)+e.textGap),h+e.textGap),g=r.branches.map(E=>({w:Math.max(a.icon,pe(E,q.regionName),pe(o.get(E)??"",q.regionNote))})),N=n+a.inset+Math.max(0,...g.map(E=>E.w)),L=Math.max(e.r,...r.made.filter(E=>m.get(E.id)===0&&i.get(E.branch)===0).map(E=>u(E)/2),h/2),F=Math.max(e.x0,N+l+L),T=new Set(r.moves.flatMap(E=>{let O=t.steps[E.step]?.events[E.event];return E.line&&E.to&&O?.type==="edge"&&O.label!==void 0?[r.made.find(X=>X.id===E.to?.commit)?.branch??""]:[]})),j=E=>Math.max(0,...r.made.filter(O=>O.branch===E).map(O=>(r.rows.get(O.id)??0)-2))*e.row,x=r.made.some(E=>i.get(E.branch)===0&&d(E).length>0),P=[],b=n;r.branches.forEach((E,O)=>{let X=O===0,S=X&&x?e.tagTop:e.tag,K=b+(X?e.topLine-(e.tagTop-S):e.line)+j(E),y=K-b+(X?e.topBelow:T.has(E)?e.below:e.bare);P.push({id:E,x:n,y:b,w:0,h:y,line:K,color:c(E),tagBase:S}),b+=y+a.gap});let B=b-a.gap,_=new Map(P.map(E=>[E.id,E])),W=r.made.map(E=>{let O=_.get(E.branch),X=i.get(E.branch)===0,S=F+w*(m.get(E.id)??0)+(X?0:w/2),K=O.line,y=d(E),G=y.map((Z,J)=>X?K-e.above-(y.length-1-J)*e.lineStep:K+e.under+J*e.lineStep),A=y.map((Z,J)=>Ge(Z.text,S,G[J],Z.style,"middle")),z=A.length===0?void 0:{...Kr(A),lines:y.map(Z=>Z.text),baselines:G},ae=E.copy!==void 0?c(r.made.find(Z=>Z.id===E.copy)?.branch??E.branch):c(E.branch);return{id:E.id,branch:E.branch,color:ae,cx:S,cy:K,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}:{},...z?{text:z}:{},...E.orphan?{orphan:E.orphan.step,orphanEvent:E.orphan.event}:{}}}),H=new Map(W.map(E=>[E.id,E])),ee=r.links.flatMap(E=>{let O=H.get(E.from);if(!O)return[];if(E.kind==="branch"){if(!r.made.some(G=>G.branch===E.to))return[];let y=_.get(E.to);return[{...E,points:us(O,O.cx+e.turn,y.line),color:c(E.to)}]}let X=H.get(E.to),S=r.made.find(y=>y.id===E.to),K;return E.kind==="copy"?K=Hr(O,X):Math.abs(O.cy-X.cy)<.5?K=[[O.cx+O.r,O.cy],[X.cx-X.r,X.cy]]:S?.joined===E.from?K=Wr(O,X):K=us(O,X.cx-X.r,X.cy),[{...E,points:K,color:X.color}]}),C=(E,O)=>{let X=H.get(O.commit),S=_.get(X.branch)?.tagBase??e.tag,K=k(E);return{x:X.cx-K/2,y:X.cy-S-O.row*e.row-s.tagH/2,w:K,h:s.tagH}},M=E=>[E.x+E.w/2,E.y+E.h/2],R=r.moves.map(E=>{let O=E.from?C(E.ref,E.from):void 0,X=E.to?C(E.ref,E.to):void 0,S=t.steps[E.step]?.events[E.event],K=E.line&&S?.type==="edge"&&S.carry.kind!=="none"&&!(S.carry.kind==="tag"&&S.carry.text===S.from);return{ref:E.ref,step:E.step,event:E.event,...O?{from:O}:{},...X?{to:X}:{},...E.to?{target:E.to.commit}:{},...K?{carried:!0}:{},...E.line&&O&&X?{line:Vr(M(O),M(X))}:{},color:"slate"}}),D=r.tags.map(E=>({...C(E.ref,E.slot),ref:E.ref,step:E.step})),V=Ke(t),Q=Math.max(F,...W.flatMap(E=>[E.cx+E.r,...E.text?[E.text.x+E.text.w]:[]]),...D.map(E=>E.x+E.w),...R.flatMap(E=>[E.from,E.to].flatMap(O=>O?[O.x+O.w]:[]))),U=Q+e.boxGap,re=(P[1]??P[0])?.line??n+p.h/2,I=t.boxes.map((E,O)=>{let X=et(t,E.id,!0),S=re+O*(p.h+l);return{id:E.id,name:E.name,...E.sub!==void 0?{sub:E.sub}:{},...E.icon!==void 0?{icon:E.icon}:{},color:V.get(E.id)??"slate",x:U,y:S-p.h/2,w:X,h:p.h,cx:U+X/2,cy:S}}),oe=P.map((E,O)=>{let X=o.get(E.id);return{id:E.id,lines:[E.id],...X!==void 0?{note:X}:{},icon:"branch",color:E.color,x:E.x,y:E.y,w:0,h:E.h,header:{x:E.x+a.inset,y:E.y+a.inset,w:g[O]?.w??0,h:a.nameY-a.inset+(X!==void 0?a.line:0)+l/2}}}),le={kind:"git",width:0,height:0,regions:oe,boxes:I,lifelines:[],edges:[],labels:[],actions:[],badges:[],paths:[],ends:[],lanes:P,commits:W,links:ee,tags:D,refs:r.refs,moves:R};le.badges=gs(t,le),le.labels=Ur(t,le);let ye=Math.max(Q,...I.map(E=>E.x+E.w),...le.labels.map(E=>E.x+E.w))+a.pad,ue=Math.max(ye+n,ze(t)+n*2);for(let E of oe)E.w=ue-n*2;for(let E of P)E.w=ue-n*2;let ke=Math.max(B,...I.map(E=>E.y+E.h),...le.labels.map(E=>E.y+E.h)),Me=Ue(t,n,ke+l,ue-n*2);return le.width=ue,le.height=(Me?Me.y+Me.h:ke)+n,Me&&(le.strip=Me),le.badges=gs(t,le),le}function Kr(t){let n=Math.min(...t.map(p=>p.x)),l=Math.min(...t.map(p=>p.y));return{x:n,y:l,w:Math.max(...t.map(p=>p.x+p.w))-n,h:Math.max(...t.map(p=>p.y+p.h))-l}}function Xr(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 a=t.commits.find(e=>e.id===p.target);return p.step===n&&p.line&&a?[{event:p.event,target:a,color:a.color}]:[]})].sort((p,a)=>p.event-a.event)[0]}function hs(t,n,l){let{r:p,inset:a}=v.badge,e=t.r+a+p,s=p*2+a;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)&&l.every(i=>bt(Ye(o),i)>=v.label.touch))}function zr(t,n,l){let{r:p,inset:a,along:e,short:s}=v.badge,r=ft(t),o=r<s?Math.min(p+1,r/2):e,i=p*2+a;for(let c=o;c<=r;c+=1){let m=Qe(t,c),f=Ye(m);if(n.every(([d,u])=>Math.hypot(m[0]-d,m[1]-u)>=i)&&l.every(d=>bt(f,d)>=v.label.touch))return m}}function gs(t,n){let{inset:l}=v.badge,p=[],a=[...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=Xr(n,o),c=i?.target?hs(i.target,p,s):void 0;if(i&&(i.points||c)){let h=i.points,w=c??(h?zr(h,p,s)??nt(h,p,a.filter(g=>g!==h)):[0,0]);p.push(w),e.push({step:o,x:w[0],y:w[1],color:i.color});return}let m=r.events.flatMap(h=>h.type==="swap"||h.type==="action"?[h.box]:[]).map(h=>n.boxes.find(w=>w.id===h))[0];if(m){e.push({step:o,x:m.x,y:m.y,color:m.color});return}if(n.strip&&r.events.some(h=>h.type==="strip")){e.push({step:o,x:n.strip.x+l,y:n.strip.y+l,color:"slate"});return}let f=n.commits.find(h=>h.id===n.refs[0]?.at[o]),d=f?hs(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],k=n.lanes[0];e.push(u?{...u,step:o}:{step:o,x:(k?.x??0)+(k?.w??0)-l-v.badge.r,y:(k?.y??0)+l+v.badge.r,color:k?.color??"slate"})}),Xe(e)}function Ur(t,n){let l=v.git,p=[],a=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)?q.labelJa:q.label)+v.label.padX*2,[f]=r.line.reduce((g,N)=>[g[0]+N[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"),k=o.labelSide!==void 0?void 0:c?{x:f-m/2,y:i.cy-Math.max(d,(n.lanes[0]?.tagBase??l.tag)+v.carrier.tagH/2)-v.label.soft-v.label.h}:{x:f-m/2,y:i.cy+l.labelUnder},h=n.badges.filter(g=>g.step<=r.step).map(g=>Ye([g.x,g.y])),w=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,...k?{base:k}:{}},{hard:[...a,...n.boxes],soft:[...e,...w,...s,...p.filter(g=>g.step===r.step)],touch:h}))}return p}var Fn=t=>t.kind==="lineup";function Jr(t,n,l){let p=t.steps.flatMap(a=>a.events.flatMap(e=>e.type==="swap"&&e.box===n?[pe(e.text,q.boxSubStrong)]:[]));return l===void 0?p:[pe(l,q.boxSub),...p]}function xs(t){let{margin:n,gap:l,lineup:p}=v,a=t.lineup?.items??[],e=new Set(a.map(P=>P.id)),s=Math.max(p.chip.w,...a.map(P=>P.label===void 0?0:pe(P.label,q.chip)+p.chip.padX*2)),r=s+p.chip.gap,o=r*Cn-p.chip.gap,i=t.boxes.map(P=>pe(P.name,q.boxName)+p.textGap+Math.max(0,...Jr(t,P.id,P.sub))),c=Math.max(o+p.padX*2,...i.map(P=>P+p.padX*2),ze(t)),m=Ke(t),f=t.boxes.map((P,b)=>{let B=n+b*(p.h+l),_=B+p.textY,W=n+c-p.padX;return{id:P.id,name:P.name,...P.sub!==void 0?{sub:P.sub}:{},color:m.get(P.id)??"slate",x:n,y:B,w:c,h:p.h,cx:n+c/2,cy:B+p.h/2,title:{...Ge(P.name,n+p.padX,_,q.boxName),text:P.name,baseline:_},...P.sub!==void 0?{note:{...Ge(P.sub,W-pe(P.sub,q.boxSub),_,q.boxSub),text:P.sub,baseline:_}}:{},noteRight:W,track:{x:n+p.padX,y:B+p.trackY,w:o,h:p.chip.h}}}),d=new Map(f.map(P=>[P.id,P])),u=[],k=[],h=[],w=[],g=new Map,N=new Map,L;t.steps.forEach((P,b)=>{let B=[...g.values()].flat();P.events.forEach((_,W)=>{if(_.type!=="line"&&_.type!=="seal"&&_.type!=="open"&&_.type!=="pick"&&_.type!=="stamp")return;let H=d.get(_.box);if(!H)return;let ee={step:b,event:W};if(_.type==="seal"&&!N.has(H.id)){let{over:C}=p.seal,M={...ee,lane:H.id,x:H.track.x-C,y:H.track.y-C,w:H.track.w+C*2,h:H.track.h+C*2};k.push(M),N.set(H.id,M)}else if(_.type==="open"){let C=N.get(H.id);C&&(C.until=ee),N.delete(H.id)}else if(_.type==="pick"&&L!==H.id)w.push({...ee,lane:H.id}),L=H.id;else if(_.type==="stamp"){let C=pe(_.text,q.stamp)+p.stamp.padX*2;h.push({...ee,lane:H.id,text:_.text,x:H.x+H.w-p.padX-C,y:H.track.y+(H.track.h-p.stamp.h)/2,w:C,h:p.stamp.h})}else if(_.type==="line"){let C=g.get(H.id)??[],R=[...new Set(_.items)].filter(D=>e.has(D)).slice(0,Cn).map((D,V)=>{let Q=C.find(oe=>oe.id===D);if(Q?.index===V)return Q;let U=B.filter(oe=>oe.id===D),re=Q??U.find(oe=>oe.lane===L)??U.at(-1),I={...ee,id:D,lane:H.id,index:V,x:H.track.x+r*V,y:H.track.y,w:s,h:p.chip.h,...re?{from:[re.x,re.y]}:{}};return u.push(I),I});for(let D of C)R.includes(D)||(D.until=ee);g.set(H.id,R)}})});let F={kind:"lineup",width:0,height:0,regions:[],boxes:f,lifelines:[],edges:[],labels:[],actions:[],badges:[],paths:[],ends:[],lanes:f,chips:u,seals:k,stamps:h,picks:w},T=Math.max(...f.map(P=>P.y+P.h),n),j=c+n*2,x=Ue(t,n,T+l,j-n*2);return F.width=j,F.height=(x?x.y+x.h:T)+n,x&&(F.strip=x),F.badges=Zr(t,F),F}function Zr(t,n){let{inset:l}=v.badge,p=[],a=(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){a(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")?a(s,n.strip.x+l,n.strip.y+l,"slate"):o?p.push({...o,step:s}):a(s,v.margin,v.margin,n.lanes[0]?.color??"slate")}),Xe(p)}function ws(t){let{box:n,sequence:l,label:p,margin:a,gap:e}=v,s=Ke(t),r=t.sequence?.lifelines??[],o=[...r,...t.boxes.map(C=>C.id).filter(C=>!r.includes(C))],i=new Map(o.map((C,M)=>[C,M])),c=o.map(C=>et(t,C,!1)),m=c.slice(1).map((C,M)=>c[M]/2+C/2+l.columnGap),f=[];for(let C of t.steps)for(let M of C.events){if(M.type!=="edge"||M.label===void 0)continue;let R=i.get(M.from)??0,D=i.get(M.to)??0,V=pe(M.label,He(M.label))+p.padX*2;R===D?R<m.length&&f.push({from:R,to:R+1,need:l.selfW+p.side+V+l.labelRoom}):f.push({from:Math.min(R,D),to:Math.max(R,D),need:V+l.labelRoom*2})}f.sort((C,M)=>C.to-C.from-(M.to-M.from));for(let{from:C,to:M,need:R}of f){let D=0;for(let Q=C;Q<M;Q++)D+=m[Q]??0;if(D>=R)continue;let V=(R-D)/(M-C);for(let Q=C;Q<M;Q++)m[Q]=(m[Q]??0)+V}let d=[];o.forEach((C,M)=>d.push(M===0?a+c[0]/2:d[M-1]+m[M-1]));let u=o.map((C,M)=>{let R=t.boxes.find(Q=>Q.id===C),D=c[M],V=d[M];return{id:C,name:R?.name??C,...R?.sub!==void 0?{sub:R.sub}:{},...R?.icon!==void 0?{icon:R.icon}:{},color:s.get(C)??"slate",x:V-D/2,y:a,w:D,h:n.h,cx:V,cy:a+n.h/2}}),k=a+n.h,h=[],w=[],g=[],N=k+l.firstRow,L=0,F=!0;t.steps.forEach((C,M)=>{C.events.forEach((R,D)=>{if(R.type!=="edge"&&R.type!=="action")return;let V,Q;if(R.type==="edge"){let U=R.labelSide??"above",re=R.from===R.to,I=R.label!==void 0;V=I&&U==="above"?l.labelOffset+p.h/2:e,Q=re?l.selfH+e:I&&U==="below"?l.labelOffset+p.h/2:e}else V=v.action.h/2,Q=v.action.h/2;if(N=F?N+V:N+Math.max(l.minPitch,L+l.rowGap+V)+(D===0&&M>0?l.stepGap:0),F=!1,L=Q,R.type==="edge"){let U=d[i.get(R.from)??0],re=d[i.get(R.to)??0],I=Math.sign(re-U)||1,oe=U===re?[[U,N],[U+l.selfW,N],[U+l.selfW,N+l.selfH],[U+v.edge.inset,N+l.selfH]]:[[U,N],[re-I*v.edge.inset,N]],le=ot(R,s),ye={};if(R.carry.kind!=="none"){let ue=v.slot.lifeline+at(R.carry)[0],[ke,Me]=oe,[E,O]=oe.slice(-2),X=Math.sign(Me[0]-ke[0])||1,S=Math.sign(O[0]-E[0])||-1;ye.wait=[U-X*ue,ke[1]],ye.settle=[re+S*ue,O[1]]}h.push({step:M,event:D,from:R.from,to:R.to,points:oe,color:le,carry:R.carry,...ye}),R.label!==void 0&&g.push({step:M,event:D,text:R.label,points:oe,color:le,...R.labelSide?{side:R.labelSide}:U===re?{side:"right"}:{},offset:l.labelOffset})}else{let U=d[i.get(R.box)??0],re=pe(R.label,q.action)+v.action.padX*2;w.push({step:M,event:D,box:R.box,text:R.label,color:s.get(R.box)??"slate",x:U+v.badge.r+4,y:N-v.action.h/2,w:re,h:v.action.h})}})});let T=(F?k:N+L)+l.tail,j=o.map((C,M)=>({id:C,x:d[M],y1:k,y2:T})),x=ut(h,t.steps.length),P=[];for(let C of g){let M=[...x].filter(([D])=>D<=C.step).map(([,D])=>Ye(D.point)),R=[...P.filter(D=>D.step===C.step),...w];P.push(Ze(C,{hard:u,soft:R,touch:M}))}let b={kind:"sequence",width:0,height:0,regions:[],boxes:u,lifelines:j,edges:h,labels:P,actions:w,badges:[],paths:[],ends:[]},B=[...u.map(C=>C.x),...P.map(C=>C.x),...w.map(C=>C.x)],_=Math.max(0,a-Math.min(...B));_>0&&Tt(b,_,0);let W=[...u.map(C=>C.x+C.w),...P.map(C=>C.x+C.w),...w.map(C=>C.x+C.w),...h.flatMap(C=>C.points.map(M=>M[0]))],H=Math.max(Math.max(...W)+a,ze(t)+a*2),ee=Ue(t,a,T+e,H-a*2);return b.width=H,b.height=(ee?ee.y+ee.h:T)+a,ee&&(b.strip=ee),b.badges=Qr(t,b),b}function Qr(t,n){let l=ut(n.edges,t.steps.length),p=t.steps.map((a,e)=>{let s=l.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}:Nt(a.events,e,n)});return Xe(p)}var $s=t=>Et.includes(t);function ei(t){let n=[],l=p=>{!$s(p)&&!n.includes(p)&&n.push(p)};for(let{edge:p}of xt(t))l(p.from),l(p.to);return n}var ti=(t,n)=>t.from===n.from&&t.to===n.to;function ks(t,n){let{box:l,state:p,margin:a,gap:e}=v,s=v.edge.inset,r=tt[n],o=Ke(t),i=xt(t),c=ei(t),m=t.boxes.map($=>$.id).filter($=>!c.includes($)),f=(t.state?.paths??[]).filter($=>!i.some(({edge:Y})=>ti(Y,$))),d=[...i.map(({edge:$})=>$),...f],u=p.ghost,k=$=>{let Y=t.boxes.find(te=>te.id===$);return u.pad*2+l.icon+u.gap+Math.max(pe(Y?.name??$,q.boxName),pe(Y?.sub??"",q.boxSub))},h=wt(t),w=Math.max(l.padX,p.done.inset+p.done.r+v.slot.clear),g=new Map(t.boxes.map($=>[$.id,m.includes($.id)?k($.id):Math.max(et(t,$.id,!0),$t(h.get($.id),$.icon!==void 0,w))])),N=Math.max(1,Math.min(p.columns,c.length)),L=Math.max(1,Math.ceil(c.length/p.columns)),F=new Map(c.map(($,Y)=>{let te=Math.floor(Y/p.columns),be=Y%p.columns;return[$,{row:te,col:te%2===0?be:N-1-be}]})),T=Array.from({length:N},($,Y)=>Math.max(l.minW,...c.filter(te=>F.get(te)?.col===Y).map(te=>g.get(te)??l.minW))),j=Array.from({length:Math.max(0,N-1)},()=>p.columnGap);for(let $ of d){let Y=F.get($.from),te=F.get($.to);if(!Y||!te||$.label===void 0||Y.row!==te.row||Math.abs(Y.col-te.col)!==1)continue;let be=Math.min(Y.col,te.col);j[be]=Math.max(j[be]??0,pe($.label,He($.label))+v.label.padX*2+p.labelRoom*2)}let x=[];for(let $=0;$<N;$++)x.push($===0?a:x[$-1]+T[$-1]+j[$-1]);let P=$=>x[$]+T[$]/2,b=$=>m.includes($),B=new Set(f.filter($=>b($.to)&&!b($.from)&&!$s($.from)).map($=>$.from)),_=[r.sideNote,...B.size>0?[r.sideFrom(B.size)]:[]],W=Math.max(pe(r.side,q.regionName),..._.map($=>pe($,q.regionNote))),H=p.side.pad*2+Math.max(u.h,q.regionName.size+v.region.line*_.length+p.side.pad/4),ee=d.some($=>$.from==="start"),C=a+(m.length>0?H+p.side.gap:ee?p.start+p.drop:0),M=$=>C+$*(l.h+p.rowGap),R=($,Y,te,be)=>{let ge=t.boxes.find(Le=>Le.id===$),xe=g.get($)??l.minW,Je=be?u.h:l.h;return{id:$,name:ge?.name??$,...ge?.sub!==void 0?{sub:ge.sub}:{},...ge?.icon!==void 0?{icon:ge.icon}:{},color:o.get($)??"slate",x:Y-xe/2,y:te,w:xe,h:Je,cx:Y,cy:te+Je/2,...be?{ghost:!0}:{}}},D=c.map($=>{let Y=F.get($);return R($,P(Y.col),M(Y.row),!1)});for(let $ of D)kt($,h.get($.id),w);let V=new Map(D.map($=>[$.id,$])),Q=$=>D.some(Y=>Y!==$&&Math.abs(Y.cx-$.cx)<.5&&Y.y>$.y),U=[],re=D[0],I=Math.max(...D.map($=>$.x+$.w)),oe,le=a+H+p.side.lane;if(m.length>0){let $=Le=>f.filter(Be=>Be.to===Le).flatMap(Be=>V.get(Be.from)??[]),Y=m.flatMap($),te=Math.max(a,Math.min(...Y.length>0?Y.map(Le=>Le.x):[a+p.side.pad])-p.side.pad),be=te+p.side.pad+W+e*2,ge=m.map(Le=>{let Be=$(Le);return{id:Le,cx:Be.length>0?Be.reduce((gt,Pt)=>gt+Pt.cx,0)/Be.length:be}});ge.sort((Le,Be)=>Le.cx-Be.cx);let xe=te;for(let{id:Le,cx:Be}of ge){let gt=g.get(Le)??l.minW,Pt=Math.max(Be-gt/2,be),dt=R(Le,Pt+gt/2,a+(H-u.h)/2,!0);D.push(dt),V.set(Le,dt);let es=f.some(ts=>ts.from===Le&&ts.to==="finish");es&&U.push({kind:"finish",x:dt.x+dt.w+p.beside,y:dt.cy,r:p.end.r,ghost:!0,text:"",box:Le}),xe=es?dt.x+dt.w+p.beside+p.end.r:dt.x+dt.w,be=xe+e*2}let Je=Math.max(xe+p.side.pad,I);oe={x:te,y:a,w:Je-te,h:H,title:r.side,notes:_}}if(re&&ee){let $=re.cx+p.start+p.text+pe(r.start,q.regionNote)+e,Y=oe&&$<oe.x?oe.y+p.side.pad+p.start:re.y-p.drop;U.unshift({kind:"start",x:re.cx,y:Y,r:p.start,ghost:!1,text:r.start})}for(let $ of D.filter(Y=>!Y.ghost&&d.some(te=>te.from===Y.id&&te.to==="finish")))U.push(Q($)?{kind:"finish",x:$.x+$.w+p.beside,y:$.cy,r:p.end.r,ghost:!1,text:r.end,box:$.id}:{kind:"finish",x:$.cx,y:$.y+$.h+p.below,r:p.end.r,ghost:!1,text:r.end,box:$.id});let ye=($,Y)=>{let te=F.get($.id),be=F.get(Y.id);if(!te||!be)return[[$.cx,$.y+$.h],[Y.cx,Y.y-s]];if(te.row===be.row&&Math.abs(te.col-be.col)===1)return Y.cx>$.cx?[[$.x+$.w,$.cy],[Y.x-s,Y.cy]]:[[$.x,$.cy],[Y.x+Y.w+s,Y.cy]];if(te.row===be.row){let xe=$.y+$.h+p.rowGap/4;return[[$.cx,$.y+$.h],[$.cx,xe],[Y.cx,xe],[Y.cx,Y.y+Y.h+s]]}if(be.row>te.row){if(Math.abs($.cx-Y.cx)<.5)return[[$.cx,$.y+$.h],[Y.cx,Y.y-s]];let xe=$.y+$.h+p.rowGap/2;return[[$.cx,$.y+$.h],[$.cx,xe],[Y.cx,xe],[Y.cx,Y.y-s]]}if(Math.abs($.cx-Y.cx)<.5)return[[$.cx,$.y],[Y.cx,Y.y+Y.h+s]];let ge=Y.y+Y.h+p.rowGap/2;return[[$.cx,$.y],[$.cx,ge],[Y.cx,ge],[Y.cx,Y.y+Y.h+s]]},ue=($,Y)=>{let te=f.filter(ge=>ge.to===Y.id).flatMap(ge=>V.get(ge.from)??[]).sort((ge,xe)=>ge.cx-xe.cx),be=te.findIndex(ge=>ge.id===$);return te.length<=1?Math.min(Math.max(te[0]?.cx??Y.cx,Y.x+p.side.entry),Y.x+Y.w-p.side.entry):Y.x+p.side.entry+(Y.w-p.side.entry*2)*Math.max(0,be)/(te.length-1)},ke=$=>ee&&$===re?$.cx+p.side.entry:$.cx,Me=$=>U.find(Y=>Y.kind==="finish"&&Y.box===$),E=($,Y)=>{if($==="start"){let ge=U.find(Je=>Je.kind==="start"),xe=V.get(Y);return!ge||!xe?[]:[[ge.x,ge.y+ge.r],[xe.cx,xe.y-s]]}let te=V.get($);if(!te)return[];if(Y==="finish"){let ge=Me($);return ge?Math.abs(ge.x-te.cx)<.5?[[te.cx,te.y+te.h],[te.cx,ge.y-ge.r-s]]:[[te.x+te.w,te.cy],[ge.x-ge.r-s,te.cy]]:[]}let be=V.get(Y);if(!be)return[];if($===Y)return Ot(te);if(be.ghost&&!te.ghost){let ge=ke(te),xe=ue($,be);return Math.abs(ge-xe)<.5?[[ge,te.y],[xe,be.y+be.h+s]]:[[ge,te.y],[ge,le],[xe,le],[xe,be.y+be.h+s]]}return te.ghost&&be.ghost?[[te.x+te.w,te.cy],[be.x-s,be.cy]]:te.ghost?[[te.cx,te.y+te.h],[te.cx,le],[be.cx,le],[be.cx,be.y-s]]:ye(te,be)},O=$=>{let Y=$.to==="finish"?Me($.from):void 0;if(!Y)return;let te=V.get($.from);return te&&Math.abs(Y.x-te.cx)<.5?[Y.x-Y.r-e-at($.carry)[0],Y.y]:[Y.x,Y.y+Y.r+e+v.carrier.tagH/2]},X=$=>{let Y=$.from==="start"?U.find(te=>te.kind==="start"):void 0;return Y?[Y.x-Y.r-v.slot.mark-at($.carry)[0],Y.y]:void 0},S=i.map(({step:$,event:Y,edge:te})=>{let be=O(te),ge=te.carry.kind==="none"?void 0:X(te);return{step:$,event:Y,from:te.from,to:te.to,points:E(te.from,te.to),color:ni(te,o),carry:te.carry,...be?{settle:be}:{},...ge?{wait:ge}:{}}});mt(S,V,h);let K=new Map;for(let $ of S){if($.points.length!==2||!S.some(xe=>xe.from===$.to&&xe.to===$.from&&xe.points.length===2))continue;let[Y,te]=$.points,be=Math.abs(te[1]-Y[1])<Math.abs(te[0]-Y[0]),ge=($.from<$.to?1:-1)*v.edge.parallel;$.points=$.points.map(([xe,Je])=>be?[xe,Je+ge]:[xe+ge,Je]),K.set($,be?ge>0?"below":"above":ge>0?"right":"left")}let y=f.map($=>({from:$.from,to:$.to,points:E($.from,$.to)})),G=($,Y,te)=>$.from===$.to?Yt($.points):nt($.points,Y,te),A=[],z=U.flatMap($=>$.text===""?[]:[Ge($.text,...Wt($),q.regionNote)]),ae=[...ut(S,t.steps.length,G).values()].map($=>Ye($.point)),Z=[...oe?[{x:oe.x,y:oe.y,w:p.side.pad+W,h:oe.h}]:[],...z],J=$=>[...S.map(Y=>Y.points),...y.map(Y=>Y.points)].filter(Y=>Y!==$);for(let $ of S){let Y=t.steps[$.step]?.events[$.event];if(Y?.type!=="edge"||Y.label===void 0)continue;let te=$.from===$.to,be=Rt($),ge=A.filter(gt=>gt.text===Y.label&&S.some(Pt=>Pt.step===gt.step&&Pt.event===gt.event&&Rt(Pt)===be)),xe=ge[ge.length-1];if(xe){xe.until=$.step,A.push({x:xe.x,y:xe.y,w:xe.w,h:xe.h,step:$.step,event:$.event,text:xe.text,family:xe.family,color:$.color});continue}let Je=pe(Y.label,He(Y.label))+v.label.padX*2,Le=te?{side:"below",base:Vt($.points,Je)}:{},Be=Y.labelSide??($.to==="finish"?"left":K.get($));A.push(Ze({step:$.step,event:$.event,text:Y.label,points:$.points,color:$.color,...Be?{side:Be}:te?{}:{flip:!0},...Le},{hard:D,soft:[...Z,...A],touch:ae,lines:J($.points)}))}let se=[];f.forEach(($,Y)=>{let te=y[Y];if($.label===void 0||te.points.length===0)return;let be=He($.label),ge=V.get($.to)?.ghost===!0&&V.get($.from)?.ghost!==!0,xe=te.points[0][0],Je=ge?{side:"below",base:{x:xe+v.label.soft,y:le+v.label.soft},slide:Math.max(...te.points.map(([Be])=>Math.abs(Be-xe)))}:{},Le=Ze({step:-1,event:Y,text:$.label,points:te.points,color:"slate",...Je},{hard:D,soft:[...Z,...A,...se],touch:ae,lines:J(te.points)});se.push(Le),te.label={x:Le.x,y:Le.y,w:Le.w,h:Le.h,text:$.label,family:be.family}});let de={kind:"state",width:0,height:0,regions:[],boxes:D,lifelines:[],edges:S,labels:A,actions:[],badges:[],paths:y,ends:U,...oe?{side:oe}:{}},Pe=[...D.map($=>$.x),...A.map($=>$.x),...y.flatMap($=>$.label?[$.label.x]:[])],qe=[...A.map($=>$.y),...y.flatMap($=>$.label?[$.label.y]:[])],Re=Math.max(0,a-Math.min(...Pe)),Te=qe.length>0?Math.max(0,a-Math.min(...qe)):0;(Re>0||Te>0)&&Tt(de,Re,Te);let De=$=>$.x+($.text===""?$.r:p.text+pe($.text,q.regionNote)),Ve=[...D.map($=>$.x+$.w),...A.map($=>$.x+$.w),...U.map(De),...S.flatMap($=>$.points.map(Y=>Y[0])),...y.flatMap($=>[...$.points.map(Y=>Y[0]),...$.label?[$.label.x+$.label.w]:[]]),...oe?[oe.x+oe.w]:[]],We=[...D.map($=>$.y+$.h),...A.map($=>$.y+$.h),...U.map($=>$.y+$.r),...S.flatMap($=>$.points.map(Y=>Y[1]))],ht={title:r.trail,states:c.map($=>({box:$,color:o.get($)??"slate"}))},ct=Math.max(Math.max(...Ve)+a,ze(t,ht)+a*2),qt=Math.max(...We,M(L-1)+l.h),At=Ue(t,a,qt+e,ct-a*2,ht);de.width=ct,de.height=(At?At.y+At.h:qt)+a,At&&(de.strip=At);let gr=ut(S,t.steps.length,G);return de.badges=Xe(t.steps.map(($,Y)=>{let te=gr.get(Y);return te?{step:Y,x:te.point[0],y:te.point[1],color:te.edge.color}:Nt($.events,Y,de)})),de}function ni(t,n){return t.carry.kind==="coin"?ot(t,n):n.get(t.to==="finish"?t.from:t.to)??"slate"}var _n=t=>t.kind==="time",Xt={d:86400,h:3600,min:60,s:1,ms:.001},si=Object.keys(Xt);function ri(t){let n=/^([0-9]+(?:\.[0-9]+)?)(ms|s|min|h|d)$/u.exec(t);if(!n)return{seconds:1,unit:"s"};let l=n[2];return{seconds:Number(n[1])*Xt[l],unit:l}}var vs=(t,n)=>si.find(l=>t/Xt[l]>=2-1e-9)??n,Ps=(t,n,l)=>`${Number((t/Xt[n]).toFixed(2))} ${tt[l].timeUnits[n]}`;function ii(t,n,l){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<=v.time.ticks);if(r!==void 0){p=r;break}}let a=[];for(let s=0;s<=t;s+=p)a.push(s);let e=a[a.length-1];return e!==t&&(t-e)*l>=v.time.minorPx&&a.push(t),{at:a,step:p}}function oi(t,n,l,p){let a=Array.from({length:n-1},(s,r)=>r+1).find(s=>n%s===0&&s*l>=v.time.minorPx);if(a===void 0)return[];let e=[];for(let s=a;s<t;s+=a)p.includes(s)||e.push(s);return e}function Ss(t){let n=0;return t.steps.map(l=>{let p=n;for(let a of l.events)a.type==="now"&&(n=Math.max(n,a.to+1));return[p,n]})}function Os(t,n="ja"){let l=v.time,{margin:p,gap:a}=v,e=v.region,s=tt[n],r=t.time??{scale:{unit:"",length:"1s",count:1},rows:[]},{scale:o}=r,i=Math.max(1,o.count),c=ri(o.length),m=Math.max(l.width,ze(t)+p*2),f=Math.max(0,...r.rows.map(S=>pe(S.name,q.timeRow))),d=Math.max(l.axisX,p+e.inset+f+l.gutterGap),u=m-l.right-d,k=u/i,h=Ke(t),w=wt(t),g=[],N=[],L=[],F=[],T=new Map(r.rows.map(S=>[S.id,S])),j,x=p;if(r.zoom){let{from:S,to:K}=r.zoom,y=K-S+1,G=u/y,A=p,z=vs(K*c.seconds,c.unit),ae=[];for(let se=0;se<y;se++){let de=S+se,Pe=d+se*G,qe=t.boxes.map((Te,De)=>{let Ve=w.get(Te.id),We=Math.max(et(t,Te.id,!1),$t(Ve,Te.icon!==void 0,v.box.padX)),ht=A+l.boxTop+De*(v.box.h+l.boxGap),ct=T.get(Te.id),qt={id:Te.id,name:Te.name,...Te.sub!==void 0?{sub:Te.sub}:{},...Te.icon!==void 0?{icon:Te.icon}:{},color:h.get(Te.id)??"slate",x:Pe+G/2-We/2,y:ht,w:We,h:v.box.h,cx:Pe+G/2,cy:ht+v.box.h/2,...ct?{row:ct.id}:{},...ct?.empty?.includes(de)?{empty:!0}:{}};return kt(qt,Ve),qt});N.push(...qe);let Re=`${o.unit} ${(o.from??0)+de}${s.headJoin}${Ps(de*c.seconds,z,n)}`;ae.push({unit:de,head:Re,boxes:qe,x:Pe,y:A,w:G,h:0})}let J=Math.max(A+l.boxTop,...N.map(se=>se.y+se.h))+l.zoomBottom;for(let se of ae)se.h=J-A;g.push({id:"zoom",lines:[s.zoom],note:`${y} ${o.unit}`,icon:"clock",color:"blue",x:p,y:A,w:m-p*2,h:J-A,header:{x:p+e.inset,y:A+e.inset,w:Math.max(e.icon,pe(s.zoom,q.regionName)),h:e.nameY-e.inset+e.line}}),j={from:S,to:K,frame:{x:0,y:0,w:0,h:0},guides:[],columns:ae,empty:s.empty,headY:A+l.head},x=J+l.zoomGap}let P=x+l.rowsTop,b=r.rows.map((S,K)=>({id:S.id,name:S.name,color:S.color??h.get(S.id)??yt[K%yt.length],x:d,y:P+K*(l.row+l.rowGap),w:u,h:l.row})),B=b.length>0?Math.max(...b.map(S=>S.y+S.h)):P,_=Math.min(l.markMax,Math.max(l.markMin,k*l.markRatio)),W=b.flatMap((S,K)=>Array.from({length:i},(y,G)=>({row:S.id,unit:G,empty:r.rows[K]?.empty?.includes(G)===!0,color:S.color,colors:[],x:d+(G+.5)*k-_/2,y:S.y,w:_,h:S.h})));if(t.steps.forEach((S,K)=>S.events.forEach((y,G)=>{if(y.type==="mark")for(let A of W)A.row===y.row&&A.unit>=y.from&&A.unit<=y.to&&!A.empty&&A.colors.push({step:K,event:G,color:y.color})})),j){let S={x:d+j.from*k-l.frame,y:P-l.frame,w:(j.to-j.from+1)*k+l.frame*2,h:B-P+l.frame*2},K=Math.max(...j.columns.map(y=>y.y+y.h));j.frame=S,j.guides=[[[S.x,S.y],[d,K]],[[S.x+S.w,S.y],[d+u,K]]]}let H=B+l.point.drop,ee=(r.points??[]).map(S=>{let K=[];t.steps.forEach((Z,J)=>Z.events.forEach((se,de)=>{se.type==="swap"&&se.box===S.id&&K.push({step:J,event:de,text:se.text,...se.color?{color:se.color}:{}})}));let y=d+(S.at+.5)*k,G=y+l.point.text,A=Math.max(pe(S.id,q.pointName),...K.map(Z=>pe(Z.text,q.pointState))),z=H+l.point.nameY-q.pointName.size*.8,ae=H+l.point.stateY+q.pointState.size*.2;return{id:S.id,unit:S.at,cx:y,cy:H,r:l.point.r,text:{x:G,y:z,w:A,h:ae-z},changes:K}}),C=new Map(ee.map(S=>[S.id,S])),M=(S,K)=>C.get(S)?.changes.filter(G=>G.step<=K&&G.color).at(-1)?.color;t.steps.forEach((S,K)=>S.events.forEach((y,G)=>{if(y.type!=="edge")return;if(y.at===void 0){let ae=C.get(y.from),Z=C.get(y.to);if(!ae||!Z||ae===Z)return;let J=Z.cx>ae.cx,se=J?Math.max(ae.cx+ae.r,ae.text.x+ae.text.w+l.point.link):ae.cx-ae.r-l.point.end,de=J?Z.cx-Z.r-l.point.end:Math.min(Z.cx-Z.r,Z.text.x+Z.text.w+l.point.link),Pe={step:K,event:G,from:y.from,to:y.to,points:[[se,ae.cy],[de,Z.cy]],color:y.carry.kind==="coin"?"coin":M(y.to,K)??"slate",carry:y.carry};y.carry.kind!=="none"&&(Pe.settle=[de-(J?1:-1)*(v.carrier.coinR+v.edge.arrow),Z.cy]),L.push(Pe);return}let A=ai(y,j);if(!A)return;let z={step:K,event:G,from:y.from,to:y.to,points:A.points,color:ot(y,h),carry:y.carry};li(z,A.from,A.to,w),L.push(z),F.push({step:K,event:G,from:A.from,to:A.to,column:y.at,into:y.into??y.at})}));let R={kind:"time",width:m,height:0,regions:g,boxes:N,lifelines:[],edges:L,labels:[],actions:[],badges:[],paths:[],ends:[],axis:{x:d,w:u,unit:k,count:i,line:0},rows:b,marks:W,ticks:[],minor:[],periods:[],points:ee,...j?{zoom:j}:{},spans:[],wires:F,needle:{y1:P-l.needle.over,y2:B+l.needle.over}},D=B,V=t.steps.some(S=>S.events.some(K=>K.type==="edge"&&K.at===void 0&&K.label!==void 0)),{r:Q,inset:U}=v.badge,re=ee.length>0?H+l.point.r+(V?l.point.room:l.point.plain):D+(Q+U)*2,I=[],oe=t.steps.flatMap((S,K)=>S.events.flatMap((y,G)=>y.type==="span"?[{s:K,e:G,event:y}]:[]));for(let{s:S,e:K,event:y}of oe){let G=y.shape==="box"?"box":"bracket",A=oe.find(se=>se.s>S&&(se.event.shape==="box"?"box":"bracket")===G&&se.event.from<=y.to&&y.from<=se.event.to),z=y.color??"slate",ae=d+y.from*k,Z=d+(y.to+1)*k,J={step:S,event:K,kind:G,from:y.from,to:y.to,text:y.text,color:z,...A?{until:A.s}:{}};if(G==="box"){let se=l.box,de={x:ae-se.pad,y:P-se.pad,w:Z-ae+se.pad*2,h:B-P+se.pad*2},Pe=pe(y.text,q.tag)+se.tagPadX*2,qe={x:de.x+se.tagX,y:de.y-se.tagH/2,w:Pe,h:se.tagH};I.push({...J,...de,textRect:qe,textY:de.y+v.baseline.tag})}else I.push({...J,x:ae,y:0,w:Z-ae,h:l.bracket.tick,textRect:{x:0,y:0,w:0,h:0},textY:0})}R.spans=I,R.badges=Ms(t,R,Ss(t)),R.labels=ci(t,R),re=Math.max(re,...R.labels.map(S=>S.y+S.h+v.label.soft));let le=[];for(let S of I.filter(K=>K.kind==="bracket")){let K=pe(S.text,q.spanText),y=Math.min(d+u-K/2,Math.max(d+K/2,S.x+S.w/2)),G={x:Math.min(S.x,y-K/2),w:Math.max(S.x+S.w,y+K/2)-Math.min(S.x,y-K/2)},A=ae=>{let Z=ae.until===void 0||ae.until>S.step,J=Math.min(ae.x,ae.textRect.x),se=Math.max(ae.x+ae.w,ae.textRect.x+ae.textRect.w)-J;return Z&&G.x<J+se&&J<G.x+G.w},z=le.findIndex(ae=>!ae.some(A));z<0&&(le.push([]),z=le.length-1),le[z].push(S),S.y=re+l.bracket.gap+z*l.bracket.lane,S.textY=S.y+l.bracket.tick+l.bracket.text,S.textRect=Ge(S.text,y,S.textY,q.spanText,"middle")}le.length>0&&(re=Math.max(...I.filter(S=>S.kind==="bracket").map(S=>S.textRect.y+S.textRect.h)));let ye=re+l.axisGap;R.axis.line=ye;let ue=ii(i,r.period?.length,k),ke=ye+l.tickY,Me=vs(i*c.seconds,c.unit);R.ticks=ue.at.map(S=>{let K=Ps(S*c.seconds,Me,n),y=pe(K,q.timeTick),G=d+S*k,A=S===0?G:S===i?G-y:Math.min(d+u-y,Math.max(d,G-y/2));return{at:S,x:G,text:K,left:A,y:ke}}),R.minor=oi(i,ue.step,k,ue.at);let E=ke+q.timeTick.size*.2;if(r.period){let S=r.period,K=[];for(let A=0,z=0;z<i;A++,z+=S.length){let ae=Math.min(i,z+S.length)-1,Z=`${S.name} ${(S.from??0)+A}`,J=(o.from??0)+z,se=`${o.unit} ${s.range(String(J),String((o.from??0)+ae))}`;K.push({index:A,from:z,to:ae,name:Z,range:se,x:d+z*k,y:ye,w:(ae-z+1)*k,h:0,nameY:ke,rangeY:ke+l.rangeY})}let y=R.ticks.map(A=>Ge(A.text,A.left,A.y,q.timeTick)),G=K.some(A=>{let z=Ge(A.name,A.x+A.w/2,A.nameY,q.timePeriod,"middle");return y.some(ae=>z.x<ae.x+ae.w+l.nameGap&&ae.x<z.x+z.w+l.nameGap)});for(let A of K)G&&(A.nameY=ke+l.rangeY+2,A.rangeY=A.nameY+l.rangeY),A.h=A.rangeY+q.timeRange.size*.2-ye;R.periods=K,E=Math.max(E,...K.map(A=>A.rangeY+q.timeRange.size*.2))}let O=E+l.bottom;g.push({id:"axis",lines:[],color:"slate",x:p,y:x,w:m-p*2,h:O-x,header:{x:p+e.inset,y:x+e.inset,w:0,h:0}});let X=Ue(t,p,O+a,m-p*2);return X&&(R.strip=X),R.height=(X?X.y+X.h:O)+p,R.badges=Ms(t,R,Ss(t)),R}function ai(t,n){if(!n||t.at===void 0)return;let l=t.into??t.at,p=n.columns.find(d=>d.unit===t.at),a=n.columns.find(d=>d.unit===l),e=p?.boxes.find(d=>d.id===t.from),s=a?.boxes.find(d=>d.id===t.to);if(!p||!a||!e||!s||e===s)return;let r=p.boxes.indexOf(e),o=a.boxes.indexOf(s),i=o>r;if(p===a){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-v.gap,Math.max(e.x+e.w,s.x+s.w)+v.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=a.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 li(t,n,l,p){let a={...t};mt([a],new Map([[t.to,l]]),p);let e={...t};mt([e],new Map([[t.from,n]]),p),a.settle&&(t.settle=a.settle),e.wait&&(t.wait=e.wait)}function Ms(t,n,l){let{r:p,inset:a}=v.badge,{axis:e}=n,s=[],r=[],o=Math.min(...n.rows.map(m=>m.y),n.needle.y1+v.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+a;return t.steps.forEach((m,f)=>{let d=(g,N)=>{s.push(g),r.push({step:f,x:g[0],y:g[1],color:N})},u=n.edges.filter(g=>g.step===f).sort((g,N)=>g.event-N.event)[0];if(u){let g=u.carry.kind!=="none"&&!u.wait?[u.points[0]]:[],N=n.edges.filter(L=>L!==u).map(L=>L.points);d(nt(u.points,[...s,...g],N),u.color);return}let[k,h]=l[f]??[0,0];if(h>k){let g=e.x+(k+h)/2*e.unit,N=n.points.find(L=>Math.abs(L.cx-g)<p+a);N&&(g=N.cx+p+a*2),d([g,c],"slate");return}for(let g of m.events){let N=pi(g,f,n);if(N){d(N.at,N.color);return}}if(n.strip&&m.events.some(g=>g.type==="strip")){r.push({step:f,x:n.strip.x+a,y:n.strip.y+a,color:"slate"});return}let w=r[r.length-1];r.push(w?{...w,step:f}:{step:f,x:e.x-p-a,y:o,color:"slate"})}),Xe(r)}function pi(t,n,l){let{r:p,inset:a}=v.badge;if(t.type==="span"){let e=l.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-a,e.y+e.h/2],color:e.color}:void 0}if(t.type==="swap"){let e=l.points.find(s=>s.id===t.box);if(e)return{at:[e.cx-e.r-a-p,e.cy],color:t.color??"slate"}}if(t.type==="mark"){let e=l.rows.find(r=>r.id===t.row),s=Math.min(...l.rows.map(r=>r.y));if(e)return{at:[l.axis.x+(t.from+t.to+1)/2*l.axis.unit,s-p-a],color:t.color}}}function ci(t,n){let l=[],p=n.points.map(s=>({x:s.cx-s.r,y:s.cy-s.r,w:s.r*2,h:s.r*2})),a=n.points.map(s=>s.text),e=(n.zoom?.columns??[]).map(s=>Ge(s.head,s.x+s.w/2,n.zoom?.headY??0,q.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);l.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:[...a,...e,...l.filter(c=>c.step===s.step)],touch:o}))}return l}var zt=t=>t.kind==="tree";function di(t){let n=new Set(t.boxes.map(e=>e.id)),l=new Set,p=new Map,a=[];return t.steps.forEach((e,s)=>{e.events.forEach((r,o)=>{if(r.type!=="leaf"&&r.type!=="node"||l.has(r.id)||n.has(r.id))return;let i=r.type==="node"?[...new Set(r.children)].filter(c=>l.has(c)&&!p.has(c)):[];for(let c of i)p.set(c,r.id);a.push({id:r.id,kind:r.type,children:i,step:s,event:o,...r.hash!==void 0?{hash:r.hash}:{}}),l.add(r.id)})}),{grown:a,parents:p}}function mi(t,n){return t.hash===void 0?[{text:t.id,style:q.boxName}]:n?[{text:t.id,style:q.rootName},{text:t.hash,style:q.rootHash}]:t.kind==="leaf"?[{text:t.hash,style:q.treeHash}]:[{text:t.hash,style:q.treeHash},{text:t.id,style:q.treeName}]}function fi(t,n){let l=v.edge.inset,p=Math.max(t.y,n.y),a=Math.min(t.y+t.h,n.y+n.h);if(a>p){let i=(p+a)/2;return n.x>=t.x+t.w?[[t.x+t.w+l,i],[n.x-l,i]]:[[t.x-l,i],[n.x+n.w+l,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+l],[i,n.y-l]]:[[i,t.y-l],[i,n.y+n.h+l]]}let r=t.x+t.w/2,o=n.y+n.h/2;return[[r,n.y>t.y?t.y+t.h+l:t.y-l],[r,o],[n.x>r?n.x-l:n.x+n.w+l,o]]}function Ns(t){let{margin:n,gap:l,box:p,tree:a,badge:e}=v,{grown:s,parents:r}=di(t),o=s.filter(O=>!r.has(O.id)),i=o[o.length-1]?.id,c=new Map(s.map(O=>[O.id,O])),m=new Map,f=(O,X)=>{m.set(O,X);for(let S of c.get(O)?.children??[])f(S,X+1)};for(let O of o)f(O.id,0);let d=new Map(s.map(O=>[O.id,mi(O,O.id===i)])),u=O=>Math.max(0,...(d.get(O)??[]).map(X=>pe(X.text,X.style))),k=O=>O.id===i?Math.max(a.root.w,a.root.textX+u(O.id)+a.root.padR):Math.max(a.w,u(O.id)+a.padX*2),h=O=>Math.max(a.card.minW,a.card.padX*2+a.card.icon+a.card.gap+pe(O.id,q.treeCard)),w=O=>O.kind==="leaf"&&O.hash!==void 0,g=s.filter(O=>O.children.length===0),N=Math.max(...s.filter(O=>O.id!==i||O.children.length===0).map(O=>Math.max(k(O),w(O)?h(O):0)),a.w)+a.slotGap,L=n+e.r*2+e.inset,F=new Map;g.forEach((O,X)=>F.set(O.id,L+N*(X+.5)));let T=O=>{let X=F.get(O);if(X!==void 0)return X;let S=c.get(O)?.children??[],K=(T(S[0])+T(S[S.length-1]))/2;return F.set(O,K),K},j=n+a.top,x=O=>j+a.root.h/2+O*a.row,P=Ke(t),b=s.map(O=>{let X=O.id===i,S=m.get(O.id)??0,K=T(O.id),y=x(S),G=k(O),A=X?a.root.h:a.h,z=d.get(O.id)??[],ae=z.length===1?[y+a.oneY]:X?[y+a.root.nameY,y+a.root.hashY]:[y+a.hashY,y+a.nameY],Z=r.get(O.id),J=X?a.rootColor:a.color;P.set(O.id,J);let se=h(O);return{id:O.id,kind:O.kind,depth:S,...Z!==void 0?{parent:Z}:{},children:O.children,step:O.step,event:O.event,...O.hash!==void 0?{hash:O.hash}:{},root:X,x:K-G/2,y:y-A/2,w:G,h:A,cx:K,cy:y,color:J,lines:z.map(de=>de.text),baselines:ae,styles:z.map(de=>de.style),...w(O)?{card:{x:K-se/2,y:y+a.card.drop-a.card.h/2,w:se,h:a.card.h,text:O.id}}:{}}}),B=new Map(b.map(O=>[O.id,O])),_=b.flatMap(O=>O.children.flatMap(X=>{let S=B.get(X);if(!S)return[];let K=(S.y+O.y+O.h)/2,y=[[S.cx,S.y-v.edge.inset],[S.cx,K],[O.cx,K],[O.cx,O.y+O.h+v.edge.inset]];return[{from:S.id,to:O.id,step:O.step,event:O.event,points:y}]})),W=wt(t),H=Math.max(L,...b.flatMap(O=>[O.x+O.w,...O.card?[O.card.x+O.card.w]:[]])),ee=b.find(O=>O.root),C=new Set(t.boxes.map(O=>O.id)),M=xt(t).flatMap(({edge:O})=>O.label!==void 0&&(C.has(O.from)||C.has(O.to))?[pe(O.label,He(O.label))+v.label.padX*2]:[]),R=Math.max(H+a.boxGap,(ee?ee.x+ee.w:L)+Math.max(0,...M)+l*2),D=ee?.y??j,V=t.boxes.map(O=>{let X=Math.max(et(t,O.id,!0),$t(W.get(O.id),O.icon!==void 0,p.padX)),S=D;D+=p.h+l;let K={id:O.id,name:O.name,...O.sub!==void 0?{sub:O.sub}:{},...O.icon!==void 0?{icon:O.icon}:{},color:P.get(O.id)??"slate",x:R,y:S,w:X,h:p.h,cx:R+X/2,cy:S+p.h/2};return kt(K,W.get(O.id)),K}),Q=new Map(V.map(O=>[O.id,O])),U=[],re=t.steps.flatMap((O,X)=>O.events.flatMap((S,K)=>{if(S.type!=="edge")return[];let y=B.get(S.from)??Q.get(S.from),G=B.get(S.to)??Q.get(S.to);if(!y||!G)return[];let A=_.find(J=>J.from===S.from&&J.to===S.to),z=_.find(J=>J.from===S.to&&J.to===S.from),ae=A??z;ae&&U.push({step:X,event:K,link:ae.from});let Z=A?A.points:z?[...z.points].reverse():S.from===S.to?Ot({cx:y.x+y.w/2,y:y.y,h:y.h}):fi(y,G);return[{step:X,event:K,from:S.from,to:S.to,points:Z,color:ot(S,P),carry:S.carry}]}));mt(re,Q,W);let I={kind:"tree",width:0,height:0,regions:[],boxes:V,lifelines:[],edges:re,labels:[],actions:[],badges:[],paths:[],ends:[],nodes:b,links:_,runs:U};I.badges=Ts(t,I),I.labels=gi(t,I);let oe=b.flatMap(O=>O.card?[O.card]:[]),le=[...b,...oe,...V,...I.labels],ye=re.flatMap(O=>O.points),ue=Math.max(...le.map(O=>O.x+O.w),...ye.map(([O])=>O),L),ke=Math.max(...le.map(O=>O.y+O.h),...ye.map(([,O])=>O),j),Me=Math.max(ue+n,ze(t)+n*2),E=Ue(t,n,ke+l,Me-n*2);return I.width=Me,I.height=(E?E.y+E.h:ke)+n,E&&(I.strip=E),I.badges=Ts(t,I),I}function Ts(t,n){let{r:l,inset:p}=v.badge,a=l*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)>=a)&&r.every(f=>bt(Ye(m),f)>=v.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(L=>L.type==="leaf"||L.type==="node"||L.type==="edge"),u=m.events[d],k=n.nodes.find(L=>L.step===f&&L.event===d);if(u&&u.type!=="edge"&&k){let L=[[k.x-p-l,k.cy],[k.x,k.y],[k.x+k.w+p+l,k.cy],[k.x+k.w,k.y]];i(f,L.find(o)??L[0],k.color);return}let h=n.edges.find(L=>L.step===f&&L.event===d);if(u?.type==="edge"&&h){let L=[h.from,h.to].sort().join(`
2
- `),F=n.runs.some(x=>x.step===f&&x.event===d),T=n.edges.filter(x=>x!==h).map(x=>x.points),j=c.get(L)??(F?ui(h.points,o):hi(h,o))??nt(h.points,e,T);c.set(L,j),i(f,j,h.color);return}let w=m.events.flatMap(L=>L.type==="swap"||L.type==="action"?[L.box]:[]).flatMap(L=>n.boxes.filter(F=>F.id===L))[0];if(w){s.push({step:f,x:w.x,y:w.y,color:w.color});return}if(n.strip&&m.events.some(L=>L.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],N=n.nodes.find(L=>L.root);s.push(g?{...g,step:f}:{step:f,x:N?.x??v.margin,y:N?.y??v.margin,color:N?.color??"slate"})}),Xe(s)}function ui(t,n){let[l,p,a]=t,e=Math.abs(a[0]-p[0]),{r:s,inset:r}=v.badge;if(e>=v.tree.badgeAlong+s){let i=Qe(t,ft([l,p])+v.tree.badgeAlong);if(n(i))return i}let o=[p[0]+s+r,p[1]];return n(o)?o:void 0}function hi(t,n){let l=ft(t.points),p=at(t.carry)[0]+v.badge.r+v.badge.inset;for(let a=0;a<=l/2-p;a+=1)for(let e of[l/2-a,l/2+a]){let s=Qe(t.points,e);if(n(s))return s}}function gi(t,n){let l=[],p=n.nodes.flatMap(a=>a.card?[a.card]:[]);for(let a of n.edges){let e=t.steps[a.step]?.events[a.event];if(e?.type!=="edge"||e.label===void 0)continue;let s=n.badges.filter(r=>r.step<=a.step).map(r=>Ye([r.x,r.y]));l.push(Ze({step:a.step,event:a.event,text:e.label,points:a.points,color:a.color,...e.labelSide?{side:e.labelSide}:{},flip:!0},{hard:[...n.nodes,...n.boxes],soft:[...p,...l.filter(r=>r.step===a.step)],touch:s}))}return l}var yi={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"},bi={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"},Ut=(t,n)=>`${t} ${n}${t===1?"":"s"}`,xi={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=>yi[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`},wi={additionalProperties:t=>`The ${t} field is not allowed`,required:t=>`The ${t} field is required`,enum:t=>`Use one of ${t.join(" / ")}`,type:t=>bi[t]??`Use ${t}`,minLength:t=>`Write at least ${Ut(t,"character")}`,maxLength:t=>`Write at most ${Ut(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 ${Ut(t,"item")}`,maxItems:t=>`Write at most ${Ut(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`},Jt={ja:xi,en:wi};function $i(t){let n=0;for(let l of t)n++;return n}var Yn=qs,Bn={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"]},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/text"}}},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/text"},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 lt(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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 k=u.length;for(let h=0;h<k;h++){let w=u[h],g=s,N=s;if(w&&typeof w=="object"&&!Array.isArray(w)){let x;if(w.type===void 0&&(x="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(w.type!==void 0){let P=w.type;if(!(P==="now"||P==="mark"||P==="span")){let b={};e===null?e=[b]:e.push(b),s++}}}var r=N===s;if(r){let x={instancePath:n+"/"+f+"/events/"+h,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=g,e!==null&&(g?e.length=g:e=null);let L=s,F=s;if(w&&typeof w=="object"&&!Array.isArray(w)){let x;if(w.type===void 0&&(x="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(w.type!==void 0){let P=w.type;if(!(P==="leaf"||P==="node")){let b={};e===null?e=[b]:e.push(b),s++}}}var o=F===s;if(o){let x={instancePath:n+"/"+f+"/events/"+h,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=L,e!==null&&(L?e.length=L:e=null);let T=s,j=s;if(w&&typeof w=="object"&&!Array.isArray(w)){let x;if(w.type===void 0&&(x="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(w.type!==void 0){let P=w.type;if(!(P==="line"||P==="seal"||P==="open"||P==="pick"||P==="stamp")){let b={};e===null?e=[b]:e.push(b),s++}}}var i=j===s;if(i){let x={instancePath:n+"/"+f+"/events/"+h,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=T,e!==null&&(T?e.length=T:e=null);if(w&&typeof w=="object"&&!Array.isArray(w)){if(w.type!==void 0){let x=w.type,P=s,b=s;if(!(x==="commit"||x==="branch")){let B={};e===null?e=[B]:e.push(B),s++}var c=b===s;if(c){let B={instancePath:n+"/"+f+"/events/"+h+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[B]:e.push(B),s++}else s=P,e!==null&&(P?e.length=P:e=null)}if(w.at!==void 0){let x={instancePath:n+"/"+f+"/events/"+h+"/at",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}if(w.into!==void 0){let x={instancePath:n+"/"+f+"/events/"+h+"/into",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}if(w.color!==void 0){let x={instancePath:n+"/"+f+"/events/"+h+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}}}}}}}return lt.errors=e,s===0}function je(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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 Zt(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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 k=0;k<u;k++){let h=d[k],w=s,g=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let j;if(h.type===void 0&&(j="type")){let x={};e===null?e=[x]:e.push(x),s++}else if(h.type!==void 0){let x=h.type;if(!(x==="now"||x==="mark"||x==="span")){let P={};e===null?e=[P]:e.push(P),s++}}}var r=g===s;if(r){let j={instancePath:n+"/"+m+"/events/"+k,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}else s=w,e!==null&&(w?e.length=w:e=null);let N=s,L=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let j;if(h.type===void 0&&(j="type")){let x={};e===null?e=[x]:e.push(x),s++}else if(h.type!==void 0){let x=h.type;if(!(x==="leaf"||x==="node")){let P={};e===null?e=[P]:e.push(P),s++}}}var o=L===s;if(o){let j={instancePath:n+"/"+m+"/events/"+k,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=N,e!==null&&(N?e.length=N:e=null);let F=s,T=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let j;if(h.type===void 0&&(j="type")){let x={};e===null?e=[x]:e.push(x),s++}else if(h.type!==void 0){let x=h.type;if(!(x==="line"||x==="seal"||x==="open"||x==="pick"||x==="stamp")){let P={};e===null?e=[P]:e.push(P),s++}}}var i=T===s;if(i){let j={instancePath:n+"/"+m+"/events/"+k,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}else s=F,e!==null&&(F?e.length=F:e=null);if(h&&typeof h=="object"&&!Array.isArray(h)){if(h.at!==void 0){let j={instancePath:n+"/"+m+"/events/"+k+"/at",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}if(h.into!==void 0){let j={instancePath:n+"/"+m+"/events/"+k+"/into",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}if(h.color!==void 0){let j={instancePath:n+"/"+m+"/events/"+k+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}}}}}}}return Zt.errors=e,s===0}function Qt(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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 k=0;k<u;k++){let h=d[k],w=s,g=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let F;if(h.type===void 0&&(F="type")){let T={};e===null?e=[T]:e.push(T),s++}else if(h.type!==void 0){let T=h.type;if(!(T==="leaf"||T==="node")){let j={};e===null?e=[j]:e.push(j),s++}}}var r=g===s;if(r){let F={instancePath:n+"/"+m+"/events/"+k,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}else s=w,e!==null&&(w?e.length=w:e=null);let N=s,L=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let F;if(h.type===void 0&&(F="type")){let T={};e===null?e=[T]:e.push(T),s++}else if(h.type!==void 0){let T=h.type;if(!(T==="line"||T==="seal"||T==="open"||T==="pick"||T==="stamp")){let j={};e===null?e=[j]:e.push(j),s++}}}var o=L===s;if(o){let F={instancePath:n+"/"+m+"/events/"+k,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}else s=N,e!==null&&(N?e.length=N:e=null);if(h&&typeof h=="object"&&!Array.isArray(h)&&h.type!==void 0){let F=h.type,T=s,j=s;if(!(F==="commit"||F==="branch")){let x={};e===null?e=[x]:e.push(x),s++}var i=j===s;if(i){let x={instancePath:n+"/"+m+"/events/"+k+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=T,e!==null&&(T?e.length=T:e=null)}}}}}}return Qt.errors=e,s===0}function en(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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 k=0;k<u;k++){let h=d[k],w=s,g=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let F;if(h.type===void 0&&(F="type")){let T={};e===null?e=[T]:e.push(T),s++}else if(h.type!==void 0){let T=h.type;if(!(T==="now"||T==="mark"||T==="span")){let j={};e===null?e=[j]:e.push(j),s++}}}var r=g===s;if(r){let F={instancePath:n+"/"+m+"/events/"+k,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}else s=w,e!==null&&(w?e.length=w:e=null);let N=s,L=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let F;if(h.type===void 0&&(F="type")){let T={};e===null?e=[T]:e.push(T),s++}else if(h.type!==void 0){let T=h.type;if(!(T==="line"||T==="seal"||T==="open"||T==="pick"||T==="stamp")){let j={};e===null?e=[j]:e.push(j),s++}}}var o=L===s;if(o){let F={instancePath:n+"/"+m+"/events/"+k,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}else s=N,e!==null&&(N?e.length=N:e=null);if(h&&typeof h=="object"&&!Array.isArray(h)){if(h.type!==void 0){let F=h.type,T=s,j=s;if(!(F==="commit"||F==="branch")){let x={};e===null?e=[x]:e.push(x),s++}var i=j===s;if(i){let x={instancePath:n+"/"+m+"/events/"+k+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=T,e!==null&&(T?e.length=T:e=null)}if(h.at!==void 0){let F={instancePath:n+"/"+m+"/events/"+k+"/at",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}if(h.into!==void 0){let F={instancePath:n+"/"+m+"/events/"+k+"/into",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}if(h.color!==void 0){let F={instancePath:n+"/"+m+"/events/"+k+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}}}}}}}return en.errors=e,s===0}function tn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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 k=u.length;for(let h=0;h<k;h++){let w=u[h],g=s,N=s;if(w&&typeof w=="object"&&!Array.isArray(w)){let x;if(w.type===void 0&&(x="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(w.type!==void 0){let P=w.type;if(!(P==="now"||P==="mark"||P==="span")){let b={};e===null?e=[b]:e.push(b),s++}}}var r=N===s;if(r){let x={instancePath:n+"/"+f+"/events/"+h,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=g,e!==null&&(g?e.length=g:e=null);let L=s,F=s;if(w&&typeof w=="object"&&!Array.isArray(w)){let x;if(w.type===void 0&&(x="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(w.type!==void 0){let P=w.type;if(!(P==="leaf"||P==="node")){let b={};e===null?e=[b]:e.push(b),s++}}}var o=F===s;if(o){let x={instancePath:n+"/"+f+"/events/"+h,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=L,e!==null&&(L?e.length=L:e=null);let T=s,j=s;if(w&&typeof w=="object"&&!Array.isArray(w)){let x;if(w.type===void 0&&(x="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(w.type!==void 0){let P=w.type;if(!(P==="edge"||P==="action")){let b={};e===null?e=[b]:e.push(b),s++}}}var i=j===s;if(i){let x={instancePath:n+"/"+f+"/events/"+h,schemaPath:"#/definitions/notWiredEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=T,e!==null&&(T?e.length=T:e=null);if(w&&typeof w=="object"&&!Array.isArray(w)){if(w.type!==void 0){let x=w.type,P=s,b=s;if(!(x==="commit"||x==="branch")){let B={};e===null?e=[B]:e.push(B),s++}var c=b===s;if(c){let B={instancePath:n+"/"+f+"/events/"+h+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[B]:e.push(B),s++}else s=P,e!==null&&(P?e.length=P:e=null)}if(w.color!==void 0){let x={instancePath:n+"/"+f+"/events/"+h+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}}}}}}}return tn.errors=e,s===0}var St={enum:["blue","amber","green","violet","rose","slate","coin"]},Ne=new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$","u"),Oe=$i;function nn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(!Ne.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(Oe(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(Oe(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:St.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(typeof r=="string"){if(Oe(r)<1){let o={instancePath:n+"/icon",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+"/icon",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 nn.errors=e,s===0}var Ls=new RegExp("^(/|https?://)","u");function sn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(!Ne.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(Oe(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(Oe(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:St.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(typeof r=="string"){if(Oe(r)<1){let o={instancePath:n+"/icon",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+"/icon",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.region!==void 0){let r=t.region;if(typeof r=="string"){if(!Ne.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(!Ls.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 sn.errors=e,s===0}var ki=new RegExp("^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$","u");function rn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(Oe(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(!ki.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 rn.errors=e,s===0}function on(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(Oe(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(Oe(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++)rn(r[i],{instancePath:n+"/meters/"+i,parentData:r,parentDataProperty:i,rootData:a})||(e=e===null?rn.errors:e.concat(rn.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 on.errors=e,s===0}function an(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(Oe(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(!Ls.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 an.errors=e,s===0}var Es={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 Gn=new RegExp("^[0-9a-f]{4,40}$","u"),vi={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 ln(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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 k={instancePath:n,schemaPath:"#/then/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};e===null?e=[k]:e.push(k),s++}var c=d===s;o=c,m="then"}else{let d=s,u=s,k=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let w;if(t.text===void 0&&(w="text")){let g={};e===null?e=[g]:e.push(g),s++}}var f=k===s;if(f){let w={instancePath:n,schemaPath:"#/else/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[w]:e.push(w),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:vi.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(Oe(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 ln.errors=e,s===0}function pn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(!Ne.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(!Ne.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(Oe(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&&(ln(t.carry,{instancePath:n+"/carry",parentData:t,parentDataProperty:"carry",rootData:a})||(e=e===null?ln.errors:e.concat(ln.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:Es.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(!Ne.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(Oe(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(!Ne.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(Oe(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:St.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(!Ne.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(!Ne.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(!Ne.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(!Ne.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(!Gn.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(Oe(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(!Ne.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(!Ne.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(!Ne.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:St.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(Oe(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:Es.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:St.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(!Ne.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(!Gn.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(!Ne.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(!Ne.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(!Gn.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(!Ne.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(!Ne.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(!Ne.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(!Ne.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(!Ne.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(!Ne.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(Oe(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(Oe(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(Oe(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(Oe(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 pn.errors=e,s===0}function cn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(Oe(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(Oe(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(Oe(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++)an(r[i],{instancePath:n+"/sources/"+i,parentData:r,parentDataProperty:i,rootData:a})||(e=e===null?an.errors:e.concat(an.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++)pn(r[i],{instancePath:n+"/events/"+i,parentData:r,parentDataProperty:i,rootData:a})||(e=e===null?pn.errors:e.concat(pn.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 cn.errors=e,s===0}function dn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(!Ne.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 dn.errors=e,s===0}function mn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(!Ne.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(!Ne.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(Oe(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 mn.errors=e,s===0}function fn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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++)mn(r[i],{instancePath:n+"/paths/"+i,parentData:r,parentDataProperty:i,rootData:a})||(e=e===null?mn.errors:e.concat(mn.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 fn.errors=e,s===0}function un(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(!Ne.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(Oe(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 un.errors=e,s===0}function hn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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++)un(r[i],{instancePath:n+"/branches/"+i,parentData:r,parentDataProperty:i,rootData:a})||(e=e===null?un.errors:e.concat(un.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 hn.errors=e,s===0}var Pi=new RegExp("^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$","u");function gn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(Oe(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(!Pi.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 gn.errors=e,s===0}function yn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(Oe(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 yn.errors=e,s===0}function bn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(!Ne.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(Oe(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:St.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 bn.errors=e,s===0}function xn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(!Ne.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 xn.errors=e,s===0}function wn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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 wn.errors=e,s===0}function $n(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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&&(gn(t.scale,{instancePath:n+"/scale",parentData:t,parentDataProperty:"scale",rootData:a})||(e=e===null?gn.errors:e.concat(gn.errors),s=e.length)),t.period!==void 0&&(yn(t.period,{instancePath:n+"/period",parentData:t,parentDataProperty:"period",rootData:a})||(e=e===null?yn.errors:e.concat(yn.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++)bn(r[i],{instancePath:n+"/rows/"+i,parentData:r,parentDataProperty:i,rootData:a})||(e=e===null?bn.errors:e.concat(bn.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++)xn(r[i],{instancePath:n+"/points/"+i,parentData:r,parentDataProperty:i,rootData:a})||(e=e===null?xn.errors:e.concat(xn.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&&(wn(t.zoom,{instancePath:n+"/zoom",parentData:t,parentDataProperty:"zoom",rootData:a})||(e=e===null?wn.errors:e.concat(wn.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 $n.errors=e,s===0}function kn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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(!Ne.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:St.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(Oe(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(Oe(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 kn.errors=e,s===0}function vn(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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++)kn(r[i],{instancePath:n+"/items/"+i,parentData:r,parentDataProperty:i,rootData:a})||(e=e===null?kn.errors:e.concat(kn.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 vn.errors=e,s===0}var Si=Object.prototype.hasOwnProperty;function qs(t,{instancePath:n="",parentData:l,parentDataProperty:p,rootData:a=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 N={};e===null?e=[N]:e.push(N),s++}else if(t.kind!==void 0&&t.kind!=="sequence"){let N={};e===null?e=[N]:e.push(N),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 L={instancePath:n,schemaPath:"#/then/required",keyword:"required",params:{missingProperty:"sequence"},message:"must have required property 'sequence'"};e===null?e=[L]:e.push(L),s++}if(t.boxes!==void 0){let L=t.boxes;if(Array.isArray(L)&&L.length<1){let F={instancePath:n+"/boxes",schemaPath:"#/then/properties/boxes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[F]:e.push(F),s++}}if(t.steps!==void 0&&(lt(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:a})||(e=e===null?lt.errors:e.concat(lt.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:a})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let L={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[L]:e.push(L),s++}if(t.git!==void 0){let L={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[L]:e.push(L),s++}if(t.time!==void 0){let L={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[L]:e.push(L),s++}if(t.lineup!==void 0){let L={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[L]:e.push(L),s++}}var c=g===s;o=c,m="then"}else{let g=s,N=s,L=!0,F=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let x;if(t.kind===void 0&&(x="kind")){let P={};e===null?e=[P]:e.push(P),s++}else if(t.kind!==void 0&&t.kind!=="state"){let P={};e===null?e=[P]:e.push(P),s++}}var f=F===s;s=N,e!==null&&(N?e.length=N:e=null);let T;if(f){let x=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.boxes!==void 0){let b=t.boxes;if(Array.isArray(b)){if(b.length<1){let _={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=[_]:e.push(_),s++}let B=b.length;for(let _=0;_<B;_++){let W=b[_];if(W&&typeof W=="object"&&!Array.isArray(W)&&W.id!==void 0){let H=W.id,ee=s,C=s;if(!(H==="start"||H==="finish")){let M={};e===null?e=[M]:e.push(M),s++}var d=C===s;if(d){let M={instancePath:n+"/boxes/"+_+"/id",schemaPath:"#/else/then/properties/boxes/items/properties/id/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[M]:e.push(M),s++}else s=ee,e!==null&&(ee?e.length=ee:e=null)}}}}if(t.steps!==void 0&&(lt(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:a})||(e=e===null?lt.errors:e.concat(lt.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:a})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.git!==void 0){let b={instancePath:n+"/git",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 f=x===s;L=f,T="then"}else{let x=s,P=s,b=!0,B=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let H;if(t.kind===void 0&&(H="kind")){let ee={};e===null?e=[ee]:e.push(ee),s++}else if(t.kind!==void 0&&t.kind!=="git"){let ee={};e===null?e=[ee]:e.push(ee),s++}}var u=B===s;s=P,e!==null&&(P?e.length=P:e=null);let _;if(u){let H=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.git===void 0){let C={instancePath:n,schemaPath:"#/else/else/then/required",keyword:"required",params:{missingProperty:"git"},message:"must have required property 'git'"};e===null?e=[C]:e.push(C),s++}if(t.steps!==void 0&&(Zt(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:a})||(e=e===null?Zt.errors:e.concat(Zt.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:a})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let C={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[C]:e.push(C),s++}if(t.regions!==void 0){let C={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[C]:e.push(C),s++}if(t.time!==void 0){let C={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[C]:e.push(C),s++}if(t.lineup!==void 0){let C={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[C]:e.push(C),s++}}var u=H===s;b=u,_="then"}else{let H=s,ee=s,C=!0,M=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let V;if(t.kind===void 0&&(V="kind")){let Q={};e===null?e=[Q]:e.push(Q),s++}else if(t.kind!==void 0&&t.kind!=="time"){let Q={};e===null?e=[Q]:e.push(Q),s++}}var k=M===s;s=ee,e!==null&&(ee?e.length=ee:e=null);let R;if(k){let V=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.time===void 0){let U={instancePath:n,schemaPath:"#/else/else/else/then/required",keyword:"required",params:{missingProperty:"time"},message:"must have required property 'time'"};e===null?e=[U]:e.push(U),s++}if(t.steps!==void 0&&(Qt(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:a})||(e=e===null?Qt.errors:e.concat(Qt.errors),s=e.length)),t.state!==void 0){let U={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[U]:e.push(U),s++}if(t.git!==void 0){let U={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[U]:e.push(U),s++}if(t.regions!==void 0){let U={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[U]:e.push(U),s++}if(t.lineup!==void 0){let U={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[U]:e.push(U),s++}}var k=V===s;C=k,R="then"}else{let V=s,Q=s,U=!0,re=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let le;if(t.kind===void 0&&(le="kind")){let ye={};e===null?e=[ye]:e.push(ye),s++}else if(t.kind!==void 0&&t.kind!=="tree"){let ye={};e===null?e=[ye]:e.push(ye),s++}}var h=re===s;s=Q,e!==null&&(Q?e.length=Q:e=null);let I;if(h){let le=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.steps!==void 0&&(en(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:a})||(e=e===null?en.errors:e.concat(en.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:a})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let ue={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ue]:e.push(ue),s++}if(t.git!==void 0){let ue={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ue]:e.push(ue),s++}if(t.time!==void 0){let ue={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ue]:e.push(ue),s++}if(t.regions!==void 0){let ue={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ue]:e.push(ue),s++}if(t.lineup!==void 0){let ue={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ue]:e.push(ue),s++}}var h=le===s;U=h,I="then"}else{let le=s,ye=s,ue=!0,ke=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let O;if(t.kind===void 0&&(O="kind")){let X={};e===null?e=[X]:e.push(X),s++}else if(t.kind!==void 0&&t.kind!=="lineup"){let X={};e===null?e=[X]:e.push(X),s++}}var w=ke===s;s=ye,e!==null&&(ye?e.length=ye:e=null);let Me;if(w){let O=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.lineup===void 0){let S={instancePath:n,schemaPath:"#/else/else/else/else/else/then/required",keyword:"required",params:{missingProperty:"lineup"},message:"must have required property 'lineup'"};e===null?e=[S]:e.push(S),s++}if(t.boxes!==void 0){let S=t.boxes;if(Array.isArray(S)){if(S.length<1){let y={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=[y]:e.push(y),s++}let K=S.length;for(let y=0;y<K;y++){let G=S[y];if(G&&typeof G=="object"&&!Array.isArray(G)){if(G.icon!==void 0){let A={instancePath:n+"/boxes/"+y+"/icon",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[A]:e.push(A),s++}if(G.link!==void 0){let A={instancePath:n+"/boxes/"+y+"/link",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[A]:e.push(A),s++}if(G.region!==void 0){let A={instancePath:n+"/boxes/"+y+"/region",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[A]:e.push(A),s++}}}}}if(t.steps!==void 0&&(tn(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:a})||(e=e===null?tn.errors:e.concat(tn.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:a})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let S={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}if(t.git!==void 0){let S={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}if(t.time!==void 0){let S={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}if(t.regions!==void 0){let S={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}}var w=O===s;ue=w,Me="then"}else{let O=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.boxes!==void 0){let S=t.boxes;if(Array.isArray(S)&&S.length<1){let K={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=[K]:e.push(K),s++}}if(t.steps!==void 0&&(lt(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:a})||(e=e===null?lt.errors:e.concat(lt.errors),s=e.length)),t.strip!==void 0&&(je(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:a})||(e=e===null?je.errors:e.concat(je.errors),s=e.length)),t.state!==void 0){let S={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}if(t.git!==void 0){let S={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}if(t.time!==void 0){let S={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}if(t.lineup!==void 0){let S={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}}var w=O===s;ue=w,Me="else"}if(!ue){let O={instancePath:n,schemaPath:"#/else/else/else/else/else/if",keyword:"if",params:{failingKeyword:Me},message:'must match "'+Me+'" schema'};e===null?e=[O]:e.push(O),s++}var h=le===s;U=h,I="else"}if(!U){let le={instancePath:n,schemaPath:"#/else/else/else/else/if",keyword:"if",params:{failingKeyword:I},message:'must match "'+I+'" schema'};e===null?e=[le]:e.push(le),s++}var k=V===s;C=k,R="else"}if(!C){let V={instancePath:n,schemaPath:"#/else/else/else/if",keyword:"if",params:{failingKeyword:R},message:'must match "'+R+'" schema'};e===null?e=[V]:e.push(V),s++}var u=H===s;b=u,_="else"}if(!b){let H={instancePath:n,schemaPath:"#/else/else/if",keyword:"if",params:{failingKeyword:_},message:'must match "'+_+'" schema'};e===null?e=[H]:e.push(H),s++}var f=x===s;L=f,T="else"}if(!L){let x={instancePath:n,schemaPath:"#/else/if",keyword:"if",params:{failingKeyword:T},message:'must match "'+T+'" schema'};e===null?e=[x]:e.push(x),s++}if(t&&typeof t=="object"&&!Array.isArray(t)&&t.sequence!==void 0){let x={instancePath:n+"/sequence",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),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(!Si.call(Bn.properties,g)){let N={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:g},message:"must NOT have additional properties"};e===null?e=[N]:e.push(N),s++}if(t.version!==void 0){let g=t.version;if(!(typeof g=="number"&&!(g%1)&&!isNaN(g)&&isFinite(g))){let N={instancePath:n+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[N]:e.push(N),s++}if(typeof g=="number"&&isFinite(g)&&(g<1||isNaN(g))){let N={instancePath:n+"/version",schemaPath:"#/properties/version/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};e===null?e=[N]:e.push(N),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 N={instancePath:n+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues:Bn.properties.kind.enum},message:"must be equal to one of the allowed values"};e===null?e=[N]:e.push(N),s++}}if(t.title!==void 0){let g=t.title;if(typeof g=="string"){if(Oe(g)<1){let N={instancePath:n+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[N]:e.push(N),s++}}else{let N={instancePath:n+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[N]:e.push(N),s++}}if(t.view!==void 0){let g=t.view;if(!(g==="fixed"||g==="follow")){let N={instancePath:n+"/view",schemaPath:"#/properties/view/enum",keyword:"enum",params:{allowedValues:Bn.properties.view.enum},message:"must be equal to one of the allowed values"};e===null?e=[N]:e.push(N),s++}}if(t.regions!==void 0){let g=t.regions;if(Array.isArray(g)){let N=g.length;for(let L=0;L<N;L++)nn(g[L],{instancePath:n+"/regions/"+L,parentData:g,parentDataProperty:L,rootData:a})||(e=e===null?nn.errors:e.concat(nn.errors),s=e.length)}else{let N={instancePath:n+"/regions",schemaPath:"#/properties/regions/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[N]:e.push(N),s++}}if(t.boxes!==void 0){let g=t.boxes;if(Array.isArray(g)){let N=g.length;for(let L=0;L<N;L++)sn(g[L],{instancePath:n+"/boxes/"+L,parentData:g,parentDataProperty:L,rootData:a})||(e=e===null?sn.errors:e.concat(sn.errors),s=e.length)}else{let N={instancePath:n+"/boxes",schemaPath:"#/properties/boxes/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[N]:e.push(N),s++}}if(t.strip!==void 0&&(on(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:a})||(e=e===null?on.errors:e.concat(on.errors),s=e.length)),t.steps!==void 0){let g=t.steps;if(Array.isArray(g)){if(g.length<1){let L={instancePath:n+"/steps",schemaPath:"#/properties/steps/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[L]:e.push(L),s++}let N=g.length;for(let L=0;L<N;L++)cn(g[L],{instancePath:n+"/steps/"+L,parentData:g,parentDataProperty:L,rootData:a})||(e=e===null?cn.errors:e.concat(cn.errors),s=e.length)}else{let N={instancePath:n+"/steps",schemaPath:"#/properties/steps/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[N]:e.push(N),s++}}t.sequence!==void 0&&(dn(t.sequence,{instancePath:n+"/sequence",parentData:t,parentDataProperty:"sequence",rootData:a})||(e=e===null?dn.errors:e.concat(dn.errors),s=e.length)),t.state!==void 0&&(fn(t.state,{instancePath:n+"/state",parentData:t,parentDataProperty:"state",rootData:a})||(e=e===null?fn.errors:e.concat(fn.errors),s=e.length)),t.git!==void 0&&(hn(t.git,{instancePath:n+"/git",parentData:t,parentDataProperty:"git",rootData:a})||(e=e===null?hn.errors:e.concat(hn.errors),s=e.length)),t.time!==void 0&&($n(t.time,{instancePath:n+"/time",parentData:t,parentDataProperty:"time",rootData:a})||(e=e===null?$n.errors:e.concat($n.errors),s=e.length)),t.lineup!==void 0&&(vn(t.lineup,{instancePath:n+"/lineup",parentData:t,parentDataProperty:"lineup",rootData:a})||(e=e===null?vn.errors:e.concat(vn.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 qs.errors=e,s===0}var Mi=["edge","action","swap","strip","commit","branch","now","mark","span","leaf","node","line","seal","open","pick","stamp"],Oi="#/definitions/absent/not",Ti={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"},Ni={carry:{field:"text",kind:"tag"}},Ei=/\/boxes\/items\/properties\/id\/not$/u,Li=/\/events\/items\/properties\/type\/not$/u,qi=["commit","branch"],Ai=/\/events\/items\/not$/u,ji=["now","mark","span"],Ri=/\/events\/items\/allOf\/0\/not$/u,Di=["leaf","node"],Ii="#/definitions/notLineupEvent/not",Ci=["line","seal","open","pick","stamp"],Fi="#/definitions/notWiredEvent/not",_i=["edge","action"],Bi=/^\^\[0-9\]\+\(\\\.\[0-9\]\+\)\?\(([a-z|]+)\)\$$/u,Gi=/%\)\$$/u,Vn=t=>t.replaceAll("~","~0").replaceAll("/","~1"),Yi="#/definitions/url/pattern",Vi=/^\^\[0-9a-f\]\{(\d+),(\d+)\}\$$/u;function Wi(t){let n=/^\^\[\^(.+)\]\+\$$/u.exec(t)?.[1];if(n===void 0)return;let l=n.match(/\\.|[^\\]/gu)??[];return{space:l.includes("\\s"),chars:l.filter(p=>p!=="\\s").map(p=>p.replace(/^\\/u,""))}}var As=(t,n)=>n.filter(l=>l!==t&&l.schemaPath.startsWith(`${t.schemaPath}/`)&&(l.instancePath===t.instancePath||l.instancePath.startsWith(`${t.instancePath}/`)));function Hi(t,n,l){let p=t.params,a=t.instancePath;switch(t.keyword){case"additionalProperties":{let e=String(p.additionalProperty);return{pointer:`${a}/${Vn(e)}`,message:l.additionalProperties(e)}}case"required":{let e=String(p.missingProperty);return{pointer:`${a}/${Vn(e)}`,message:l.required(e)}}case"not":{if(Ei.test(t.schemaPath))return{pointer:a,message:l.reserved(Et)};if(Li.test(t.schemaPath))return{pointer:a,message:l.kindOnly(qi,"git")};if(Ai.test(t.schemaPath))return{pointer:`${a}/type`,message:l.kindOnly(ji,"time")};if(Ri.test(t.schemaPath))return{pointer:`${a}/type`,message:l.kindOnly(Di,"tree")};if(t.schemaPath===Ii)return{pointer:`${a}/type`,message:l.kindOnly(Ci,"lineup")};if(t.schemaPath===Fi)return{pointer:`${a}/type`,message:l.kindOnly(_i,"sequence / architecture / state / git / time / tree")};let e=a.slice(a.lastIndexOf("/")+1);if(t.schemaPath===Oi)return{pointer:a,message:l.not({field:e,kind:Ti[e]??e})};let s=Ni[e];return{pointer:s?`${a}/${s.field}`:a,message:l.not(s)}}case"anyOf":{let e=As(t,n),s=e.every(r=>r.keyword==="required")?e.map(r=>String(r.params.missingProperty)):[];return{pointer:a,message:l.anyOf(s)}}case"discriminator":{let e=String(p.tag);return{pointer:`${a}/${Vn(e)}`,message:l.discriminator(e,Mi)}}case"enum":return{pointer:a,message:l.enum(p.allowedValues.map(String))};case"type":return{pointer:a,message:l.type(String(p.type))};case"minLength":return{pointer:a,message:l.minLength(Number(p.limit))};case"maxLength":return{pointer:a,message:l.maxLength(Number(p.limit))};case"pattern":{if(t.schemaPath===Yi)return{pointer:a,message:l.url};let e=String(p.pattern),s=Vi.exec(e);if(s)return{pointer:a,message:l.hex(Number(s[1]),Number(s[2]))};let r=Bi.exec(e);return r?{pointer:a,message:l.duration((r[1]??"").split("|"))}:Gi.test(e)?{pointer:a,message:l.ratio}:{pointer:a,message:l.pattern(Wi(e))}}case"minItems":return{pointer:a,message:l.minItems(Number(p.limit))};case"maxItems":return{pointer:a,message:l.maxItems(Number(p.limit))};case"minimum":return{pointer:a,message:l.minimum(Number(p.limit))};case"const":return{pointer:a,message:l.const(String(p.allowedValue))};case"oneOf":return{pointer:a,message:l.oneOf};default:return{pointer:a,message:t.message??t.keyword}}}function js(t,n={}){if(Yn(t))return{ok:!0};let l=Yn.errors??[],p=new Set(l.filter(s=>s.keyword==="anyOf").flatMap(s=>As(s,l))),a=Jt[n.lang??"ja"];return{ok:!1,errors:l.filter(s=>s.keyword!=="if"&&!p.has(s)).map(s=>Hi(s,l,a))}}var Rs=1;function Ki(t){if(typeof t!="object"||t===null)return;let n=t.version;return typeof n=="number"&&n>Rs?n:void 0}var Xi=(t,n)=>({pointer:"/version",message:Jt[n].newer(t,Rs)});function Ds(t,n={}){let l=Ki(t);if(l!==void 0)return{ok:!1,errors:[Xi(l,n.lang??"ja")]};let p=js(t,n);return p.ok?{ok:!0,diagram:t,warnings:[]}:p}var zi={line:ie.lineup.slide,seal:ie.lineup.seal,open:ie.fade,pick:ie.fade,stamp:ie.popFade};function Is(t,n){let l={edges:[],events:[],busy:0},p=ie.edgeAt,a,e=0,s=Number.NEGATIVE_INFINITY,r=(f,d,u)=>{let k=d.carry.kind!=="none",h=u+(k?ie.drawCarry:ie.draw);return l.edges.push({event:f,a:u,b:h,carries:k,coin:d.carry.kind==="coin",named:d.label!==void 0}),l.busy=Math.max(l.busy,h),h},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+ie.change),k=[[u,i]],h=[];for(let w=i;w<c;w++){let g=u,N=t.events.flatMap((T,j)=>m(T)&&T.at===w?[{k:j,ev:T}]:[]),L=N.reduce((T,j,x)=>Math.max(T,r(j.k,j.ev,g+ie.stagger*x)),g),F=Math.max(g+n.speed,N.length>0?L+ie.time.wait:g);F-n.speed>g+1e-9&&k.push([F-n.speed,w]),k.push([F,w+1]),h.push({unit:w,at:F}),u=F}l.sweep={keys:k,passed:h},l.busy=Math.max(l.busy,u),p=u+ie.time.after,a=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,k=u+zi[f.type];l.edges.push({event:d,a:u,b:k,carries:!1,coin:!1,named:!1}),p=u+ie.lineup.stagger,a=k,e=0,l.busy=Math.max(l.busy,k);return}if(f.type==="commit"||f.type==="branch"||f.type==="leaf"||f.type==="node"){let u=p,k=u+ie.draw;l.edges.push({event:d,a:u,b:k,carries:!1,coin:!1,named:!1}),p=u+ie.stagger,a=k,e=0,l.busy=Math.max(l.busy,k)}else if(f.type==="edge"){let u=p;a=r(d,f,u),p=u+ie.stagger,e=0}else if(f.type==="action")l.events.push({event:d,at:p}),l.busy=Math.max(l.busy,p+ie.action),p+=ie.action,e=0;else{let u=(a??p)+ie.change*e++;l.events.push({event:d,at:u}),l.busy=Math.max(l.busy,u),s=Math.max(s,u)}}}),l.edges.sort((f,d)=>f.a-d.a),l}function Cs(t,n=!1){let l=t.kind==="time"?t.time:void 0,p=ie.time,a=l?Math.min(p.unitMax,Math.max(p.unitMin,p.axis/Math.max(1,l.scale.count))):0,e=0,s=t.steps.map(P=>{if(!l)return Is(P);let b=Is(P,{from:e,speed:a});return e=b.sweep?.keys[b.sweep.keys.length-1]?.[1]??e,b}),r=[],o=ie.intro;t.steps.forEach((P,b)=>{let B=Math.min(ie.stepMax,Math.max(ie.stepMin,ie.stepBase+[...P.body].length*ie.perChar)),_=Math.max(B,(s[b]?.busy??0)+ie.dwell);r.push({start:o,end:o+_}),o+=_});let c=Math.ceil(o+ie.outro),m=c-ie.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,k=[],h=[],w=[],g=[];s.forEach((P,b)=>{let B=r[b],_=[];for(let W of P.edges){let H=B.start+W.a;k.push({step:b,event:W.event,start:H,drawn:B.start+W.b,end:B.end});let ee=t.steps[b]?.events[W.event],C=t.kind==="git"&&ee?.type==="edge"&&ee.carry.kind==="tag"&&ee.carry.text===ee.from;W.carries&&!C&&g.push({step:b,event:W.event,who:W.coin?"coin":"main",a:H,b:B.start+W.b}),W.named&&_.push({step:b,event:W.event,start:H+ie.labelDelay,end:B.end})}_.forEach((W,H)=>{let ee=_[H+2];ee&&(W.end=Math.min(W.end,ee.start))});for(let W of _)d&&W.end>d.start?W.end=d.end:(t.kind==="state"&&W.end<u&&(W.after={start:W.end,end:u}),d&&(W.again=d));h.push(..._);for(let W of P.events)w.push({step:b,event:W.event,at:B.start+W.at})});let N=r[0]?.start??0,L=g.some(P=>P.who==="main"),F=[];for(let P of["main","coin"]){let b=g.filter(B=>B.who===P);b.forEach((B,_)=>{let W=b[_+1],H=_===0&&(P==="main"||!L);F.push({step:B.step,event:B.event,who:P,depart:B.a,arrive:B.b,start:H?Math.min(N,B.a):B.a,end:W?Math.max(W.a,B.b):m})})}F.sort((P,b)=>P.depart-b.depart);let T=t.kind==="state"?Zi(t,k,m):void 0,j=[[0,0]],x=[];return s.forEach((P,b)=>{let B=r[b].start;for(let[_,W]of P.sweep?.keys??[])j.push([B+_,W]);for(let _ of P.sweep?.passed??[])x.push({unit:_.unit,passed:B+_.at})}),j.push([c,e]),{total:c,last:m,steps:r,edges:k,carriers:F,labels:h,badges:r.map((P,b)=>({step:b,appears:P.start})),events:w,stills:r.map(P=>P.end-ie.still),...d?{whole:d}:{},...T?{states:T}:{},...l?{needle:j,units:x,meters:Ui(t,s,r)}:{}}}function Ui(t,n,l){let p=t.time?.period?.length;return(t.strip?.meters??[]).map(({field:a})=>{let e=[[0,0]],s=0;return n.forEach((r,o)=>{let i=l[o].start,c=(t.steps[o]?.events??[]).flatMap((k,h)=>{let w=k.type==="strip"&&k.field===a&&k.value!==void 0?In(k.value):void 0;return w===void 0?[]:[{e:h,ratio:w}]}),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[k,h]=[d[1],u[1]],w=s,g=k,N=p?Math.floor((h-1e-9)/p)*p:0;if(N>0&&N>=k){let L=i+(f.find(([,T])=>T===N)?.[0]??d[0]),F=e[e.length-1][0];e.push([Math.max(F,L-ie.time.reset),s],[L,0]),w=0,g=N}for(let[L,F]of f)F>=g&&e.push([i+L,w+(m.ratio-w)*(F-g)/(h-g)])}else{let k=i+(r.events.find(h=>h.event===m.e)?.at??0);e.push([k,s],[k+ie.fade,m.ratio])}s=m.ratio}),{field:a,keys:e}})}var Ji=t=>Et.includes(t);function Zi(t,n,l){let p=new Map,a=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=a(e.box);o.lit.push({start:e.since,end:s.start}),e.box===r.from&&o.done===void 0&&(o.done=s.start+ie.done),e=void 0}Ji(r.to)||(e={box:r.to,since:s.drawn})}}return e&&a(e.box).lit.push({start:e.since,end:l}),[...p.values()]}var Dt={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 Ce=[[0,Number.POSITIVE_INFINITY]],Wn=.5,Fs=(t,n)=>t.shown.some(([l,p])=>l<=n&&n<p),Hn=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 _s(t,n,l=[]){let p=[];return n.forEach((a,e)=>{let s=t.filter(o=>Fs(o,a));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>Wn&&f>Wn&&p.push({kind:"texts",step:e,texts:[o.text,c.text],spots:[Hn(o),Hn(c)]})}});let r=l.filter(o=>Fs(o,a));for(let o of s)if(!o.boxed)for(let i of r)Gt(i.points,o.rect,Wn)&&p.push({kind:"line",step:e,text:o.text,line:{from:i.from,to:i.to},spots:[Hn(o)]})}),p}var $e=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Pn=(t,n)=>t===void 0?n:`<a href="${$e(t)}">${n}</a>`,ne=t=>Math.round(t*100)/100,we=t=>t==="coin"?"--c:var(--coin);--ct:var(--coint)":`--c:var(--c-${t});--ct:var(--t-${t})`;function st(t,n,l,p,a="dg-gl"){let e=t===void 0?void 0:Dt[t];return e?`<path class="${a}" transform="translate(${ne(n)} ${ne(l)}) scale(${p})" d="${e}"/>`:""}function rt(t){let n=t.filter((e,s)=>s===0||e[0]!==t[s-1][0]||e[1]!==t[s-1][1]),[l,p]=n[0],a=`M ${ne(l)} ${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(v.edge.bend,f/2,d/2);a+=` 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];a+=` L ${ne(e)} ${ne(s)}`}return a}function Lt(t){let[n,l]=t[t.length-1],[p,a]=t[t.length-2],e=Math.hypot(n-p,l-a)||1,s=(n-p)/e,r=(l-a)/e,{arrow:o,arrowHalf:i}=v.edge;return`M ${ne(n-s*o-r*i)} ${ne(l-r*o+s*i)} L ${ne(n)} ${ne(l)} L ${ne(n-s*o+r*i)} ${ne(l-r*o-s*i)}`}function Se(t,n,l,p,a,e,s=Ce,r){return t?.push({text:a,rect:Ge(a,l,p,e,r),shown:s}),`<text class="${n}" x="${ne(l)}" y="${ne(p)}"${r?` text-anchor="${r}"`:""}>${$e(a)}</text>`}function Bs(t,n){let l=[[0,{opacity:0}]];for(let[p,a]of n)l.push([p,{opacity:0},me.out],[p+ie.fade,{opacity:1}],[a-.1,{opacity:1},me.inOut],[a+.25,{opacity:0}]);return l.push([t.total,{opacity:0}]),t.kf(l)}function Sn(t,n){let l=[];for(let p=0;p<n.length;){let a=p;for(;a+1<n.length&&n[a+1]===n[a]+1;)a++;l.push([t.t.steps[n[p]].start,t.t.steps[n[a]].end]),p=a+1}return Bs(t.m,l)}function Gs(t,n){let{radius:l,icon:p,iconRadius:a,iconScale:e,nameY:s,line:r}=v.region,{x:o,y:i}=t.header,c=t.lines.map((d,u)=>Se(n,"dg-bz",o,t.y+s+u*r,d,q.regionName)).join(""),m=t.note?Se(n,"dg-bx",o,t.y+s+t.lines.length*r+1,t.note,q.regionNote):"",f=t.icon&&Dt[t.icon]?`<rect class="dg-bi" x="${ne(o)}" y="${ne(i)}" width="${p}" height="${p}" rx="${a}"/>${st(t.icon,o+p/2,i+p/2,e)}`:"";return`<g style="${we(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="${l}"/>${f}${c}${m}</g>`}function Mn(t,n,l,p,a,e){let s=[[0,t.sub??"","dg-ss"],...l];return s.map(([r,o,i],c)=>{let m=s[c+1]?.[0],f=c===0?m===void 0?"":n.until(m-ie.untilFade):m===void 0?n.rise(r):n.rise(r,m-ie.untilFade);if(o==="")return"";let d=[[c===0?0:r,m===void 0?Number.POSITIVE_INFINITY:m-ie.untilFade]],u=i==="dg-ss"?q.boxSub:q.boxSubStrong,k=e===void 0?Se(a,i,t.cx,p,o,u,d,"middle"):Se(a,i,e-pe(o,u),p,o,u,d);return`<g${f?` class="dg-a" style="${f}"`:""}>${k}</g>`}).join("")}function Ys(t,n,l,p,a){let e=(s,r="")=>`<rect class="${s}" x="${ne(t.x)}" y="${ne(p)}" width="${ne(t.w)}" height="${a}" rx="${v.box.radius}"${r}/>`;return`${l?`<g class="dg-a" style="${l}">${e("dg-halo")}</g>`:""}${e("dg-st",` ${n.sh}`)}${l?`<g class="dg-a" style="${l}">${e("dg-on")}</g>`:""}`}function On(t,n,l,p,a){let{icon:e,iconRadius:s,iconScale:r,iconY:o,nameY:i,subY:c}=v.box,m=Mn(t,n.m,p,t.cy+c,n.ink),f=a?a.length>0?Bs(n.m,a.map(h=>[h.start,h.end])):void 0:l.length>0?Sn(n,l):void 0,d=t.iconX??t.cx,u=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="${v.slot.radius}"/>`:"",k="";if(t.icon&&Dt[t.icon]){let h={x:d-e/2,y:t.cy+o-e/2,w:e,h:e};n.ink.push({text:`${t.name} \u306E\u7D75\u67C4`,rect:h,shown:Ce,boxed:!0,part:{kind:"icon",box:t.name}}),k=`<rect class="dg-ic" x="${ne(h.x)}" y="${ne(h.y)}" width="${e}" height="${e}" rx="${s}"/>${st(t.icon,d,t.cy+o,r)}`}return`<g style="${we(t.color)}">${Ys(t,n,f,t.y,t.h)}${u}${k}${Se(n.ink,"dg-sn",t.cx,t.cy+i,t.name,q.boxName,Ce,"middle")}${m}</g>`}function Vs(t,n,l,p){let{pad:a,h:e,nameY:s,subY:r}=v.follow.head,o=Mn(t,n.m,p,a+r),i=l.length>0?Sn(n,l):void 0;return`<g style="${we(t.color)}">${Ys(t,n,i,a,e)}<text class="dg-sn" x="${ne(t.cx)}" y="${ne(a+s)}" text-anchor="middle">${$e(t.name)}</text>${o}</g>`}function Ws(t,n){let{icon:l,iconRadius:p,iconScale:a,radius:e}=v.box,s=v.state.ghost,r=t.x+s.pad+l/2,o=t.x+s.pad+l+s.gap,i=t.icon&&Dt[t.icon]?`<rect class="dg-ic" x="${ne(r-l/2)}" y="${ne(t.cy-l/2)}" width="${l}" height="${l}" rx="${p}"/>${st(t.icon,r,t.cy,a)}`:"",c=t.sub?s.nameY:v.baseline.mark,m=t.sub?Se(n,"dg-ss",o,t.cy+s.subY,t.sub,q.boxSub,Ce,"start"):"";return`<g data-ghost="${$e(t.id)}" style="${we(t.color)}"><rect class="dg-ghost" x="${ne(t.x)}" y="${ne(t.y)}" width="${ne(t.w)}" height="${t.h}" rx="${e}"/>${i}${Se(n,"dg-sn",o,t.cy+c,t.name,q.boxName,Ce,"start")}${m}</g>`}function Hs(t,n,l){let{r:p,inset:a}=v.state.done,e=t.x+t.w-a,s=t.y+a;return`<g class="dg-popc dg-a" data-done="${$e(t.id)}" style="${we(t.color)};${l.m.pop(n)}"><circle class="dg-done" cx="${ne(e)}" cy="${ne(s)}" r="${p}"/>${st("check",e,s,.5,"dg-done-ck")}</g>`}function Ks(t,n,l,p){p.push({from:t.from,to:t.to,points:t.points,shown:Ce});let a=t.label?.family==="sans",e=t.label?Se(l,`dg-path-t${a?" dg-path-tj":""}`,t.label.x+v.label.padX,t.label.y+t.label.h/2+v.baseline.label,t.label.text,a?q.labelJa:q.label):"";return`<g data-path="${$e(`${t.from}->${t.to}`)}" style="${we(n)}"><path class="dg-path" d="${rt(t.points)}"/><path class="dg-path-h" d="${Lt(t.points)}"/>${e}</g>`}function Xs(t,n,l){let{pad:p}=v.state.side,a=t.y+p+q.regionName.size,e=t.notes.map((s,r)=>Se(l,"dg-side-n",t.x+p,a+v.region.line*(r+1),s,q.regionNote)).join("");return`<g style="${we(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="${v.region.radius}"/>${Se(l,"dg-side-t",t.x+p,a,t.title,q.regionName)}${e}</g>`}function zs(t,n,l){let{end:p}=v.state,a=Wt(t),e=t.text===""?"":Se(l,"dg-mark",a[0],a[1],t.text,q.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="${we(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 Us(t,n,l){return`<line class="dg-ll" x1="${ne(t)}" y1="${ne(n)}" x2="${ne(t)}" y2="${ne(l)}"/>`}function Js(t,n,l,p=!1,a=0){let{m:e}=l;l.traces.push({from:t.from,to:t.to,points:t.points,shown:a>0?[[a,Number.POSITIVE_INFINITY]]:Ce});let s=rt(t.points),r=Lt(t.points),{start:o,drawn:i,end:c}=n,m=p?[[c,{opacity:1},me.inOut],[c+.4,{opacity:0}],[e.total,{opacity:0}]]:[[c,{opacity:1},me.inOut],[c+.4,{opacity:.45}],[l.end+.3,{opacity:.45},me.inOut],[l.end+1,{opacity:.95}],[e.last,{opacity:.95},me.inOut],[e.total,{opacity:0}]],f=e.kf([[0,{opacity:0,"stroke-dashoffset":1}],[o,{opacity:0,"stroke-dashoffset":1},me.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,k=e.kf([[0,{opacity:0,"stroke-dashoffset":0}],[i,{opacity:0,"stroke-dashoffset":0}],[i+.25,{opacity:.9}],[c-.1,{opacity:.9},me.inOut],[c+.2,{opacity:0,"stroke-dashoffset":u}],[e.total,{opacity:0,"stroke-dashoffset":u}]]),h=p?e.kf([[0,{opacity:0}],[c,{opacity:0},me.inOut],[c+.4,{opacity:1}],[e.last,{opacity:1},me.inOut],[e.total,{opacity:0}]]):"",w=`<path class="dg-e" d="${s}"/><path class="dg-eh" d="${r}"/>`;return{base:`${a>0?`<g class="dg-a" style="${e.vis(a)}">${w}</g>`:w}${p?`<path class="dg-e-past dg-a" d="${s}" style="${h}"/><path class="dg-eh-past dg-a" d="${r}" style="${h}"/>`:""}`,lit:`<g style="${we(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="${k}"/></g>`}}function Zs(t,n,l){let p=t.family==="sans"?" dg-capj":"",{radius:a}=v.label,e=n.again?[[n.start,n.end],[n.again.start,n.again.end]]:[[n.start,n.end]];l.ink.push({text:t.text,rect:t,shown:e,boxed:!0}),n.after&&l.ink.push({text:t.text,rect:Ge(t.text,t.x+t.w/2,t.y+t.h/2+v.baseline.label,t.family==="sans"?q.labelJa:q.label,"middle"),shown:[[n.after.start,n.after.end]]});let s=ne(t.x+t.w/2),r=ne(t.y+t.h/2+v.baseline.label),o=n.after?`<g class="dg-cap-past${t.family==="sans"?" dg-cap-pastj":""} dg-a" style="${l.m.vis(n.after.start,n.after.end)}"><text x="${s}" y="${r}" text-anchor="middle">${$e(t.text)}</text></g>`:"",i=e.map(([c,m])=>`<g class="dg-cap${p} dg-a" style="${we(t.color)};${l.m.rise(c,m,!0)}"><rect x="${ne(t.x)}" y="${ne(t.y)}" width="${ne(t.w)}" height="${t.h}" rx="${a}"/><text x="${s}" y="${r}" text-anchor="middle">${$e(t.text)}</text></g>`);return`${o}${i.join("")}`}function Kn(t,n,l,p,a){let e=a?[[n,l],[a.start,a.end]]:[[n,l]];return p.ink.push({text:t.text,rect:t,shown:e,boxed:!0}),e.map(([s,r])=>`<g class="dg-act dg-a" style="${we(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="${v.action.radius}"/><text x="${ne(t.x+t.w/2)}" y="${ne(t.y+t.h/2+v.baseline.action)}" text-anchor="middle">${$e(t.text)}</text></g>`).join("")}function Qi(t,n){let l=v.carrier;if(t.carry.kind==="coin")return`<circle class="dg-coin" r="${l.coinR}"/><circle class="dg-coin-in" r="${l.coinIn}"/>`;if(t.carry.kind==="tag"){let p=t.carry.text,a=Ie(p),e=pe(p,a?q.carrierJa:q.carrier)+l.tagPadX*2;return`<rect class="dg-car" x="${ne(-e/2)}" y="${-l.tagH/2}" width="${ne(e)}" height="${l.tagH}" rx="${l.tagH/2}" ${n}/><text class="dg-car-t${a?" dg-car-tj":""}" y="${v.baseline.carrier}" text-anchor="middle">${$e(p)}</text>`}return`<rect class="dg-env" x="${-l.envW/2}" y="${-l.envH/2}" width="${l.envW}" height="${l.envH}" rx="3" ${n}/><path class="dg-env-in" d="M -8 -4.5 L 0 1.5 L 8 -4.5"/>`}var eo=t=>t<.5?4*t*t*t:1-(-2*t+2)**3/2;function Tn(t,n,l){let{m:p}=l,a=v.carrier.samples,e=t.wait?[t.wait,...t.points]:t.points,s=ft(e),{depart:r,arrive:o,start:i,end:c}=n,m=[];for(let T=0;T<=a;T++){let[j,x]=Qe(e,eo(T/a)*s);m.push([r+(o-r)*T/a,j,x])}let f=m[0],d=m[m.length-1],u=t.settle??[d[1],d[2]],k=[[0,f[1],f[2]],...m];t.settle&&k.push([Math.min(o+.3,Math.max(c,o+.01)),u[0],u[1]]),k.push([c,u[0],u[1]],[p.total,u[0],u[1]]);let[h,w]=at(t.carry),g=t.carry.kind==="tag"?t.carry.text:t.carry.kind==="coin"?"\u786C\u8CA8":"\u5C01\u7B52",N=t.carry.kind==="tag"?{}:{part:{kind:t.carry.kind==="coin"?"coin":"envelope"}},L=T=>({x:T[0]-h,y:T[1]-w,w:h*2,h:w*2});r>i&&l.ink.push({text:g,rect:L([f[1],f[2]]),shown:[[i,r]],boxed:!0,...N}),l.ink.push({text:g,rect:L(u),shown:[[o,c]],boxed:!0,...N});let F=c<p.last?.05:.18;return`<g class="dg-a" style="${p.move(k,p.blink(i+.02,c,F))}">${Qi(t,l.sh)}</g>`}function Qs(t,n,l=!1){let{m:p}=n,a=n.t.steps[t.step],e=a.start,s=a.end,{r,ring:o}=v.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},me.pop],[e+.35,{opacity:1,transform:"scale(1)",...i}],[s,{opacity:1,transform:"scale(1)",...i},me.inOut],[s+(f?ie.untilFade:.4),{opacity:0,transform:"scale(1)",...c}],[p.total,{opacity:0,transform:"scale(.5)",...c}]]),u=m??p.last,k=f?p.kf([[0,{opacity:0,...c}],[p.total,{opacity:0,...c}]]):p.kf([[0,{opacity:0,...c}],[s,{opacity:0,...c},me.inOut],[s+.4,{opacity:1,...i}],[u,{opacity:1,...i},me.inOut],...m===void 0?[]:[[m+ie.untilFade,{opacity:0,...c}]],[p.total,{opacity:0,...c}]]),h=p.kf([[0,{opacity:0,transform:"scale(1)"}],[e+.05,{opacity:0,transform:"scale(1)"}],[e+.1,{opacity:.7,transform:"scale(1)"},me.out],[e+.9,{opacity:0,transform:"scale(2.3)"}],[p.total,{opacity:0,transform:"scale(1)"}]]),w=ne(t.x),g=ne(t.y),N=ne(t.y+v.baseline.badge),L=t.step+1;return n.ink.push({text:String(L),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="${we(t.color)}"><circle class="dg-bdr dg-popc dg-a" cx="${w}" cy="${g}" r="${o}" style="${h}"/><g class="dg-a" style="${k}"><circle class="${l?"dg-bdp-g":"dg-bdp"}" cx="${w}" cy="${g}" r="${o}"/><text class="${l?"dg-bdpt-g":"dg-bdpt"}" x="${w}" y="${N}" text-anchor="middle">${L}</text></g><g class="dg-popc dg-a" style="${d}"><circle class="dg-bdf" cx="${w}" cy="${g}" r="${r}"/><text class="dg-bdft" x="${w}" y="${N}" text-anchor="middle">${L}</text></g></g>`}function er(t,n,l,p=!1,a=new Map,e){let{m:s,sh:r}=l,o=v.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="${v.region.radius}" ${r}/>`,`<g style="${we("slate")}"><rect class="dg-bi" x="${ne(t.x+o.pad)}" y="${ne(i-o.icon/2)}" width="${o.icon}" height="${o.icon}" rx="${v.box.iconRadius}"/>${st("env",t.x+o.pad+o.icon/2,i,.78)}</g>`,Se(l.ink,"dg-sh",t.x+o.titleX,i+v.baseline.stripTitle,t.title,q.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(Se(l.ink,"dg-fl",m.x,m.y+o.nameY,m.name,q.fieldName));let u=e?.(m);if(u!==void 0){c.push(u);return}let k=n.get(m.name)??[],h=k.filter(g=>g.value!==void 0),w=k.filter(g=>g.tag!==void 0);h.forEach((g,N)=>{let L=h[N+1]?.at,F=g.value,T=Ie(F)?"dg-fvj":"dg-fv";l.ink.push({text:F,rect:Ge(F,m.x,m.y+o.valueY,Ie(F)?q.fieldValueJa:q.fieldValue),shown:[[g.at,L===void 0?Number.POSITIVE_INFINITY:L-ie.untilFade]]});let j=B=>`<text class="${B}" x="${ne(m.x)}" y="${ne(m.y+o.valueY)}">${$e(F)}</text>`,x=j(T);if(!p){let B=L===void 0?s.rise(g.at):s.rise(g.at,L-ie.untilFade);c.push(`<g class="dg-a" style="${B}">${x}</g>`);return}let P=Math.min(g.until,L??g.until),b=`<circle class="dg-fl-now" cx="${ne(m.x+pe(m.name,q.fieldName)+o.now.gap)}" cy="${ne(m.y+o.nameY-q.fieldName.size/3)}" r="${o.now.r}"/>`;c.push(`<g class="dg-fv-now dg-a" data-step="${g.step}" style="${we(g.color)};${s.rise(g.at,P-ie.untilFade)}">${j(`${T} dg-fv-c`)}${b}</g>`),(L===void 0||L>P)&&c.push(`<g class="dg-a" style="${s.vis(P-ie.untilFade,L===void 0?s.last:L-ie.untilFade)}">${x}</g>`)}),w.forEach((g,N)=>{let L=w[N+1]?.at,F=g.tag,T=[...h].reverse().find(b=>b.at<=g.at+1e-9)?.value,j=m.x+(T?pe(T,Ie(T)?q.fieldValueJa:q.fieldValue)+o.tagGap:0),x=pe(F,q.tag)+o.tagPadX*2,P=m.y+o.valueY-o.tagH/2-v.baseline.tag;l.ink.push({text:F,rect:{x:j,y:P,w:x,h:o.tagH},shown:[[g.at,L===void 0?Number.POSITIVE_INFINITY:L-ie.untilFade]],boxed:!0}),c.push(`<g class="dg-tg dg-popc dg-a" style="${we(g.color)};${L===void 0?s.pop(g.at):s.pop(g.at,L-ie.untilFade)}"><rect x="${ne(j)}" y="${ne(P)}" width="${ne(x)}" height="${o.tagH}" rx="${o.tagH/2}"/><text x="${ne(j+x/2)}" y="${ne(P+o.tagH/2+v.baseline.tag)}" text-anchor="middle">${$e(F)}</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(Se(l.ink,"dg-fl",m.x,m.y+o.nameY,m.title,q.fieldName));let d=m.y+o.valueY-q.fieldValue.size/3;m.states.forEach((u,k)=>{let h=ne(m.x+o.trail.r+k*o.trail.step),w=a.get(u.box),g=w===void 0?"":`<circle class="dg-tr-fill dg-a" cx="${h}" cy="${ne(d)}" r="${o.trail.r}" style="${s.pop(w)}"/>`;c.push(`<g data-trail="${$e(u.box)}" style="${we(u.color)}"><circle class="dg-tr-ring" cx="${h}" cy="${ne(d)}" r="${o.trail.r}"/>${g}</g>`)})}return c.join("")}var pt=t=>Math.round(t*100)/100,tr=t=>[t.x+t.w/2,t.y+t.h/2];function to(t,n){let l=v.carrier,p=Ie(t),a=pe(t,p?q.carrierJa:q.carrier)+l.tagPadX*2;return`<rect class="dg-car" x="${pt(-a/2)}" y="${-l.tagH/2}" width="${pt(a)}" height="${l.tagH}" rx="${l.tagH/2}" ${n}/><text class="dg-car-t${p?" dg-car-tj":""}" y="${v.baseline.carrier}" text-anchor="middle">${$e(t)}</text>`}function nr(t,n,l,p){let{m:a}=p,e=v.git,s=(d,u)=>l.edges.find(k=>k.step===d&&k.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 k=rt(d.points);if(d.kind==="copy")return`<g style="${we(d.color)}"><path class="dg-git-cp dg-a" d="${k}" style="${a.vis(u.start,a.last)}"/></g>`;let h=a.kf([[0,{opacity:0,"stroke-dashoffset":1}],[u.start,{opacity:0,"stroke-dashoffset":1},me.inOut],[u.start+.05,{opacity:1}],[u.drawn,{"stroke-dashoffset":0}],[a.last,{opacity:1,"stroke-dashoffset":0},me.inOut],[a.total,{opacity:0,"stroke-dashoffset":0}]]);return`<g style="${we(d.color)}"><path class="dg-git-l dg-a" pathLength="1" d="${k}" style="${h}"/></g>`}).join(""),o=t.commits.map(d=>{let u=s(d.step,d.event)?.drawn??0,k={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:k,shown:[[u,Number.POSITIVE_INFINITY]],boxed:!0});let h=(d.text?.lines??[]).map((T,j)=>{let x=j===0&&d.hash!==void 0,P=d.text?.baselines[j]??d.cy;return Se(p.ink,x?"dg-git-h":"dg-git-n",d.cx,P,T,x?q.gitHash:q.gitNote,[[u,Number.POSITIVE_INFINITY]],"middle")}).join(""),w=`<text class="dg-git-id" x="${pt(d.cx)}" y="${pt(d.cy+v.baseline.badge)}" text-anchor="middle">${$e(d.id)}</text>`,g=`<g class="dg-popc dg-a" style="${a.pop(u)}"><circle class="dg-git-c" cx="${pt(d.cx)}" cy="${pt(d.cy)}" r="${d.r}" ${p.sh}/>${w}</g>`,N=h===""?"":`<g class="dg-a" style="${a.vis(u)}">${h}</g>`,L=d.orphan===void 0?void 0:s(d.orphan,d.orphanEvent??0)?.drawn,F=L===void 0?"":`<g class="dg-a" data-orphan="${$e(d.id)}" style="${a.vis(L,a.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+v.baseline.badge)}" text-anchor="middle">${$e(d.id)}</text></g>`;return`<g data-commit="${$e(d.id)}" style="${we(d.color)}">${g}${N}${F}</g>`}).join(""),i=t.moves.flatMap(d=>{let u=s(d.step,d.event);if(!d.line||!u)return[];let k=l.steps[d.step].end;p.traces.push({from:d.ref,to:d.target??d.ref,points:d.line,shown:[[u.start,k+.4]]});let h=a.kf([[0,{opacity:0,"stroke-dashoffset":1}],[u.start,{opacity:0,"stroke-dashoffset":1},me.inOut],[u.start+.05,{opacity:1}],[u.drawn,{"stroke-dashoffset":0}],[k,{opacity:1},me.inOut],[k+.4,{opacity:0}],[a.total,{opacity:0,"stroke-dashoffset":0}]]);return[`<g style="${we(d.color)}"><path class="dg-e-on dg-a" pathLength="1" d="${rt(d.line)}" style="${h}"/></g>`]}).join(""),c=l.carriers.flatMap(d=>{let u=t.moves.find(w=>w.step===d.step&&w.event===d.event&&w.line),k=n.steps[d.step]?.events[d.event];if(!u?.line||k?.type!=="edge")return[];let h={step:d.step,event:d.event,from:u.ref,to:u.target??u.ref,points:u.line,color:u.color,carry:k.carry};return[Tn(h,{...d,start:d.depart,end:d.arrive+ie.fade},p)]}).join(""),f=[...new Set(t.moves.map(d=>d.ref))].map(d=>no(d,t.moves.filter(u=>u.ref===d),s,p)).join("")+c;return{links:r,lines:i,commits:o,tags:f}}function no(t,n,l,p){let{m:a}=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=l(d.step,d.event);if(!u)continue;let{start:k,drawn:h}=u,w=d.from?tr(d.from):void 0,g=d.to?tr(d.to):void 0;if(i(k),d.carried&&w&&g&&r){e.push([k+ie.fade,w[0],w[1]],[h-ie.fade,g[0],g[1]]),s.push([k,{opacity:1},me.inOut],[k+ie.fade,{opacity:0}],[h-ie.fade,{opacity:0},me.out],[h,{opacity:1}]),o={rect:d.to,since:h};continue}if(w&&e.push([k,w[0],w[1]]),g&&e.push([h,g[0],g[1]]),g&&!r){let N=w?k:h-ie.fade;s.push([N,{opacity:0},me.out],[N+ie.fade,{opacity:1}]),r=!0}else!g&&r&&(s.push([h,{opacity:1},me.inOut],[h+ie.untilFade,{opacity:0}]),r=!1);d.to&&(o={rect:d.to,since:h})}if(i(Number.POSITIVE_INFINITY),e.length===0)return"";let c=e[0],m=e[e.length-1];r?s.push([a.last,{opacity:1},me.inOut],[a.total,{opacity:0}]):s.push([a.total,{opacity:0}]);let f=a.move([[0,c[1],c[2]],...e,[a.total,m[1],m[2]]],s);return`<g class="dg-a" data-ref="${$e(t)}" style="${f}">${to(t,p.sh)}</g>`}var Fe=t=>Math.round(t*100)/100,Xn=(t,n,l=1)=>`translate(${Fe(t)}px,${Fe(n)}px) scale(${l})`,so=(t,n)=>n.reduce((l,[p,a])=>l.flatMap(([e,s])=>a<=e||p>=s?[[e,s]]:[...e<p?[[e,p]]:[],...a<s?[[a,s]]:[]]),[t]);function sr(t,n,l,p,a){let{m:e}=p,s=v.lineup,r=ie.lineup.cut,o=b=>l.edges.find(B=>B.step===b.step&&B.event===b.event)??{start:0,drawn:0},i=new Map((n.lineup?.items??[]).map(b=>[b.id,b])),c=new Map(t.lanes.map(b=>[b.id,[]])),m=new Set,f=(b,B,_)=>{m.has(b)!==_&&(_?m.add(b):m.delete(b),c.get(b)?.push([B,_]))};for(let b of[...l.edges].sort((B,_)=>B.start-_.start)){let B=n.steps[b.step]?.events[b.event];if(B?.type==="line"&&f(B.box,b.start,!1),B?.type==="pick")for(let _ of t.lanes)f(_.id,b.start,_.id!==B.box)}let d=b=>{let B=c.get(b)??[];if(B.length===0)return;let _=[[0,{opacity:1}]],W=1;for(let[H,ee]of B){let C=ee?s.faint:1;_.push([H,{opacity:W},me.inOut],[H+ie.fade,{opacity:C}]),W=C}return _.push([e.last,{opacity:W},me.inOut],[e.total,{opacity:1}]),e.kf(_)},u=b=>[o(b).drawn,b.until?o(b.until).start:Number.POSITIVE_INFINITY],k=b=>{if(b.length===0)return;let B=[[0,{opacity:1}]];for(let _ of b){let[W,H]=u(_);B.push([W,{opacity:1}],[W+r,{opacity:0}]),_.until&&B.push([H,{opacity:0}],[H+r,{opacity:1}])}return B.push([e.total-r,{opacity:b.at(-1)?.until?1:0}],[e.total,{opacity:1}]),e.kf(B)},h=b=>{let{start:B,drawn:_}=o(b),W={opacity:0,transform:"scaleX(0)"},H=b.until?[[o(b.until).start,{opacity:1},me.inOut],[o(b.until).start+ie.fade,{opacity:0}],[e.total,{opacity:0}]]:[[e.last,{opacity:1},me.inOut],[e.total,{opacity:0}]];return e.kf([[0,W],[B-r,W],[B,{opacity:1,transform:"scaleX(0)"},me.inOut],[_,{transform:"scaleX(1)"}],...H])},w=b=>{if(!b.until)return;let B=b.until,_=t.chips.find(W=>W!==b&&W.id===b.id&&W.step===B.step&&W.from?.[0]===b.x&&W.from?.[1]===b.y);return _?{at:o(_).start,moved:!0}:{at:o(B).start,moved:!1}},g=b=>{let B=o(b).start,_=Xn(0,0),W=[];if(b.from){let ee=Xn(b.from[0]-b.x,b.from[1]-b.y);W.push([0,{opacity:0,transform:ee}],[B-r,{opacity:0,transform:ee}],[B,{opacity:1,transform:ee},me.inOut],[B+ie.lineup.slide,{transform:_}])}else{let ee=Xn(0,0,v.popFrom);W.push([0,{opacity:0,transform:ee}],[B,{opacity:0,transform:ee},me.pop],[B+ie.popFade,{opacity:1,transform:_}])}let H=w(b);return H?W.push([H.at,{opacity:1},me.inOut],[H.at+(H.moved?r:ie.fade),{opacity:0}],[e.total,{opacity:0}]):W.push([e.last,{opacity:1},me.inOut],[e.total,{opacity:0}]),e.kf(W)},N=(b,B)=>{let _=i.get(b.id),W=_?.color,H=`<rect class="${W?"dg-ln-chip":"dg-ln-plain"}" x="${Fe(b.x)}" y="${Fe(b.y)}" width="${Fe(b.w)}" height="${b.h}" rx="${s.chip.radius}"/>`,ee=so([o(b).start+ie.lineup.slide,w(b)?.at??Number.POSITIVE_INFINITY],B),C=_?.label===void 0?"":Se(p.ink,W?"dg-ln-t":"dg-ln-tp",b.x+b.w/2,b.y+b.h/2+v.baseline.tag,_.label,q.chip,ee,"middle");return`<g class="dg-popc dg-a" data-lineup-chip="${$e(b.id)}" data-lineup-on="${$e(b.lane)}" data-lineup-seat="${b.index}" style="${W?`${we(W)};`:""}${g(b)}">${H}${C}</g>`},L=(b,B,_)=>`<g class="dg-a" data-lineup-ring="${$e(b.lane)}" style="${e.vis(o(b).start,B?o(B).start:e.last)}">${_}</g>`,F=new Map(t.lanes.map(b=>[b.id,d(b.id)])),T=t.lanes.map(b=>{let B=(ee,C="")=>`<rect class="${ee}" x="${Fe(b.x)}" y="${Fe(b.y)}" width="${Fe(b.w)}" height="${b.h}" rx="${s.radius}"${C}/>`,_=t.picks.flatMap((ee,C)=>ee.lane===b.id?[L(ee,t.picks[C+1],`${B("dg-halo")}${B("dg-on")}`)]:[]).join(""),W=Mn(b,e,a.get(b.id)??[],b.title.baseline,p.ink,b.noteRight),H=F.get(b.id);return`<g${H?' class="dg-a"':""} data-lineup-lane="${$e(b.id)}" style="${we(b.color)}${H?`;${H}`:""}">${B("dg-st",` ${p.sh}`)}${_}${Se(p.ink,"dg-sn",b.title.x,b.title.baseline,b.name,q.boxName,Ce)}${W}</g>`}).join(""),j=s.seal.stripe,x=`<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>`,P=t.lanes.map(b=>{let B=t.seals.filter(D=>D.lane===b.id),_=B.map(u),W=t.chips.filter(D=>D.lane===b.id).map(D=>N(D,_)).join(""),H=k(B),ee=`<g${H?' class="dg-a"':""} data-lineup-track="${$e(b.id)}"${H?` style="${H}"`:""}>${W}</g>`,C=B.map(D=>`<rect class="dg-ln-seal dg-a" data-lineup-seal="${$e(b.id)}" x="${Fe(D.x)}" y="${Fe(D.y)}" width="${Fe(D.w)}" height="${Fe(D.h)}" rx="${s.seal.radius}" fill="url(#dg-seal-${p.id})" style="${h(D)}"/>`).join(""),M=t.stamps.filter(D=>D.lane===b.id).map(D=>{let V=o(D).start,Q=D.x+D.w/2,U=D.y+D.h/2,re=Se(p.ink,"dg-ln-st",Q,U+v.baseline.tag,D.text,q.stamp,[[V,Number.POSITIVE_INFINITY]],"middle");return`<g class="dg-popc dg-a" data-lineup-stamp="${$e(b.id)}" style="${we(s.stamp.color)};${e.pop(V)}"><g transform="rotate(${s.stamp.tilt} ${Fe(Q)} ${Fe(U)})"><rect class="dg-ln-stamp" x="${Fe(D.x)}" y="${Fe(D.y)}" width="${Fe(D.w)}" height="${D.h}" rx="${s.stamp.radius}"/>${re}</g></g>`}).join(""),R=F.get(b.id);return`<g${R?` class="dg-a" style="${R}"`:""}>${ee}${C}${M}</g>`}).join("");return{lanes:T,chips:`${x}${P}`}}var ce=t=>Math.round(t*100)/100,Mt=(t,n)=>Ie(n)?`${t} ${t}j`:t,It=t=>({...t,family:"sans"});function rr(t){let n=[];for(let l of t){let p=n[n.length-2],a=n[n.length-1];if(p&&a){let e=a[0]===p[0]?Number.NaN:(a[1]-p[1])/(a[0]-p[0]),s=l[0]===a[0]?Number.NaN:(l[1]-a[1])/(l[0]-a[0]);Number.isFinite(e)&&Number.isFinite(s)&&Math.abs(e-s)<1e-9?n[n.length-1]=l:n.push(l)}else n.push(l)}return n}function ir(t,n){let l=t[0];if(!l)return 0;if(n<=l[0])return l[1];for(let p=1;p<t.length;p++){let[a,e]=t[p],[s,r]=t[p-1];if(n<=a)return a===s?e:r+(e-r)*(n-s)/(a-s)}return t[t.length-1][1]}function or(t,n,l,p,a){let{m:e,ink:s}=p,r=v.time,{axis:o}=t,i=new Map((l.units??[]).map(M=>[M.unit,M.passed])),c=(M,R)=>l.events.find(D=>D.step===M&&D.event===R)?.at,m=(M,R)=>l.edges.find(D=>D.step===M&&D.event===R)?.drawn,f=[],d=[],u=[],k=[],h=Math.min(...t.rows.map(M=>M.y)),w=Math.max(...t.rows.map(M=>M.y+M.h)),g=new Map;for(let M of t.wires){let R=m(M.step,M.event);R!==void 0&&g.set(M.to,Math.min(g.get(M.to)??Number.POSITIVE_INFINITY,R))}let N=(M,R)=>{let D=t.zoom?.columns.find(Q=>Q.unit===R)?.boxes.find(Q=>Q.id===M),V=[i.get(R),D?g.get(D):void 0].filter(Q=>Q!==void 0);return V.length>0?Math.min(...V):void 0};for(let M of t.periods)M.index%2===1&&f.push(`<rect class="dg-tm-ep" x="${ce(M.x)}" y="${ce(h-r.shade)}" width="${ce(M.w)}" height="${ce(w-h+r.shade*2)}" rx="4"/>`);if(t.zoom){let M=t.zoom;M.columns.forEach((R,D)=>{D>0&&f.push(`<line class="dg-tm-sep" x1="${ce(R.x)}" y1="${ce(R.y+r.sep)}" x2="${ce(R.x)}" y2="${ce(R.y+R.h-r.sep)}"/>`),f.push(Se(s,Mt("dg-tm-hd",R.head),R.x+R.w/2,M.headY,R.head,q.timeHead,Ce,"middle"));for(let V of R.boxes)u.push(L(V,R.unit))})}function L(M,R){let D=[...new Set(t.wires.filter(re=>re.from===M||re.to===M).map(re=>re.step))].sort((re,I)=>re-I),V=re=>`<rect class="${re}" x="${ce(M.x)}" y="${ce(M.y)}" width="${ce(M.w)}" height="${M.h}" rx="${v.box.radius}"/>`;if(M.empty){let re=i.get(R),I=t.zoom?.empty??"",oe=re===void 0?"":`<g class="dg-a" style="${e.vis(re)}">${V("dg-tm-ex")}${Se(s,"dg-tm-ext",M.cx,M.cy+v.baseline.mark,I,q.emptyText,[[re,Number.POSITIVE_INFINITY]],"middle")}</g>`;return`<g data-empty="${$e(M.id)}">${V("dg-tm-ph")}${oe}</g>`}let Q=Pn(n.boxes.find(re=>re.id===M.id)?.link,On(M,p,D,a.get(M.id)??[]));if(!M.row)return Q;let U=N(M.row,R);return U===void 0?V("dg-tm-ph"):`<g class="dg-a" style="${e.until(U)}">${V("dg-tm-ph")}</g><g class="dg-popc dg-a" style="${e.pop(U)}">${Q}</g>`}for(let M of t.rows){let R=[];for(let D of t.marks.filter(V=>V.row===M.id)){let V=(U,re="")=>`<rect class="${U}" x="${ce(D.x)}" y="${ce(D.y)}" width="${ce(D.w)}" height="${ce(D.h)}" rx="${r.markRadius}"${re}/>`;if(R.push(V("dg-tm-slot")),D.empty){let U=i.get(D.unit);U!==void 0&&R.push(`<circle class="dg-tm-x dg-a" cx="${ce(D.x+D.w/2)}" cy="${ce(D.y+D.h/2)}" r="${r.emptyR}" style="${e.vis(U,e.last,{f:.2})}"/>`);continue}let Q=N(M.id,D.unit);Q!==void 0&&R.push(V("dg-tm-m dg-a",` style="${e.vis(Q,e.last,{f:.2})}"`)),D.colors.forEach((U,re)=>{let I=c(U.step,U.event);if(I===void 0)return;let oe=D.colors[re+1],le=oe?c(oe.step,oe.event):void 0;R.push(`<g style="${we(U.color)}">${V("dg-tm-m dg-a",` style="${e.vis(I,le??e.last,{f:.35})}"`)}</g>`)})}f.push(`<g data-row="${$e(M.id)}" style="${we(M.color)}">${R.join("")}</g>`),f.push(Se(s,"dg-tm-rn",v.margin+v.region.inset,M.y+M.h/2+v.baseline.mark,M.name,q.timeRow))}if(t.zoom){let M=t.zoom,R=t.spans.filter(Q=>Q.kind==="box"&&Q.from<=M.to&&M.from<=Q.to).map(Q=>c(Q.step,Q.event)).filter(Q=>Q!==void 0).sort((Q,U)=>Q-U)[0],D=M.guides.map(Q=>`<path class="dg-tm-gd" d="${rt(Q)}"/>`).join(""),V=`<rect class="dg-tm-fr" x="${ce(M.frame.x)}" y="${ce(M.frame.y)}" width="${ce(M.frame.w)}" height="${ce(M.frame.h)}" rx="4"/>${D}`;f.push(R===void 0?V:`<g class="dg-a" style="${e.until(R)}">${V}</g>`)}let F=M=>ce(o.x+M*o.unit),T=t.ticks.map(M=>`M ${F(M.at)} ${ce(o.line-r.major/2)} V ${ce(o.line+r.major/2)}`),j=t.minor.map(M=>`M ${F(M)} ${ce(o.line-r.minor/2)} V ${ce(o.line+r.minor/2)}`);f.push(`<path class="dg-tm-ax" d="M ${F(0)} ${ce(o.line)} H ${F(o.count)} ${[...T,...j].join(" ")}"/>`);for(let M of t.ticks)f.push(Se(s,Mt("dg-tm-tk",M.text),M.left,M.y,M.text,q.timeTick));for(let M of t.periods)f.push(Se(s,Mt("dg-tm-en",M.name),M.x+M.w/2,M.nameY,M.name,q.timePeriod,Ce,"middle")),f.push(Se(s,Mt("dg-tm-er",M.range),M.x+M.w/2,M.rangeY,M.range,q.timeRange,Ce,"middle"));for(let M of t.spans){let R=c(M.step,M.event);if(R===void 0)continue;let D=M.until===void 0?void 0:l.steps[M.until].start,V=[[R,D??Number.POSITIVE_INFINITY]],Q=D===void 0?e.vis(R):e.vis(R,D,{within:!0});if(M.kind==="bracket"){let[re,I,oe,le]=[ce(M.x+1),ce(M.x+M.w-1),ce(M.y),ce(M.y+M.h)],ye=Se(s,Mt("dg-tm-bt",M.text),M.textRect.x+M.textRect.w/2,M.textY,M.text,q.spanText,V,"middle");f.push(`<g class="dg-a" data-span="${M.step}" style="${we(M.color)};${Q}"><path class="dg-tm-br" d="M ${re} ${oe} L ${re} ${le} L ${I} ${le} L ${I} ${oe}"/>${ye}</g>`);continue}f.push(`<g class="dg-a" data-span="${M.step}" style="${we(M.color)};${Q}"><rect class="dg-tm-bx" x="${ce(M.x)}" y="${ce(M.y)}" width="${ce(M.w)}" height="${ce(M.h)}" rx="6"/></g>`);let U=M.textRect;s.push({text:M.text,rect:U,shown:V,boxed:!0}),k.push(`<g class="dg-tg dg-popc dg-a" style="${we(M.color)};${D===void 0?e.pop(R):e.pop(R,D)}"><rect x="${ce(U.x)}" y="${ce(U.y)}" width="${ce(U.w)}" height="${U.h}" rx="${U.h/2}"/><text x="${ce(U.x+U.w/2)}" y="${ce(M.textY)}" text-anchor="middle">${$e(M.text)}</text></g>`)}let x=r.point;for(let M of t.points){let{cx:R,cy:D,r:V}=M,Q=M.changes.map(ke=>c(ke.step,ke.event)??Number.POSITIVE_INFINITY),U=Q[0];f.push(`<path class="dg-tm-con" d="M ${ce(R)} ${ce(w+3)} L ${ce(R)} ${ce(D-V-2)}"/>`);let re=M.text.x,I=Se(s,Mt("dg-tm-pn",M.id),re,D+x.nameY,M.id,q.pointName),oe=I.replace(/class="([^"]*)"/u,'class="$1 dg-tm-pn-g"'),le=U===void 0||!Number.isFinite(U)?oe:`<g class="dg-a" style="${e.until(U)}">${oe}</g><g class="dg-a" style="${e.vis(U)}">${I}</g>`,ye=M.changes.map((ke,Me)=>{let E=Q[Me];if(!Number.isFinite(E))return"";let O=Q[Me+1],X=O!==void 0&&Number.isFinite(O)?O-ie.untilFade:void 0,S=Se(s,Mt("dg-tm-ps",ke.text),re,D+x.stateY,ke.text,q.pointState,[[E,X??Number.POSITIVE_INFINITY]]);return`<g class="dg-a" style="${we(ke.color??"slate")};${X===void 0?e.rise(E):e.rise(E,X)}">${S}</g>`}).join(""),ue=M.changes.map((ke,Me)=>{let E=Q[Me];return!ke.color||!Number.isFinite(E)?"":`<g class="dg-popc dg-a" style="${we(ke.color)};${e.pop(E)}"><circle class="dg-tm-pc" cx="${ce(R)}" cy="${ce(D)}" r="${V+.5}"/>${st("flag",R,D,x.glyph,"dg-tm-pcg")}</g>`}).join("");u.push(`<g data-point="${$e(M.id)}"><circle class="dg-tm-pg" cx="${ce(R)}" cy="${ce(D)}" r="${V}"/>${st("flag",R,D,x.glyph,"dg-tm-pgl")}${ue}${le}${ye}</g>`)}let P=new Set(t.wires.map(M=>`${M.step}/${M.event}`));for(let M of t.edges){if(P.has(`${M.step}/${M.event}`))continue;let R=l.edges.find(Q=>Q.step===M.step&&Q.event===M.event);if(!R)continue;p.traces.push({from:M.from,to:M.to,points:M.points,shown:[[R.start,Number.POSITIVE_INFINITY]]});let D=e.kf([[0,{opacity:0,"stroke-dashoffset":1}],[R.start,{opacity:0,"stroke-dashoffset":1},me.inOut],[R.start+.05,{opacity:1}],[R.drawn,{"stroke-dashoffset":0}],[e.last,{opacity:1,"stroke-dashoffset":0},me.inOut],[e.total,{opacity:0,"stroke-dashoffset":0}]]),V=e.kf([[0,{opacity:0}],[R.drawn-.05,{opacity:0}],[R.drawn,{opacity:1}],[e.last,{opacity:1},me.inOut],[e.total,{opacity:0}]]);d.push(`<g data-link="${$e(`${M.from}->${M.to}`)}" style="${we(M.color)}"><path class="dg-tm-ln dg-a" pathLength="1" d="${rt(M.points)}" style="${D}"/><path class="dg-eh-on dg-a" d="${Lt(M.points)}" style="${V}"/></g>`)}let b=l.needle??[],B=rr(b.filter(([M])=>M<e.total)),_=B[B.length-1]?.[1]??0,W=[...B.map(([M,R])=>[M,o.x+R*o.unit,0]),[e.last,o.x+_*o.unit,0],[e.total,o.x,0]],{y1:H,y2:ee}=t.needle,C=r.needle;return k.push(`<g class="dg-a" data-needle="" style="${e.move(W)}"><line class="dg-tm-nd" x1="0" y1="${ce(H)}" x2="0" y2="${ce(ee)}"/><path class="dg-tm-nh" d="M ${-C.head*.75} ${ce(H-C.head)} L ${C.head*.75} ${ce(H-C.head)} L 0 ${ce(H)} Z"/><circle class="dg-tm-nh" cy="${ce(o.line)}" r="${C.dot}"/></g>`),{base:f.join(""),lit:d.join(""),node:u.join(""),top:k.join("")}}function ar(t,n,l){let{m:p}=l,a=v.time.meter,{x:e,w:s,line:r,text:o}=t.meter,i=t.y+a.y,c=p.kf([...rr(n).map(([f,d])=>[f,{transform:`scaleX(${ce(d*1e3)/1e3})`}]),[p.last,{transform:`scaleX(${ce(ir(n,p.last)*1e3)/1e3})`},me.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="${a.h}" rx="${a.h/2}"/><rect class="dg-tm-mf dg-a" x="${ce(e)}" y="${ce(i)}" width="${ce(s)}" height="${a.h}" rx="${a.h/2}" style="${we(a.color)};${c}"/><line class="dg-tm-mk" x1="${ce(m)}" y1="${ce(i-a.mark)}" x2="${ce(m)}" y2="${ce(i+a.h+a.mark)}"/>`+Se(l.ink,"dg-tm-ml",m,t.y+a.textY,o,q.meterLine,Ce,"middle")}function lr(t,n,l,p,a,e){let s=n.steps[l],r=ir(n.needle??[],s.end-ie.still),o=t.axis.x+r*t.axis.unit,i=Math.min(...t.rows.map(k=>k.y)),c=Math.max(...t.rows.map(k=>k.y+k.h)),m={x:o-1,y:i,w:2,h:c-i},f=t.badges.find(k=>k.step===l),d=k=>Math.hypot(Math.max(0,k.x-o,o-k.x-k.w),Math.max(0,k.y-i,i-k.y-k.h)),u=[...f?[{x:f.x-v.badge.r,y:f.y-v.badge.r,w:v.badge.r*2,h:v.badge.r*2}]:[],...[...p].sort((k,h)=>d(k)-d(h))];for(let k of u){let h=Math.min(m.x,k.x),w=Math.min(m.y,k.y),g={x:h,y:w,w:Math.max(m.x+m.w,k.x+k.w)-h,h:Math.max(m.y+m.h,k.y+k.h)-w};g.w<=a&&g.h<=e&&(m=g)}return m}var it=t=>Math.round(t*100)/100;function pr(t,n,l,p){let{m:a}=p,e=v.tree,s=v.box,r=(T,j)=>l.edges.find(x=>x.step===T&&x.event===j),o=new Map,i=new Map;n.steps.forEach((T,j)=>{for(let x of T.events)if(x.type==="edge")for(let P of[x.from,x.to])o.set(P,(o.get(P)??new Set).add(j)),x.carry.kind!=="none"&&!i.has(P)&&i.set(P,j)});let c=(T,j)=>{let x=n.steps[T]?.events[j];return x?.type==="edge"&&x.carry.kind!=="none"},m=t.runs.filter(T=>c(T.step,T.event)).reduce((T,j)=>T===void 0?j.step:Math.min(T,j.step),void 0),f=m===void 0?void 0:l.steps[m]?.start,d=T=>{if(m===void 0||f===void 0)return;let j=i.get(T);if(j!==void 0&&j<=m)return;let x=j===void 0?void 0:l.steps[j]?.start,P=[[0,{opacity:1}],[f,{opacity:1},me.inOut],[f+ie.fade,{opacity:e.faint}]];return x!==void 0&&P.push([x,{opacity:e.faint},me.inOut],[x+ie.fade,{opacity:1}]),P.push([a.last,{opacity:x===void 0?e.faint:1},me.inOut],[a.total,{opacity:1}]),a.kf(P)},u=(T,j,x="")=>{let P=d(T);return P?`<g class="dg-a"${x} style="${P}">${j}</g>`:x===""?j:`<g${x}>${j}</g>`},k=new Map(t.nodes.map(T=>[T.id,r(T.step,T.event)?.drawn??0])),h=t.links.map(T=>{let j=r(T.step,T.event);if(!j)return"";p.traces.push({from:T.from,to:T.to,points:T.points,shown:[[j.start,Number.POSITIVE_INFINITY]]});let x=a.kf([[0,{opacity:0,"stroke-dashoffset":1}],[j.start,{opacity:0,"stroke-dashoffset":1},me.inOut],[j.start+.05,{opacity:1}],[j.drawn,{"stroke-dashoffset":0}],[a.last,{opacity:1,"stroke-dashoffset":0},me.inOut],[a.total,{opacity:0,"stroke-dashoffset":0}]]);return u(T.from,`<path class="dg-tree-l dg-a" data-tree-link="${$e(T.from)}" pathLength="1" d="${rt(T.points)}" style="${x}"/>`)}).join(""),w=t.nodes.flatMap(T=>{if(!T.card)return[];let j=k.get(T.id)??0,x=`M ${it(T.cx)} ${it(T.y+T.h+v.edge.inset)} V ${it(T.card.y-v.edge.inset)}`;return[u(T.id,`<path class="dg-tree-con dg-a" d="${x}" style="${a.vis(j)}"/>`)]}).join(""),g=new Set,N=t.runs.flatMap(T=>{let j=t.edges.find(H=>H.step===T.step&&H.event===T.event);if(!j||g.has(T.link))return[];let x=l.carriers.find(H=>H.step===T.step&&H.event===T.event),P=r(T.step,T.event),b=x?.depart??P?.start,B=x?.arrive??P?.drawn;if(b===void 0||B===void 0)return[];g.add(T.link);let _=a.kf([[0,{opacity:0,"stroke-dashoffset":1}],[b,{opacity:0,"stroke-dashoffset":1},me.inOut],[b+.05,{opacity:1}],[B,{"stroke-dashoffset":0}],[a.last,{opacity:1,"stroke-dashoffset":0},me.inOut],[a.total,{opacity:0,"stroke-dashoffset":0}]]),W=rt(j.points);return[`<g style="${we(j.color)}"><path class="dg-tree-tr dg-a" data-tree-trail="${$e(T.link)}" pathLength="1" d="${W}" style="${_}"/><path class="dg-tree-h dg-a" d="${Lt(j.points)}" style="${a.vis(B)}"/></g>`]}).join(""),L=t.nodes.flatMap(T=>{let j=T.card;if(!j)return[];let x=j.x+e.card.padX+e.card.icon/2,P=j.y+j.h/2,b=Se(p.ink,"dg-tree-ct",j.x+e.card.padX+e.card.icon+e.card.gap,P+v.baseline.label,j.text,q.treeCard,Ce);return[u(T.id,`<rect class="dg-tree-card" x="${it(j.x)}" y="${it(j.y)}" width="${it(j.w)}" height="${j.h}" rx="${e.card.radius}"/>${st("doc",x,P,e.card.glyph,"dg-tree-cg")}${b}`,` data-tree-card="${$e(T.id)}"`)]}).join(""),F=t.nodes.map(T=>{let j=k.get(T.id)??0,x=[...o.get(T.id)??[]].sort((R,D)=>R-D),P=x.length>0?Sn(p,x):void 0,b=T.root?e.root.radius:e.radius,B=(R,D="")=>`<rect class="${R}" x="${it(T.x)}" y="${it(T.y)}" width="${it(T.w)}" height="${T.h}" rx="${b}"${D}/>`,_=`${P?`<g class="dg-a" style="${P}">${B("dg-halo")}</g>`:""}${B("dg-st",` ${p.sh}`)}${P?`<g class="dg-a" style="${P}">${B("dg-on")}</g>`:""}`,W=T.x+e.root.iconX+s.icon/2,H=T.root?`<rect class="dg-ic" x="${it(W-s.icon/2)}" y="${it(T.cy-s.icon/2)}" width="${s.icon}" height="${s.icon}" rx="${s.iconRadius}"/>${st("tree",W,T.cy,s.iconScale)}`:"",ee=[[j,Number.POSITIVE_INFINITY]],C=T.lines.map((R,D)=>{let V=T.styles[D]??q.boxName,Q=V===q.treeHash?"dg-tree-hash":V===q.treeName?"dg-tree-name":V===q.rootHash?"dg-tree-rh":V===q.rootName?"dg-tree-rn":"dg-tree-one",U=T.baselines[D]??T.cy;return T.root?Se(p.ink,Q,T.x+e.root.textX,U,R,V,ee):Se(p.ink,Q,T.cx,U,R,V,ee,"middle")}).join(""),M=u(T.id,`${_}${H}${C}`,` data-tree-node="${$e(T.id)}"${T.root?` data-tree-root="${$e(T.id)}"`:""}`);return`<g class="dg-popc dg-a" style="${we(T.color)};${a.pop(j)}">${M}</g>`}).join("");return{links:h+w,trails:N,nodes:L+F,appear:k}}var cr=t=>Math.round(t*100)/100,Nn=class{constructor(n,l,p){this.prefix=n;this.total=l;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 l=`${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 a=[...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 ${l}{${a}}`),`animation-name:${l}`}vis(n,l=this.last,p={}){let a=p.f??ie.fade,e=p.on??{},s=p.off??{},r=p.within?Math.max(n+a,l-a):l;return this.kf([[0,{opacity:0,...s}],[n,{opacity:0,...s},p.ein??me.out],[n+a,{opacity:1,...e}],[r,{opacity:1,...e},me.inOut],[Math.min(r+a,this.total),{opacity:0,...s}],[this.total,{opacity:0,...s}]])}rise(n,l=this.last,p=!1){return this.vis(n,l,{on:{transform:"translateY(0)"},off:{transform:`translateY(${v.rise}px)`},within:p})}pop(n,l=this.last){return this.vis(n,l,{f:ie.popFade,ein:me.pop,on:{transform:"scale(1)"},off:{transform:`scale(${v.popFrom})`}})}until(n){let l=ie.untilFade;return this.kf([[0,{opacity:1}],[n,{opacity:1},me.inOut],[n+l,{opacity:0}],[this.last,{opacity:0}],[this.total,{opacity:1}]])}move(n,l=[]){return this.kf(n.map(([p,a,e,s=1,r])=>[p,{transform:`translate(${cr(a)}px,${cr(e)}px) scale(${s})`},r]).concat(l))}blink(n,l,p){return[[0,{opacity:0}],[n-.01,{opacity:0}],[n,{opacity:1}],[l,{opacity:1}],[l+p,{opacity:0}],[this.total,{opacity:0}]]}};var fe=t=>`font:${t.weight} ${t.size}px var(--${t.family})`,_e=(t,n="var(--surf)")=>`color-mix(in srgb,var(--c) ${t}%,${n})`,he=v.stroke,Ee=v.mix,zn=`color-mix(in srgb,var(--mute) ${Ee.past}%,var(--bg))`,ro=[".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{${fe(q.regionName)};fill:var(--ct)}`,`.dg-bx{${fe(q.regionNote)};fill:var(--mute)}`,".dg-st{fill:var(--surf);stroke:var(--hair)}",`.dg-halo{fill:none;stroke:var(--c);stroke-width:${he.halo};stroke-opacity:.16}`,`.dg-on{fill:none;stroke:var(--c);stroke-width:${he.on}}`,`.dg-ic{fill:${_e(Ee.icon)}}`,`.dg-slot{fill:none;stroke:${_e(Ee.slot,"transparent")};stroke-width:${he.slot};stroke-dasharray:3 3}`,`.dg-gl{fill:none;stroke:var(--c);stroke-width:${he.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-sn{${fe(q.boxName)};fill:var(--ink)}`,`.dg-ss{${fe(q.boxSub)};fill:var(--mute)}`,`.dg-ss-ok{${fe(q.boxSubStrong)};fill:var(--ct)}`,`.dg-ss-act{${fe(q.boxSubStrong)};fill:var(--ink)}`,`.dg-ll{stroke:var(--line);stroke-width:${he.lifeline};stroke-dasharray:3 4}`,`.dg-e{fill:none;stroke:var(--line);stroke-width:${he.edge};stroke-linecap:round;stroke-dasharray:0 ${v.edge.ghostDash}}`,`.dg-eh{fill:none;stroke:var(--line);stroke-width:${he.arrow};stroke-linecap:round;stroke-linejoin:round}`,`.dg-e-on{fill:none;stroke:var(--c);stroke-width:${he.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,`.dg-eh-on{fill:none;stroke:var(--c);stroke-width:${he.edgeOn};stroke-linecap:round;stroke-linejoin:round}`,`.dg-flow{fill:none;stroke:var(--surf);stroke-width:${he.flow};stroke-linecap:round;stroke-dasharray:1.5 ${v.edge.flowDash}}`,`.dg-e-past{fill:none;stroke:${zn};stroke-width:${he.edge};stroke-linecap:round}`,`.dg-eh-past{fill:none;stroke:${zn};stroke-width:${he.arrow};stroke-linecap:round;stroke-linejoin:round}`,".dg-bd{cursor:pointer}",".dg-bdf{fill:var(--c)}",`.dg-bdft{${fe(q.badge)};fill:var(--on-c)}`,`.dg-bdr{fill:none;stroke:var(--c);stroke-width:${he.badgeRing};pointer-events:none}`,`.dg-bdp{fill:${_e(Ee.badgePast)};stroke:${_e(Ee.badgePastEdge,"transparent")};stroke-width:${he.hair}}`,`.dg-bdpt{${fe(q.badge)};fill:var(--ct)}`,`.dg-bdp-g{fill:var(--surf);stroke:${zn};stroke-width:${he.hair}}`,`.dg-bdpt-g{${fe(q.badge)};fill:var(--mute)}`,`.dg-cap rect,.dg-act rect{fill:${_e(Ee.cap)};stroke:${_e(Ee.capEdge,"transparent")}}`,`.dg-cap text{${fe(q.label)};fill:var(--ct)}`,`.dg-capj text{${fe(q.labelJa)}}`,`.dg-cap-past text{${fe(q.label)};fill:var(--mute);fill-opacity:${v.state.pastLabel}}`,`.dg-cap-pastj text{${fe(q.labelJa)}}`,`.dg-act text{${fe(q.action)};fill:var(--ct)}`,".dg-car{fill:var(--carry,var(--ink))}",`.dg-car-t{${fe(q.carrier)};fill:var(--bg)}`,`.dg-car-tj{${fe(q.carrierJa)}}`,`.dg-env{fill:var(--carry,var(--ink));stroke:var(--surf);stroke-width:${he.envelope}}`,`.dg-env-in{fill:none;stroke:var(--surf);stroke-width:${he.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:${he.hair}}`,`.dg-sh{${fe(q.stripTitle)};fill:var(--ink)}`,`.dg-fl{${fe(q.fieldName)};fill:var(--mute)}`,`.dg-fv{${fe(q.fieldValue)};fill:var(--ink)}`,`.dg-fvj{${fe(q.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:${he.trail}}`,".dg-tr-fill{fill:var(--c)}",".dg-tg rect{fill:var(--c)}",`.dg-tg text{${fe(q.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{${fe(q.regionName)};fill:var(--ct)}`,`.dg-side-n{${fe(q.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:${he.path};stroke-linecap:round;stroke-dasharray:0 ${v.edge.ghostDash}}`,`.dg-path-h{fill:none;stroke:${_e(Ee.path,"transparent")};stroke-width:${he.arrow};stroke-linecap:round;stroke-linejoin:round}`,`.dg-path-t{${fe(q.label)};fill:var(--ct)}`,`.dg-path-tj{${fe(q.labelJa)}}`,".dg-start{fill:var(--ink)}",`.dg-end{fill:var(--bg);stroke:var(--ink);stroke-width:${he.end}}`,".dg-end-in{fill:var(--ink)}",`.dg-end-x{fill:var(--bg);stroke:${_e(Ee.path,"transparent")};stroke-width:${he.arrow};stroke-dasharray:2 2.5}`,`.dg-end-xi{fill:${_e(Ee.path,"transparent")}}`,`.dg-mark{${fe(q.regionNote)};fill:var(--mute)}`,`.dg-done{fill:var(--ink);stroke:var(--surf);stroke-width:${he.done}}`,`.dg-done-ck{fill:none;stroke:var(--surf);stroke-width:${he.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-git-l{fill:none;stroke:var(--c);stroke-width:${he.git};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,`.dg-git-cp{fill:none;stroke:var(--c);stroke-width:${he.gitOrphan};stroke-linecap:round;stroke-dasharray:3 3;stroke-opacity:.7}`,`.dg-git-c{fill:var(--surf);stroke:var(--c);stroke-width:${he.git}}`,`.dg-git-id{${fe(q.gitId)};fill:var(--ct)}`,`.dg-git-h{${fe(q.gitHash)};fill:var(--mute)}`,`.dg-git-n{${fe(q.gitNote)};fill:var(--ink2)}`,`.dg-git-old{fill:var(--surf);stroke:var(--c);stroke-width:${he.gitOrphan};stroke-dasharray:3 3;stroke-opacity:.6}`,`.dg-git-oldl{${fe(q.gitId)};fill:var(--ct);opacity:.55}`,`.dg-tree-l{fill:none;stroke:var(--line);stroke-width:${he.tree};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,`.dg-tree-tr{fill:none;stroke:var(--c);stroke-width:${he.treeTrail};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,`.dg-tree-h{fill:none;stroke:var(--c);stroke-width:${he.treeTrail};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tree-con{fill:none;stroke:var(--line);stroke-width:${he.treeCon};stroke-linecap:round;stroke-dasharray:2 3.5}`,`.dg-tree-card{fill:var(--surf);stroke:var(--hair);stroke-width:${he.hair}}`,`.dg-tree-cg{fill:none;stroke:var(--mute);stroke-width:${he.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tree-ct{${fe(q.treeCard)};fill:var(--ink)}`,`.dg-tree-hash{${fe(q.treeHash)};fill:var(--ink)}`,`.dg-tree-name{${fe(q.treeName)};fill:var(--mute)}`,`.dg-tree-one{${fe(q.boxName)};fill:var(--ink)}`,`.dg-tree-rh{${fe(q.rootHash)};fill:var(--ink)}`,`.dg-tree-rn{${fe(q.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{${fe(q.chip)};fill:var(--on-c)}`,`.dg-ln-tp{${fe(q.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:${he.stamp}}`,`.dg-ln-st{${fe(q.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:${he.hair};stroke-dasharray:2 4}`,`.dg-tm-hd{${fe(q.timeHead)};fill:var(--ink)}`,`.dg-tm-hdj{${fe(It(q.timeHead))}}`,`.dg-tm-slot{fill:none;stroke:var(--line);stroke-width:${he.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:${he.timeFrame};stroke-dasharray:3 2}`,`.dg-tm-gd{fill:none;stroke:color-mix(in srgb,var(--c-blue) ${Ee.timeGuide}%,transparent);stroke-width:${he.hair};stroke-dasharray:2 3}`,`.dg-tm-ax{fill:none;stroke:var(--line);stroke-width:${he.timeAxis}}`,`.dg-tm-tk{${fe(q.timeTick)};fill:var(--mute)}`,`.dg-tm-tkj{${fe(It(q.timeTick))}}`,`.dg-tm-en{${fe(q.timePeriod)};fill:var(--ink2)}`,`.dg-tm-er{${fe(q.timeRange)};fill:var(--mute)}`,`.dg-tm-erj{${fe(It(q.timeRange))}}`,`.dg-tm-rn{${fe(q.timeRow)};fill:var(--ink2)}`,`.dg-tm-br{fill:none;stroke:var(--c);stroke-width:${he.timeSpan};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tm-bt{${fe(q.spanText)};fill:var(--ct)}`,`.dg-tm-bx{fill:color-mix(in srgb,var(--c) ${Ee.timeSpan}%,transparent);stroke:var(--c);stroke-width:${he.timeSpan};stroke-dasharray:4 3}`,`.dg-tm-con{fill:none;stroke:var(--line);stroke-width:${he.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:${he.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tm-pc{fill:var(--surf);stroke:var(--c);stroke-width:${he.timePoint}}`,`.dg-tm-pcg{fill:none;stroke:var(--c);stroke-width:${he.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tm-pn{${fe(q.pointName)};fill:var(--ink)}`,`.dg-tm-pnj{${fe(It(q.pointName))}}`,".dg-tm-pn-g{fill:var(--mute)}",`.dg-tm-ps{${fe(q.pointState)};fill:var(--ct)}`,`.dg-tm-ln{fill:none;stroke:var(--c);stroke-width:${he.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,`.dg-tm-nd{stroke:var(--ink);stroke-width:${he.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:${he.timeFrame};stroke-dasharray:3 3}`,`.dg-tm-ext{${fe(q.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:${he.timeMeter}}`,`.dg-tm-ml{${fe(q.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{${fe(q.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:${he.badgeRing};vector-effect:non-scaling-stroke}`].join("");function io(t){let n=2166136261;for(let l=0;l<t.length;l++)n^=t.charCodeAt(l),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function oo(t){let n=new Map,l=(p,a)=>{n.set(p,(n.get(p)??new Set).add(a))};return t.steps.forEach((p,a)=>{for(let e of p.events)e.type==="edge"?(l(e.from,a),l(e.to,a)):(e.type==="action"||e.type==="swap")&&l(e.box,a)}),new Map([...n].map(([p,a])=>[p,[...a].sort((e,s)=>e-s)]))}function ao(t,n,l){let p=[],{whole:a}=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}),l&&o?.type==="action"){p.push({t:r.at,order:e++,box:o.box,act:o.label});let i=n.steps[r.step].end;(!a||i<=a.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(k=>k.box===r.id),d=[...f].reverse().find(k=>k.set!==void 0||typeof k.act=="string");a&&typeof d?.act=="string"&&f.push({t:a.start,order:e++,box:r.id,act:d.act});for(let k of f){k.set!==void 0&&(o=[k.set,"dg-ss-ok"],i=void 0),k.act!==void 0&&(i=k.act??void 0);let h=i!==void 0?[i,"dg-ss-act"]:o;h.join("|")!==c&&(c=h.join("|"),m.push([k.t,h[0],h[1]]))}let u=m.filter((k,h)=>{let w=m[h+1];return w===void 0||w[0]-k[0]>=ie.minShow});s.set(r.id,u)}return s}function lo(t,n,l){let p=new Map;for(let a of n.events){let e=t.steps[a.step]?.events[a.event];if(e?.type!=="strip")continue;let s=l.badges[a.step]?.color??"slate",r=p.get(e.field)??[],o=n.steps[a.step].end;r.push({at:a.at,color:s,step:a.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 po(t,n,l){if(t.until===void 0)return n;let{after:p,again:a,...e}=n;if(!p)return e;let s=l[t.until].start;return s>p.start?{...e,after:{start:p.start,end:Math.min(p.end,s)}}:e}function Jn(t,n,l,p,a,e,s=[],r=[]){let o=_t(p,a),i=io(`${JSON.stringify(t)}|${o}|${e?`${e.width}|${e.lang}`:""}`),c=new Nn(`dg${i}`,l.total,l.last),m={m:c,t:l,id:i,sh:`filter="url(#dg-sh-${i})"`,end:l.steps[l.steps.length-1].end,ink:s,traces:r},f=oo(t),d=ao(t,l,n.kind!=="sequence"),u={band:[],base:[],lit:[],node:[],badge:[],top:[]};for(let I of n.regions)u.band.push(Gs(I,s));let k=n.boxes.find(I=>I.ghost)?.color??"slate";n.side&&u.band.push(Xs(n.side,k,s));let h=(I,oe)=>n.boxes.find(le=>le.id===I&&(oe===void 0||le.ghost===oe))?.color;for(let I of n.paths)u.base.push(Ks(I,h(I.to,!0)??h(I.from)??k,s,r));for(let I of n.ends)u.node.push(zs(I,k,s));let w=n.kind==="state",g=new Map((l.states??[]).flatMap(I=>I.lit[0]?[[I.box,I.lit[0].start]]:[])),N=new Map((l.meters??[]).map(I=>[I.field,I.keys])),L=I=>I.meter?ar({...I,meter:I.meter},N.get(I.name)??[[0,0]],m):void 0;n.strip&&u.band.push(er(n.strip,lo(t,l,n),m,w,g,L));for(let I of n.lifelines)u.base.push(Us(I.x,I.y1,I.y2));if(ys(n)){let I=nr(n,t,l,m);u.base.push(I.links),u.lit.push(I.lines),u.node.push(I.commits),u.top.push(I.tags)}let F=zt(n)?n:void 0,T=F?pr(F,t,l,m):void 0;T&&(u.base.push(T.links),u.lit.push(T.trails),u.node.push(T.nodes));let j=new Set((F?.runs??[]).map(I=>`${I.step}/${I.event}`)),x=Fn(n)?n:void 0;if(x){let I=sr(x,t,l,m,d);u.base.push(I.lanes),u.node.push(I.chips)}let P=_n(n)?n:void 0;if(P){let I=or(P,t,l,m,d);u.base.push(I.base),u.lit.push(I.lit),u.node.push(I.node),u.top.push(I.top)}let b=new Set((P?.wires??[]).map(I=>`${I.step}/${I.event}`));for(let I of n.edges){let oe=l.edges.find(ue=>ue.step===I.step&&ue.event===I.event);if(!oe||P&&!b.has(`${I.step}/${I.event}`)||j.has(`${I.step}/${I.event}`))continue;let le=Math.max(T?.appear.get(I.from)??0,T?.appear.get(I.to)??0),ye=Js(I,oe,m,w,le);u.base.push(ye.base),u.lit.push(ye.lit)}let B=new Map((l.states??[]).map(I=>[I.box,I])),_=new Map(t.boxes.flatMap(I=>I.link===void 0?[]:[[I.id,I.link]])),W=(I,oe)=>Pn(_.get(I),oe);for(let I of P||x?[]:n.boxes){if(I.ghost){u.node.push(W(I.id,Ws(I,s)));continue}let oe=B.get(I.id);u.node.push(W(I.id,On(I,m,f.get(I.id)??[],d.get(I.id)??[],w?oe?.lit??[]:void 0))),oe?.done!==void 0&&u.node.push(Hs(I,oe.done,m))}for(let I of n.badges)u.badge.push(Qs(I,m,w));for(let I of n.labels){let oe=l.labels.find(le=>le.step===I.step&&le.event===I.event);oe&&u.top.push(Zs(I,po(I,oe,l.steps),m))}let{whole:H}=l;for(let I of n.actions){let oe=l.events.find(ye=>ye.step===I.step&&ye.event===I.event);if(!oe)continue;let le=l.steps[I.step].end;u.top.push(H&&le>H.start?Kn(I,oe.at,H.end,m):Kn(I,oe.at,le,m,H))}for(let I of l.carriers){let oe=n.edges.find(le=>le.step===I.step&&le.event===I.event);oe&&u.top.push(Tn(oe,F?{...I,start:I.depart,end:I.arrive+ie.fade}:I,m))}let ee=Object.values(u).map(I=>I.join("")).join(""),{near:C,far:M,nearY:R,farY:D}=v.shadow,V=`<filter id="dg-sh-${i}" x="-20%" y="-30%" width="140%" height="180%"><feDropShadow dx="0" dy="${R}" stdDeviation="${C}" style="flood-color:var(--sh);flood-opacity:var(--shA)"/><feDropShadow dx="0" dy="${D}" stdDeviation="${M}" style="flood-color:var(--sh);flood-opacity:var(--shB)"/></filter>`,Q=e&&n.kind==="sequence"?n.boxes.map(I=>W(I.id,Vs(I,m,f.get(I.id)??[],d.get(I.id)??[]))).join(""):"",U=e?fo(n,l,t,c,i,ee,e,Q):{body:`<rect class="dg-bg" width="${n.width}" height="${n.height}" rx="${v.region.radius}"/>${ee}`,w:n.width,h:n.height},re=`.dg-${i}{${Bt};--T:${l.total}s;${o}}${ro}${c.frames.join("")}`;return`<svg xmlns="http://www.w3.org/2000/svg" class="dg dg-${i}" viewBox="0 0 ${Math.ceil(U.w)} ${Math.ceil(U.h)}" width="${Math.ceil(U.w)}" height="${Math.ceil(U.h)}" role="img" aria-label="${$e(t.title)}" data-dragon="figure" data-view="${e?"follow":"fixed"}"><style>${re}</style><defs>${V}</defs>${U.body}</svg>`}function dr(t){let n=Math.min(...t.map(p=>p.x)),l=Math.min(...t.map(p=>p.y));return{x:n,y:l,w:Math.max(...t.map(p=>p.x+p.w))-n,h:Math.max(...t.map(p=>p.y+p.h))-l}}function co(t,n,l){let p=Un(t,n,l);return p.length===0?void 0:dr(p)}function mo(t,n,l,p){let a=v.badge.r+v.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-a,y:s-a,w:a*2,h:a*2};for(let i of[...n].sort((c,m)=>r(c)-r(m))){let c=dr([o,i]);c.w<=l&&c.h<=p&&(o=c)}return o}function Un(t,n,l){let p=[];for(let a of t.edges.filter(e=>e.step===l)){let e=a.points.map(r=>r[0]),s=a.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(a=>a.step===l),...t.actions.filter(a=>a.step===l)),zt(t)){let a=new Set((n.steps[l]?.events??[]).flatMap(e=>e.type==="edge"?[e.from,e.to]:[]));p.push(...t.nodes.filter(e=>e.step===l||a.has(e.id)));for(let e of t.links.filter(s=>s.step===l)){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(Fn(t)){let a=new Set((n.steps[l]?.events??[]).flatMap(e=>"box"in e?[e.box]:[]));p.push(...t.lanes.filter(e=>a.has(e.id)))}for(let a of n.steps[l]?.events??[]){let e=a.type==="edge"?[a.from,a.to]:a.type==="action"||a.type==="swap"?[a.box]:[];for(let s of e){let r=t.boxes.find(o=>o.id===s);r&&(t.kind==="architecture"||a.type==="swap")&&p.push(r)}}return p}function fo(t,n,l,p,a,e,s,r){let o=v.follow,i=v.mini,c=Math.max(1,s.width),m=Math.min(t.width,c),f=tt[s.lang].overview,d=O=>{let X=Math.min(i.w,m*.4,O*.4/t.height*t.width),S=X/t.width,K=t.height*S,y=Math.max(X,Math.ceil(pe(f,q.miniTitle)));return{vh:O,mw:X,k:S,mh:K,bw:y,bgW:y+i.pad*2,bgH:K+i.pad*2+i.title,beside:K>X}},u=d(Math.min(t.height,Math.max(o.minH,m*o.aspect))),k=u.beside&&c<o.narrow,h=s.height===void 0?Number.POSITIVE_INFINITY:u.beside?s.height:s.height-u.bgH-i.inset,{vh:w,mw:g,k:N,mh:L,bw:F,bgW:T,bgH:j,beside:x}=h<u.vh?d(Math.max(o.fitMinH,h)):{...u,vh:Number.isFinite(h)?Math.min(t.height,h):u.vh},P=x&&!k?Math.min(t.width,c-T-i.inset):m,b=O=>Math.min(t.width-P/2,Math.max(P/2,O)),B=r===""?0:Math.max(...t.boxes.map(O=>O.y+O.h))+o.headRoom,_=r===""?0:o.head.pad*2+o.head.h,W=w-_,H=O=>Math.min(t.height-W/2,Math.max(B+W/2,O)),ee=v.badge.r,C=[t.width/2,t.height/2],R=n.steps.map((O,X)=>{if(_n(t)){let A=lr(t,n,X,Un(t,l,X),P,W);return C=[A.x+A.w/2,A.y+A.h/2],[b(C[0]),H(C[1])]}let S=co(t,l,X);C=S?[S.x+S.w/2,S.y+S.h/2]:C;let K=[b(C[0]),H(C[1])],y=t.badges.find(A=>A.step===X);if(!y||Math.abs(y.x-K[0])<=P/2-ee&&Math.abs(y.y-K[1])<=W/2-ee)return K;let G=mo(y,Un(t,l,X),P,W);return C=[G.x+G.w/2,G.y+G.h/2],[b(C[0]),H(C[1])]}).map(([O,X])=>[O,X-_/2]),D=R[0],V=[[0,D[0],D[1]],[n.steps[0].start,D[0],D[1]]];R.forEach((O,X)=>{if(X===0)return;let S=R[X-1],K=n.steps[X].start;V.push([K,S[0],S[1],1,me.inOut],[K+o.ease,O[0],O[1]])});let Q=R[R.length-1];V.push([n.last,Q[0],Q[1],1,me.inOut],[n.total,D[0],D[1]]);let U=p.move(V.map(([O,X,S,K,y])=>[O,P/2-X,w/2-S,K,y])),re=x?P+i.inset:P-T-i.inset,I=x?0:w+i.inset,oe=re+i.pad,le=oe+(F-g)/2,ye=I+i.pad+i.title,ke=k?{clip:"",body:""}:(()=>{let O=[...t.regions.map(S=>`<rect class="dg-mm-band" style="${we(S.color)}" x="${le+S.x*N}" y="${ye+S.y*N}" width="${S.w*N}" height="${S.h*N}" rx="3"/>`),...t.boxes.map(S=>`<rect class="dg-mm-card" style="${we(S.color)}" x="${le+S.x*N}" y="${ye+S.y*N}" width="${S.w*N}" height="${S.h*N}" rx="1.5"/>`),...(zt(t)?t.nodes:[]).map(S=>`<rect class="dg-mm-card" style="${we(S.color)}" x="${le+S.x*N}" y="${ye+S.y*N}" width="${S.w*N}" height="${S.h*N}" rx="1.5"/>`)].join(""),X=p.move(V.map(([S,K,y,,G])=>[S,le+(K-P/2)*N,ye+(y-w/2)*N,1,G]));return{clip:`<clipPath id="dg-mm-${a}"><rect x="${le}" y="${ye}" width="${g}" height="${L}" rx="4"/></clipPath>`,body:`<rect class="dg-mm-bg" x="${re}" y="${I}" width="${T}" height="${j}" rx="${i.radius}"/><text class="dg-mm-t" x="${oe}" y="${ye-i.pad+2}">${f}</text><g clip-path="url(#dg-mm-${a})"><rect class="dg-mm-world" x="${le}" y="${ye}" width="${g}" height="${L}"/>${O}<rect class="dg-mm-vp dg-a"${_===0?"":` y="${_*N}"`} width="${P*N}" height="${(w-_)*N}" rx="2" style="${X}"/></g>`}})(),Me=_===0?"":`<g class="dg-hd"><rect class="dg-hd-bg" width="${P}" height="${_}"/><line class="dg-sep" x1="0" y1="${_}" x2="${P}" y2="${_}"/><g class="dg-a" style="${p.move(V.map(([O,X,,S,K])=>[O,P/2-X,0,S,K]))}">${r}</g></g>`;return{body:`<defs><clipPath id="dg-vp-${a}"><rect width="${P}" height="${w}" rx="${v.region.radius}"/></clipPath>${ke.clip}</defs><g clip-path="url(#dg-vp-${a})"><rect class="dg-vp-bg" width="${P}" height="${w}"/><g class="dg-a" style="${U}">${e}</g>${Me}</g><rect class="dg-vp-frame" x="0.5" y="0.5" width="${P-1}" height="${w-1}" rx="${v.region.radius}"/>${ke.body}`,w:x&&!k?P+i.inset+T:m,h:x?w:I+j}}function Zn(t,n){let l=rs(t.palette);if(!t.colors)return l;let p=tt[t.lang??"ja"],a=Object.entries(t.colors).flatMap(([e,s])=>is(e)?os(s)?[]:[p.unreadableColor(e)]:[p.unknownColor(e)]);if(a.length>0)throw new Error(p.cannotDraw(a.join(" / ")));return{...l,[n]:{...l[n],...t.colors}}}function mr(t,n={}){let l=n.lang??"ja",p=Ds(t,{lang:l});if(!p.ok)throw new Error(tt[l].cannotDraw(p.errors.map(s=>`${s.pointer} ${s.message}`).join(" / ")));let a=p.diagram,e=a.kind==="sequence"?ws(a):a.kind==="state"?ks(a,l):a.kind==="git"?bs(a):a.kind==="time"?Os(a,l):a.kind==="tree"?Ns(a):a.kind==="lineup"?xs(a):ms(a);return uo(a,e,Cs(a,n.still===!0),n)}function uo(t,n,l,p={}){let a=p.theme==="dark"?"dark":"light",e=Zn(p,a),s=[],r=[];return{svg:Jn(t,n,l,e,a,void 0,s,r),palette:e.id,theme:a,...t.view?{view:t.view}:{},fonts:{...jt},layout:n,timeline:l,diagram:t,overlaps:_s(s,l.stills,r)}}function Qn(t,n,l){let p=Math.max(0,n)/t.layout.width,e=(l===void 0?p:Math.min(p,Math.max(0,l)/t.layout.height))*q.boxName.size;return t.view?{mode:t.view,textPx:e}:{mode:e>=as?"fixed":"follow",textPx:e}}var En=t=>`font:${t.weight} ${t.size}px var(--${t.family})`,Ae=t=>`${t}px`;function ho(){let t=v.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(v.stroke.hair)} solid var(--hair);background:var(--surf);color:var(--ink);${En(q.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{${En(q.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{${En(q.stepTitle)};margin:0}`,`.dg-tb{${En(q.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(v.stroke.mark)};stroke-dasharray:${v.mark.dash} ${v.mark.gap};pointer-events:none}`].join("")}function go(t){if(t.getElementById("dragon-player-css"))return;let n=t.createElement("style");n.id="dragon-player-css",n.textContent=ho(),t.head.appendChild(n)}var Ct={prev:"\u2039",pause:"\u275A\u275A",play:"\u25B6",next:"\u203A"},fr="http://www.w3.org/2000/svg",ur=t=>String(t).padStart(2,"0"),yo=(t,n)=>`${ur(t+1)}/${ur(n)}`;function hr(t,n,l={}){let p=t.ownerDocument,a=p.defaultView,e=!!a?.matchMedia?.("(prefers-reduced-motion: reduce)").matches,s=mr(n,l),r=l.lang??"ja",o=tt[r],i=Zn(l,s.theme),{timeline:c}=s,m=s.diagram.steps,f=m.length;go(p);let d=p.createElement("div");d.className="dg-player",d.dataset.dragon="player",d.setAttribute("style",`${Bt};${_t(i,s.theme)}`);let u=p.createElement("div");u.className="dg-frame";let k=(Z,J,se)=>{let de=p.createElement("button");return de.type="button",de.className="dg-btn",de.dataset.dragon=Z,de.setAttribute("aria-label",J),de.textContent=se,de},h=k("prev",o.prev,Ct.prev),w=k("toggle",o.pause,Ct.pause),g=k("next",o.next,Ct.next),N=p.createElement("div");N.className="dg-btns",N.setAttribute("lang",r),N.append(h,w,g);let L=p.createElement("div");L.className="dg-say",L.setAttribute("aria-hidden","true");let F=p.createElement("div");F.className="dg-no",F.dataset.dragon="step-no";let T=p.createElement("div");T.className="dg-txt";let j=p.createElement("p");j.className="dg-tt",j.dataset.dragon="step-title";let x=p.createElement("p");x.className="dg-tb",x.dataset.dragon="step-body";let P=p.createElement("div");P.append(j,x),T.append(P);for(let Z of m){let J=p.createElement("div");J.className="dg-room",J.dataset.dragon="caption-room";let se=p.createElement("p");se.className="dg-tt",se.textContent=Z.title;let de=p.createElement("p");de.className="dg-tb",de.textContent=Z.body,J.append(se,de),T.append(J)}L.append(F,T);for(let Z of[F,j,x])Z.setAttribute("aria-hidden","true");let b=p.createElement("div");b.className="dg-row",b.append(N,L);let B=p.createElement("div");B.className="dg-bar",B.append(b);let _=p.createElement("ol");_.className="dg-sr",_.dataset.dragon="steps",_.setAttribute("aria-label",o.steps(s.diagram.title));for(let Z of m){let J=p.createElement("li"),se=p.createElement("strong");se.textContent=Z.title,J.append(se);for(let de of Z.body.split(`
3
- `)){let Pe=p.createElement("p");Pe.textContent=de,J.append(Pe)}if(Z.sources){let de=p.createElement("ul");for(let Pe of Z.sources){let qe=p.createElement("a");qe.href=Pe.url,qe.textContent=Pe.name;let Re=p.createElement("li");Re.append(qe),de.append(Re)}J.append(de)}_.append(J)}d.append(u,B,_),t.append(d);let W=()=>u.clientWidth||t.clientWidth||s.layout.width,H=()=>{if(!l.fitHeight||!a)return;let Z=a.getComputedStyle(u),J=u.clientHeight-(Number.parseFloat(Z.paddingTop)||0)-(Number.parseFloat(Z.paddingBottom)||0);return J>0?J:void 0},ee=Qn(s,W(),H()).mode,C=W(),M=H(),R=null,D=l.pausedAt===void 0?0:Math.min(f-1,Math.max(0,l.pausedAt)),V=!e&&l.pausedAt===void 0,Q=V?0:c.stills[D]??0,U=c.stills[f-1]??0,re=Date.now(),I=[],oe=()=>{if(!R)return;for(let se of R.querySelectorAll(".dg-spots"))se.remove();if(I.length===0)return;let Z=v.mark,J=p.createElementNS(fr,"g");J.setAttribute("class","dg-spots");for(let se of I){let de=p.createElementNS(fr,"rect");de.setAttribute("class","dg-spot"),de.setAttribute("x",String(se.x-Z.pad)),de.setAttribute("y",String(se.y-Z.pad)),de.setAttribute("width",String(se.w+Z.pad*2)),de.setAttribute("height",String(se.h+Z.pad*2)),de.setAttribute("rx",String(Z.radius)),J.append(de)}(R.querySelector('g[clip-path^="url(#dg-vp-"] > g.dg-a')??R).append(J)},le=Z=>{let J;if(Z!==void 0){let se=p.createElement("div");se.innerHTML=Z,J=se.querySelector("svg")}else J=R?R.cloneNode(!0):null;J&&(J.setAttribute("aria-hidden","true"),J.removeAttribute("role"),J.removeAttribute("aria-label"),J.style.setProperty("--at",String(Q)),J.style.setProperty("--play",V?"running":"paused"),J.dataset.motion=V?"play":"still",R?R.replaceWith(J):u.append(J),R=J,re=Date.now(),oe())},ye=()=>ee==="follow"?Jn(s.diagram,s.layout,c,i,s.theme,{width:C,...M===void 0?{}:{height:M},lang:r}):s.svg,ue=()=>V?(Q+(Date.now()-re)/1e3)%c.total:Q,ke=Z=>{let J=0;return c.steps.forEach((se,de)=>{se.start<=Z&&(J=de)}),J},Me=()=>{let Z=m[D];F.textContent=yo(D,f),j.textContent=Z?.title??"",x.textContent=Z?.body??"",w.setAttribute("aria-label",V?o.pause:o.play),w.textContent=V?Ct.pause:Ct.play,l.onStep?.(D)},E=(Z,J)=>{Q=Z,V=J,le(),Me()},O=Z=>{D=Math.min(f-1,Math.max(0,Z));let J=c.steps[D];E(V?J.start:c.stills[D]??J.start,V)},X=()=>{l.playOnce&&Q>=U&&(D=0,Q=0),E(Q,!0)};le(ye()),Me();let S=a?.setInterval(()=>{if(!V)return;if(l.playOnce&&Q+(Date.now()-re)/1e3>=U){D=f-1,E(U,!1);return}let Z=ke(ue());Z!==D&&(D=Z,Me())},120),K=()=>O(D-1),y=()=>O(D+1),G=()=>V?E(ue(),!1):X(),A=Z=>{let J=Z.target?.closest?.("[data-step]"),se=J?Number(J.getAttribute("data-step")):Number.NaN;Number.isInteger(se)&&O(se)};h.addEventListener("click",K),g.addEventListener("click",y),w.addEventListener("click",G),u.addEventListener("click",A);let z=a?.ResizeObserver,ae=z?new z(()=>{let Z=W(),J=H(),se=Qn(s,Z,J).mode;if(se===ee&&(ee==="fixed"||Z===C&&J===M))return;let de=ue();ee=se,C=Z,M=J,Q=de,le(ye())}):void 0;return ae?.observe(u),{get step(){return D},get playing(){return V},next:y,prev:K,play:()=>{V||X()},pause:()=>{V&&E(ue(),!1)},goTo:Z=>{V=!1,O(Z)},mark:Z=>{I=Z,oe()},destroy:()=>{S!==void 0&&a?.clearInterval(S),ae?.disconnect(),h.removeEventListener("click",K),g.removeEventListener("click",y),w.removeEventListener("click",G),u.removeEventListener("click",A),d.remove()}}}return kr(bo);})();
1
+ "use strict";var DragonPlayer=(()=>{var An=Object.defineProperty;var Sr=Object.getOwnPropertyDescriptor;var Mr=Object.getOwnPropertyNames;var Or=Object.prototype.hasOwnProperty;var Tt=(t,n)=>{for(var a in n)An(t,a,{get:n[a],enumerable:!0})},Tr=(t,n,a,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of Mr(n))!Or.call(t,l)&&l!==a&&An(t,l,{get:()=>n[l],enumerable:!(p=Sr(n,l))||p.enumerable});return t};var Nr=t=>Tr(An({},"__esModule",{value:!0}),t);var Mo={};Tt(Mo,{mountDiagram:()=>vr});var Vn={};Tt(Vn,{drawGit:()=>Cs,layoutGit:()=>ws});var ls={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"},Lr={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},qr=600,Ar=11904,Gt=1e3;function ps(t,n){return(t.codePointAt(0)??0)>=Ar?Gt:n==="mono"?qr:Lr[t]??Gt}var jr="paper",jn=Object.fromEntries(Object.entries(ls).map(([t,n])=>[t,{id:t,...n}]));function cs(t){return(t!==void 0&&Object.hasOwn(jn,t)?jn[t]:void 0)??jn[jr]}var Rr=["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"],Dr=new Set(Rr),ds=t=>Dr.has(t);function ms(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 Yt(t,n){return Object.entries(t[n]).map(([a,p])=>`--${a}:${p}`).join(";")}var Vt=`--sans:"${It.sans}";--mono:"${It.mono}"`,bt=["blue","amber","green","violet","rose"],ve=(t,n,a="sans")=>({size:t,weight:n,family:a}),q={boxName:ve(13,650),boxSub:ve(11,500),boxSubStrong:ve(11,700),regionName:ve(12.5,700),regionNote:ve(11,500),label:ve(11,600,"mono"),labelJa:ve(11,650),action:ve(11,650),badge:ve(10.5,700,"mono"),carrier:ve(10.5,700,"mono"),carrierJa:ve(10.5,700),stripTitle:ve(12.5,700),fieldName:ve(10.5,600),fieldValue:ve(12,600,"mono"),fieldValueJa:ve(12,600),tag:ve(10.5,700),miniTitle:ve(10.5,700),stepTitle:ve(15,700),stepBody:ve(13.5,500),stepNo:ve(13,700,"mono"),button:ve(14,700),gitId:ve(11,700),gitHash:ve(10.5,600,"mono"),gitNote:ve(10.5,650),treeHash:ve(13.5,700,"mono"),treeName:ve(10.5,600),rootHash:ve(15,700,"mono"),rootName:ve(11,700),treeCard:ve(11.5,650),chip:ve(10.5,700,"mono"),stamp:ve(11,700),timeHead:ve(11,650,"mono"),timeRow:ve(11,600),timeTick:ve(10.5,600,"mono"),timePeriod:ve(11.5,650),timeRange:ve(10.5,500,"mono"),pointName:ve(11,700,"mono"),pointState:ve(11.5,700),spanText:ve(11,650),emptyText:ve(11,700),meterLine:ve(10.5,700,"mono")},v={gap:10,margin:14,box:{h:72,minW:92,padX:12,radius:12,icon:24,iconRadius:7,iconY:-16,iconScale:.74,nameY:12,subY:27},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,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}},ie={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}},fs=10.5,me={inOut:"cubic-bezier(.65,0,.35,1)",out:"cubic-bezier(.22,1,.36,1)",pop:"cubic-bezier(.34,1.56,.64,1)"};var Kt=t=>Object.keys(t),Ao=Kt({sequence:!0,architecture:!0,state:!0,git:!0,time:!0,tree:!0,lineup:!0}),Nt=["start","finish"],Ir=["scale","period","row","point","zoom","mark","span"];var Cr=["leaf","node"],Fr=["item","line","seal","open","pick","stamp"],Rn=12;var jo=["group","end","box","strip","step","say","code","source","act","note","set","branch","commit",...Ir,...Cr,...Fr];var xt="HEAD";var Ro=Kt({coin:!0,none:!0}),Do=Kt({fixed:!0,follow:!0}),Io=Kt({above:!0,below:!0,left:!0,right:!0});var Ie=t=>[...t].some(n=>(n.codePointAt(0)??0)>=11904);function _r(t,n){return n==="mono"&&Ie(t)?"sans":n}function pe(t,n){let a=_r(t,n.family),p=0;for(let l of t)p+=ps(l,a);return p*n.size/Gt}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=In(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 In(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 v.box.minW;let l=[pe(p.name,q.boxName),pe(p.sub??"",q.boxSub)];for(let e of t.steps)for(let s of e.events)s.type==="swap"&&s.box===n&&l.push(pe(s.text,q.boxSubStrong)),a&&s.type==="action"&&s.box===n&&l.push(pe(s.label,q.boxSubStrong));return Math.max(v.box.minW,Math.max(...l)+v.box.padX*2)}function lt(t){let n=v.carrier;return t.kind==="tag"?[(pe(t.text,Ie(t.text)?q.carrierJa:q.carrier)+n.tagPadX*2)/2,n.tagH/2]:t.kind==="coin"?[n.coinR,n.coinR]:[n.envW/2,n.envH/2]}var us=t=>t.main+t.coin+(t.main>0&&t.coin>0?v.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?v.box.icon+v.slot.gap:0)+us(t)+v.slot.pad*2+v.box.padX+a:0}function Pt(t,n,a=v.box.padX){if(!n)return;let p=v.box,l=v.slot,e=us(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=v.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 Wt(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,k=1,h=(w,g)=>{if(w===0)return g>0;let N=g/w;return w<0?u=Math.max(u,N):k=Math.min(k,N),u<k};if(h(-f,o-p)&&h(f,e-o)&&h(-d,i-l)&&h(d,s-i))return!0}return!1}function Br(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}=v.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+v.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 Ht(t){let n=Math.max(...t.map(([l])=>l)),a=t[0][1],p=Math.max(...t.map(([,l])=>l));return[n+v.badge.r+v.badge.inset,a+(p-a)*v.state.loop.badgeAt]}function Xt(t,n){return{x:(t[0]?.[0]??0)-v.state.loop.w/2-n/2,y:Math.max(...t.map(([,a])=>a))+v.label.soft}}var Cn=v.state.loop.h+v.label.soft*2+v.label.h;function st(t,n=[],a=[]){let p=ut(t),l=p<v.badge.short?Math.min(v.badge.r+1,p/2):v.badge.along,e=v.badge.r*2+v.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 Gr(t,l,n,a)??et(t,l)}function Gr(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=v.badge.r*2;for(let k of[v.edge.arrowHalf,0])for(let h=1;h<=u+v.badge.inset;h++)for(let w of[1,-1]){let g=[e+f*h*w,s+d*h*w];if(a.every(([L,F])=>Math.max(Math.abs(g[0]-L),Math.abs(g[1]-F))>=u+1)&&p.every(L=>!Wt(L,Ye(g),-k)))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-v.badge.r,y:n-v.badge.r,w:v.badge.r*2,h:v.badge.r*2}),zt=t=>[t.x+v.state.text,t.y+v.baseline.mark],We=t=>Ie(t)?q.labelJa:q.label,Yr={above:"below",below:"above",left:"right",right:"left"};function Ze(t,n){let a=pe(t.text,We(t.text))+v.label.padX*2,p=v.label.h,l=Br(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}=v.label,i=t.offset??v.label.offset,c=h=>h==="above"?{x:e-a/2,y:s-i-p/2,w:a,h:p}:h==="below"?{x:e-a/2,y:s+i-p/2,w:a,h:p}:h==="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,Yr[r]]:[r],d=h=>n.hard.every(w=>wt(h,w)>=v.gap)&&n.soft.every(w=>wt(h,w)>=v.label.soft)&&(n.touch??[]).every(w=>wt(h,w)>=v.label.touch)&&(n.lines??[]).every(w=>!Wt(w,h,-v.label.touch)),{search:u,searchMax:k}=v.label;for(let h=0;h<=k;h+=u)for(let w of f){let g=w===r?m:c(w),N=w==="above"?[0,-1]:w==="below"?[0,1]:w==="left"?[-1,0]:[1,0],L=[Math.abs(N[1]),Math.abs(N[0])],F=t.slide??(w==="above"||w==="below"?a:p*4);for(let T=0;T<=F;T+=u)for(let j of T===0?[1]:[1,-1]){let x={x:g.x+N[0]*h+L[0]*T*j,y:g.y+N[1]*h+L[1]*T*j,w:a,h:p};if(d(x))return{...x,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 Fn(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 hs=(t,n)=>t.strip?.meters?.find(a=>a.field===n);function gs(t,n){if(hs(t,n))return Math.max(pe(n,q.fieldName),v.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)?q.fieldValueJa:q.fieldValue))),s.tag!==void 0&&(p=Math.max(p,pe(s.tag,q.tag)+v.strip.tagPadX*2)));let l=a+(p>0?(a>0?v.strip.tagGap:0)+p:0);return Math.max(pe(n,q.fieldName),l)}var Dn=t=>Math.max(pe(t.title,q.fieldName),t.states.length*v.strip.trail.step);function ze(t,n){if(!t.strip)return 0;let{titleX:a,fieldGap:p,pad:l}=v.strip,e=a+pe(t.strip.title,q.stripTitle)+p,s=[...t.strip.fields.map(r=>gs(t,r)),...n?[Dn(n)]:[]];return e+s.reduce((r,o)=>r+o+p,0)-p+l}function Ue(t,n,a,p,l){if(!t.strip)return;let{titleX:e,fieldGap:s,pad:r,line:o,h:i}=v.strip,c=e+pe(t.strip.title,q.stripTitle)+s,m=[],f=c,d=0,u=h=>{f>c&&f+h>p-r&&(f=c,d++);let w={x:n+f,y:a+d*o};return f+=h+s,w};for(let h of t.strip.fields){let w=gs(t,h),g=u(w),N=hs(t,h),L=N?Fn(N.line):void 0;m.push({name:h,...g,w,...N&&L!==void 0?{meter:{line:L,text:N.line,x:g.x,w:v.time.meter.w}}:{}})}let k=l?{...l,...u(Dn(l)),w:Dn(l)}:void 0;return{x:n,y:a,w:p,h:i+d*o,title:t.strip.title,fields:m,...k?{trail:k}:{}}}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}=v.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 Vr(t){let n=(t.git?.branches??[]).map(x=>x.id),a=x=>{n.includes(x)||n.push(x)};for(let x of t.steps)for(let P of x.events)(P.type==="commit"||P.type==="branch")&&a(P.branch);let p=new Map(n.map(x=>[x,null])),l=null,e=null,s=[],r=new Map,o=[],i=[],c=[],m=new Map,f=new Map,d=new Map,u=[...n,xt],k=new Map(u.map(x=>[x,[]])),h=[],w=x=>x===xt?e===null?l:null:p.get(x)??null,g=x=>{let P=m.get(x)??[],b=P.indexOf(null);return b<0?P.length:b},N=(x,P,b,B)=>{let _=new Map(u.map(C=>[C,w(C)])),K=l;b();let ee=u.filter(C=>_.get(C)!==w(C)).map(C=>{let M=d.get(C);return M&&(m.get(M.commit)[M.row]=null,d.delete(C)),{ref:C,slot:M}});for(let{ref:C,slot:M}of ee){let R=M??(C===xt&&K!==null?{commit:K,row:g(K)}:void 0),D=w(C),V;if(D!==null){V={commit:D,row:g(D)};let Q=m.get(D)??[];Q[V.row]=C,m.set(D,Q),f.set(D,Math.max(f.get(D)??0,Q.filter(U=>U!==null).length)),d.set(C,V)}i.push({ref:C,step:x,event:P,...R?{from:R}:{},...V?{to:V}:{},line:C===B})}},L=(x,P)=>{let b=new Set,B=[...p.values(),l].filter(_=>_!==null);for(;B.length>0;){let _=B.pop();b.has(_)||(b.add(_),B.push(...r.get(_)?.parents??[]))}for(let _ of s)!b.has(_.id)&&_.orphan===void 0&&(_.orphan={step:x,event:P})};t.steps.forEach((x,P)=>{x.events.forEach((b,B)=>{if(b.type==="commit")T(b,P,B);else if(b.type==="branch"){if(!r.has(b.from))return;F(b.from)!==b.branch&&o.push({kind:"branch",from:b.from,to:b.branch,step:P,event:B}),N(P,B,()=>{p.set(b.branch,b.from),e=b.branch,l=b.from})}else if(b.type==="edge"){let _=b.from;if(_!==xt&&!p.has(_)||!r.has(b.to))return;N(P,B,()=>{if(_===xt){e=null,l=b.to;return}p.set(_,b.to),e===_?l=b.to:e===null&&l===b.to&&(e=_)},_)}else return;L(P,B)});for(let b of u)k.get(b)?.push(b===xt?l:p.get(b)??null);h.push(e);for(let b of u){let B=d.get(b);B&&c.push({ref:b,step:P,slot:B})}});function F(x){return r.get(x)?.branch}function T(x,P,b){if(r.has(x.id))return;let B=x.copy!==void 0&&r.has(x.copy)?x.copy:void 0,_=B!==void 0&&e===null&&l!==null?l:p.get(x.branch)??null,K=x.merge!==void 0&&x.merge!==x.branch?p.get(x.merge)??void 0:void 0,W=[...new Set([_,K].filter(M=>M!=null))],ee={id:x.id,branch:x.branch,parents:W,...K!==void 0&&K!==_?{joined:K}:{},...B!==void 0?{copy:B}:{},...x.hash!==void 0?{hash:x.hash}:{},...x.note!==void 0?{note:x.note}:{},step:P,event:b};s.push(ee),r.set(ee.id,ee);for(let M of W)o.push({kind:"parent",from:M,to:ee.id,step:P,event:b});B!==void 0&&o.push({kind:"copy",from:B,to:ee.id,step:P,event:b});let C=e===null&&l===null;N(P,b,()=>{B===void 0?(p.set(x.branch,ee.id),e===x.branch&&(l=ee.id)):e===null&&(l=ee.id),C&&(e=x.branch,l=ee.id)})}let j=u.map(x=>({name:x,at:k.get(x)??[],...x===xt?{attached:h}:{}}));return{branches:n,made:s,links:o,moves:i,refs:j,tags:c,rows:f}}function Ut(t,n,a,p){let l=v.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 Kr(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 ys(t,n,a){let p=a>t.cy?1:-1,l=[t.cx,t.cy+p*t.r],e=Math.max(0,Math.min(v.git.turn,n-t.cx)),s=[t.cx+e,a],r=Ut(l,[l[0],l[1]+(a-l[1])*.7],[t.cx+e*.2,a],s);return[l,...r,...n>s[0]?[[n,a]]:[]]}function Wr(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(v.git.turn,n.cx-p[0])),s=[n.cx-e,t.cy],r=Ut(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 Hr(t,n){if(Math.abs(t.cy-n.cy)<.5){let s=t.cy-t.r,r=v.git.turn*.7;return[[t.cx,s],...Ut([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,...Ut(p,[p[0],p[1]+e],[l[0],l[1]-e],l)]}function ws(t){let{margin:n,gap:a,box:p,region:l,git:e,carrier:s}=v,r=Vr(t),o=new Map((t.git?.branches??[]).map(E=>[E.id,E.note])),i=new Map(r.branches.map((E,O)=>[E,O])),c=E=>e.colors[(i.get(E)??0)%e.colors.length],m=new Map,f=new Map;for(let E of r.made){let O=Math.max(0,...E.parents.map(X=>(m.get(X)??-1)+1),(f.get(E.branch)??-1)+1);m.set(E.id,O),f.set(E.branch,O)}let d=E=>[...E.hash!==void 0?[{text:E.hash,style:q.gitHash}]:[],...E.note!==void 0?[{text:E.note,style:q.gitNote}]:[]],u=E=>Math.max(0,...d(E).map(O=>pe(O.text,O.style))),k=E=>pe(E,Ie(E)?q.carrierJa:q.carrier)+s.tagPadX*2,h=Math.max(0,...r.refs.map(E=>k(E.name))),w=Math.max(e.pitch,...r.made.map(E=>u(E)+e.textGap),h+e.textGap),g=r.branches.map(E=>({w:Math.max(l.icon,pe(E,q.regionName),pe(o.get(E)??"",q.regionNote))})),N=n+l.inset+Math.max(0,...g.map(E=>E.w)),L=Math.max(e.r,...r.made.filter(E=>m.get(E.id)===0&&i.get(E.branch)===0).map(E=>u(E)/2),h/2),F=Math.max(e.x0,N+a+L),T=new Set(r.moves.flatMap(E=>{let O=t.steps[E.step]?.events[E.event];return E.line&&E.to&&O?.type==="edge"&&O.label!==void 0?[r.made.find(X=>X.id===E.to?.commit)?.branch??""]:[]})),j=E=>Math.max(0,...r.made.filter(O=>O.branch===E).map(O=>(r.rows.get(O.id)??0)-2))*e.row,x=r.made.some(E=>i.get(E.branch)===0&&d(E).length>0),P=[],b=n;r.branches.forEach((E,O)=>{let X=O===0,S=X&&x?e.tagTop:e.tag,H=b+(X?e.topLine-(e.tagTop-S):e.line)+j(E),y=H-b+(X?e.topBelow:T.has(E)?e.below:e.bare);P.push({id:E,x:n,y:b,w:0,h:y,line:H,color:c(E),tagBase:S}),b+=y+l.gap});let B=b-l.gap,_=new Map(P.map(E=>[E.id,E])),K=r.made.map(E=>{let O=_.get(E.branch),X=i.get(E.branch)===0,S=F+w*(m.get(E.id)??0)+(X?0:w/2),H=O.line,y=d(E),G=y.map((Z,J)=>X?H-e.above-(y.length-1-J)*e.lineStep:H+e.under+J*e.lineStep),A=y.map((Z,J)=>Ge(Z.text,S,G[J],Z.style,"middle")),z=A.length===0?void 0:{...Xr(A),lines:y.map(Z=>Z.text),baselines:G},ae=E.copy!==void 0?c(r.made.find(Z=>Z.id===E.copy)?.branch??E.branch):c(E.branch);return{id:E.id,branch:E.branch,color:ae,cx:S,cy:H,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}:{},...z?{text:z}:{},...E.orphan?{orphan:E.orphan.step,orphanEvent:E.orphan.event}:{}}}),W=new Map(K.map(E=>[E.id,E])),ee=r.links.flatMap(E=>{let O=W.get(E.from);if(!O)return[];if(E.kind==="branch"){if(!r.made.some(G=>G.branch===E.to))return[];let y=_.get(E.to);return[{...E,points:ys(O,O.cx+e.turn,y.line),color:c(E.to)}]}let X=W.get(E.to),S=r.made.find(y=>y.id===E.to),H;return E.kind==="copy"?H=Hr(O,X):Math.abs(O.cy-X.cy)<.5?H=[[O.cx+O.r,O.cy],[X.cx-X.r,X.cy]]:S?.joined===E.from?H=Wr(O,X):H=ys(O,X.cx-X.r,X.cy),[{...E,points:H,color:X.color}]}),C=(E,O)=>{let X=W.get(O.commit),S=_.get(X.branch)?.tagBase??e.tag,H=k(E);return{x:X.cx-H/2,y:X.cy-S-O.row*e.row-s.tagH/2,w:H,h:s.tagH}},M=E=>[E.x+E.w/2,E.y+E.h/2],R=r.moves.map(E=>{let O=E.from?C(E.ref,E.from):void 0,X=E.to?C(E.ref,E.to):void 0,S=t.steps[E.step]?.events[E.event],H=E.line&&S?.type==="edge"&&S.carry.kind!=="none"&&!(S.carry.kind==="tag"&&S.carry.text===S.from);return{ref:E.ref,step:E.step,event:E.event,...O?{from:O}:{},...X?{to:X}:{},...E.to?{target:E.to.commit}:{},...H?{carried:!0}:{},...E.line&&O&&X?{line:Kr(M(O),M(X))}:{},color:"slate"}}),D=r.tags.map(E=>({...C(E.ref,E.slot),ref:E.ref,step:E.step})),V=He(t),Q=Math.max(F,...K.flatMap(E=>[E.cx+E.r,...E.text?[E.text.x+E.text.w]:[]]),...D.map(E=>E.x+E.w),...R.flatMap(E=>[E.from,E.to].flatMap(O=>O?[O.x+O.w]:[]))),U=Q+e.boxGap,re=(P[1]??P[0])?.line??n+p.h/2,I=t.boxes.map((E,O)=>{let X=tt(t,E.id,!0),S=re+O*(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:V.get(E.id)??"slate",x:U,y:S-p.h/2,w:X,h:p.h,cx:U+X/2,cy:S}}),oe=P.map((E,O)=>{let X=o.get(E.id);return{id:E.id,lines:[E.id],...X!==void 0?{note:X}:{},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[O]?.w??0,h:l.nameY-l.inset+(X!==void 0?l.line:0)+a/2}}}),le={kind:"git",width:0,height:0,regions:oe,boxes:I,lifelines:[],edges:[],labels:[],actions:[],badges:[],paths:[],ends:[],lanes:P,commits:K,links:ee,tags:D,refs:r.refs,moves:R};le.badges=xs(t,le),le.labels=Jr(t,le);let ye=Math.max(Q,...I.map(E=>E.x+E.w),...le.labels.map(E=>E.x+E.w))+l.pad,ue=Math.max(ye+n,ze(t)+n*2);for(let E of oe)E.w=ue-n*2;for(let E of P)E.w=ue-n*2;let ke=Math.max(B,...I.map(E=>E.y+E.h),...le.labels.map(E=>E.y+E.h)),Me=Ue(t,n,ke+a,ue-n*2);return le.width=ue,le.height=(Me?Me.y+Me.h:ke)+n,Me&&(le.strip=Me),le.badges=xs(t,le),le}function Xr(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 zr(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 bs(t,n,a){let{r:p,inset:l}=v.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)>=v.label.touch))}function Ur(t,n,a){let{r:p,inset:l,along:e,short:s}=v.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)>=v.label.touch))return m}}function xs(t,n){let{inset:a}=v.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=zr(n,o),c=i?.target?bs(i.target,p,s):void 0;if(i&&(i.points||c)){let h=i.points,w=c??(h?Ur(h,p,s)??st(h,p,l.filter(g=>g!==h)):[0,0]);p.push(w),e.push({step:o,x:w[0],y:w[1],color:i.color});return}let m=r.events.flatMap(h=>h.type==="swap"||h.type==="action"?[h.box]:[]).map(h=>n.boxes.find(w=>w.id===h))[0];if(m){e.push({step:o,x:m.x,y:m.y,color:m.color});return}if(n.strip&&r.events.some(h=>h.type==="strip")){e.push({step:o,x:n.strip.x+a,y:n.strip.y+a,color:"slate"});return}let f=n.commits.find(h=>h.id===n.refs[0]?.at[o]),d=f?bs(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],k=n.lanes[0];e.push(u?{...u,step:o}:{step:o,x:(k?.x??0)+(k?.w??0)-a-v.badge.r,y:(k?.y??0)+a+v.badge.r,color:k?.color??"slate"})}),Xe(e)}function Jr(t,n){let a=v.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)?q.labelJa:q.label)+v.label.padX*2,[f]=r.line.reduce((g,N)=>[g[0]+N[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"),k=o.labelSide!==void 0?void 0:c?{x:f-m/2,y:i.cy-Math.max(d,(n.lanes[0]?.tagBase??a.tag)+v.carrier.tagH/2)-v.label.soft-v.label.h}:{x:f-m/2,y:i.cy+a.labelUnder},h=n.badges.filter(g=>g.step<=r.step).map(g=>Ye([g.x,g.y])),w=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,...k?{base:k}:{}},{hard:[...l,...n.boxes],soft:[...e,...w,...s,...p.filter(g=>g.step===r.step)],touch:h}))}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 _n=t=>/[0-9A-Za-z]$/u.test(t)?`${t} `:t,Zr=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)=>`${_n(t)}\u3068${_n(n)}\u304C\u91CD\u306A\u308B`,lineCrosses:(t,n,a)=>`\u7DDA ${t} \u2192 ${n} \u304C${_n(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)=>Zr(`${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]],Bn=.5,$s=(t,n)=>t.shown.some(([a,p])=>a<=n&&n<p),Gn=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 ks(t,n,a=[]){let p=[];return n.forEach((l,e)=>{let s=t.filter(o=>$s(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>Bn&&f>Bn&&p.push({kind:"texts",step:e,texts:[o.text,c.text],spots:[Gn(o),Gn(c)]})}});let r=a.filter(o=>$s(o,l));for(let o of s)if(!o.boxed)for(let i of r)Wt(i.points,o.rect,Bn)&&p.push({kind:"line",step:e,text:o.text,line:{from:i.from,to:i.to},spots:[Gn(o)]})}),p}var $e=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Jt=(t,n)=>t===void 0?n:`<a href="${$e(t)}">${n}</a>`,ne=t=>Math.round(t*100)/100,we=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?void 0:Ft[t];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(v.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}=v.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,family:"sans"});function Se(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}"`:""}>${$e(l)}</text>`}function vs(t,n){let a=[[0,{opacity:0}]];for(let[p,l]of n)a.push([p,{opacity:0},me.out],[p+ie.fade,{opacity:1}],[l-.1,{opacity:1},me.inOut],[l+.25,{opacity:0}]);return a.push([t.total,{opacity:0}]),t.kf(a)}function Zt(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 vs(t.m,a)}function Ps(t,n){let{radius:a,icon:p,iconRadius:l,iconScale:e,nameY:s,line:r}=v.region,{x:o,y:i}=t.header,c=t.lines.map((d,u)=>Se(n,"dg-bz",o,t.y+s+u*r,d,q.regionName)).join(""),m=t.note?Se(n,"dg-bx",o,t.y+s+t.lines.length*r+1,t.note,q.regionNote):"",f=t.icon&&Ft[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="${we(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 Qt(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-ie.untilFade):m===void 0?n.rise(r):n.rise(r,m-ie.untilFade);if(o==="")return"";let d=[[c===0?0:r,m===void 0?Number.POSITIVE_INFINITY:m-ie.untilFade]],u=i==="dg-ss"?q.boxSub:q.boxSubStrong,k=e===void 0?Se(l,i,t.cx,p,o,u,d,"middle"):Se(l,i,e-pe(o,u),p,o,u,d);return`<g${f?` class="dg-a" style="${f}"`:""}>${k}</g>`}).join("")}function Ss(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="${v.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 en(t,n,a,p,l){let{icon:e,iconRadius:s,iconScale:r,iconY:o,nameY:i,subY:c}=v.box,m=Qt(t,n.m,p,t.cy+c,n.ink),f=l?l.length>0?vs(n.m,l.map(h=>[h.start,h.end])):void 0:a.length>0?Zt(n,a):void 0,d=t.iconX??t.cx,u=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="${v.slot.radius}"/>`:"",k="";if(t.icon&&Ft[t.icon]){let h={x:d-e/2,y:t.cy+o-e/2,w:e,h:e};n.ink.push({text:`${t.name} \u306E\u7D75\u67C4`,rect:h,shown:Ce,boxed:!0,part:{kind:"icon",box:t.name}}),k=`<rect class="dg-ic" x="${ne(h.x)}" y="${ne(h.y)}" width="${e}" height="${e}" rx="${s}"/>${rt(t.icon,d,t.cy+o,r)}`}return`<g style="${we(t.color)}">${Ss(t,n,f,t.y,t.h)}${u}${k}${Se(n.ink,"dg-sn",t.cx,t.cy+i,t.name,q.boxName,Ce,"middle")}${m}</g>`}function Ms(t,n,a,p){let{pad:l,h:e,nameY:s,subY:r}=v.follow.head,o=Qt(t,n.m,p,l+r),i=a.length>0?Zt(n,a):void 0;return`<g style="${we(t.color)}">${Ss(t,n,i,l,e)}<text class="dg-sn" x="${ne(t.cx)}" y="${ne(l+s)}" text-anchor="middle">${$e(t.name)}</text>${o}</g>`}function Os(t,n){let{icon:a,iconRadius:p,iconScale:l,radius:e}=v.box,s=v.state.ghost,r=t.x+s.pad+a/2,o=t.x+s.pad+a+s.gap,i=t.icon&&Ft[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:v.baseline.mark,m=t.sub?Se(n,"dg-ss",o,t.cy+s.subY,t.sub,q.boxSub,Ce,"start"):"";return`<g data-ghost="${$e(t.id)}" style="${we(t.color)}"><rect class="dg-ghost" x="${ne(t.x)}" y="${ne(t.y)}" width="${ne(t.w)}" height="${t.h}" rx="${e}"/>${i}${Se(n,"dg-sn",o,t.cy+c,t.name,q.boxName,Ce,"start")}${m}</g>`}function Ts(t,n,a){let{r:p,inset:l}=v.state.done,e=t.x+t.w-l,s=t.y+l;return`<g class="dg-popc dg-a" data-done="${$e(t.id)}" style="${we(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 Ns(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?Se(a,`dg-path-t${l?" dg-path-tj":""}`,t.label.x+v.label.padX,t.label.y+t.label.h/2+v.baseline.label,t.label.text,l?q.labelJa:q.label):"";return`<g data-path="${$e(`${t.from}->${t.to}`)}" style="${we(n)}"><path class="dg-path" d="${it(t.points)}"/><path class="dg-path-h" d="${At(t.points)}"/>${e}</g>`}function Es(t,n,a){let{pad:p}=v.state.side,l=t.y+p+q.regionName.size,e=t.notes.map((s,r)=>Se(a,"dg-side-n",t.x+p,l+v.region.line*(r+1),s,q.regionNote)).join("");return`<g style="${we(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="${v.region.radius}"/>${Se(a,"dg-side-t",t.x+p,l,t.title,q.regionName)}${e}</g>`}function Ls(t,n,a){let{end:p}=v.state,l=zt(t),e=t.text===""?"":Se(a,"dg-mark",l[0],l[1],t.text,q.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="${we(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 qs(t,n,a){return`<line class="dg-ll" x1="${ne(t)}" y1="${ne(n)}" x2="${ne(t)}" y2="${ne(a)}"/>`}function As(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},me.inOut],[c+.4,{opacity:0}],[e.total,{opacity:0}]]:[[c,{opacity:1},me.inOut],[c+.4,{opacity:.45}],[a.end+.3,{opacity:.45},me.inOut],[a.end+1,{opacity:.95}],[e.last,{opacity:.95},me.inOut],[e.total,{opacity:0}]],f=e.kf([[0,{opacity:0,"stroke-dashoffset":1}],[o,{opacity:0,"stroke-dashoffset":1},me.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,k=e.kf([[0,{opacity:0,"stroke-dashoffset":0}],[i,{opacity:0,"stroke-dashoffset":0}],[i+.25,{opacity:.9}],[c-.1,{opacity:.9},me.inOut],[c+.2,{opacity:0,"stroke-dashoffset":u}],[e.total,{opacity:0,"stroke-dashoffset":u}]]),h=p?e.kf([[0,{opacity:0}],[c,{opacity:0},me.inOut],[c+.4,{opacity:1}],[e.last,{opacity:1},me.inOut],[e.total,{opacity:0}]]):"",w=`<path class="dg-e" d="${s}"/><path class="dg-eh" d="${r}"/>`;return{base:`${l>0?`<g class="dg-a" style="${e.vis(l)}">${w}</g>`:w}${p?`<path class="dg-e-past dg-a" d="${s}" style="${h}"/><path class="dg-eh-past dg-a" d="${r}" style="${h}"/>`:""}`,lit:`<g style="${we(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="${k}"/></g>`}}function js(t,n,a){let p=t.family==="sans"?" dg-capj":"",{radius:l}=v.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+v.baseline.label,t.family==="sans"?q.labelJa:q.label,"middle"),shown:[[n.after.start,n.after.end]]});let s=ne(t.x+t.w/2),r=ne(t.y+t.h/2+v.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">${$e(t.text)}</text></g>`:"",i=e.map(([c,m])=>`<g class="dg-cap${p} dg-a" style="${we(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">${$e(t.text)}</text></g>`);return`${o}${i.join("")}`}function Yn(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="${we(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="${v.action.radius}"/><text x="${ne(t.x+t.w/2)}" y="${ne(t.y+t.h/2+v.baseline.action)}" text-anchor="middle">${$e(t.text)}</text></g>`).join("")}function Qr(t,n){let a=v.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?q.carrierJa:q.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="${v.baseline.carrier}" text-anchor="middle">${$e(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 ei=t=>t<.5?4*t*t*t:1-(-2*t+2)**3/2;function tn(t,n,a){let{m:p}=a,l=v.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 T=0;T<=l;T++){let[j,x]=et(e,ei(T/l)*s);m.push([r+(o-r)*T/l,j,x])}let f=m[0],d=m[m.length-1],u=t.settle??[d[1],d[2]],k=[[0,f[1],f[2]],...m];t.settle&&k.push([Math.min(o+.3,Math.max(c,o+.01)),u[0],u[1]]),k.push([c,u[0],u[1]],[p.total,u[0],u[1]]);let[h,w]=lt(t.carry),g=t.carry.kind==="tag"?t.carry.text:t.carry.kind==="coin"?"\u786C\u8CA8":"\u5C01\u7B52",N=t.carry.kind==="tag"?{}:{part:{kind:t.carry.kind==="coin"?"coin":"envelope"}},L=T=>({x:T[0]-h,y:T[1]-w,w:h*2,h:w*2});r>i&&a.ink.push({text:g,rect:L([f[1],f[2]]),shown:[[i,r]],boxed:!0,...N}),a.ink.push({text:g,rect:L(u),shown:[[o,c]],boxed:!0,...N});let F=c<p.last?.05:.18;return`<g class="dg-a" style="${p.move(k,p.blink(i+.02,c,F))}">${Qr(t,a.sh)}</g>`}function Rs(t,n,a=!1){let{m:p}=n,l=n.t.steps[t.step],e=l.start,s=l.end,{r,ring:o}=v.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},me.pop],[e+.35,{opacity:1,transform:"scale(1)",...i}],[s,{opacity:1,transform:"scale(1)",...i},me.inOut],[s+(f?ie.untilFade:.4),{opacity:0,transform:"scale(1)",...c}],[p.total,{opacity:0,transform:"scale(.5)",...c}]]),u=m??p.last,k=f?p.kf([[0,{opacity:0,...c}],[p.total,{opacity:0,...c}]]):p.kf([[0,{opacity:0,...c}],[s,{opacity:0,...c},me.inOut],[s+.4,{opacity:1,...i}],[u,{opacity:1,...i},me.inOut],...m===void 0?[]:[[m+ie.untilFade,{opacity:0,...c}]],[p.total,{opacity:0,...c}]]),h=p.kf([[0,{opacity:0,transform:"scale(1)"}],[e+.05,{opacity:0,transform:"scale(1)"}],[e+.1,{opacity:.7,transform:"scale(1)"},me.out],[e+.9,{opacity:0,transform:"scale(2.3)"}],[p.total,{opacity:0,transform:"scale(1)"}]]),w=ne(t.x),g=ne(t.y),N=ne(t.y+v.baseline.badge),L=t.step+1;return n.ink.push({text:String(L),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="${we(t.color)}"><circle class="dg-bdr dg-popc dg-a" cx="${w}" cy="${g}" r="${o}" style="${h}"/><g class="dg-a" style="${k}"><circle class="${a?"dg-bdp-g":"dg-bdp"}" cx="${w}" cy="${g}" r="${o}"/><text class="${a?"dg-bdpt-g":"dg-bdpt"}" x="${w}" y="${N}" text-anchor="middle">${L}</text></g><g class="dg-popc dg-a" style="${d}"><circle class="dg-bdf" cx="${w}" cy="${g}" r="${r}"/><text class="dg-bdft" x="${w}" y="${N}" text-anchor="middle">${L}</text></g></g>`}function Ds(t,n,a,p=!1,l=new Map,e){let{m:s,sh:r}=a,o=v.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="${v.region.radius}" ${r}/>`,`<g style="${we("slate")}"><rect class="dg-bi" x="${ne(t.x+o.pad)}" y="${ne(i-o.icon/2)}" width="${o.icon}" height="${o.icon}" rx="${v.box.iconRadius}"/>${rt("env",t.x+o.pad+o.icon/2,i,.78)}</g>`,Se(a.ink,"dg-sh",t.x+o.titleX,i+v.baseline.stripTitle,t.title,q.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(Se(a.ink,"dg-fl",m.x,m.y+o.nameY,m.name,q.fieldName));let u=e?.(m);if(u!==void 0){c.push(u);return}let k=n.get(m.name)??[],h=k.filter(g=>g.value!==void 0),w=k.filter(g=>g.tag!==void 0);h.forEach((g,N)=>{let L=h[N+1]?.at,F=g.value,T=Ie(F)?"dg-fvj":"dg-fv";a.ink.push({text:F,rect:Ge(F,m.x,m.y+o.valueY,Ie(F)?q.fieldValueJa:q.fieldValue),shown:[[g.at,L===void 0?Number.POSITIVE_INFINITY:L-ie.untilFade]]});let j=B=>`<text class="${B}" x="${ne(m.x)}" y="${ne(m.y+o.valueY)}">${$e(F)}</text>`,x=j(T);if(!p){let B=L===void 0?s.rise(g.at):s.rise(g.at,L-ie.untilFade);c.push(`<g class="dg-a" style="${B}">${x}</g>`);return}let P=Math.min(g.until,L??g.until),b=`<circle class="dg-fl-now" cx="${ne(m.x+pe(m.name,q.fieldName)+o.now.gap)}" cy="${ne(m.y+o.nameY-q.fieldName.size/3)}" r="${o.now.r}"/>`;c.push(`<g class="dg-fv-now dg-a" data-step="${g.step}" style="${we(g.color)};${s.rise(g.at,P-ie.untilFade)}">${j(`${T} dg-fv-c`)}${b}</g>`),(L===void 0||L>P)&&c.push(`<g class="dg-a" style="${s.vis(P-ie.untilFade,L===void 0?s.last:L-ie.untilFade)}">${x}</g>`)}),w.forEach((g,N)=>{let L=w[N+1]?.at,F=g.tag,T=[...h].reverse().find(b=>b.at<=g.at+1e-9)?.value,j=m.x+(T?pe(T,Ie(T)?q.fieldValueJa:q.fieldValue)+o.tagGap:0),x=pe(F,q.tag)+o.tagPadX*2,P=m.y+o.valueY-o.tagH/2-v.baseline.tag;a.ink.push({text:F,rect:{x:j,y:P,w:x,h:o.tagH},shown:[[g.at,L===void 0?Number.POSITIVE_INFINITY:L-ie.untilFade]],boxed:!0}),c.push(`<g class="dg-tg dg-popc dg-a" style="${we(g.color)};${L===void 0?s.pop(g.at):s.pop(g.at,L-ie.untilFade)}"><rect x="${ne(j)}" y="${ne(P)}" width="${ne(x)}" height="${o.tagH}" rx="${o.tagH/2}"/><text x="${ne(j+x/2)}" y="${ne(P+o.tagH/2+v.baseline.tag)}" text-anchor="middle">${$e(F)}</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(Se(a.ink,"dg-fl",m.x,m.y+o.nameY,m.title,q.fieldName));let d=m.y+o.valueY-q.fieldValue.size/3;m.states.forEach((u,k)=>{let h=ne(m.x+o.trail.r+k*o.trail.step),w=l.get(u.box),g=w===void 0?"":`<circle class="dg-tr-fill dg-a" cx="${h}" cy="${ne(d)}" r="${o.trail.r}" style="${s.pop(w)}"/>`;c.push(`<g data-trail="${$e(u.box)}" style="${we(u.color)}"><circle class="dg-tr-ring" cx="${h}" cy="${ne(d)}" r="${o.trail.r}"/>${g}</g>`)})}return c.join("")}var pt=t=>Math.round(t*100)/100,Is=t=>[t.x+t.w/2,t.y+t.h/2];function ti(t,n){let a=v.carrier,p=Ie(t),l=pe(t,p?q.carrierJa:q.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="${v.baseline.carrier}" text-anchor="middle">${$e(t)}</text>`}function Cs(t,n,a,p){let{m:l}=p,e=v.git,s=(d,u)=>a.edges.find(k=>k.step===d&&k.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 k=it(d.points);if(d.kind==="copy")return`<g style="${we(d.color)}"><path class="dg-git-cp dg-a" d="${k}" style="${l.vis(u.start,l.last)}"/></g>`;let h=l.kf([[0,{opacity:0,"stroke-dashoffset":1}],[u.start,{opacity:0,"stroke-dashoffset":1},me.inOut],[u.start+.05,{opacity:1}],[u.drawn,{"stroke-dashoffset":0}],[l.last,{opacity:1,"stroke-dashoffset":0},me.inOut],[l.total,{opacity:0,"stroke-dashoffset":0}]]);return`<g style="${we(d.color)}"><path class="dg-git-l dg-a" pathLength="1" d="${k}" style="${h}"/></g>`}).join(""),o=t.commits.map(d=>{let u=s(d.step,d.event)?.drawn??0,k={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:k,shown:[[u,Number.POSITIVE_INFINITY]],boxed:!0});let h=(d.text?.lines??[]).map((T,j)=>{let x=j===0&&d.hash!==void 0,P=d.text?.baselines[j]??d.cy;return Se(p.ink,x?"dg-git-h":"dg-git-n",d.cx,P,T,x?q.gitHash:q.gitNote,[[u,Number.POSITIVE_INFINITY]],"middle")}).join(""),w=`<text class="dg-git-id" x="${pt(d.cx)}" y="${pt(d.cy+v.baseline.badge)}" text-anchor="middle">${$e(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}/>${w}</g>`,N=h===""?"":`<g class="dg-a" style="${l.vis(u)}">${h}</g>`,L=d.orphan===void 0?void 0:s(d.orphan,d.orphanEvent??0)?.drawn,F=L===void 0?"":`<g class="dg-a" data-orphan="${$e(d.id)}" style="${l.vis(L,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+v.baseline.badge)}" text-anchor="middle">${$e(d.id)}</text></g>`;return`<g data-commit="${$e(d.id)}" style="${we(d.color)}">${g}${N}${F}</g>`}).join(""),i=t.moves.flatMap(d=>{let u=s(d.step,d.event);if(!d.line||!u)return[];let k=a.steps[d.step].end;p.traces.push({from:d.ref,to:d.target??d.ref,points:d.line,shown:[[u.start,k+.4]]});let h=l.kf([[0,{opacity:0,"stroke-dashoffset":1}],[u.start,{opacity:0,"stroke-dashoffset":1},me.inOut],[u.start+.05,{opacity:1}],[u.drawn,{"stroke-dashoffset":0}],[k,{opacity:1},me.inOut],[k+.4,{opacity:0}],[l.total,{opacity:0,"stroke-dashoffset":0}]]);return[`<g style="${we(d.color)}"><path class="dg-e-on dg-a" pathLength="1" d="${it(d.line)}" style="${h}"/></g>`]}).join(""),c=a.carriers.flatMap(d=>{let u=t.moves.find(w=>w.step===d.step&&w.event===d.event&&w.line),k=n.steps[d.step]?.events[d.event];if(!u?.line||k?.type!=="edge")return[];let h={step:d.step,event:d.event,from:u.ref,to:u.target??u.ref,points:u.line,color:u.color,carry:k.carry};return[tn(h,{...d,start:d.depart,end:d.arrive+ie.fade},p)]}).join(""),f=[...new Set(t.moves.map(d=>d.ref))].map(d=>ni(d,t.moves.filter(u=>u.ref===d),s,p)).join("")+c;return{links:r,lines:i,commits:o,tags:f}}function ni(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:k,drawn:h}=u,w=d.from?Is(d.from):void 0,g=d.to?Is(d.to):void 0;if(i(k),d.carried&&w&&g&&r){e.push([k+ie.fade,w[0],w[1]],[h-ie.fade,g[0],g[1]]),s.push([k,{opacity:1},me.inOut],[k+ie.fade,{opacity:0}],[h-ie.fade,{opacity:0},me.out],[h,{opacity:1}]),o={rect:d.to,since:h};continue}if(w&&e.push([k,w[0],w[1]]),g&&e.push([h,g[0],g[1]]),g&&!r){let N=w?k:h-ie.fade;s.push([N,{opacity:0},me.out],[N+ie.fade,{opacity:1}]),r=!0}else!g&&r&&(s.push([h,{opacity:1},me.inOut],[h+ie.untilFade,{opacity:0}]),r=!1);d.to&&(o={rect:d.to,since:h})}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},me.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="${$e(t)}" style="${f}">${ti(t,p.sh)}</g>`}var Wn={};Tt(Wn,{drawLineup:()=>_s,layoutLineup:()=>Fs});function si(t,n,a){let p=t.steps.flatMap(l=>l.events.flatMap(e=>e.type==="swap"&&e.box===n?[pe(e.text,q.boxSubStrong)]:[]));return a===void 0?p:[pe(a,q.boxSub),...p]}function Fs(t){let{margin:n,gap:a,lineup:p}=v,l=t.lineup?.items??[],e=new Set(l.map(P=>P.id)),s=Math.max(p.chip.w,...l.map(P=>P.label===void 0?0:pe(P.label,q.chip)+p.chip.padX*2)),r=s+p.chip.gap,o=r*Rn-p.chip.gap,i=t.boxes.map(P=>pe(P.name,q.boxName)+p.textGap+Math.max(0,...si(t,P.id,P.sub))),c=Math.max(o+p.padX*2,...i.map(P=>P+p.padX*2),ze(t)),m=He(t),f=t.boxes.map((P,b)=>{let B=n+b*(p.h+a),_=B+p.textY,K=n+c-p.padX;return{id:P.id,name:P.name,...P.sub!==void 0?{sub:P.sub}:{},color:m.get(P.id)??"slate",x:n,y:B,w:c,h:p.h,cx:n+c/2,cy:B+p.h/2,title:{...Ge(P.name,n+p.padX,_,q.boxName),text:P.name,baseline:_},...P.sub!==void 0?{note:{...Ge(P.sub,K-pe(P.sub,q.boxSub),_,q.boxSub),text:P.sub,baseline:_}}:{},noteRight:K,track:{x:n+p.padX,y:B+p.trackY,w:o,h:p.chip.h}}}),d=new Map(f.map(P=>[P.id,P])),u=[],k=[],h=[],w=[],g=new Map,N=new Map,L;t.steps.forEach((P,b)=>{let B=[...g.values()].flat();P.events.forEach((_,K)=>{if(_.type!=="line"&&_.type!=="seal"&&_.type!=="open"&&_.type!=="pick"&&_.type!=="stamp")return;let W=d.get(_.box);if(!W)return;let ee={step:b,event:K};if(_.type==="seal"&&!N.has(W.id)){let{over:C}=p.seal,M={...ee,lane:W.id,x:W.track.x-C,y:W.track.y-C,w:W.track.w+C*2,h:W.track.h+C*2};k.push(M),N.set(W.id,M)}else if(_.type==="open"){let C=N.get(W.id);C&&(C.until=ee),N.delete(W.id)}else if(_.type==="pick"&&L!==W.id)w.push({...ee,lane:W.id}),L=W.id;else if(_.type==="stamp"){let C=pe(_.text,q.stamp)+p.stamp.padX*2;h.push({...ee,lane:W.id,text:_.text,x:W.x+W.w-p.padX-C,y:W.track.y+(W.track.h-p.stamp.h)/2,w:C,h:p.stamp.h})}else if(_.type==="line"){let C=g.get(W.id)??[],R=[...new Set(_.items)].filter(D=>e.has(D)).slice(0,Rn).map((D,V)=>{let Q=C.find(oe=>oe.id===D);if(Q?.index===V)return Q;let U=B.filter(oe=>oe.id===D),re=Q??U.find(oe=>oe.lane===L)??U.at(-1),I={...ee,id:D,lane:W.id,index:V,x:W.track.x+r*V,y:W.track.y,w:s,h:p.chip.h,...re?{from:[re.x,re.y]}:{}};return u.push(I),I});for(let D of C)R.includes(D)||(D.until=ee);g.set(W.id,R)}})});let F={kind:"lineup",width:0,height:0,regions:[],boxes:f,lifelines:[],edges:[],labels:[],actions:[],badges:[],paths:[],ends:[],lanes:f,chips:u,seals:k,stamps:h,picks:w},T=Math.max(...f.map(P=>P.y+P.h),n),j=c+n*2,x=Ue(t,n,T+a,j-n*2);return F.width=j,F.height=(x?x.y+x.h:T)+n,x&&(F.strip=x),F.badges=ri(t,F),F}function ri(t,n){let{inset:a}=v.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,v.margin,v.margin,n.lanes[0]?.color??"slate")}),Xe(p)}var Fe=t=>Math.round(t*100)/100,Kn=(t,n,a=1)=>`translate(${Fe(t)}px,${Fe(n)}px) scale(${a})`,ii=(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 _s(t,n,a,p,l){let{m:e}=p,s=v.lineup,r=ie.lineup.cut,o=b=>a.edges.find(B=>B.step===b.step&&B.event===b.event)??{start:0,drawn:0},i=new Map((n.lineup?.items??[]).map(b=>[b.id,b])),c=new Map(t.lanes.map(b=>[b.id,[]])),m=new Set,f=(b,B,_)=>{m.has(b)!==_&&(_?m.add(b):m.delete(b),c.get(b)?.push([B,_]))};for(let b of[...a.edges].sort((B,_)=>B.start-_.start)){let B=n.steps[b.step]?.events[b.event];if(B?.type==="line"&&f(B.box,b.start,!1),B?.type==="pick")for(let _ of t.lanes)f(_.id,b.start,_.id!==B.box)}let d=b=>{let B=c.get(b)??[];if(B.length===0)return;let _=[[0,{opacity:1}]],K=1;for(let[W,ee]of B){let C=ee?s.faint:1;_.push([W,{opacity:K},me.inOut],[W+ie.fade,{opacity:C}]),K=C}return _.push([e.last,{opacity:K},me.inOut],[e.total,{opacity:1}]),e.kf(_)},u=b=>[o(b).drawn,b.until?o(b.until).start:Number.POSITIVE_INFINITY],k=b=>{if(b.length===0)return;let B=[[0,{opacity:1}]];for(let _ of b){let[K,W]=u(_);B.push([K,{opacity:1}],[K+r,{opacity:0}]),_.until&&B.push([W,{opacity:0}],[W+r,{opacity:1}])}return B.push([e.total-r,{opacity:b.at(-1)?.until?1:0}],[e.total,{opacity:1}]),e.kf(B)},h=b=>{let{start:B,drawn:_}=o(b),K={opacity:0,transform:"scaleX(0)"},W=b.until?[[o(b.until).start,{opacity:1},me.inOut],[o(b.until).start+ie.fade,{opacity:0}],[e.total,{opacity:0}]]:[[e.last,{opacity:1},me.inOut],[e.total,{opacity:0}]];return e.kf([[0,K],[B-r,K],[B,{opacity:1,transform:"scaleX(0)"},me.inOut],[_,{transform:"scaleX(1)"}],...W])},w=b=>{if(!b.until)return;let B=b.until,_=t.chips.find(K=>K!==b&&K.id===b.id&&K.step===B.step&&K.from?.[0]===b.x&&K.from?.[1]===b.y);return _?{at:o(_).start,moved:!0}:{at:o(B).start,moved:!1}},g=b=>{let B=o(b).start,_=Kn(0,0),K=[];if(b.from){let ee=Kn(b.from[0]-b.x,b.from[1]-b.y);K.push([0,{opacity:0,transform:ee}],[B-r,{opacity:0,transform:ee}],[B,{opacity:1,transform:ee},me.inOut],[B+ie.lineup.slide,{transform:_}])}else{let ee=Kn(0,0,v.popFrom);K.push([0,{opacity:0,transform:ee}],[B,{opacity:0,transform:ee},me.pop],[B+ie.popFade,{opacity:1,transform:_}])}let W=w(b);return W?K.push([W.at,{opacity:1},me.inOut],[W.at+(W.moved?r:ie.fade),{opacity:0}],[e.total,{opacity:0}]):K.push([e.last,{opacity:1},me.inOut],[e.total,{opacity:0}]),e.kf(K)},N=(b,B)=>{let _=i.get(b.id),K=_?.color,W=`<rect class="${K?"dg-ln-chip":"dg-ln-plain"}" x="${Fe(b.x)}" y="${Fe(b.y)}" width="${Fe(b.w)}" height="${b.h}" rx="${s.chip.radius}"/>`,ee=ii([o(b).start+ie.lineup.slide,w(b)?.at??Number.POSITIVE_INFINITY],B),C=_?.label===void 0?"":Se(p.ink,K?"dg-ln-t":"dg-ln-tp",b.x+b.w/2,b.y+b.h/2+v.baseline.tag,_.label,q.chip,ee,"middle");return`<g class="dg-popc dg-a" data-lineup-chip="${$e(b.id)}" data-lineup-on="${$e(b.lane)}" data-lineup-seat="${b.index}" style="${K?`${we(K)};`:""}${g(b)}">${W}${C}</g>`},L=(b,B,_)=>`<g class="dg-a" data-lineup-ring="${$e(b.lane)}" style="${e.vis(o(b).start,B?o(B).start:e.last)}">${_}</g>`,F=new Map(t.lanes.map(b=>[b.id,d(b.id)])),T=t.lanes.map(b=>{let B=(ee,C="")=>`<rect class="${ee}" x="${Fe(b.x)}" y="${Fe(b.y)}" width="${Fe(b.w)}" height="${b.h}" rx="${s.radius}"${C}/>`,_=t.picks.flatMap((ee,C)=>ee.lane===b.id?[L(ee,t.picks[C+1],`${B("dg-halo")}${B("dg-on")}`)]:[]).join(""),K=Qt(b,e,l.get(b.id)??[],b.title.baseline,p.ink,b.noteRight),W=F.get(b.id);return`<g${W?' class="dg-a"':""} data-lineup-lane="${$e(b.id)}" style="${we(b.color)}${W?`;${W}`:""}">${B("dg-st",` ${p.sh}`)}${_}${Se(p.ink,"dg-sn",b.title.x,b.title.baseline,b.name,q.boxName,Ce)}${K}</g>`}).join(""),j=s.seal.stripe,x=`<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>`,P=t.lanes.map(b=>{let B=t.seals.filter(D=>D.lane===b.id),_=B.map(u),K=t.chips.filter(D=>D.lane===b.id).map(D=>N(D,_)).join(""),W=k(B),ee=`<g${W?' class="dg-a"':""} data-lineup-track="${$e(b.id)}"${W?` style="${W}"`:""}>${K}</g>`,C=B.map(D=>`<rect class="dg-ln-seal dg-a" data-lineup-seal="${$e(b.id)}" x="${Fe(D.x)}" y="${Fe(D.y)}" width="${Fe(D.w)}" height="${Fe(D.h)}" rx="${s.seal.radius}" fill="url(#dg-seal-${p.id})" style="${h(D)}"/>`).join(""),M=t.stamps.filter(D=>D.lane===b.id).map(D=>{let V=o(D).start,Q=D.x+D.w/2,U=D.y+D.h/2,re=Se(p.ink,"dg-ln-st",Q,U+v.baseline.tag,D.text,q.stamp,[[V,Number.POSITIVE_INFINITY]],"middle");return`<g class="dg-popc dg-a" data-lineup-stamp="${$e(b.id)}" style="${we(s.stamp.color)};${e.pop(V)}"><g transform="rotate(${s.stamp.tilt} ${Fe(Q)} ${Fe(U)})"><rect class="dg-ln-stamp" x="${Fe(D.x)}" y="${Fe(D.y)}" width="${Fe(D.w)}" height="${D.h}" rx="${s.stamp.radius}"/>${re}</g></g>`}).join(""),R=F.get(b.id);return`<g${R?` class="dg-a" style="${R}"`:""}>${ee}${C}${M}</g>`}).join("");return{lanes:T,chips:`${x}${P}`}}var Bs={};function jt(t,n){Bs[t]=n}function nt(t,n="ja"){let a=Bs[t];if(a===void 0)throw new Error(Qe[n].kindNotLoaded(t));return a}var Hn={};Tt(Hn,{layoutState:()=>Ys});var Gs=t=>Nt.includes(t);function oi(t){let n=[],a=p=>{!Gs(p)&&!n.includes(p)&&n.push(p)};for(let{edge:p}of $t(t))a(p.from),a(p.to);return n}var ai=(t,n)=>t.from===n.from&&t.to===n.to;function Ys(t,n){let{box:a,state:p,margin:l,gap:e}=v,s=v.edge.inset,r=Qe[n],o=He(t),i=$t(t),c=oi(t),m=t.boxes.map($=>$.id).filter($=>!c.includes($)),f=(t.state?.paths??[]).filter($=>!i.some(({edge:Y})=>ai(Y,$))),d=[...i.map(({edge:$})=>$),...f],u=p.ghost,k=$=>{let Y=t.boxes.find(te=>te.id===$);return u.pad*2+a.icon+u.gap+Math.max(pe(Y?.name??$,q.boxName),pe(Y?.sub??"",q.boxSub))},h=kt(t),w=Math.max(a.padX,p.done.inset+p.done.r+v.slot.clear),g=new Map(t.boxes.map($=>[$.id,m.includes($.id)?k($.id):Math.max(tt(t,$.id,!0),vt(h.get($.id),$.icon!==void 0,w))])),N=Math.max(1,Math.min(p.columns,c.length)),L=Math.max(1,Math.ceil(c.length/p.columns)),F=new Map(c.map(($,Y)=>{let te=Math.floor(Y/p.columns),be=Y%p.columns;return[$,{row:te,col:te%2===0?be:N-1-be}]})),T=Array.from({length:N},($,Y)=>Math.max(a.minW,...c.filter(te=>F.get(te)?.col===Y).map(te=>g.get(te)??a.minW))),j=Array.from({length:Math.max(0,N-1)},()=>p.columnGap);for(let $ of d){let Y=F.get($.from),te=F.get($.to);if(!Y||!te||$.label===void 0||Y.row!==te.row||Math.abs(Y.col-te.col)!==1)continue;let be=Math.min(Y.col,te.col);j[be]=Math.max(j[be]??0,pe($.label,We($.label))+v.label.padX*2+p.labelRoom*2)}let x=[];for(let $=0;$<N;$++)x.push($===0?l:x[$-1]+T[$-1]+j[$-1]);let P=$=>x[$]+T[$]/2,b=$=>m.includes($),B=new Set(f.filter($=>b($.to)&&!b($.from)&&!Gs($.from)).map($=>$.from)),_=[r.sideNote,...B.size>0?[r.sideFrom(B.size)]:[]],K=Math.max(pe(r.side,q.regionName),..._.map($=>pe($,q.regionNote))),W=p.side.pad*2+Math.max(u.h,q.regionName.size+v.region.line*_.length+p.side.pad/4),ee=d.some($=>$.from==="start"),C=l+(m.length>0?W+p.side.gap:ee?p.start+p.drop:0),M=$=>C+$*(a.h+p.rowGap),R=($,Y,te,be)=>{let ge=t.boxes.find(Le=>Le.id===$),xe=g.get($)??a.minW,Je=be?u.h:a.h;return{id:$,name:ge?.name??$,...ge?.sub!==void 0?{sub:ge.sub}:{},...ge?.icon!==void 0?{icon:ge.icon}:{},color:o.get($)??"slate",x:Y-xe/2,y:te,w:xe,h:Je,cx:Y,cy:te+Je/2,...be?{ghost:!0}:{}}},D=c.map($=>{let Y=F.get($);return R($,P(Y.col),M(Y.row),!1)});for(let $ of D)Pt($,h.get($.id),w);let V=new Map(D.map($=>[$.id,$])),Q=$=>D.some(Y=>Y!==$&&Math.abs(Y.cx-$.cx)<.5&&Y.y>$.y),U=[],re=D[0],I=Math.max(...D.map($=>$.x+$.w)),oe,le=l+W+p.side.lane;if(m.length>0){let $=Le=>f.filter(Be=>Be.to===Le).flatMap(Be=>V.get(Be.from)??[]),Y=m.flatMap($),te=Math.max(l,Math.min(...Y.length>0?Y.map(Le=>Le.x):[l+p.side.pad])-p.side.pad),be=te+p.side.pad+K+e*2,ge=m.map(Le=>{let Be=$(Le);return{id:Le,cx:Be.length>0?Be.reduce((yt,St)=>yt+St.cx,0)/Be.length:be}});ge.sort((Le,Be)=>Le.cx-Be.cx);let xe=te;for(let{id:Le,cx:Be}of ge){let yt=g.get(Le)??a.minW,St=Math.max(Be-yt/2,be),mt=R(Le,St+yt/2,l+(W-u.h)/2,!0);D.push(mt),V.set(Le,mt);let os=f.some(as=>as.from===Le&&as.to==="finish");os&&U.push({kind:"finish",x:mt.x+mt.w+p.beside,y:mt.cy,r:p.end.r,ghost:!0,text:"",box:Le}),xe=os?mt.x+mt.w+p.beside+p.end.r:mt.x+mt.w,be=xe+e*2}let Je=Math.max(xe+p.side.pad,I);oe={x:te,y:l,w:Je-te,h:W,title:r.side,notes:_}}if(re&&ee){let $=re.cx+p.start+p.text+pe(r.start,q.regionNote)+e,Y=oe&&$<oe.x?oe.y+p.side.pad+p.start:re.y-p.drop;U.unshift({kind:"start",x:re.cx,y:Y,r:p.start,ghost:!1,text:r.start})}for(let $ of D.filter(Y=>!Y.ghost&&d.some(te=>te.from===Y.id&&te.to==="finish")))U.push(Q($)?{kind:"finish",x:$.x+$.w+p.beside,y:$.cy,r:p.end.r,ghost:!1,text:r.end,box:$.id}:{kind:"finish",x:$.cx,y:$.y+$.h+p.below,r:p.end.r,ghost:!1,text:r.end,box:$.id});let ye=($,Y)=>{let te=F.get($.id),be=F.get(Y.id);if(!te||!be)return[[$.cx,$.y+$.h],[Y.cx,Y.y-s]];if(te.row===be.row&&Math.abs(te.col-be.col)===1)return Y.cx>$.cx?[[$.x+$.w,$.cy],[Y.x-s,Y.cy]]:[[$.x,$.cy],[Y.x+Y.w+s,Y.cy]];if(te.row===be.row){let xe=$.y+$.h+p.rowGap/4;return[[$.cx,$.y+$.h],[$.cx,xe],[Y.cx,xe],[Y.cx,Y.y+Y.h+s]]}if(be.row>te.row){if(Math.abs($.cx-Y.cx)<.5)return[[$.cx,$.y+$.h],[Y.cx,Y.y-s]];let xe=$.y+$.h+p.rowGap/2;return[[$.cx,$.y+$.h],[$.cx,xe],[Y.cx,xe],[Y.cx,Y.y-s]]}if(Math.abs($.cx-Y.cx)<.5)return[[$.cx,$.y],[Y.cx,Y.y+Y.h+s]];let ge=Y.y+Y.h+p.rowGap/2;return[[$.cx,$.y],[$.cx,ge],[Y.cx,ge],[Y.cx,Y.y+Y.h+s]]},ue=($,Y)=>{let te=f.filter(ge=>ge.to===Y.id).flatMap(ge=>V.get(ge.from)??[]).sort((ge,xe)=>ge.cx-xe.cx),be=te.findIndex(ge=>ge.id===$);return te.length<=1?Math.min(Math.max(te[0]?.cx??Y.cx,Y.x+p.side.entry),Y.x+Y.w-p.side.entry):Y.x+p.side.entry+(Y.w-p.side.entry*2)*Math.max(0,be)/(te.length-1)},ke=$=>ee&&$===re?$.cx+p.side.entry:$.cx,Me=$=>U.find(Y=>Y.kind==="finish"&&Y.box===$),E=($,Y)=>{if($==="start"){let ge=U.find(Je=>Je.kind==="start"),xe=V.get(Y);return!ge||!xe?[]:[[ge.x,ge.y+ge.r],[xe.cx,xe.y-s]]}let te=V.get($);if(!te)return[];if(Y==="finish"){let ge=Me($);return ge?Math.abs(ge.x-te.cx)<.5?[[te.cx,te.y+te.h],[te.cx,ge.y-ge.r-s]]:[[te.x+te.w,te.cy],[ge.x-ge.r-s,te.cy]]:[]}let be=V.get(Y);if(!be)return[];if($===Y)return Et(te);if(be.ghost&&!te.ghost){let ge=ke(te),xe=ue($,be);return Math.abs(ge-xe)<.5?[[ge,te.y],[xe,be.y+be.h+s]]:[[ge,te.y],[ge,le],[xe,le],[xe,be.y+be.h+s]]}return te.ghost&&be.ghost?[[te.x+te.w,te.cy],[be.x-s,be.cy]]:te.ghost?[[te.cx,te.y+te.h],[te.cx,le],[be.cx,le],[be.cx,be.y-s]]:ye(te,be)},O=$=>{let Y=$.to==="finish"?Me($.from):void 0;if(!Y)return;let te=V.get($.from);return te&&Math.abs(Y.x-te.cx)<.5?[Y.x-Y.r-e-lt($.carry)[0],Y.y]:[Y.x,Y.y+Y.r+e+v.carrier.tagH/2]},X=$=>{let Y=$.from==="start"?U.find(te=>te.kind==="start"):void 0;return Y?[Y.x-Y.r-v.slot.mark-lt($.carry)[0],Y.y]:void 0},S=i.map(({step:$,event:Y,edge:te})=>{let be=O(te),ge=te.carry.kind==="none"?void 0:X(te);return{step:$,event:Y,from:te.from,to:te.to,points:E(te.from,te.to),color:li(te,o),carry:te.carry,...be?{settle:be}:{},...ge?{wait:ge}:{}}});ft(S,V,h);let H=new Map;for(let $ of S){if($.points.length!==2||!S.some(xe=>xe.from===$.to&&xe.to===$.from&&xe.points.length===2))continue;let[Y,te]=$.points,be=Math.abs(te[1]-Y[1])<Math.abs(te[0]-Y[0]),ge=($.from<$.to?1:-1)*v.edge.parallel;$.points=$.points.map(([xe,Je])=>be?[xe,Je+ge]:[xe+ge,Je]),H.set($,be?ge>0?"below":"above":ge>0?"right":"left")}let y=f.map($=>({from:$.from,to:$.to,points:E($.from,$.to)})),G=($,Y,te)=>$.from===$.to?Ht($.points):st($.points,Y,te),A=[],z=U.flatMap($=>$.text===""?[]:[Ge($.text,...zt($),q.regionNote)]),ae=[...ht(S,t.steps.length,G).values()].map($=>Ye($.point)),Z=[...oe?[{x:oe.x,y:oe.y,w:p.side.pad+K,h:oe.h}]:[],...z],J=$=>[...S.map(Y=>Y.points),...y.map(Y=>Y.points)].filter(Y=>Y!==$);for(let $ of S){let Y=t.steps[$.step]?.events[$.event];if(Y?.type!=="edge"||Y.label===void 0)continue;let te=$.from===$.to,be=Ct($),ge=A.filter(yt=>yt.text===Y.label&&S.some(St=>St.step===yt.step&&St.event===yt.event&&Ct(St)===be)),xe=ge[ge.length-1];if(xe){xe.until=$.step,A.push({x:xe.x,y:xe.y,w:xe.w,h:xe.h,step:$.step,event:$.event,text:xe.text,family:xe.family,color:$.color});continue}let Je=pe(Y.label,We(Y.label))+v.label.padX*2,Le=te?{side:"below",base:Xt($.points,Je)}:{},Be=Y.labelSide??($.to==="finish"?"left":H.get($));A.push(Ze({step:$.step,event:$.event,text:Y.label,points:$.points,color:$.color,...Be?{side:Be}:te?{}:{flip:!0},...Le},{hard:D,soft:[...Z,...A],touch:ae,lines:J($.points)}))}let se=[];f.forEach(($,Y)=>{let te=y[Y];if($.label===void 0||te.points.length===0)return;let be=We($.label),ge=V.get($.to)?.ghost===!0&&V.get($.from)?.ghost!==!0,xe=te.points[0][0],Je=ge?{side:"below",base:{x:xe+v.label.soft,y:le+v.label.soft},slide:Math.max(...te.points.map(([Be])=>Math.abs(Be-xe)))}:{},Le=Ze({step:-1,event:Y,text:$.label,points:te.points,color:"slate",...Je},{hard:D,soft:[...Z,...A,...se],touch:ae,lines:J(te.points)});se.push(Le),te.label={x:Le.x,y:Le.y,w:Le.w,h:Le.h,text:$.label,family:be.family}});let de={kind:"state",width:0,height:0,regions:[],boxes:D,lifelines:[],edges:S,labels:A,actions:[],badges:[],paths:y,ends:U,...oe?{side:oe}:{}},Pe=[...D.map($=>$.x),...A.map($=>$.x),...y.flatMap($=>$.label?[$.label.x]:[])],qe=[...A.map($=>$.y),...y.flatMap($=>$.label?[$.label.y]:[])],Re=Math.max(0,l-Math.min(...Pe)),Te=qe.length>0?Math.max(0,l-Math.min(...qe)):0;(Re>0||Te>0)&&Lt(de,Re,Te);let De=$=>$.x+($.text===""?$.r:p.text+pe($.text,q.regionNote)),Ve=[...D.map($=>$.x+$.w),...A.map($=>$.x+$.w),...U.map(De),...S.flatMap($=>$.points.map(Y=>Y[0])),...y.flatMap($=>[...$.points.map(Y=>Y[0]),...$.label?[$.label.x+$.label.w]:[]]),...oe?[oe.x+oe.w]:[]],Ke=[...D.map($=>$.y+$.h),...A.map($=>$.y+$.h),...U.map($=>$.y+$.r),...S.flatMap($=>$.points.map(Y=>Y[1]))],gt={title:r.trail,states:c.map($=>({box:$,color:o.get($)??"slate"}))},dt=Math.max(Math.max(...Ve)+l,ze(t,gt)+l*2),Rt=Math.max(...Ke,M(L-1)+a.h),Dt=Ue(t,l,Rt+e,dt-l*2,gt);de.width=dt,de.height=(Dt?Dt.y+Dt.h:Rt)+l,Dt&&(de.strip=Dt);let Pr=ht(S,t.steps.length,G);return de.badges=Xe(t.steps.map(($,Y)=>{let te=Pr.get(Y);return te?{step:Y,x:te.point[0],y:te.point[1],color:te.edge.color}:qt($.events,Y,de)})),de}function li(t,n){return t.carry.kind==="coin"?at(t,n):n.get(t.to==="finish"?t.from:t.to)??"slate"}var Xn={};Tt(Xn,{drawTime:()=>Js,layoutTime:()=>Xs,meterField:()=>Zs,timeFocus:()=>Qs});var nn={d:86400,h:3600,min:60,s:1,ms:.001},pi=Object.keys(nn);function ci(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])*nn[a],unit:a}}var Vs=(t,n)=>pi.find(a=>t/nn[a]>=2-1e-9)??n,Ks=(t,n,a)=>`${Number((t/nn[n]).toFixed(2))} ${Qe[a].timeUnits[n]}`;function di(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<=v.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>=v.time.minorPx&&l.push(t),{at:l,step:p}}function mi(t,n,a,p){let l=Array.from({length:n-1},(s,r)=>r+1).find(s=>n%s===0&&s*a>=v.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 Ws(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 Xs(t,n="ja"){let a=v.time,{margin:p,gap:l}=v,e=v.region,s=Qe[n],r=t.time??{scale:{unit:"",length:"1s",count:1},rows:[]},{scale:o}=r,i=Math.max(1,o.count),c=ci(o.length),m=Math.max(a.width,ze(t)+p*2),f=Math.max(0,...r.rows.map(S=>pe(S.name,q.timeRow))),d=Math.max(a.axisX,p+e.inset+f+a.gutterGap),u=m-a.right-d,k=u/i,h=He(t),w=kt(t),g=[],N=[],L=[],F=[],T=new Map(r.rows.map(S=>[S.id,S])),j,x=p;if(r.zoom){let{from:S,to:H}=r.zoom,y=H-S+1,G=u/y,A=p,z=Vs(H*c.seconds,c.unit),ae=[];for(let se=0;se<y;se++){let de=S+se,Pe=d+se*G,qe=t.boxes.map((Te,De)=>{let Ve=w.get(Te.id),Ke=Math.max(tt(t,Te.id,!1),vt(Ve,Te.icon!==void 0,v.box.padX)),gt=A+a.boxTop+De*(v.box.h+a.boxGap),dt=T.get(Te.id),Rt={id:Te.id,name:Te.name,...Te.sub!==void 0?{sub:Te.sub}:{},...Te.icon!==void 0?{icon:Te.icon}:{},color:h.get(Te.id)??"slate",x:Pe+G/2-Ke/2,y:gt,w:Ke,h:v.box.h,cx:Pe+G/2,cy:gt+v.box.h/2,...dt?{row:dt.id}:{},...dt?.empty?.includes(de)?{empty:!0}:{}};return Pt(Rt,Ve),Rt});N.push(...qe);let Re=`${o.unit} ${(o.from??0)+de}${s.headJoin}${Ks(de*c.seconds,z,n)}`;ae.push({unit:de,head:Re,boxes:qe,x:Pe,y:A,w:G,h:0})}let J=Math.max(A+a.boxTop,...N.map(se=>se.y+se.h))+a.zoomBottom;for(let se of ae)se.h=J-A;g.push({id:"zoom",lines:[s.zoom],note:`${y} ${o.unit}`,icon:"clock",color:"blue",x:p,y:A,w:m-p*2,h:J-A,header:{x:p+e.inset,y:A+e.inset,w:Math.max(e.icon,pe(s.zoom,q.regionName)),h:e.nameY-e.inset+e.line}}),j={from:S,to:H,frame:{x:0,y:0,w:0,h:0},guides:[],columns:ae,empty:s.empty,headY:A+a.head},x=J+a.zoomGap}let P=x+a.rowsTop,b=r.rows.map((S,H)=>({id:S.id,name:S.name,color:S.color??h.get(S.id)??bt[H%bt.length],x:d,y:P+H*(a.row+a.rowGap),w:u,h:a.row})),B=b.length>0?Math.max(...b.map(S=>S.y+S.h)):P,_=Math.min(a.markMax,Math.max(a.markMin,k*a.markRatio)),K=b.flatMap((S,H)=>Array.from({length:i},(y,G)=>({row:S.id,unit:G,empty:r.rows[H]?.empty?.includes(G)===!0,color:S.color,colors:[],x:d+(G+.5)*k-_/2,y:S.y,w:_,h:S.h})));if(t.steps.forEach((S,H)=>S.events.forEach((y,G)=>{if(y.type==="mark")for(let A of K)A.row===y.row&&A.unit>=y.from&&A.unit<=y.to&&!A.empty&&A.colors.push({step:H,event:G,color:y.color})})),j){let S={x:d+j.from*k-a.frame,y:P-a.frame,w:(j.to-j.from+1)*k+a.frame*2,h:B-P+a.frame*2},H=Math.max(...j.columns.map(y=>y.y+y.h));j.frame=S,j.guides=[[[S.x,S.y],[d,H]],[[S.x+S.w,S.y],[d+u,H]]]}let W=B+a.point.drop,ee=(r.points??[]).map(S=>{let H=[];t.steps.forEach((Z,J)=>Z.events.forEach((se,de)=>{se.type==="swap"&&se.box===S.id&&H.push({step:J,event:de,text:se.text,...se.color?{color:se.color}:{}})}));let y=d+(S.at+.5)*k,G=y+a.point.text,A=Math.max(pe(S.id,q.pointName),...H.map(Z=>pe(Z.text,q.pointState))),z=W+a.point.nameY-q.pointName.size*.8,ae=W+a.point.stateY+q.pointState.size*.2;return{id:S.id,unit:S.at,cx:y,cy:W,r:a.point.r,text:{x:G,y:z,w:A,h:ae-z},changes:H}}),C=new Map(ee.map(S=>[S.id,S])),M=(S,H)=>C.get(S)?.changes.filter(G=>G.step<=H&&G.color).at(-1)?.color;t.steps.forEach((S,H)=>S.events.forEach((y,G)=>{if(y.type!=="edge")return;if(y.at===void 0){let ae=C.get(y.from),Z=C.get(y.to);if(!ae||!Z||ae===Z)return;let J=Z.cx>ae.cx,se=J?Math.max(ae.cx+ae.r,ae.text.x+ae.text.w+a.point.link):ae.cx-ae.r-a.point.end,de=J?Z.cx-Z.r-a.point.end:Math.min(Z.cx-Z.r,Z.text.x+Z.text.w+a.point.link),Pe={step:H,event:G,from:y.from,to:y.to,points:[[se,ae.cy],[de,Z.cy]],color:y.carry.kind==="coin"?"coin":M(y.to,H)??"slate",carry:y.carry};y.carry.kind!=="none"&&(Pe.settle=[de-(J?1:-1)*(v.carrier.coinR+v.edge.arrow),Z.cy]),L.push(Pe);return}let A=fi(y,j);if(!A)return;let z={step:H,event:G,from:y.from,to:y.to,points:A.points,color:at(y,h),carry:y.carry};ui(z,A.from,A.to,w),L.push(z),F.push({step:H,event:G,from:A.from,to:A.to,column:y.at,into:y.into??y.at})}));let R={kind:"time",width:m,height:0,regions:g,boxes:N,lifelines:[],edges:L,labels:[],actions:[],badges:[],paths:[],ends:[],axis:{x:d,w:u,unit:k,count:i,line:0},rows:b,marks:K,ticks:[],minor:[],periods:[],points:ee,...j?{zoom:j}:{},spans:[],wires:F,needle:{y1:P-a.needle.over,y2:B+a.needle.over}},D=B,V=t.steps.some(S=>S.events.some(H=>H.type==="edge"&&H.at===void 0&&H.label!==void 0)),{r:Q,inset:U}=v.badge,re=ee.length>0?W+a.point.r+(V?a.point.room:a.point.plain):D+(Q+U)*2,I=[],oe=t.steps.flatMap((S,H)=>S.events.flatMap((y,G)=>y.type==="span"?[{s:H,e:G,event:y}]:[]));for(let{s:S,e:H,event:y}of oe){let G=y.shape==="box"?"box":"bracket",A=oe.find(se=>se.s>S&&(se.event.shape==="box"?"box":"bracket")===G&&se.event.from<=y.to&&y.from<=se.event.to),z=y.color??"slate",ae=d+y.from*k,Z=d+(y.to+1)*k,J={step:S,event:H,kind:G,from:y.from,to:y.to,text:y.text,color:z,...A?{until:A.s}:{}};if(G==="box"){let se=a.box,de={x:ae-se.pad,y:P-se.pad,w:Z-ae+se.pad*2,h:B-P+se.pad*2},Pe=pe(y.text,q.tag)+se.tagPadX*2,qe={x:de.x+se.tagX,y:de.y-se.tagH/2,w:Pe,h:se.tagH};I.push({...J,...de,textRect:qe,textY:de.y+v.baseline.tag})}else I.push({...J,x:ae,y:0,w:Z-ae,h:a.bracket.tick,textRect:{x:0,y:0,w:0,h:0},textY:0})}R.spans=I,R.badges=Hs(t,R,Ws(t)),R.labels=gi(t,R),re=Math.max(re,...R.labels.map(S=>S.y+S.h+v.label.soft));let le=[];for(let S of I.filter(H=>H.kind==="bracket")){let H=pe(S.text,q.spanText),y=Math.min(d+u-H/2,Math.max(d+H/2,S.x+S.w/2)),G={x:Math.min(S.x,y-H/2),w:Math.max(S.x+S.w,y+H/2)-Math.min(S.x,y-H/2)},A=ae=>{let Z=ae.until===void 0||ae.until>S.step,J=Math.min(ae.x,ae.textRect.x),se=Math.max(ae.x+ae.w,ae.textRect.x+ae.textRect.w)-J;return Z&&G.x<J+se&&J<G.x+G.w},z=le.findIndex(ae=>!ae.some(A));z<0&&(le.push([]),z=le.length-1),le[z].push(S),S.y=re+a.bracket.gap+z*a.bracket.lane,S.textY=S.y+a.bracket.tick+a.bracket.text,S.textRect=Ge(S.text,y,S.textY,q.spanText,"middle")}le.length>0&&(re=Math.max(...I.filter(S=>S.kind==="bracket").map(S=>S.textRect.y+S.textRect.h)));let ye=re+a.axisGap;R.axis.line=ye;let ue=di(i,r.period?.length,k),ke=ye+a.tickY,Me=Vs(i*c.seconds,c.unit);R.ticks=ue.at.map(S=>{let H=Ks(S*c.seconds,Me,n),y=pe(H,q.timeTick),G=d+S*k,A=S===0?G:S===i?G-y:Math.min(d+u-y,Math.max(d,G-y/2));return{at:S,x:G,text:H,left:A,y:ke}}),R.minor=mi(i,ue.step,k,ue.at);let E=ke+q.timeTick.size*.2;if(r.period){let S=r.period,H=[];for(let A=0,z=0;z<i;A++,z+=S.length){let ae=Math.min(i,z+S.length)-1,Z=`${S.name} ${(S.from??0)+A}`,J=(o.from??0)+z,se=`${o.unit} ${s.range(String(J),String((o.from??0)+ae))}`;H.push({index:A,from:z,to:ae,name:Z,range:se,x:d+z*k,y:ye,w:(ae-z+1)*k,h:0,nameY:ke,rangeY:ke+a.rangeY})}let y=R.ticks.map(A=>Ge(A.text,A.left,A.y,q.timeTick)),G=H.some(A=>{let z=Ge(A.name,A.x+A.w/2,A.nameY,q.timePeriod,"middle");return y.some(ae=>z.x<ae.x+ae.w+a.nameGap&&ae.x<z.x+z.w+a.nameGap)});for(let A of H)G&&(A.nameY=ke+a.rangeY+2,A.rangeY=A.nameY+a.rangeY),A.h=A.rangeY+q.timeRange.size*.2-ye;R.periods=H,E=Math.max(E,...H.map(A=>A.rangeY+q.timeRange.size*.2))}let O=E+a.bottom;g.push({id:"axis",lines:[],color:"slate",x:p,y:x,w:m-p*2,h:O-x,header:{x:p+e.inset,y:x+e.inset,w:0,h:0}});let X=Ue(t,p,O+l,m-p*2);return X&&(R.strip=X),R.height=(X?X.y+X.h:O)+p,R.badges=Hs(t,R,Ws(t)),R}function fi(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-v.gap,Math.max(e.x+e.w,s.x+s.w)+v.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 ui(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 Hs(t,n,a){let{r:p,inset:l}=v.badge,{axis:e}=n,s=[],r=[],o=Math.min(...n.rows.map(m=>m.y),n.needle.y1+v.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,N)=>{s.push(g),r.push({step:f,x:g[0],y:g[1],color:N})},u=n.edges.filter(g=>g.step===f).sort((g,N)=>g.event-N.event)[0];if(u){let g=u.carry.kind!=="none"&&!u.wait?[u.points[0]]:[],N=n.edges.filter(L=>L!==u).map(L=>L.points);d(st(u.points,[...s,...g],N),u.color);return}let[k,h]=a[f]??[0,0];if(h>k){let g=e.x+(k+h)/2*e.unit,N=n.points.find(L=>Math.abs(L.cx-g)<p+l);N&&(g=N.cx+p+l*2),d([g,c],"slate");return}for(let g of m.events){let N=hi(g,f,n);if(N){d(N.at,N.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 w=r[r.length-1];r.push(w?{...w,step:f}:{step:f,x:e.x-p-l,y:o,color:"slate"})}),Xe(r)}function hi(t,n,a){let{r:p,inset:l}=v.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 gi(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,q.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 zs(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 Us(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 Js(t,n,a,p,l){let{m:e,ink:s}=p,r=v.time,{axis:o}=t,i=new Map((a.units??[]).map(M=>[M.unit,M.passed])),c=(M,R)=>a.events.find(D=>D.step===M&&D.event===R)?.at,m=(M,R)=>a.edges.find(D=>D.step===M&&D.event===R)?.drawn,f=[],d=[],u=[],k=[],h=Math.min(...t.rows.map(M=>M.y)),w=Math.max(...t.rows.map(M=>M.y+M.h)),g=new Map;for(let M of t.wires){let R=m(M.step,M.event);R!==void 0&&g.set(M.to,Math.min(g.get(M.to)??Number.POSITIVE_INFINITY,R))}let N=(M,R)=>{let D=t.zoom?.columns.find(Q=>Q.unit===R)?.boxes.find(Q=>Q.id===M),V=[i.get(R),D?g.get(D):void 0].filter(Q=>Q!==void 0);return V.length>0?Math.min(...V):void 0};for(let M of t.periods)M.index%2===1&&f.push(`<rect class="dg-tm-ep" x="${ce(M.x)}" y="${ce(h-r.shade)}" width="${ce(M.w)}" height="${ce(w-h+r.shade*2)}" rx="4"/>`);if(t.zoom){let M=t.zoom;M.columns.forEach((R,D)=>{D>0&&f.push(`<line class="dg-tm-sep" x1="${ce(R.x)}" y1="${ce(R.y+r.sep)}" x2="${ce(R.x)}" y2="${ce(R.y+R.h-r.sep)}"/>`),f.push(Se(s,Mt("dg-tm-hd",R.head),R.x+R.w/2,M.headY,R.head,q.timeHead,Ce,"middle"));for(let V of R.boxes)u.push(L(V,R.unit))})}function L(M,R){let D=[...new Set(t.wires.filter(re=>re.from===M||re.to===M).map(re=>re.step))].sort((re,I)=>re-I),V=re=>`<rect class="${re}" x="${ce(M.x)}" y="${ce(M.y)}" width="${ce(M.w)}" height="${M.h}" rx="${v.box.radius}"/>`;if(M.empty){let re=i.get(R),I=t.zoom?.empty??"",oe=re===void 0?"":`<g class="dg-a" style="${e.vis(re)}">${V("dg-tm-ex")}${Se(s,"dg-tm-ext",M.cx,M.cy+v.baseline.mark,I,q.emptyText,[[re,Number.POSITIVE_INFINITY]],"middle")}</g>`;return`<g data-empty="${$e(M.id)}">${V("dg-tm-ph")}${oe}</g>`}let Q=Jt(n.boxes.find(re=>re.id===M.id)?.link,en(M,p,D,l.get(M.id)??[]));if(!M.row)return Q;let U=N(M.row,R);return U===void 0?V("dg-tm-ph"):`<g class="dg-a" style="${e.until(U)}">${V("dg-tm-ph")}</g><g class="dg-popc dg-a" style="${e.pop(U)}">${Q}</g>`}for(let M of t.rows){let R=[];for(let D of t.marks.filter(V=>V.row===M.id)){let V=(U,re="")=>`<rect class="${U}" x="${ce(D.x)}" y="${ce(D.y)}" width="${ce(D.w)}" height="${ce(D.h)}" rx="${r.markRadius}"${re}/>`;if(R.push(V("dg-tm-slot")),D.empty){let U=i.get(D.unit);U!==void 0&&R.push(`<circle class="dg-tm-x dg-a" cx="${ce(D.x+D.w/2)}" cy="${ce(D.y+D.h/2)}" r="${r.emptyR}" style="${e.vis(U,e.last,{f:.2})}"/>`);continue}let Q=N(M.id,D.unit);Q!==void 0&&R.push(V("dg-tm-m dg-a",` style="${e.vis(Q,e.last,{f:.2})}"`)),D.colors.forEach((U,re)=>{let I=c(U.step,U.event);if(I===void 0)return;let oe=D.colors[re+1],le=oe?c(oe.step,oe.event):void 0;R.push(`<g style="${we(U.color)}">${V("dg-tm-m dg-a",` style="${e.vis(I,le??e.last,{f:.35})}"`)}</g>`)})}f.push(`<g data-row="${$e(M.id)}" style="${we(M.color)}">${R.join("")}</g>`),f.push(Se(s,"dg-tm-rn",v.margin+v.region.inset,M.y+M.h/2+v.baseline.mark,M.name,q.timeRow))}if(t.zoom){let M=t.zoom,R=t.spans.filter(Q=>Q.kind==="box"&&Q.from<=M.to&&M.from<=Q.to).map(Q=>c(Q.step,Q.event)).filter(Q=>Q!==void 0).sort((Q,U)=>Q-U)[0],D=M.guides.map(Q=>`<path class="dg-tm-gd" d="${it(Q)}"/>`).join(""),V=`<rect class="dg-tm-fr" x="${ce(M.frame.x)}" y="${ce(M.frame.y)}" width="${ce(M.frame.w)}" height="${ce(M.frame.h)}" rx="4"/>${D}`;f.push(R===void 0?V:`<g class="dg-a" style="${e.until(R)}">${V}</g>`)}let F=M=>ce(o.x+M*o.unit),T=t.ticks.map(M=>`M ${F(M.at)} ${ce(o.line-r.major/2)} V ${ce(o.line+r.major/2)}`),j=t.minor.map(M=>`M ${F(M)} ${ce(o.line-r.minor/2)} V ${ce(o.line+r.minor/2)}`);f.push(`<path class="dg-tm-ax" d="M ${F(0)} ${ce(o.line)} H ${F(o.count)} ${[...T,...j].join(" ")}"/>`);for(let M of t.ticks)f.push(Se(s,Mt("dg-tm-tk",M.text),M.left,M.y,M.text,q.timeTick));for(let M of t.periods)f.push(Se(s,Mt("dg-tm-en",M.name),M.x+M.w/2,M.nameY,M.name,q.timePeriod,Ce,"middle")),f.push(Se(s,Mt("dg-tm-er",M.range),M.x+M.w/2,M.rangeY,M.range,q.timeRange,Ce,"middle"));for(let M of t.spans){let R=c(M.step,M.event);if(R===void 0)continue;let D=M.until===void 0?void 0:a.steps[M.until].start,V=[[R,D??Number.POSITIVE_INFINITY]],Q=D===void 0?e.vis(R):e.vis(R,D,{within:!0});if(M.kind==="bracket"){let[re,I,oe,le]=[ce(M.x+1),ce(M.x+M.w-1),ce(M.y),ce(M.y+M.h)],ye=Se(s,Mt("dg-tm-bt",M.text),M.textRect.x+M.textRect.w/2,M.textY,M.text,q.spanText,V,"middle");f.push(`<g class="dg-a" data-span="${M.step}" style="${we(M.color)};${Q}"><path class="dg-tm-br" d="M ${re} ${oe} L ${re} ${le} L ${I} ${le} L ${I} ${oe}"/>${ye}</g>`);continue}f.push(`<g class="dg-a" data-span="${M.step}" style="${we(M.color)};${Q}"><rect class="dg-tm-bx" x="${ce(M.x)}" y="${ce(M.y)}" width="${ce(M.w)}" height="${ce(M.h)}" rx="6"/></g>`);let U=M.textRect;s.push({text:M.text,rect:U,shown:V,boxed:!0}),k.push(`<g class="dg-tg dg-popc dg-a" style="${we(M.color)};${D===void 0?e.pop(R):e.pop(R,D)}"><rect x="${ce(U.x)}" y="${ce(U.y)}" width="${ce(U.w)}" height="${U.h}" rx="${U.h/2}"/><text x="${ce(U.x+U.w/2)}" y="${ce(M.textY)}" text-anchor="middle">${$e(M.text)}</text></g>`)}let x=r.point;for(let M of t.points){let{cx:R,cy:D,r:V}=M,Q=M.changes.map(ke=>c(ke.step,ke.event)??Number.POSITIVE_INFINITY),U=Q[0];f.push(`<path class="dg-tm-con" d="M ${ce(R)} ${ce(w+3)} L ${ce(R)} ${ce(D-V-2)}"/>`);let re=M.text.x,I=Se(s,Mt("dg-tm-pn",M.id),re,D+x.nameY,M.id,q.pointName),oe=I.replace(/class="([^"]*)"/u,'class="$1 dg-tm-pn-g"'),le=U===void 0||!Number.isFinite(U)?oe:`<g class="dg-a" style="${e.until(U)}">${oe}</g><g class="dg-a" style="${e.vis(U)}">${I}</g>`,ye=M.changes.map((ke,Me)=>{let E=Q[Me];if(!Number.isFinite(E))return"";let O=Q[Me+1],X=O!==void 0&&Number.isFinite(O)?O-ie.untilFade:void 0,S=Se(s,Mt("dg-tm-ps",ke.text),re,D+x.stateY,ke.text,q.pointState,[[E,X??Number.POSITIVE_INFINITY]]);return`<g class="dg-a" style="${we(ke.color??"slate")};${X===void 0?e.rise(E):e.rise(E,X)}">${S}</g>`}).join(""),ue=M.changes.map((ke,Me)=>{let E=Q[Me];return!ke.color||!Number.isFinite(E)?"":`<g class="dg-popc dg-a" style="${we(ke.color)};${e.pop(E)}"><circle class="dg-tm-pc" cx="${ce(R)}" cy="${ce(D)}" r="${V+.5}"/>${rt("flag",R,D,x.glyph,"dg-tm-pcg")}</g>`}).join("");u.push(`<g data-point="${$e(M.id)}"><circle class="dg-tm-pg" cx="${ce(R)}" cy="${ce(D)}" r="${V}"/>${rt("flag",R,D,x.glyph,"dg-tm-pgl")}${ue}${le}${ye}</g>`)}let P=new Set(t.wires.map(M=>`${M.step}/${M.event}`));for(let M of t.edges){if(P.has(`${M.step}/${M.event}`))continue;let R=a.edges.find(Q=>Q.step===M.step&&Q.event===M.event);if(!R)continue;p.traces.push({from:M.from,to:M.to,points:M.points,shown:[[R.start,Number.POSITIVE_INFINITY]]});let D=e.kf([[0,{opacity:0,"stroke-dashoffset":1}],[R.start,{opacity:0,"stroke-dashoffset":1},me.inOut],[R.start+.05,{opacity:1}],[R.drawn,{"stroke-dashoffset":0}],[e.last,{opacity:1,"stroke-dashoffset":0},me.inOut],[e.total,{opacity:0,"stroke-dashoffset":0}]]),V=e.kf([[0,{opacity:0}],[R.drawn-.05,{opacity:0}],[R.drawn,{opacity:1}],[e.last,{opacity:1},me.inOut],[e.total,{opacity:0}]]);d.push(`<g data-link="${$e(`${M.from}->${M.to}`)}" style="${we(M.color)}"><path class="dg-tm-ln dg-a" pathLength="1" d="${it(M.points)}" style="${D}"/><path class="dg-eh-on dg-a" d="${At(M.points)}" style="${V}"/></g>`)}let b=a.needle??[],B=zs(b.filter(([M])=>M<e.total)),_=B[B.length-1]?.[1]??0,K=[...B.map(([M,R])=>[M,o.x+R*o.unit,0]),[e.last,o.x+_*o.unit,0],[e.total,o.x,0]],{y1:W,y2:ee}=t.needle,C=r.needle;return k.push(`<g class="dg-a" data-needle="" style="${e.move(K)}"><line class="dg-tm-nd" x1="0" y1="${ce(W)}" x2="0" y2="${ce(ee)}"/><path class="dg-tm-nh" d="M ${-C.head*.75} ${ce(W-C.head)} L ${C.head*.75} ${ce(W-C.head)} L 0 ${ce(W)} Z"/><circle class="dg-tm-nh" cy="${ce(o.line)}" r="${C.dot}"/></g>`),{base:f.join(""),lit:d.join(""),node:u.join(""),top:k.join("")}}function Zs(t,n,a){let{m:p}=a,l=v.time.meter,{x:e,w:s,line:r,text:o}=t.meter,i=t.y+l.y,c=p.kf([...zs(n).map(([f,d])=>[f,{transform:`scaleX(${ce(d*1e3)/1e3})`}]),[p.last,{transform:`scaleX(${ce(Us(n,p.last)*1e3)/1e3})`},me.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="${we(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)}"/>`+Se(a.ink,"dg-tm-ml",m,t.y+l.textY,o,q.meterLine,Ce,"middle")}function Qs(t,n,a,p,l,e){let s=n.steps[a],r=Us(n.needle??[],s.end-ie.still),o=t.axis.x+r*t.axis.unit,i=Math.min(...t.rows.map(k=>k.y)),c=Math.max(...t.rows.map(k=>k.y+k.h)),m={x:o-1,y:i,w:2,h:c-i},f=t.badges.find(k=>k.step===a),d=k=>Math.hypot(Math.max(0,k.x-o,o-k.x-k.w),Math.max(0,k.y-i,i-k.y-k.h)),u=[...f?[{x:f.x-v.badge.r,y:f.y-v.badge.r,w:v.badge.r*2,h:v.badge.r*2}]:[],...[...p].sort((k,h)=>d(k)-d(h))];for(let k of u){let h=Math.min(m.x,k.x),w=Math.min(m.y,k.y),g={x:h,y:w,w:Math.max(m.x+m.w,k.x+k.w)-h,h:Math.max(m.y+m.h,k.y+k.h)-w};g.w<=l&&g.h<=e&&(m=g)}return m}var zn={};Tt(zn,{drawTree:()=>nr,layoutTree:()=>tr});function yi(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 bi(t,n){return t.hash===void 0?[{text:t.id,style:q.boxName}]:n?[{text:t.id,style:q.rootName},{text:t.hash,style:q.rootHash}]:t.kind==="leaf"?[{text:t.hash,style:q.treeHash}]:[{text:t.hash,style:q.treeHash},{text:t.id,style:q.treeName}]}function xi(t,n){let a=v.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 tr(t){let{margin:n,gap:a,box:p,tree:l,badge:e}=v,{grown:s,parents:r}=yi(t),o=s.filter(O=>!r.has(O.id)),i=o[o.length-1]?.id,c=new Map(s.map(O=>[O.id,O])),m=new Map,f=(O,X)=>{m.set(O,X);for(let S of c.get(O)?.children??[])f(S,X+1)};for(let O of o)f(O.id,0);let d=new Map(s.map(O=>[O.id,bi(O,O.id===i)])),u=O=>Math.max(0,...(d.get(O)??[]).map(X=>pe(X.text,X.style))),k=O=>O.id===i?Math.max(l.root.w,l.root.textX+u(O.id)+l.root.padR):Math.max(l.w,u(O.id)+l.padX*2),h=O=>Math.max(l.card.minW,l.card.padX*2+l.card.icon+l.card.gap+pe(O.id,q.treeCard)),w=O=>O.kind==="leaf"&&O.hash!==void 0,g=s.filter(O=>O.children.length===0),N=Math.max(...s.filter(O=>O.id!==i||O.children.length===0).map(O=>Math.max(k(O),w(O)?h(O):0)),l.w)+l.slotGap,L=n+e.r*2+e.inset,F=new Map;g.forEach((O,X)=>F.set(O.id,L+N*(X+.5)));let T=O=>{let X=F.get(O);if(X!==void 0)return X;let S=c.get(O)?.children??[],H=(T(S[0])+T(S[S.length-1]))/2;return F.set(O,H),H},j=n+l.top,x=O=>j+l.root.h/2+O*l.row,P=He(t),b=s.map(O=>{let X=O.id===i,S=m.get(O.id)??0,H=T(O.id),y=x(S),G=k(O),A=X?l.root.h:l.h,z=d.get(O.id)??[],ae=z.length===1?[y+l.oneY]:X?[y+l.root.nameY,y+l.root.hashY]:[y+l.hashY,y+l.nameY],Z=r.get(O.id),J=X?l.rootColor:l.color;P.set(O.id,J);let se=h(O);return{id:O.id,kind:O.kind,depth:S,...Z!==void 0?{parent:Z}:{},children:O.children,step:O.step,event:O.event,...O.hash!==void 0?{hash:O.hash}:{},root:X,x:H-G/2,y:y-A/2,w:G,h:A,cx:H,cy:y,color:J,lines:z.map(de=>de.text),baselines:ae,styles:z.map(de=>de.style),...w(O)?{card:{x:H-se/2,y:y+l.card.drop-l.card.h/2,w:se,h:l.card.h,text:O.id}}:{}}}),B=new Map(b.map(O=>[O.id,O])),_=b.flatMap(O=>O.children.flatMap(X=>{let S=B.get(X);if(!S)return[];let H=(S.y+O.y+O.h)/2,y=[[S.cx,S.y-v.edge.inset],[S.cx,H],[O.cx,H],[O.cx,O.y+O.h+v.edge.inset]];return[{from:S.id,to:O.id,step:O.step,event:O.event,points:y}]})),K=kt(t),W=Math.max(L,...b.flatMap(O=>[O.x+O.w,...O.card?[O.card.x+O.card.w]:[]])),ee=b.find(O=>O.root),C=new Set(t.boxes.map(O=>O.id)),M=$t(t).flatMap(({edge:O})=>O.label!==void 0&&(C.has(O.from)||C.has(O.to))?[pe(O.label,We(O.label))+v.label.padX*2]:[]),R=Math.max(W+l.boxGap,(ee?ee.x+ee.w:L)+Math.max(0,...M)+a*2),D=ee?.y??j,V=t.boxes.map(O=>{let X=Math.max(tt(t,O.id,!0),vt(K.get(O.id),O.icon!==void 0,p.padX)),S=D;D+=p.h+a;let H={id:O.id,name:O.name,...O.sub!==void 0?{sub:O.sub}:{},...O.icon!==void 0?{icon:O.icon}:{},color:P.get(O.id)??"slate",x:R,y:S,w:X,h:p.h,cx:R+X/2,cy:S+p.h/2};return Pt(H,K.get(O.id)),H}),Q=new Map(V.map(O=>[O.id,O])),U=[],re=t.steps.flatMap((O,X)=>O.events.flatMap((S,H)=>{if(S.type!=="edge")return[];let y=B.get(S.from)??Q.get(S.from),G=B.get(S.to)??Q.get(S.to);if(!y||!G)return[];let A=_.find(J=>J.from===S.from&&J.to===S.to),z=_.find(J=>J.from===S.to&&J.to===S.from),ae=A??z;ae&&U.push({step:X,event:H,link:ae.from});let Z=A?A.points:z?[...z.points].reverse():S.from===S.to?Et({cx:y.x+y.w/2,y:y.y,h:y.h}):xi(y,G);return[{step:X,event:H,from:S.from,to:S.to,points:Z,color:at(S,P),carry:S.carry}]}));ft(re,Q,K);let I={kind:"tree",width:0,height:0,regions:[],boxes:V,lifelines:[],edges:re,labels:[],actions:[],badges:[],paths:[],ends:[],nodes:b,links:_,runs:U};I.badges=er(t,I),I.labels=ki(t,I);let oe=b.flatMap(O=>O.card?[O.card]:[]),le=[...b,...oe,...V,...I.labels],ye=re.flatMap(O=>O.points),ue=Math.max(...le.map(O=>O.x+O.w),...ye.map(([O])=>O),L),ke=Math.max(...le.map(O=>O.y+O.h),...ye.map(([,O])=>O),j),Me=Math.max(ue+n,ze(t)+n*2),E=Ue(t,n,ke+a,Me-n*2);return I.width=Me,I.height=(E?E.y+E.h:ke)+n,E&&(I.strip=E),I.badges=er(t,I),I}function er(t,n){let{r:a,inset:p}=v.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)>=v.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(L=>L.type==="leaf"||L.type==="node"||L.type==="edge"),u=m.events[d],k=n.nodes.find(L=>L.step===f&&L.event===d);if(u&&u.type!=="edge"&&k){let L=[[k.x-p-a,k.cy],[k.x,k.y],[k.x+k.w+p+a,k.cy],[k.x+k.w,k.y]];i(f,L.find(o)??L[0],k.color);return}let h=n.edges.find(L=>L.step===f&&L.event===d);if(u?.type==="edge"&&h){let L=[h.from,h.to].sort().join(`
2
+ `),F=n.runs.some(x=>x.step===f&&x.event===d),T=n.edges.filter(x=>x!==h).map(x=>x.points),j=c.get(L)??(F?wi(h.points,o):$i(h,o))??st(h.points,e,T);c.set(L,j),i(f,j,h.color);return}let w=m.events.flatMap(L=>L.type==="swap"||L.type==="action"?[L.box]:[]).flatMap(L=>n.boxes.filter(F=>F.id===L))[0];if(w){s.push({step:f,x:w.x,y:w.y,color:w.color});return}if(n.strip&&m.events.some(L=>L.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],N=n.nodes.find(L=>L.root);s.push(g?{...g,step:f}:{step:f,x:N?.x??v.margin,y:N?.y??v.margin,color:N?.color??"slate"})}),Xe(s)}function wi(t,n){let[a,p,l]=t,e=Math.abs(l[0]-p[0]),{r:s,inset:r}=v.badge;if(e>=v.tree.badgeAlong+s){let i=et(t,ut([a,p])+v.tree.badgeAlong);if(n(i))return i}let o=[p[0]+s+r,p[1]];return n(o)?o:void 0}function $i(t,n){let a=ut(t.points),p=lt(t.carry)[0]+v.badge.r+v.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 ki(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 nr(t,n,a,p){let{m:l}=p,e=v.tree,s=v.box,r=(T,j)=>a.edges.find(x=>x.step===T&&x.event===j),o=new Map,i=new Map;n.steps.forEach((T,j)=>{for(let x of T.events)if(x.type==="edge")for(let P of[x.from,x.to])o.set(P,(o.get(P)??new Set).add(j)),x.carry.kind!=="none"&&!i.has(P)&&i.set(P,j)});let c=(T,j)=>{let x=n.steps[T]?.events[j];return x?.type==="edge"&&x.carry.kind!=="none"},m=t.runs.filter(T=>c(T.step,T.event)).reduce((T,j)=>T===void 0?j.step:Math.min(T,j.step),void 0),f=m===void 0?void 0:a.steps[m]?.start,d=T=>{if(m===void 0||f===void 0)return;let j=i.get(T);if(j!==void 0&&j<=m)return;let x=j===void 0?void 0:a.steps[j]?.start,P=[[0,{opacity:1}],[f,{opacity:1},me.inOut],[f+ie.fade,{opacity:e.faint}]];return x!==void 0&&P.push([x,{opacity:e.faint},me.inOut],[x+ie.fade,{opacity:1}]),P.push([l.last,{opacity:x===void 0?e.faint:1},me.inOut],[l.total,{opacity:1}]),l.kf(P)},u=(T,j,x="")=>{let P=d(T);return P?`<g class="dg-a"${x} style="${P}">${j}</g>`:x===""?j:`<g${x}>${j}</g>`},k=new Map(t.nodes.map(T=>[T.id,r(T.step,T.event)?.drawn??0])),h=t.links.map(T=>{let j=r(T.step,T.event);if(!j)return"";p.traces.push({from:T.from,to:T.to,points:T.points,shown:[[j.start,Number.POSITIVE_INFINITY]]});let x=l.kf([[0,{opacity:0,"stroke-dashoffset":1}],[j.start,{opacity:0,"stroke-dashoffset":1},me.inOut],[j.start+.05,{opacity:1}],[j.drawn,{"stroke-dashoffset":0}],[l.last,{opacity:1,"stroke-dashoffset":0},me.inOut],[l.total,{opacity:0,"stroke-dashoffset":0}]]);return u(T.from,`<path class="dg-tree-l dg-a" data-tree-link="${$e(T.from)}" pathLength="1" d="${it(T.points)}" style="${x}"/>`)}).join(""),w=t.nodes.flatMap(T=>{if(!T.card)return[];let j=k.get(T.id)??0,x=`M ${ot(T.cx)} ${ot(T.y+T.h+v.edge.inset)} V ${ot(T.card.y-v.edge.inset)}`;return[u(T.id,`<path class="dg-tree-con dg-a" d="${x}" style="${l.vis(j)}"/>`)]}).join(""),g=new Set,N=t.runs.flatMap(T=>{let j=t.edges.find(W=>W.step===T.step&&W.event===T.event);if(!j||g.has(T.link))return[];let x=a.carriers.find(W=>W.step===T.step&&W.event===T.event),P=r(T.step,T.event),b=x?.depart??P?.start,B=x?.arrive??P?.drawn;if(b===void 0||B===void 0)return[];g.add(T.link);let _=l.kf([[0,{opacity:0,"stroke-dashoffset":1}],[b,{opacity:0,"stroke-dashoffset":1},me.inOut],[b+.05,{opacity:1}],[B,{"stroke-dashoffset":0}],[l.last,{opacity:1,"stroke-dashoffset":0},me.inOut],[l.total,{opacity:0,"stroke-dashoffset":0}]]),K=it(j.points);return[`<g style="${we(j.color)}"><path class="dg-tree-tr dg-a" data-tree-trail="${$e(T.link)}" pathLength="1" d="${K}" style="${_}"/><path class="dg-tree-h dg-a" d="${At(j.points)}" style="${l.vis(B)}"/></g>`]}).join(""),L=t.nodes.flatMap(T=>{let j=T.card;if(!j)return[];let x=j.x+e.card.padX+e.card.icon/2,P=j.y+j.h/2,b=Se(p.ink,"dg-tree-ct",j.x+e.card.padX+e.card.icon+e.card.gap,P+v.baseline.label,j.text,q.treeCard,Ce);return[u(T.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",x,P,e.card.glyph,"dg-tree-cg")}${b}`,` data-tree-card="${$e(T.id)}"`)]}).join(""),F=t.nodes.map(T=>{let j=k.get(T.id)??0,x=[...o.get(T.id)??[]].sort((R,D)=>R-D),P=x.length>0?Zt(p,x):void 0,b=T.root?e.root.radius:e.radius,B=(R,D="")=>`<rect class="${R}" x="${ot(T.x)}" y="${ot(T.y)}" width="${ot(T.w)}" height="${T.h}" rx="${b}"${D}/>`,_=`${P?`<g class="dg-a" style="${P}">${B("dg-halo")}</g>`:""}${B("dg-st",` ${p.sh}`)}${P?`<g class="dg-a" style="${P}">${B("dg-on")}</g>`:""}`,K=T.x+e.root.iconX+s.icon/2,W=T.root?`<rect class="dg-ic" x="${ot(K-s.icon/2)}" y="${ot(T.cy-s.icon/2)}" width="${s.icon}" height="${s.icon}" rx="${s.iconRadius}"/>${rt("tree",K,T.cy,s.iconScale)}`:"",ee=[[j,Number.POSITIVE_INFINITY]],C=T.lines.map((R,D)=>{let V=T.styles[D]??q.boxName,Q=V===q.treeHash?"dg-tree-hash":V===q.treeName?"dg-tree-name":V===q.rootHash?"dg-tree-rh":V===q.rootName?"dg-tree-rn":"dg-tree-one",U=T.baselines[D]??T.cy;return T.root?Se(p.ink,Q,T.x+e.root.textX,U,R,V,ee):Se(p.ink,Q,T.cx,U,R,V,ee,"middle")}).join(""),M=u(T.id,`${_}${W}${C}`,` data-tree-node="${$e(T.id)}"${T.root?` data-tree-root="${$e(T.id)}"`:""}`);return`<g class="dg-popc dg-a" style="${we(T.color)};${l.pop(j)}">${M}</g>`}).join("");return{links:h+w,trails:N,nodes:L+F,appear:k}}jt("git",Vn);jt("lineup",Wn);jt("state",Hn);jt("time",Xn);jt("tree",zn);function rr(t){let n=vi(t),a=Pi(t,n),p=n.map(()=>({top:0,bottom:0})),l=sr(t,n,a,p);for(let e=0;e<3&&Oi(l,n,a,p);e++)l=sr(t,n,a,p);return l}function vi(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 ir=t=>t==="left"||t==="right";function Pi(t,n){let a=v.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=(w,g)=>w>=0&&w<a&&!i.has(`${w},${g}`),m=(w,g)=>{let N=Math.min(a-1,Math.max(0,w));for(let L=g;;L++)for(let F=0;F<a;F++)for(let T of[N+F,N-F])if(c(T,L))return[T,L]},f=(w,g,N)=>{l.set(w,{group:r,col:g,row:N}),i.add(`${g},${N}`)},d=1,u=w=>{for(let g of p){let N=g.from===w?g.to:g.to===w?g.from:void 0;if(N===void 0||!o.has(N)||l.has(N))continue;let L=l.get(w),[F,T]=ir(g.labelSide)?m(L.col,L.row+1):c(L.col+d,L.row)?[L.col+d,L.row]:m(L.col+d,L.row);f(N,F,T),u(N)}},k=w=>{for(let g=0;g<p.length;g++){let N=p[g],L=N?.from===w?N.to:N?.to===w?N.from:void 0,F=L===void 0?void 0:l.get(L);if(F&&F.group<r)return{order:g,col:F.col}}},h=0;for(;;){let w=s.members.filter(j=>!l.has(j));if(w.length===0)break;let g=w.map(j=>({id:j,anchor:k(j)})).filter(j=>j.anchor!==void 0);g.sort((j,x)=>(j.anchor?.order??0)-(x.anchor?.order??0));let N=g[0]??{id:w[0],anchor:void 0},L=N.anchor?.col??0;h===0&&(d=L>=(a-1)/2?-1:1);let[F,T]=c(L,0)?[L,0]:m(L,0);f(N.id,F,T),u(N.id),h++}});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 Si(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 Mi(t){let{icon:n,nameY:a,line:p,inset:l}=v.region,e=Si(t.name),s=Math.max(n,...e.map(o=>pe(o,q.regionName)),pe(t.note??"",q.regionNote)),r=a-l+(e.length-1)*p+(t.note?p:0)+v.gap/2;return{w:s,h:r,lines:e}}function sr(t,n,a,p){let{box:l,region:e,architecture:s,margin:r,gap:o}=v,i=He(t),c=In(t),m=$t(t),f=Math.max(1,...[...a.values()].map(y=>y.col+1)),d=kt(t),u=new Map(t.boxes.map(y=>[y.id,Math.max(tt(t,y.id,!0),vt(d.get(y.id),y.icon!==void 0,l.padX))])),k=Array.from({length:f},(y,G)=>Math.max(l.minW,...[...a].filter(([,A])=>A.col===G).map(([A])=>u.get(A)??l.minW))),h=Array.from({length:Math.max(0,f-1)},()=>s.columnGap);for(let{edge:y}of m){let G=a.get(y.from),A=a.get(y.to);if(!G||!A||y.label===void 0||G.group!==A.group||G.row!==A.row||Math.abs(G.col-A.col)!==1||ir(y.labelSide))continue;let z=pe(y.label,We(y.label))+v.label.padX*2+s.labelRoom*2,ae=Math.min(G.col,A.col);z<=s.maxColumnGap&&(h[ae]=Math.max(h[ae]??0,z))}let w=n.map(y=>y.region?Mi(y.region):void 0),g=Math.max(0,...w.map(y=>y?y.w+e.inset*2:0)),N=[];for(let y=0;y<f;y++)N.push(y===0?r+(g>0?g:e.pad):N[y-1]+k[y-1]+h[y-1]);let L=y=>N[y]+k[y]/2,F=new Set(m.filter(({edge:y})=>y.from===y.to).map(({edge:y})=>y.from)),T=new Set([...F].flatMap(y=>{let G=a.get(y);return G?[`${G.group}:${G.row}`]:[]})),j=(y,G)=>T.has(`${y}:${G}`)?Cn:0,x=[],P=[],b=r;n.forEach((y,G)=>{let A=Math.max(1,...y.members.map(Pe=>(a.get(Pe)?.row??0)+1)),z=p[G],ae=b+e.pad+z.top,Z=[0];for(let Pe=1;Pe<A;Pe++)Z.push(Z[Pe-1]+l.h+s.rowGap+j(G,Pe-1));for(let Pe of y.members){let qe=a.get(Pe),Re=t.boxes.find(Ke=>Ke.id===Pe),Te=u.get(Pe)??l.minW,De=L(qe.col),Ve=ae+Z[qe.row];x.push({id:Pe,name:Re?.name??Pe,...Re?.sub!==void 0?{sub:Re.sub}:{},...Re?.icon!==void 0?{icon:Re.icon}:{},color:i.get(Pe)??"slate",x:De-Te/2,y:Ve,w:Te,h:l.h,cx:De,cy:Ve+l.h/2})}let J=ae+Z[A-1]+l.h+j(G,A-1),se=w[G],de=Math.max(J+e.pad+z.bottom-b,se?se.h+e.inset*2:0,y.region?e.minH:0);P.push({group:G,y:b,h:de,rows:A}),b+=de+e.gap});let B=b-e.gap;for(let y of x)Pt(y,d.get(y.id));let _=new Map(x.map(y=>[y.id,y])),K=y=>P[a.get(y)?.group??0],W=(y,G,A)=>{for(let z=1;z<y.length;z++){let[ae,Z]=y[z-1],[J,se]=y[z];if(Math.min(ae,J)<=G.x+G.w+A&&Math.max(ae,J)>=G.x-A&&Math.min(Z,se)<=G.y+G.h+A&&Math.max(Z,se)>=G.y-A)return!0}return!1},ee=[...F].flatMap(y=>{let G=_.get(y);return G?[{x:G.x,y:G.y+G.h,w:G.w,h:Cn}]:[]}),C=y=>ee.some(G=>W(y,G,0)),M=(y,G,A)=>x.some(z=>z.id!==G&&z.id!==A&&W(y,z,v.label.search))||C(y),R=y=>{let G=_.get(y),A=K(y),z=a.get(y),ae=G.y+G.h+(z?j(z.group,z.row):0);return(z?.row??0)<A.rows-1?ae+s.rowGap/2:Math.min(ae+e.pad/2,A.y+A.h-v.edge.inset)},D=y=>{let G=_.get(y),A=K(y);return(a.get(y)?.row??0)>0?G.y-s.rowGap/2:Math.max(G.y-e.pad/2,A.y+v.edge.inset)},V=v.edge.inset,Q=(y,G)=>G?N[y]+k[y]+(h[y]??s.columnGap)/2:N[y]-(h[y-1]??s.columnGap)/2,U=(y,G)=>{let A=_.get(y),z=_.get(G);if(y===G)return Et(A);let ae=a.get(y),Z=a.get(G);if(ae.group===Z.group&&ae.row===Z.row){let Te=z.cx>A.cx,De=[[Te?A.x+A.w:A.x,A.cy],[Te?z.x-V:z.x+z.w+V,z.cy]];if(!M(De,y,G))return De;let Ve=R(y),Ke=[[A.cx,A.y+A.h],[A.cx,Ve],[z.cx,Ve],[z.cx,z.y+z.h+V]];if(!C(Ke))return Ke;let gt=D(y),dt=[[A.cx,A.y],[A.cx,gt],[z.cx,gt],[z.cx,z.y-V]];return C(dt)?Ke:dt}let J=z.cy>A.cy,se=[A.cx,J?A.y+A.h:A.y],de=[z.cx,J?z.y-V:z.y+z.h+V];if(ae.col===Z.col){let Te=[se,de];if(!M(Te,y,G))return Te;let De=Q(ae.col,!0);return[[A.x+A.w,A.cy],[De,A.cy],[De,z.cy],[z.x+z.w+V,z.cy]]}let Pe=z.cx>A.cx,qe=J?R(y):D(y),Re=[[se,[A.cx,z.cy],[Pe?z.x-V:z.x+z.w+V,z.cy]],[[Pe?A.x+A.w:A.x,A.cy],[z.cx,A.cy],de],[se,[A.cx,qe],[z.cx,qe],de]];if(F.has(y)||F.has(G)){let Te=Q(ae.col,Pe),De=Q(Z.col,!Pe),Ve=[[Pe?A.x+A.w:A.x,A.cy],[Te,A.cy]],Ke=[Pe?z.x-V:z.x+z.w+V,z.cy];Re.push([...Ve,[Te,z.cy],Ke],[...Ve,[Te,qe],[z.cx,qe],de],[se,[A.cx,qe],[De,qe],[De,z.cy],Ke],[...Ve,[Te,qe],[De,qe],[De,z.cy],Ke])}return Re.find(Te=>!M(Te,y,G))??Re[2]},re=m.map(({step:y,event:G,edge:A})=>({step:y,event:G,from:A.from,to:A.to,points:U(A.from,A.to),color:at(A,i),carry:A.carry}));ft(re,_,d);let I=new Map;for(let y of re){if(y.points.length!==2||!re.some(J=>J.from===y.to&&J.to===y.from&&J.points.length===2))continue;let[A,z]=y.points,ae=Math.abs(z[1]-A[1])<Math.abs(z[0]-A[0]),Z=(y.from<y.to?1:-1)*v.edge.parallel;y.points=y.points.map(([J,se])=>ae?[J,se+Z]:[J+Z,se]),I.set(y,ae?Z>0?"below":"above":Z>0?"right":"left")}let oe=[];n.forEach((y,G)=>{let A=P[G],z=w[G];!y.region||!z||oe.push({id:y.region.id,lines:z.lines,...y.region.note!==void 0?{note:y.region.note}:{},...y.region.icon!==void 0?{icon:y.region.icon}:{},color:c.get(y.region.id)??"slate",x:r,y:A.y,w:0,h:A.h,header:{x:r+e.inset,y:A.y+e.inset,w:z.w,h:z.h}})});let le=(y,G,A)=>y.from===y.to?Ht(y.points):st(y.points,G,A),ye=ht(re,t.steps.length,le),ue=[];for(let y of re){let G=t.steps[y.step]?.events[y.event];if(G?.type!=="edge"||G.label===void 0)continue;let A=[...ye].filter(([J])=>J<=y.step).map(([,J])=>Ye(J.point)),z=[...oe.map(J=>J.header),...ue.filter(J=>J.step===y.step)],ae=G.labelSide??I.get(y),Z=y.from===y.to?{side:"below",base:Xt(y.points,pe(G.label,We(G.label))+v.label.padX*2)}:void 0;ue.push(Ze({step:y.step,event:y.event,text:G.label,points:y.points,color:y.color,...Z??(ae?{side:ae}:{flip:!0})},{hard:x,soft:z,touch:A}))}let ke={kind:"architecture",width:0,height:0,regions:oe,boxes:x,lifelines:[],edges:re,labels:ue,actions:[],badges:[],paths:[],ends:[]},Me=ue.length>0?Math.max(0,r+v.label.soft-Math.min(...ue.map(y=>y.x))):0;Me>0&&Lt(ke,Me,0);let E=Math.max(...x.map(y=>y.x+y.w+e.pad),...ue.map(y=>y.x+y.w+v.label.soft),...re.flatMap(y=>y.points.map(G=>G[0]+e.pad))),O=Math.max(E+r,ze(t)+r*2);for(let y of oe)y.w=O-r*2;let X=Math.max(B,...ue.map(y=>y.y+y.h)),S=Ue(t,r,X+o,O-r*2);ke.width=O,ke.height=(S?S.y+S.h:X)+r,S&&(ke.strip=S);let H=ht(re,t.steps.length,le);return ke.badges=Xe(t.steps.map((y,G)=>{let A=H.get(G);return A?{step:G,x:A.point[0],y:A.point[1],color:A.edge.color}:qt(y.events,G,ke)})),ke}function Oi(t,n,a,p){let l=!1,e=v.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 or(t){let{box:n,sequence:a,label:p,margin:l,gap:e}=v,s=He(t),r=t.sequence?.lifelines??[],o=[...r,...t.boxes.map(C=>C.id).filter(C=>!r.includes(C))],i=new Map(o.map((C,M)=>[C,M])),c=o.map(C=>tt(t,C,!1)),m=c.slice(1).map((C,M)=>c[M]/2+C/2+a.columnGap),f=[];for(let C of t.steps)for(let M of C.events){if(M.type!=="edge"||M.label===void 0)continue;let R=i.get(M.from)??0,D=i.get(M.to)??0,V=pe(M.label,We(M.label))+p.padX*2;R===D?R<m.length&&f.push({from:R,to:R+1,need:a.selfW+p.side+V+a.labelRoom}):f.push({from:Math.min(R,D),to:Math.max(R,D),need:V+a.labelRoom*2})}f.sort((C,M)=>C.to-C.from-(M.to-M.from));for(let{from:C,to:M,need:R}of f){let D=0;for(let Q=C;Q<M;Q++)D+=m[Q]??0;if(D>=R)continue;let V=(R-D)/(M-C);for(let Q=C;Q<M;Q++)m[Q]=(m[Q]??0)+V}let d=[];o.forEach((C,M)=>d.push(M===0?l+c[0]/2:d[M-1]+m[M-1]));let u=o.map((C,M)=>{let R=t.boxes.find(Q=>Q.id===C),D=c[M],V=d[M];return{id:C,name:R?.name??C,...R?.sub!==void 0?{sub:R.sub}:{},...R?.icon!==void 0?{icon:R.icon}:{},color:s.get(C)??"slate",x:V-D/2,y:l,w:D,h:n.h,cx:V,cy:l+n.h/2}}),k=l+n.h,h=[],w=[],g=[],N=k+a.firstRow,L=0,F=!0;t.steps.forEach((C,M)=>{C.events.forEach((R,D)=>{if(R.type!=="edge"&&R.type!=="action")return;let V,Q;if(R.type==="edge"){let U=R.labelSide??"above",re=R.from===R.to,I=R.label!==void 0;V=I&&U==="above"?a.labelOffset+p.h/2:e,Q=re?a.selfH+e:I&&U==="below"?a.labelOffset+p.h/2:e}else V=v.action.h/2,Q=v.action.h/2;if(N=F?N+V:N+Math.max(a.minPitch,L+a.rowGap+V)+(D===0&&M>0?a.stepGap:0),F=!1,L=Q,R.type==="edge"){let U=d[i.get(R.from)??0],re=d[i.get(R.to)??0],I=Math.sign(re-U)||1,oe=U===re?[[U,N],[U+a.selfW,N],[U+a.selfW,N+a.selfH],[U+v.edge.inset,N+a.selfH]]:[[U,N],[re-I*v.edge.inset,N]],le=at(R,s),ye={};if(R.carry.kind!=="none"){let ue=v.slot.lifeline+lt(R.carry)[0],[ke,Me]=oe,[E,O]=oe.slice(-2),X=Math.sign(Me[0]-ke[0])||1,S=Math.sign(O[0]-E[0])||-1;ye.wait=[U-X*ue,ke[1]],ye.settle=[re+S*ue,O[1]]}h.push({step:M,event:D,from:R.from,to:R.to,points:oe,color:le,carry:R.carry,...ye}),R.label!==void 0&&g.push({step:M,event:D,text:R.label,points:oe,color:le,...R.labelSide?{side:R.labelSide}:U===re?{side:"right"}:{},offset:a.labelOffset})}else{let U=d[i.get(R.box)??0],re=pe(R.label,q.action)+v.action.padX*2;w.push({step:M,event:D,box:R.box,text:R.label,color:s.get(R.box)??"slate",x:U+v.badge.r+4,y:N-v.action.h/2,w:re,h:v.action.h})}})});let T=(F?k:N+L)+a.tail,j=o.map((C,M)=>({id:C,x:d[M],y1:k,y2:T})),x=ht(h,t.steps.length),P=[];for(let C of g){let M=[...x].filter(([D])=>D<=C.step).map(([,D])=>Ye(D.point)),R=[...P.filter(D=>D.step===C.step),...w];P.push(Ze(C,{hard:u,soft:R,touch:M}))}let b={kind:"sequence",width:0,height:0,regions:[],boxes:u,lifelines:j,edges:h,labels:P,actions:w,badges:[],paths:[],ends:[]},B=[...u.map(C=>C.x),...P.map(C=>C.x),...w.map(C=>C.x)],_=Math.max(0,l-Math.min(...B));_>0&&Lt(b,_,0);let K=[...u.map(C=>C.x+C.w),...P.map(C=>C.x+C.w),...w.map(C=>C.x+C.w),...h.flatMap(C=>C.points.map(M=>M[0]))],W=Math.max(Math.max(...K)+l,ze(t)+l*2),ee=Ue(t,l,T+e,W-l*2);return b.width=W,b.height=(ee?ee.y+ee.h:T)+l,ee&&(b.strip=ee),b.badges=Ti(t,b),b}function Ti(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 Ni={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"},Ei={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"},sn=(t,n)=>`${t} ${n}${t===1?"":"s"}`,Li={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=>Ni[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`},qi={additionalProperties:t=>`The ${t} field is not allowed`,required:t=>`The ${t} field is required`,enum:t=>`Use one of ${t.join(" / ")}`,type:t=>Ei[t]??`Use ${t}`,minLength:t=>`Write at least ${sn(t,"character")}`,maxLength:t=>`Write at most ${sn(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 ${sn(t,"item")}`,maxItems:t=>`Write at most ${sn(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`},rn={ja:Li,en:qi};function Ai(t){let n=0;for(let a of t)n++;return n}var Zn=pr,Un={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"]},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/text"}}},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/text"},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 k=u.length;for(let h=0;h<k;h++){let w=u[h],g=s,N=s;if(w&&typeof w=="object"&&!Array.isArray(w)){let x;if(w.type===void 0&&(x="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(w.type!==void 0){let P=w.type;if(!(P==="now"||P==="mark"||P==="span")){let b={};e===null?e=[b]:e.push(b),s++}}}var r=N===s;if(r){let x={instancePath:n+"/"+f+"/events/"+h,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=g,e!==null&&(g?e.length=g:e=null);let L=s,F=s;if(w&&typeof w=="object"&&!Array.isArray(w)){let x;if(w.type===void 0&&(x="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(w.type!==void 0){let P=w.type;if(!(P==="leaf"||P==="node")){let b={};e===null?e=[b]:e.push(b),s++}}}var o=F===s;if(o){let x={instancePath:n+"/"+f+"/events/"+h,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=L,e!==null&&(L?e.length=L:e=null);let T=s,j=s;if(w&&typeof w=="object"&&!Array.isArray(w)){let x;if(w.type===void 0&&(x="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(w.type!==void 0){let P=w.type;if(!(P==="line"||P==="seal"||P==="open"||P==="pick"||P==="stamp")){let b={};e===null?e=[b]:e.push(b),s++}}}var i=j===s;if(i){let x={instancePath:n+"/"+f+"/events/"+h,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=T,e!==null&&(T?e.length=T:e=null);if(w&&typeof w=="object"&&!Array.isArray(w)){if(w.type!==void 0){let x=w.type,P=s,b=s;if(!(x==="commit"||x==="branch")){let B={};e===null?e=[B]:e.push(B),s++}var c=b===s;if(c){let B={instancePath:n+"/"+f+"/events/"+h+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[B]:e.push(B),s++}else s=P,e!==null&&(P?e.length=P:e=null)}if(w.at!==void 0){let x={instancePath:n+"/"+f+"/events/"+h+"/at",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}if(w.into!==void 0){let x={instancePath:n+"/"+f+"/events/"+h+"/into",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}if(w.color!==void 0){let x={instancePath:n+"/"+f+"/events/"+h+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),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 on(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 k=0;k<u;k++){let h=d[k],w=s,g=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let j;if(h.type===void 0&&(j="type")){let x={};e===null?e=[x]:e.push(x),s++}else if(h.type!==void 0){let x=h.type;if(!(x==="now"||x==="mark"||x==="span")){let P={};e===null?e=[P]:e.push(P),s++}}}var r=g===s;if(r){let j={instancePath:n+"/"+m+"/events/"+k,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}else s=w,e!==null&&(w?e.length=w:e=null);let N=s,L=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let j;if(h.type===void 0&&(j="type")){let x={};e===null?e=[x]:e.push(x),s++}else if(h.type!==void 0){let x=h.type;if(!(x==="leaf"||x==="node")){let P={};e===null?e=[P]:e.push(P),s++}}}var o=L===s;if(o){let j={instancePath:n+"/"+m+"/events/"+k,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=N,e!==null&&(N?e.length=N:e=null);let F=s,T=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let j;if(h.type===void 0&&(j="type")){let x={};e===null?e=[x]:e.push(x),s++}else if(h.type!==void 0){let x=h.type;if(!(x==="line"||x==="seal"||x==="open"||x==="pick"||x==="stamp")){let P={};e===null?e=[P]:e.push(P),s++}}}var i=T===s;if(i){let j={instancePath:n+"/"+m+"/events/"+k,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}else s=F,e!==null&&(F?e.length=F:e=null);if(h&&typeof h=="object"&&!Array.isArray(h)){if(h.at!==void 0){let j={instancePath:n+"/"+m+"/events/"+k+"/at",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}if(h.into!==void 0){let j={instancePath:n+"/"+m+"/events/"+k+"/into",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}if(h.color!==void 0){let j={instancePath:n+"/"+m+"/events/"+k+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[j]:e.push(j),s++}}}}}}}return on.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 k=0;k<u;k++){let h=d[k],w=s,g=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let F;if(h.type===void 0&&(F="type")){let T={};e===null?e=[T]:e.push(T),s++}else if(h.type!==void 0){let T=h.type;if(!(T==="leaf"||T==="node")){let j={};e===null?e=[j]:e.push(j),s++}}}var r=g===s;if(r){let F={instancePath:n+"/"+m+"/events/"+k,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}else s=w,e!==null&&(w?e.length=w:e=null);let N=s,L=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let F;if(h.type===void 0&&(F="type")){let T={};e===null?e=[T]:e.push(T),s++}else if(h.type!==void 0){let T=h.type;if(!(T==="line"||T==="seal"||T==="open"||T==="pick"||T==="stamp")){let j={};e===null?e=[j]:e.push(j),s++}}}var o=L===s;if(o){let F={instancePath:n+"/"+m+"/events/"+k,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}else s=N,e!==null&&(N?e.length=N:e=null);if(h&&typeof h=="object"&&!Array.isArray(h)&&h.type!==void 0){let F=h.type,T=s,j=s;if(!(F==="commit"||F==="branch")){let x={};e===null?e=[x]:e.push(x),s++}var i=j===s;if(i){let x={instancePath:n+"/"+m+"/events/"+k+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=T,e!==null&&(T?e.length=T:e=null)}}}}}}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 k=0;k<u;k++){let h=d[k],w=s,g=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let F;if(h.type===void 0&&(F="type")){let T={};e===null?e=[T]:e.push(T),s++}else if(h.type!==void 0){let T=h.type;if(!(T==="now"||T==="mark"||T==="span")){let j={};e===null?e=[j]:e.push(j),s++}}}var r=g===s;if(r){let F={instancePath:n+"/"+m+"/events/"+k,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}else s=w,e!==null&&(w?e.length=w:e=null);let N=s,L=s;if(h&&typeof h=="object"&&!Array.isArray(h)){let F;if(h.type===void 0&&(F="type")){let T={};e===null?e=[T]:e.push(T),s++}else if(h.type!==void 0){let T=h.type;if(!(T==="line"||T==="seal"||T==="open"||T==="pick"||T==="stamp")){let j={};e===null?e=[j]:e.push(j),s++}}}var o=L===s;if(o){let F={instancePath:n+"/"+m+"/events/"+k,schemaPath:"#/definitions/notLineupEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}else s=N,e!==null&&(N?e.length=N:e=null);if(h&&typeof h=="object"&&!Array.isArray(h)){if(h.type!==void 0){let F=h.type,T=s,j=s;if(!(F==="commit"||F==="branch")){let x={};e===null?e=[x]:e.push(x),s++}var i=j===s;if(i){let x={instancePath:n+"/"+m+"/events/"+k+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=T,e!==null&&(T?e.length=T:e=null)}if(h.at!==void 0){let F={instancePath:n+"/"+m+"/events/"+k+"/at",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}if(h.into!==void 0){let F={instancePath:n+"/"+m+"/events/"+k+"/into",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}if(h.color!==void 0){let F={instancePath:n+"/"+m+"/events/"+k+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[F]:e.push(F),s++}}}}}}}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 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 k=u.length;for(let h=0;h<k;h++){let w=u[h],g=s,N=s;if(w&&typeof w=="object"&&!Array.isArray(w)){let x;if(w.type===void 0&&(x="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(w.type!==void 0){let P=w.type;if(!(P==="now"||P==="mark"||P==="span")){let b={};e===null?e=[b]:e.push(b),s++}}}var r=N===s;if(r){let x={instancePath:n+"/"+f+"/events/"+h,schemaPath:"#/items/properties/events/items/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=g,e!==null&&(g?e.length=g:e=null);let L=s,F=s;if(w&&typeof w=="object"&&!Array.isArray(w)){let x;if(w.type===void 0&&(x="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(w.type!==void 0){let P=w.type;if(!(P==="leaf"||P==="node")){let b={};e===null?e=[b]:e.push(b),s++}}}var o=F===s;if(o){let x={instancePath:n+"/"+f+"/events/"+h,schemaPath:"#/items/properties/events/items/allOf/0/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=L,e!==null&&(L?e.length=L:e=null);let T=s,j=s;if(w&&typeof w=="object"&&!Array.isArray(w)){let x;if(w.type===void 0&&(x="type")){let P={};e===null?e=[P]:e.push(P),s++}else if(w.type!==void 0){let P=w.type;if(!(P==="edge"||P==="action")){let b={};e===null?e=[b]:e.push(b),s++}}}var i=j===s;if(i){let x={instancePath:n+"/"+f+"/events/"+h,schemaPath:"#/definitions/notWiredEvent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}else s=T,e!==null&&(T?e.length=T:e=null);if(w&&typeof w=="object"&&!Array.isArray(w)){if(w.type!==void 0){let x=w.type,P=s,b=s;if(!(x==="commit"||x==="branch")){let B={};e===null?e=[B]:e.push(B),s++}var c=b===s;if(c){let B={instancePath:n+"/"+f+"/events/"+h+"/type",schemaPath:"#/items/properties/events/items/properties/type/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[B]:e.push(B),s++}else s=P,e!==null&&(P?e.length=P:e=null)}if(w.color!==void 0){let x={instancePath:n+"/"+f+"/events/"+h+"/color",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),s++}}}}}}}return pn.errors=e,s===0}var Ot={enum:["blue","amber","green","violet","rose","slate","coin"]},Ne=new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$","u"),Oe=Ai;function cn(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(!Ne.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(Oe(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(Oe(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(typeof r=="string"){if(Oe(r)<1){let o={instancePath:n+"/icon",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+"/icon",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 cn.errors=e,s===0}var lr=new RegExp("^(/|https?://)","u");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==="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(!Ne.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(Oe(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(Oe(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(typeof r=="string"){if(Oe(r)<1){let o={instancePath:n+"/icon",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+"/icon",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[o]:e.push(o),s++}}if(t.region!==void 0){let r=t.region;if(typeof r=="string"){if(!Ne.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(!lr.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 dn.errors=e,s===0}var ji=new RegExp("^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$","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.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(Oe(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(!ji.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 mn.errors=e,s===0}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.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(Oe(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(Oe(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++)mn(r[i],{instancePath:n+"/meters/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?mn.errors:e.concat(mn.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 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.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(Oe(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(!lr.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 un.errors=e,s===0}var ar={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 Jn=new RegExp("^[0-9a-f]{4,40}$","u"),Ri={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 hn(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 k={instancePath:n,schemaPath:"#/then/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};e===null?e=[k]:e.push(k),s++}var c=d===s;o=c,m="then"}else{let d=s,u=s,k=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let w;if(t.text===void 0&&(w="text")){let g={};e===null?e=[g]:e.push(g),s++}}var f=k===s;if(f){let w={instancePath:n,schemaPath:"#/else/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[w]:e.push(w),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:Ri.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(Oe(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 hn.errors=e,s===0}function gn(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(!Ne.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(!Ne.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(Oe(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&&(hn(t.carry,{instancePath:n+"/carry",parentData:t,parentDataProperty:"carry",rootData:l})||(e=e===null?hn.errors:e.concat(hn.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:ar.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(!Ne.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(Oe(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(!Ne.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(Oe(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(!Ne.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(!Ne.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(!Ne.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(!Ne.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(!Jn.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(Oe(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(!Ne.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(!Ne.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(!Ne.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(Oe(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:ar.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(!Ne.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(!Jn.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(!Ne.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(!Ne.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(!Jn.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(!Ne.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(!Ne.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(!Ne.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(!Ne.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(!Ne.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(!Ne.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(Oe(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(Oe(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(Oe(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(Oe(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 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.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(Oe(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(Oe(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(Oe(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++)un(r[i],{instancePath:n+"/sources/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?un.errors:e.concat(un.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++)gn(r[i],{instancePath:n+"/events/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?gn.errors:e.concat(gn.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 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.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(!Ne.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 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.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(!Ne.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(!Ne.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(Oe(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 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.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++)xn(r[i],{instancePath:n+"/paths/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?xn.errors:e.concat(xn.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 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.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(!Ne.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(Oe(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 $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.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++)$n(r[i],{instancePath:n+"/branches/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?$n.errors:e.concat($n.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 kn.errors=e,s===0}var Di=new RegExp("^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$","u");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.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(Oe(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(!Di.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 vn.errors=e,s===0}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.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(Oe(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 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.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(!Ne.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(Oe(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 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.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(!Ne.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 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.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 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.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&&(vn(t.scale,{instancePath:n+"/scale",parentData:t,parentDataProperty:"scale",rootData:l})||(e=e===null?vn.errors:e.concat(vn.errors),s=e.length)),t.period!==void 0&&(Pn(t.period,{instancePath:n+"/period",parentData:t,parentDataProperty:"period",rootData:l})||(e=e===null?Pn.errors:e.concat(Pn.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++)Sn(r[i],{instancePath:n+"/rows/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?Sn.errors:e.concat(Sn.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++)Mn(r[i],{instancePath:n+"/points/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?Mn.errors:e.concat(Mn.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&&(On(t.zoom,{instancePath:n+"/zoom",parentData:t,parentDataProperty:"zoom",rootData:l})||(e=e===null?On.errors:e.concat(On.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 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.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(!Ne.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(Oe(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(Oe(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 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.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++)Nn(r[i],{instancePath:n+"/items/"+i,parentData:r,parentDataProperty:i,rootData:l})||(e=e===null?Nn.errors:e.concat(Nn.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 En.errors=e,s===0}var Ii=Object.prototype.hasOwnProperty;function pr(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 N={};e===null?e=[N]:e.push(N),s++}else if(t.kind!==void 0&&t.kind!=="sequence"){let N={};e===null?e=[N]:e.push(N),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 L={instancePath:n,schemaPath:"#/then/required",keyword:"required",params:{missingProperty:"sequence"},message:"must have required property 'sequence'"};e===null?e=[L]:e.push(L),s++}if(t.boxes!==void 0){let L=t.boxes;if(Array.isArray(L)&&L.length<1){let F={instancePath:n+"/boxes",schemaPath:"#/then/properties/boxes/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[F]:e.push(F),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 L={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[L]:e.push(L),s++}if(t.git!==void 0){let L={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[L]:e.push(L),s++}if(t.time!==void 0){let L={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[L]:e.push(L),s++}if(t.lineup!==void 0){let L={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[L]:e.push(L),s++}}var c=g===s;o=c,m="then"}else{let g=s,N=s,L=!0,F=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let x;if(t.kind===void 0&&(x="kind")){let P={};e===null?e=[P]:e.push(P),s++}else if(t.kind!==void 0&&t.kind!=="state"){let P={};e===null?e=[P]:e.push(P),s++}}var f=F===s;s=N,e!==null&&(N?e.length=N:e=null);let T;if(f){let x=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.boxes!==void 0){let b=t.boxes;if(Array.isArray(b)){if(b.length<1){let _={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=[_]:e.push(_),s++}let B=b.length;for(let _=0;_<B;_++){let K=b[_];if(K&&typeof K=="object"&&!Array.isArray(K)&&K.id!==void 0){let W=K.id,ee=s,C=s;if(!(W==="start"||W==="finish")){let M={};e===null?e=[M]:e.push(M),s++}var d=C===s;if(d){let M={instancePath:n+"/boxes/"+_+"/id",schemaPath:"#/else/then/properties/boxes/items/properties/id/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[M]:e.push(M),s++}else s=ee,e!==null&&(ee?e.length=ee: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 b={instancePath:n+"/git",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 f=x===s;L=f,T="then"}else{let x=s,P=s,b=!0,B=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let W;if(t.kind===void 0&&(W="kind")){let ee={};e===null?e=[ee]:e.push(ee),s++}else if(t.kind!==void 0&&t.kind!=="git"){let ee={};e===null?e=[ee]:e.push(ee),s++}}var u=B===s;s=P,e!==null&&(P?e.length=P:e=null);let _;if(u){let W=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.git===void 0){let C={instancePath:n,schemaPath:"#/else/else/then/required",keyword:"required",params:{missingProperty:"git"},message:"must have required property 'git'"};e===null?e=[C]:e.push(C),s++}if(t.steps!==void 0&&(on(t.steps,{instancePath:n+"/steps",parentData:t,parentDataProperty:"steps",rootData:l})||(e=e===null?on.errors:e.concat(on.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 C={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[C]:e.push(C),s++}if(t.regions!==void 0){let C={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[C]:e.push(C),s++}if(t.time!==void 0){let C={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[C]:e.push(C),s++}if(t.lineup!==void 0){let C={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[C]:e.push(C),s++}}var u=W===s;b=u,_="then"}else{let W=s,ee=s,C=!0,M=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let V;if(t.kind===void 0&&(V="kind")){let Q={};e===null?e=[Q]:e.push(Q),s++}else if(t.kind!==void 0&&t.kind!=="time"){let Q={};e===null?e=[Q]:e.push(Q),s++}}var k=M===s;s=ee,e!==null&&(ee?e.length=ee:e=null);let R;if(k){let V=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.time===void 0){let U={instancePath:n,schemaPath:"#/else/else/else/then/required",keyword:"required",params:{missingProperty:"time"},message:"must have required property 'time'"};e===null?e=[U]:e.push(U),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.state!==void 0){let U={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[U]:e.push(U),s++}if(t.git!==void 0){let U={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[U]:e.push(U),s++}if(t.regions!==void 0){let U={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[U]:e.push(U),s++}if(t.lineup!==void 0){let U={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[U]:e.push(U),s++}}var k=V===s;C=k,R="then"}else{let V=s,Q=s,U=!0,re=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let le;if(t.kind===void 0&&(le="kind")){let ye={};e===null?e=[ye]:e.push(ye),s++}else if(t.kind!==void 0&&t.kind!=="tree"){let ye={};e===null?e=[ye]:e.push(ye),s++}}var h=re===s;s=Q,e!==null&&(Q?e.length=Q:e=null);let I;if(h){let le=s;if(t&&typeof t=="object"&&!Array.isArray(t)){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.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 ue={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ue]:e.push(ue),s++}if(t.git!==void 0){let ue={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ue]:e.push(ue),s++}if(t.time!==void 0){let ue={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ue]:e.push(ue),s++}if(t.regions!==void 0){let ue={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ue]:e.push(ue),s++}if(t.lineup!==void 0){let ue={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[ue]:e.push(ue),s++}}var h=le===s;U=h,I="then"}else{let le=s,ye=s,ue=!0,ke=s;if(t&&typeof t=="object"&&!Array.isArray(t)){let O;if(t.kind===void 0&&(O="kind")){let X={};e===null?e=[X]:e.push(X),s++}else if(t.kind!==void 0&&t.kind!=="lineup"){let X={};e===null?e=[X]:e.push(X),s++}}var w=ke===s;s=ye,e!==null&&(ye?e.length=ye:e=null);let Me;if(w){let O=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.lineup===void 0){let S={instancePath:n,schemaPath:"#/else/else/else/else/else/then/required",keyword:"required",params:{missingProperty:"lineup"},message:"must have required property 'lineup'"};e===null?e=[S]:e.push(S),s++}if(t.boxes!==void 0){let S=t.boxes;if(Array.isArray(S)){if(S.length<1){let y={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=[y]:e.push(y),s++}let H=S.length;for(let y=0;y<H;y++){let G=S[y];if(G&&typeof G=="object"&&!Array.isArray(G)){if(G.icon!==void 0){let A={instancePath:n+"/boxes/"+y+"/icon",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[A]:e.push(A),s++}if(G.link!==void 0){let A={instancePath:n+"/boxes/"+y+"/link",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[A]:e.push(A),s++}if(G.region!==void 0){let A={instancePath:n+"/boxes/"+y+"/region",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[A]:e.push(A),s++}}}}}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 S={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}if(t.git!==void 0){let S={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}if(t.time!==void 0){let S={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}if(t.regions!==void 0){let S={instancePath:n+"/regions",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}}var w=O===s;ue=w,Me="then"}else{let O=s;if(t&&typeof t=="object"&&!Array.isArray(t)){if(t.boxes!==void 0){let S=t.boxes;if(Array.isArray(S)&&S.length<1){let H={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=[H]:e.push(H),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 S={instancePath:n+"/state",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}if(t.git!==void 0){let S={instancePath:n+"/git",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}if(t.time!==void 0){let S={instancePath:n+"/time",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}if(t.lineup!==void 0){let S={instancePath:n+"/lineup",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[S]:e.push(S),s++}}var w=O===s;ue=w,Me="else"}if(!ue){let O={instancePath:n,schemaPath:"#/else/else/else/else/else/if",keyword:"if",params:{failingKeyword:Me},message:'must match "'+Me+'" schema'};e===null?e=[O]:e.push(O),s++}var h=le===s;U=h,I="else"}if(!U){let le={instancePath:n,schemaPath:"#/else/else/else/else/if",keyword:"if",params:{failingKeyword:I},message:'must match "'+I+'" schema'};e===null?e=[le]:e.push(le),s++}var k=V===s;C=k,R="else"}if(!C){let V={instancePath:n,schemaPath:"#/else/else/else/if",keyword:"if",params:{failingKeyword:R},message:'must match "'+R+'" schema'};e===null?e=[V]:e.push(V),s++}var u=W===s;b=u,_="else"}if(!b){let W={instancePath:n,schemaPath:"#/else/else/if",keyword:"if",params:{failingKeyword:_},message:'must match "'+_+'" schema'};e===null?e=[W]:e.push(W),s++}var f=x===s;L=f,T="else"}if(!L){let x={instancePath:n,schemaPath:"#/else/if",keyword:"if",params:{failingKeyword:T},message:'must match "'+T+'" schema'};e===null?e=[x]:e.push(x),s++}if(t&&typeof t=="object"&&!Array.isArray(t)&&t.sequence!==void 0){let x={instancePath:n+"/sequence",schemaPath:"#/definitions/absent/not",keyword:"not",params:{},message:"must NOT be valid"};e===null?e=[x]:e.push(x),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(!Ii.call(Un.properties,g)){let N={instancePath:n,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:g},message:"must NOT have additional properties"};e===null?e=[N]:e.push(N),s++}if(t.version!==void 0){let g=t.version;if(!(typeof g=="number"&&!(g%1)&&!isNaN(g)&&isFinite(g))){let N={instancePath:n+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"integer"},message:"must be integer"};e===null?e=[N]:e.push(N),s++}if(typeof g=="number"&&isFinite(g)&&(g<1||isNaN(g))){let N={instancePath:n+"/version",schemaPath:"#/properties/version/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};e===null?e=[N]:e.push(N),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 N={instancePath:n+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues:Un.properties.kind.enum},message:"must be equal to one of the allowed values"};e===null?e=[N]:e.push(N),s++}}if(t.title!==void 0){let g=t.title;if(typeof g=="string"){if(Oe(g)<1){let N={instancePath:n+"/title",schemaPath:"#/definitions/text/minLength",keyword:"minLength",params:{limit:1},message:"must NOT have fewer than 1 characters"};e===null?e=[N]:e.push(N),s++}}else{let N={instancePath:n+"/title",schemaPath:"#/definitions/text/type",keyword:"type",params:{type:"string"},message:"must be string"};e===null?e=[N]:e.push(N),s++}}if(t.view!==void 0){let g=t.view;if(!(g==="fixed"||g==="follow")){let N={instancePath:n+"/view",schemaPath:"#/properties/view/enum",keyword:"enum",params:{allowedValues:Un.properties.view.enum},message:"must be equal to one of the allowed values"};e===null?e=[N]:e.push(N),s++}}if(t.regions!==void 0){let g=t.regions;if(Array.isArray(g)){let N=g.length;for(let L=0;L<N;L++)cn(g[L],{instancePath:n+"/regions/"+L,parentData:g,parentDataProperty:L,rootData:l})||(e=e===null?cn.errors:e.concat(cn.errors),s=e.length)}else{let N={instancePath:n+"/regions",schemaPath:"#/properties/regions/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[N]:e.push(N),s++}}if(t.boxes!==void 0){let g=t.boxes;if(Array.isArray(g)){let N=g.length;for(let L=0;L<N;L++)dn(g[L],{instancePath:n+"/boxes/"+L,parentData:g,parentDataProperty:L,rootData:l})||(e=e===null?dn.errors:e.concat(dn.errors),s=e.length)}else{let N={instancePath:n+"/boxes",schemaPath:"#/properties/boxes/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[N]:e.push(N),s++}}if(t.strip!==void 0&&(fn(t.strip,{instancePath:n+"/strip",parentData:t,parentDataProperty:"strip",rootData:l})||(e=e===null?fn.errors:e.concat(fn.errors),s=e.length)),t.steps!==void 0){let g=t.steps;if(Array.isArray(g)){if(g.length<1){let L={instancePath:n+"/steps",schemaPath:"#/properties/steps/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};e===null?e=[L]:e.push(L),s++}let N=g.length;for(let L=0;L<N;L++)yn(g[L],{instancePath:n+"/steps/"+L,parentData:g,parentDataProperty:L,rootData:l})||(e=e===null?yn.errors:e.concat(yn.errors),s=e.length)}else{let N={instancePath:n+"/steps",schemaPath:"#/properties/steps/type",keyword:"type",params:{type:"array"},message:"must be array"};e===null?e=[N]:e.push(N),s++}}t.sequence!==void 0&&(bn(t.sequence,{instancePath:n+"/sequence",parentData:t,parentDataProperty:"sequence",rootData:l})||(e=e===null?bn.errors:e.concat(bn.errors),s=e.length)),t.state!==void 0&&(wn(t.state,{instancePath:n+"/state",parentData:t,parentDataProperty:"state",rootData:l})||(e=e===null?wn.errors:e.concat(wn.errors),s=e.length)),t.git!==void 0&&(kn(t.git,{instancePath:n+"/git",parentData:t,parentDataProperty:"git",rootData:l})||(e=e===null?kn.errors:e.concat(kn.errors),s=e.length)),t.time!==void 0&&(Tn(t.time,{instancePath:n+"/time",parentData:t,parentDataProperty:"time",rootData:l})||(e=e===null?Tn.errors:e.concat(Tn.errors),s=e.length)),t.lineup!==void 0&&(En(t.lineup,{instancePath:n+"/lineup",parentData:t,parentDataProperty:"lineup",rootData:l})||(e=e===null?En.errors:e.concat(En.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 pr.errors=e,s===0}var Ci=["edge","action","swap","strip","commit","branch","now","mark","span","leaf","node","line","seal","open","pick","stamp"],Fi="#/definitions/absent/not",_i={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"},Bi={carry:{field:"text",kind:"tag"}},Gi=/\/boxes\/items\/properties\/id\/not$/u,Yi=/\/events\/items\/properties\/type\/not$/u,Vi=["commit","branch"],Ki=/\/events\/items\/not$/u,Wi=["now","mark","span"],Hi=/\/events\/items\/allOf\/0\/not$/u,Xi=["leaf","node"],zi="#/definitions/notLineupEvent/not",Ui=["line","seal","open","pick","stamp"],Ji="#/definitions/notWiredEvent/not",Zi=["edge","action"],Qi=/^\^\[0-9\]\+\(\\\.\[0-9\]\+\)\?\(([a-z|]+)\)\$$/u,eo=/%\)\$$/u,Qn=t=>t.replaceAll("~","~0").replaceAll("/","~1"),to="#/definitions/url/pattern",no=/^\^\[0-9a-f\]\{(\d+),(\d+)\}\$$/u;function so(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 cr=(t,n)=>n.filter(a=>a!==t&&a.schemaPath.startsWith(`${t.schemaPath}/`)&&(a.instancePath===t.instancePath||a.instancePath.startsWith(`${t.instancePath}/`)));function ro(t,n,a){let p=t.params,l=t.instancePath;switch(t.keyword){case"additionalProperties":{let e=String(p.additionalProperty);return{pointer:`${l}/${Qn(e)}`,message:a.additionalProperties(e)}}case"required":{let e=String(p.missingProperty);return{pointer:`${l}/${Qn(e)}`,message:a.required(e)}}case"not":{if(Gi.test(t.schemaPath))return{pointer:l,message:a.reserved(Nt)};if(Yi.test(t.schemaPath))return{pointer:l,message:a.kindOnly(Vi,"git")};if(Ki.test(t.schemaPath))return{pointer:`${l}/type`,message:a.kindOnly(Wi,"time")};if(Hi.test(t.schemaPath))return{pointer:`${l}/type`,message:a.kindOnly(Xi,"tree")};if(t.schemaPath===zi)return{pointer:`${l}/type`,message:a.kindOnly(Ui,"lineup")};if(t.schemaPath===Ji)return{pointer:`${l}/type`,message:a.kindOnly(Zi,"sequence / architecture / state / git / time / tree")};let e=l.slice(l.lastIndexOf("/")+1);if(t.schemaPath===Fi)return{pointer:l,message:a.not({field:e,kind:_i[e]??e})};let s=Bi[e];return{pointer:s?`${l}/${s.field}`:l,message:a.not(s)}}case"anyOf":{let e=cr(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}/${Qn(e)}`,message:a.discriminator(e,Ci)}}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===to)return{pointer:l,message:a.url};let e=String(p.pattern),s=no.exec(e);if(s)return{pointer:l,message:a.hex(Number(s[1]),Number(s[2]))};let r=Qi.exec(e);return r?{pointer:l,message:a.duration((r[1]??"").split("|"))}:eo.test(e)?{pointer:l,message:a.ratio}:{pointer:l,message:a.pattern(so(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 dr(t,n={}){if(Zn(t))return{ok:!0};let a=Zn.errors??[],p=new Set(a.filter(s=>s.keyword==="anyOf").flatMap(s=>cr(s,a))),l=rn[n.lang??"ja"];return{ok:!1,errors:a.filter(s=>s.keyword!=="if"&&!p.has(s)).map(s=>ro(s,a,l))}}var mr=1;function io(t){if(typeof t!="object"||t===null)return;let n=t.version;return typeof n=="number"&&n>mr?n:void 0}var oo=(t,n)=>({pointer:"/version",message:rn[n].newer(t,mr)});function fr(t,n={}){let a=io(t);if(a!==void 0)return{ok:!1,errors:[oo(a,n.lang??"ja")]};let p=dr(t,n);return p.ok?{ok:!0,diagram:t,warnings:[]}:p}var ao={line:ie.lineup.slide,seal:ie.lineup.seal,open:ie.fade,pick:ie.fade,stamp:ie.popFade};function ur(t,n){let a={edges:[],events:[],busy:0},p=ie.edgeAt,l,e=0,s=Number.NEGATIVE_INFINITY,r=(f,d,u)=>{let k=d.carry.kind!=="none",h=u+(k?ie.drawCarry:ie.draw);return a.edges.push({event:f,a:u,b:h,carries:k,coin:d.carry.kind==="coin",named:d.label!==void 0}),a.busy=Math.max(a.busy,h),h},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+ie.change),k=[[u,i]],h=[];for(let w=i;w<c;w++){let g=u,N=t.events.flatMap((T,j)=>m(T)&&T.at===w?[{k:j,ev:T}]:[]),L=N.reduce((T,j,x)=>Math.max(T,r(j.k,j.ev,g+ie.stagger*x)),g),F=Math.max(g+n.speed,N.length>0?L+ie.time.wait:g);F-n.speed>g+1e-9&&k.push([F-n.speed,w]),k.push([F,w+1]),h.push({unit:w,at:F}),u=F}a.sweep={keys:k,passed:h},a.busy=Math.max(a.busy,u),p=u+ie.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,k=u+ao[f.type];a.edges.push({event:d,a:u,b:k,carries:!1,coin:!1,named:!1}),p=u+ie.lineup.stagger,l=k,e=0,a.busy=Math.max(a.busy,k);return}if(f.type==="commit"||f.type==="branch"||f.type==="leaf"||f.type==="node"){let u=p,k=u+ie.draw;a.edges.push({event:d,a:u,b:k,carries:!1,coin:!1,named:!1}),p=u+ie.stagger,l=k,e=0,a.busy=Math.max(a.busy,k)}else if(f.type==="edge"){let u=p;l=r(d,f,u),p=u+ie.stagger,e=0}else if(f.type==="action")a.events.push({event:d,at:p}),a.busy=Math.max(a.busy,p+ie.action),p+=ie.action,e=0;else{let u=(l??p)+ie.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 hr(t,n=!1){let a=t.kind==="time"?t.time:void 0,p=ie.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(P=>{if(!a)return ur(P);let b=ur(P,{from:e,speed:l});return e=b.sweep?.keys[b.sweep.keys.length-1]?.[1]??e,b}),r=[],o=ie.intro;t.steps.forEach((P,b)=>{let B=Math.min(ie.stepMax,Math.max(ie.stepMin,ie.stepBase+[...P.body].length*ie.perChar)),_=Math.max(B,(s[b]?.busy??0)+ie.dwell);r.push({start:o,end:o+_}),o+=_});let c=Math.ceil(o+ie.outro),m=c-ie.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,k=[],h=[],w=[],g=[];s.forEach((P,b)=>{let B=r[b],_=[];for(let K of P.edges){let W=B.start+K.a;k.push({step:b,event:K.event,start:W,drawn:B.start+K.b,end:B.end});let ee=t.steps[b]?.events[K.event],C=t.kind==="git"&&ee?.type==="edge"&&ee.carry.kind==="tag"&&ee.carry.text===ee.from;K.carries&&!C&&g.push({step:b,event:K.event,who:K.coin?"coin":"main",a:W,b:B.start+K.b}),K.named&&_.push({step:b,event:K.event,start:W+ie.labelDelay,end:B.end})}_.forEach((K,W)=>{let ee=_[W+2];ee&&(K.end=Math.min(K.end,ee.start))});for(let K of _)d&&K.end>d.start?K.end=d.end:(t.kind==="state"&&K.end<u&&(K.after={start:K.end,end:u}),d&&(K.again=d));h.push(..._);for(let K of P.events)w.push({step:b,event:K.event,at:B.start+K.at})});let N=r[0]?.start??0,L=g.some(P=>P.who==="main"),F=[];for(let P of["main","coin"]){let b=g.filter(B=>B.who===P);b.forEach((B,_)=>{let K=b[_+1],W=_===0&&(P==="main"||!L);F.push({step:B.step,event:B.event,who:P,depart:B.a,arrive:B.b,start:W?Math.min(N,B.a):B.a,end:K?Math.max(K.a,B.b):m})})}F.sort((P,b)=>P.depart-b.depart);let T=t.kind==="state"?co(t,k,m):void 0,j=[[0,0]],x=[];return s.forEach((P,b)=>{let B=r[b].start;for(let[_,K]of P.sweep?.keys??[])j.push([B+_,K]);for(let _ of P.sweep?.passed??[])x.push({unit:_.unit,passed:B+_.at})}),j.push([c,e]),{total:c,last:m,steps:r,edges:k,carriers:F,labels:h,badges:r.map((P,b)=>({step:b,appears:P.start})),events:w,stills:r.map(P=>P.end-ie.still),...d?{whole:d}:{},...T?{states:T}:{},...a?{needle:j,units:x,meters:lo(t,s,r)}:{}}}function lo(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((k,h)=>{let w=k.type==="strip"&&k.field===l&&k.value!==void 0?Fn(k.value):void 0;return w===void 0?[]:[{e:h,ratio:w}]}),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[k,h]=[d[1],u[1]],w=s,g=k,N=p?Math.floor((h-1e-9)/p)*p:0;if(N>0&&N>=k){let L=i+(f.find(([,T])=>T===N)?.[0]??d[0]),F=e[e.length-1][0];e.push([Math.max(F,L-ie.time.reset),s],[L,0]),w=0,g=N}for(let[L,F]of f)F>=g&&e.push([i+L,w+(m.ratio-w)*(F-g)/(h-g)])}else{let k=i+(r.events.find(h=>h.event===m.e)?.at??0);e.push([k,s],[k+ie.fade,m.ratio])}s=m.ratio}),{field:l,keys:e}})}var po=t=>Nt.includes(t);function co(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+ie.done),e=void 0}po(r.to)||(e={box:r.to,since:s.drawn})}}return e&&l(e.box).lit.push({start:e.since,end:a}),[...p.values()]}var gr=t=>Math.round(t*100)/100,Ln=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??ie.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??me.out],[n+l,{opacity:1,...e}],[r,{opacity:1,...e},me.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(${v.rise}px)`},within:p})}pop(n,a=this.last){return this.vis(n,a,{f:ie.popFade,ein:me.pop,on:{transform:"scale(1)"},off:{transform:`scale(${v.popFrom})`}})}until(n){let a=ie.untilFade;return this.kf([[0,{opacity:1}],[n,{opacity:1},me.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(${gr(l)}px,${gr(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 mo=t=>t.kind==="git",yr=t=>t.kind==="lineup",br=t=>t.kind==="time",ns=t=>t.kind==="tree",fe=t=>`font:${t.weight} ${t.size}px var(--${t.family})`,_e=(t,n="var(--surf)")=>`color-mix(in srgb,var(--c) ${t}%,${n})`,he=v.stroke,Ee=v.mix,es=`color-mix(in srgb,var(--mute) ${Ee.past}%,var(--bg))`,fo=[".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{${fe(q.regionName)};fill:var(--ct)}`,`.dg-bx{${fe(q.regionNote)};fill:var(--mute)}`,".dg-st{fill:var(--surf);stroke:var(--hair)}",`.dg-halo{fill:none;stroke:var(--c);stroke-width:${he.halo};stroke-opacity:.16}`,`.dg-on{fill:none;stroke:var(--c);stroke-width:${he.on}}`,`.dg-ic{fill:${_e(Ee.icon)}}`,`.dg-slot{fill:none;stroke:${_e(Ee.slot,"transparent")};stroke-width:${he.slot};stroke-dasharray:3 3}`,`.dg-gl{fill:none;stroke:var(--c);stroke-width:${he.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-sn{${fe(q.boxName)};fill:var(--ink)}`,`.dg-ss{${fe(q.boxSub)};fill:var(--mute)}`,`.dg-ss-ok{${fe(q.boxSubStrong)};fill:var(--ct)}`,`.dg-ss-act{${fe(q.boxSubStrong)};fill:var(--ink)}`,`.dg-ll{stroke:var(--line);stroke-width:${he.lifeline};stroke-dasharray:3 4}`,`.dg-e{fill:none;stroke:var(--line);stroke-width:${he.edge};stroke-linecap:round;stroke-dasharray:0 ${v.edge.ghostDash}}`,`.dg-eh{fill:none;stroke:var(--line);stroke-width:${he.arrow};stroke-linecap:round;stroke-linejoin:round}`,`.dg-e-on{fill:none;stroke:var(--c);stroke-width:${he.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,`.dg-eh-on{fill:none;stroke:var(--c);stroke-width:${he.edgeOn};stroke-linecap:round;stroke-linejoin:round}`,`.dg-flow{fill:none;stroke:var(--surf);stroke-width:${he.flow};stroke-linecap:round;stroke-dasharray:1.5 ${v.edge.flowDash}}`,`.dg-e-past{fill:none;stroke:${es};stroke-width:${he.edge};stroke-linecap:round}`,`.dg-eh-past{fill:none;stroke:${es};stroke-width:${he.arrow};stroke-linecap:round;stroke-linejoin:round}`,".dg-bd{cursor:pointer}",".dg-bdf{fill:var(--c)}",`.dg-bdft{${fe(q.badge)};fill:var(--on-c)}`,`.dg-bdr{fill:none;stroke:var(--c);stroke-width:${he.badgeRing};pointer-events:none}`,`.dg-bdp{fill:${_e(Ee.badgePast)};stroke:${_e(Ee.badgePastEdge,"transparent")};stroke-width:${he.hair}}`,`.dg-bdpt{${fe(q.badge)};fill:var(--ct)}`,`.dg-bdp-g{fill:var(--surf);stroke:${es};stroke-width:${he.hair}}`,`.dg-bdpt-g{${fe(q.badge)};fill:var(--mute)}`,`.dg-cap rect,.dg-act rect{fill:${_e(Ee.cap)};stroke:${_e(Ee.capEdge,"transparent")}}`,`.dg-cap text{${fe(q.label)};fill:var(--ct)}`,`.dg-capj text{${fe(q.labelJa)}}`,`.dg-cap-past text{${fe(q.label)};fill:var(--mute);fill-opacity:${v.state.pastLabel}}`,`.dg-cap-pastj text{${fe(q.labelJa)}}`,`.dg-act text{${fe(q.action)};fill:var(--ct)}`,".dg-car{fill:var(--carry,var(--ink))}",`.dg-car-t{${fe(q.carrier)};fill:var(--bg)}`,`.dg-car-tj{${fe(q.carrierJa)}}`,`.dg-env{fill:var(--carry,var(--ink));stroke:var(--surf);stroke-width:${he.envelope}}`,`.dg-env-in{fill:none;stroke:var(--surf);stroke-width:${he.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:${he.hair}}`,`.dg-sh{${fe(q.stripTitle)};fill:var(--ink)}`,`.dg-fl{${fe(q.fieldName)};fill:var(--mute)}`,`.dg-fv{${fe(q.fieldValue)};fill:var(--ink)}`,`.dg-fvj{${fe(q.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:${he.trail}}`,".dg-tr-fill{fill:var(--c)}",".dg-tg rect{fill:var(--c)}",`.dg-tg text{${fe(q.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{${fe(q.regionName)};fill:var(--ct)}`,`.dg-side-n{${fe(q.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:${he.path};stroke-linecap:round;stroke-dasharray:0 ${v.edge.ghostDash}}`,`.dg-path-h{fill:none;stroke:${_e(Ee.path,"transparent")};stroke-width:${he.arrow};stroke-linecap:round;stroke-linejoin:round}`,`.dg-path-t{${fe(q.label)};fill:var(--ct)}`,`.dg-path-tj{${fe(q.labelJa)}}`,".dg-start{fill:var(--ink)}",`.dg-end{fill:var(--bg);stroke:var(--ink);stroke-width:${he.end}}`,".dg-end-in{fill:var(--ink)}",`.dg-end-x{fill:var(--bg);stroke:${_e(Ee.path,"transparent")};stroke-width:${he.arrow};stroke-dasharray:2 2.5}`,`.dg-end-xi{fill:${_e(Ee.path,"transparent")}}`,`.dg-mark{${fe(q.regionNote)};fill:var(--mute)}`,`.dg-done{fill:var(--ink);stroke:var(--surf);stroke-width:${he.done}}`,`.dg-done-ck{fill:none;stroke:var(--surf);stroke-width:${he.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-git-l{fill:none;stroke:var(--c);stroke-width:${he.git};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,`.dg-git-cp{fill:none;stroke:var(--c);stroke-width:${he.gitOrphan};stroke-linecap:round;stroke-dasharray:3 3;stroke-opacity:.7}`,`.dg-git-c{fill:var(--surf);stroke:var(--c);stroke-width:${he.git}}`,`.dg-git-id{${fe(q.gitId)};fill:var(--ct)}`,`.dg-git-h{${fe(q.gitHash)};fill:var(--mute)}`,`.dg-git-n{${fe(q.gitNote)};fill:var(--ink2)}`,`.dg-git-old{fill:var(--surf);stroke:var(--c);stroke-width:${he.gitOrphan};stroke-dasharray:3 3;stroke-opacity:.6}`,`.dg-git-oldl{${fe(q.gitId)};fill:var(--ct);opacity:.55}`,`.dg-tree-l{fill:none;stroke:var(--line);stroke-width:${he.tree};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,`.dg-tree-tr{fill:none;stroke:var(--c);stroke-width:${he.treeTrail};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,`.dg-tree-h{fill:none;stroke:var(--c);stroke-width:${he.treeTrail};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tree-con{fill:none;stroke:var(--line);stroke-width:${he.treeCon};stroke-linecap:round;stroke-dasharray:2 3.5}`,`.dg-tree-card{fill:var(--surf);stroke:var(--hair);stroke-width:${he.hair}}`,`.dg-tree-cg{fill:none;stroke:var(--mute);stroke-width:${he.glyph};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tree-ct{${fe(q.treeCard)};fill:var(--ink)}`,`.dg-tree-hash{${fe(q.treeHash)};fill:var(--ink)}`,`.dg-tree-name{${fe(q.treeName)};fill:var(--mute)}`,`.dg-tree-one{${fe(q.boxName)};fill:var(--ink)}`,`.dg-tree-rh{${fe(q.rootHash)};fill:var(--ink)}`,`.dg-tree-rn{${fe(q.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{${fe(q.chip)};fill:var(--on-c)}`,`.dg-ln-tp{${fe(q.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:${he.stamp}}`,`.dg-ln-st{${fe(q.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:${he.hair};stroke-dasharray:2 4}`,`.dg-tm-hd{${fe(q.timeHead)};fill:var(--ink)}`,`.dg-tm-hdj{${fe(_t(q.timeHead))}}`,`.dg-tm-slot{fill:none;stroke:var(--line);stroke-width:${he.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:${he.timeFrame};stroke-dasharray:3 2}`,`.dg-tm-gd{fill:none;stroke:color-mix(in srgb,var(--c-blue) ${Ee.timeGuide}%,transparent);stroke-width:${he.hair};stroke-dasharray:2 3}`,`.dg-tm-ax{fill:none;stroke:var(--line);stroke-width:${he.timeAxis}}`,`.dg-tm-tk{${fe(q.timeTick)};fill:var(--mute)}`,`.dg-tm-tkj{${fe(_t(q.timeTick))}}`,`.dg-tm-en{${fe(q.timePeriod)};fill:var(--ink2)}`,`.dg-tm-er{${fe(q.timeRange)};fill:var(--mute)}`,`.dg-tm-erj{${fe(_t(q.timeRange))}}`,`.dg-tm-rn{${fe(q.timeRow)};fill:var(--ink2)}`,`.dg-tm-br{fill:none;stroke:var(--c);stroke-width:${he.timeSpan};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tm-bt{${fe(q.spanText)};fill:var(--ct)}`,`.dg-tm-bx{fill:color-mix(in srgb,var(--c) ${Ee.timeSpan}%,transparent);stroke:var(--c);stroke-width:${he.timeSpan};stroke-dasharray:4 3}`,`.dg-tm-con{fill:none;stroke:var(--line);stroke-width:${he.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:${he.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tm-pc{fill:var(--surf);stroke:var(--c);stroke-width:${he.timePoint}}`,`.dg-tm-pcg{fill:none;stroke:var(--c);stroke-width:${he.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,`.dg-tm-pn{${fe(q.pointName)};fill:var(--ink)}`,`.dg-tm-pnj{${fe(_t(q.pointName))}}`,".dg-tm-pn-g{fill:var(--mute)}",`.dg-tm-ps{${fe(q.pointState)};fill:var(--ct)}`,`.dg-tm-ln{fill:none;stroke:var(--c);stroke-width:${he.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,`.dg-tm-nd{stroke:var(--ink);stroke-width:${he.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:${he.timeFrame};stroke-dasharray:3 3}`,`.dg-tm-ext{${fe(q.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:${he.timeMeter}}`,`.dg-tm-ml{${fe(q.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{${fe(q.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:${he.badgeRing};vector-effect:non-scaling-stroke}`].join("");function uo(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 ho(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 go(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(k=>k.box===r.id),d=[...f].reverse().find(k=>k.set!==void 0||typeof k.act=="string");l&&typeof d?.act=="string"&&f.push({t:l.start,order:e++,box:r.id,act:d.act});for(let k of f){k.set!==void 0&&(o=[k.set,"dg-ss-ok"],i=void 0),k.act!==void 0&&(i=k.act??void 0);let h=i!==void 0?[i,"dg-ss-act"]:o;h.join("|")!==c&&(c=h.join("|"),m.push([k.t,h[0],h[1]]))}let u=m.filter((k,h)=>{let w=m[h+1];return w===void 0||w[0]-k[0]>=ie.minShow});s.set(r.id,u)}return s}function yo(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 bo(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 ss(t,n,a,p,l,e,s=[],r=[]){let o=Yt(p,l),i=uo(`${JSON.stringify(t)}|${o}|${e?`${e.width}|${e.lang}`:""}`),c=new Ln(`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},f=ho(t),d=go(t,a,n.kind!=="sequence"),u={band:[],base:[],lit:[],node:[],badge:[],top:[]};for(let I of n.regions)u.band.push(Ps(I,s));let k=n.boxes.find(I=>I.ghost)?.color??"slate";n.side&&u.band.push(Es(n.side,k,s));let h=(I,oe)=>n.boxes.find(le=>le.id===I&&(oe===void 0||le.ghost===oe))?.color;for(let I of n.paths)u.base.push(Ns(I,h(I.to,!0)??h(I.from)??k,s,r));for(let I of n.ends)u.node.push(Ls(I,k,s));let w=n.kind==="state",g=new Map((a.states??[]).flatMap(I=>I.lit[0]?[[I.box,I.lit[0].start]]:[])),N=new Map((a.meters??[]).map(I=>[I.field,I.keys])),L=I=>I.meter?nt("time").meterField({...I,meter:I.meter},N.get(I.name)??[[0,0]],m):void 0;n.strip&&u.band.push(Ds(n.strip,yo(t,a,n),m,w,g,L));for(let I of n.lifelines)u.base.push(qs(I.x,I.y1,I.y2));if(mo(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 F=ns(n)?n:void 0,T=F?nt("tree").drawTree(F,t,a,m):void 0;T&&(u.base.push(T.links),u.lit.push(T.trails),u.node.push(T.nodes));let j=new Set((F?.runs??[]).map(I=>`${I.step}/${I.event}`)),x=yr(n)?n:void 0;if(x){let I=nt("lineup").drawLineup(x,t,a,m,d);u.base.push(I.lanes),u.node.push(I.chips)}let P=br(n)?n:void 0;if(P){let I=nt("time").drawTime(P,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 b=new Set((P?.wires??[]).map(I=>`${I.step}/${I.event}`));for(let I of n.edges){let oe=a.edges.find(ue=>ue.step===I.step&&ue.event===I.event);if(!oe||P&&!b.has(`${I.step}/${I.event}`)||j.has(`${I.step}/${I.event}`))continue;let le=Math.max(T?.appear.get(I.from)??0,T?.appear.get(I.to)??0),ye=As(I,oe,m,w,le);u.base.push(ye.base),u.lit.push(ye.lit)}let B=new Map((a.states??[]).map(I=>[I.box,I])),_=new Map(t.boxes.flatMap(I=>I.link===void 0?[]:[[I.id,I.link]])),K=(I,oe)=>Jt(_.get(I),oe);for(let I of P||x?[]:n.boxes){if(I.ghost){u.node.push(K(I.id,Os(I,s)));continue}let oe=B.get(I.id);u.node.push(K(I.id,en(I,m,f.get(I.id)??[],d.get(I.id)??[],w?oe?.lit??[]:void 0))),oe?.done!==void 0&&u.node.push(Ts(I,oe.done,m))}for(let I of n.badges)u.badge.push(Rs(I,m,w));for(let I of n.labels){let oe=a.labels.find(le=>le.step===I.step&&le.event===I.event);oe&&u.top.push(js(I,bo(I,oe,a.steps),m))}let{whole:W}=a;for(let I of n.actions){let oe=a.events.find(ye=>ye.step===I.step&&ye.event===I.event);if(!oe)continue;let le=a.steps[I.step].end;u.top.push(W&&le>W.start?Yn(I,oe.at,W.end,m):Yn(I,oe.at,le,m,W))}for(let I of a.carriers){let oe=n.edges.find(le=>le.step===I.step&&le.event===I.event);oe&&u.top.push(tn(oe,F?{...I,start:I.depart,end:I.arrive+ie.fade}:I,m))}let ee=Object.values(u).map(I=>I.join("")).join(""),{near:C,far:M,nearY:R,farY:D}=v.shadow,V=`<filter id="dg-sh-${i}" x="-20%" y="-30%" width="140%" height="180%"><feDropShadow dx="0" dy="${R}" stdDeviation="${C}" style="flood-color:var(--sh);flood-opacity:var(--shA)"/><feDropShadow dx="0" dy="${D}" stdDeviation="${M}" style="flood-color:var(--sh);flood-opacity:var(--shB)"/></filter>`,Q=e&&n.kind==="sequence"?n.boxes.map(I=>K(I.id,Ms(I,m,f.get(I.id)??[],d.get(I.id)??[]))).join(""):"",U=e?$o(n,a,t,c,i,ee,e,Q):{body:`<rect class="dg-bg" width="${n.width}" height="${n.height}" rx="${v.region.radius}"/>${ee}`,w:n.width,h:n.height},re=`.dg-${i}{${Vt};--T:${a.total}s;${o}}${fo}${c.frames.join("")}`;return`<svg xmlns="http://www.w3.org/2000/svg" class="dg dg-${i}" viewBox="0 0 ${Math.ceil(U.w)} ${Math.ceil(U.h)}" width="${Math.ceil(U.w)}" height="${Math.ceil(U.h)}" role="img" aria-label="${$e(t.title)}" data-dragon="figure" data-view="${e?"follow":"fixed"}"><style>${re}</style><defs>${V}</defs>${U.body}</svg>`}function xr(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 xo(t,n,a){let p=ts(t,n,a);return p.length===0?void 0:xr(p)}function wo(t,n,a,p){let l=v.badge.r+v.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=xr([o,i]);c.w<=a&&c.h<=p&&(o=c)}return o}function ts(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)),ns(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(yr(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 $o(t,n,a,p,l,e,s,r){let o=v.follow,i=v.mini,c=Math.max(1,s.width),m=Math.min(t.width,c),f=Qe[s.lang].overview,d=O=>{let X=Math.min(i.w,m*.4,O*.4/t.height*t.width),S=X/t.width,H=t.height*S,y=Math.max(X,Math.ceil(pe(f,q.miniTitle)));return{vh:O,mw:X,k:S,mh:H,bw:y,bgW:y+i.pad*2,bgH:H+i.pad*2+i.title,beside:H>X}},u=d(Math.min(t.height,Math.max(o.minH,m*o.aspect))),k=u.beside&&c<o.narrow,h=s.height===void 0?Number.POSITIVE_INFINITY:u.beside?s.height:s.height-u.bgH-i.inset,{vh:w,mw:g,k:N,mh:L,bw:F,bgW:T,bgH:j,beside:x}=h<u.vh?d(Math.max(o.fitMinH,h)):{...u,vh:Number.isFinite(h)?Math.min(t.height,h):u.vh},P=x&&!k?Math.min(t.width,c-T-i.inset):m,b=O=>Math.min(t.width-P/2,Math.max(P/2,O)),B=r===""?0:Math.max(...t.boxes.map(O=>O.y+O.h))+o.headRoom,_=r===""?0:o.head.pad*2+o.head.h,K=w-_,W=O=>Math.min(t.height-K/2,Math.max(B+K/2,O)),ee=v.badge.r,C=[t.width/2,t.height/2],R=n.steps.map((O,X)=>{if(br(t)){let A=nt("time").timeFocus(t,n,X,ts(t,a,X),P,K);return C=[A.x+A.w/2,A.y+A.h/2],[b(C[0]),W(C[1])]}let S=xo(t,a,X);C=S?[S.x+S.w/2,S.y+S.h/2]:C;let H=[b(C[0]),W(C[1])],y=t.badges.find(A=>A.step===X);if(!y||Math.abs(y.x-H[0])<=P/2-ee&&Math.abs(y.y-H[1])<=K/2-ee)return H;let G=wo(y,ts(t,a,X),P,K);return C=[G.x+G.w/2,G.y+G.h/2],[b(C[0]),W(C[1])]}).map(([O,X])=>[O,X-_/2]),D=R[0],V=[[0,D[0],D[1]],[n.steps[0].start,D[0],D[1]]];R.forEach((O,X)=>{if(X===0)return;let S=R[X-1],H=n.steps[X].start;V.push([H,S[0],S[1],1,me.inOut],[H+o.ease,O[0],O[1]])});let Q=R[R.length-1];V.push([n.last,Q[0],Q[1],1,me.inOut],[n.total,D[0],D[1]]);let U=p.move(V.map(([O,X,S,H,y])=>[O,P/2-X,w/2-S,H,y])),re=x?P+i.inset:P-T-i.inset,I=x?0:w+i.inset,oe=re+i.pad,le=oe+(F-g)/2,ye=I+i.pad+i.title,ke=k?{clip:"",body:""}:(()=>{let O=[...t.regions.map(S=>`<rect class="dg-mm-band" style="${we(S.color)}" x="${le+S.x*N}" y="${ye+S.y*N}" width="${S.w*N}" height="${S.h*N}" rx="3"/>`),...t.boxes.map(S=>`<rect class="dg-mm-card" style="${we(S.color)}" x="${le+S.x*N}" y="${ye+S.y*N}" width="${S.w*N}" height="${S.h*N}" rx="1.5"/>`),...(ns(t)?t.nodes:[]).map(S=>`<rect class="dg-mm-card" style="${we(S.color)}" x="${le+S.x*N}" y="${ye+S.y*N}" width="${S.w*N}" height="${S.h*N}" rx="1.5"/>`)].join(""),X=p.move(V.map(([S,H,y,,G])=>[S,le+(H-P/2)*N,ye+(y-w/2)*N,1,G]));return{clip:`<clipPath id="dg-mm-${l}"><rect x="${le}" y="${ye}" width="${g}" height="${L}" rx="4"/></clipPath>`,body:`<rect class="dg-mm-bg" x="${re}" y="${I}" width="${T}" height="${j}" rx="${i.radius}"/><text class="dg-mm-t" x="${oe}" y="${ye-i.pad+2}">${f}</text><g clip-path="url(#dg-mm-${l})"><rect class="dg-mm-world" x="${le}" y="${ye}" width="${g}" height="${L}"/>${O}<rect class="dg-mm-vp dg-a"${_===0?"":` y="${_*N}"`} width="${P*N}" height="${(w-_)*N}" rx="2" style="${X}"/></g>`}})(),Me=_===0?"":`<g class="dg-hd"><rect class="dg-hd-bg" width="${P}" height="${_}"/><line class="dg-sep" x1="0" y1="${_}" x2="${P}" y2="${_}"/><g class="dg-a" style="${p.move(V.map(([O,X,,S,H])=>[O,P/2-X,0,S,H]))}">${r}</g></g>`;return{body:`<defs><clipPath id="dg-vp-${l}"><rect width="${P}" height="${w}" rx="${v.region.radius}"/></clipPath>${ke.clip}</defs><g clip-path="url(#dg-vp-${l})"><rect class="dg-vp-bg" width="${P}" height="${w}"/><g class="dg-a" style="${U}">${e}</g>${Me}</g><rect class="dg-vp-frame" x="0.5" y="0.5" width="${P-1}" height="${w-1}" rx="${v.region.radius}"/>${ke.body}`,w:x&&!k?P+i.inset+T:m,h:x?w:I+j}}function rs(t,n){let a=cs(t.palette);if(!t.colors)return a;let p=Qe[t.lang??"ja"],l=Object.entries(t.colors).flatMap(([e,s])=>ds(e)?ms(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 wr(t,n={}){let a=n.lang??"ja",p=fr(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"?or(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):rr(l);return ko(l,e,hr(l,n.still===!0),n)}function ko(t,n,a,p={}){let l=p.theme==="dark"?"dark":"light",e=rs(p,l),s=[],r=[];return{svg:ss(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:ks(s,a.stills,r)}}function is(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))*q.boxName.size;return t.view?{mode:t.view,textPx:e}:{mode:e>=fs?"fixed":"follow",textPx:e}}var qn=t=>`font:${t.weight} ${t.size}px var(--${t.family})`,Ae=t=>`${t}px`;function vo(){let t=v.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(v.stroke.hair)} solid var(--hair);background:var(--surf);color:var(--ink);${qn(q.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{${qn(q.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{${qn(q.stepTitle)};margin:0}`,`.dg-tb{${qn(q.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(v.stroke.mark)};stroke-dasharray:${v.mark.dash} ${v.mark.gap};pointer-events:none}`].join("")}function Po(t){if(t.getElementById("dragon-player-css"))return;let n=t.createElement("style");n.id="dragon-player-css",n.textContent=vo(),t.head.appendChild(n)}var Bt={prev:"\u2039",pause:"\u275A\u275A",play:"\u25B6",next:"\u203A"},$r="http://www.w3.org/2000/svg",kr=t=>String(t).padStart(2,"0"),So=(t,n)=>`${kr(t+1)}/${kr(n)}`;function vr(t,n,a={}){let p=t.ownerDocument,l=p.defaultView,e=!!l?.matchMedia?.("(prefers-reduced-motion: reduce)").matches,s=wr(n,a),r=a.lang??"ja",o=Qe[r],i=rs(a,s.theme),{timeline:c}=s,m=s.diagram.steps,f=m.length;Po(p);let d=p.createElement("div");d.className="dg-player",d.dataset.dragon="player",d.setAttribute("style",`${Vt};${Yt(i,s.theme)}`);let u=p.createElement("div");u.className="dg-frame";let k=(Z,J,se)=>{let de=p.createElement("button");return de.type="button",de.className="dg-btn",de.dataset.dragon=Z,de.setAttribute("aria-label",J),de.textContent=se,de},h=k("prev",o.prev,Bt.prev),w=k("toggle",o.pause,Bt.pause),g=k("next",o.next,Bt.next),N=p.createElement("div");N.className="dg-btns",N.setAttribute("lang",r),N.append(h,w,g);let L=p.createElement("div");L.className="dg-say",L.setAttribute("aria-hidden","true");let F=p.createElement("div");F.className="dg-no",F.dataset.dragon="step-no";let T=p.createElement("div");T.className="dg-txt";let j=p.createElement("p");j.className="dg-tt",j.dataset.dragon="step-title";let x=p.createElement("p");x.className="dg-tb",x.dataset.dragon="step-body";let P=p.createElement("div");P.append(j,x),T.append(P);for(let Z of m){let J=p.createElement("div");J.className="dg-room",J.dataset.dragon="caption-room";let se=p.createElement("p");se.className="dg-tt",se.textContent=Z.title;let de=p.createElement("p");de.className="dg-tb",de.textContent=Z.body,J.append(se,de),T.append(J)}L.append(F,T);for(let Z of[F,j,x])Z.setAttribute("aria-hidden","true");let b=p.createElement("div");b.className="dg-row",b.append(N,L);let B=p.createElement("div");B.className="dg-bar",B.append(b);let _=p.createElement("ol");_.className="dg-sr",_.dataset.dragon="steps",_.setAttribute("aria-label",o.steps(s.diagram.title));for(let Z of m){let J=p.createElement("li"),se=p.createElement("strong");se.textContent=Z.title,J.append(se);for(let de of Z.body.split(`
3
+ `)){let Pe=p.createElement("p");Pe.textContent=de,J.append(Pe)}if(Z.sources){let de=p.createElement("ul");for(let Pe of Z.sources){let qe=p.createElement("a");qe.href=Pe.url,qe.textContent=Pe.name;let Re=p.createElement("li");Re.append(qe),de.append(Re)}J.append(de)}_.append(J)}d.append(u,B,_),t.append(d);let K=()=>u.clientWidth||t.clientWidth||s.layout.width,W=()=>{if(!a.fitHeight||!l)return;let Z=l.getComputedStyle(u),J=u.clientHeight-(Number.parseFloat(Z.paddingTop)||0)-(Number.parseFloat(Z.paddingBottom)||0);return J>0?J:void 0},ee=is(s,K(),W()).mode,C=K(),M=W(),R=null,D=a.pausedAt===void 0?0:Math.min(f-1,Math.max(0,a.pausedAt)),V=!e&&a.pausedAt===void 0,Q=V?0:c.stills[D]??0,U=c.stills[f-1]??0,re=Date.now(),I=[],oe=()=>{if(!R)return;for(let se of R.querySelectorAll(".dg-spots"))se.remove();if(I.length===0)return;let Z=v.mark,J=p.createElementNS($r,"g");J.setAttribute("class","dg-spots");for(let se of I){let de=p.createElementNS($r,"rect");de.setAttribute("class","dg-spot"),de.setAttribute("x",String(se.x-Z.pad)),de.setAttribute("y",String(se.y-Z.pad)),de.setAttribute("width",String(se.w+Z.pad*2)),de.setAttribute("height",String(se.h+Z.pad*2)),de.setAttribute("rx",String(Z.radius)),J.append(de)}(R.querySelector('g[clip-path^="url(#dg-vp-"] > g.dg-a')??R).append(J)},le=Z=>{let J;if(Z!==void 0){let se=p.createElement("div");se.innerHTML=Z,J=se.querySelector("svg")}else J=R?R.cloneNode(!0):null;J&&(J.setAttribute("aria-hidden","true"),J.removeAttribute("role"),J.removeAttribute("aria-label"),J.style.setProperty("--at",String(Q)),J.style.setProperty("--play",V?"running":"paused"),J.dataset.motion=V?"play":"still",R?R.replaceWith(J):u.append(J),R=J,re=Date.now(),oe())},ye=()=>ee==="follow"?ss(s.diagram,s.layout,c,i,s.theme,{width:C,...M===void 0?{}:{height:M},lang:r}):s.svg,ue=()=>V?(Q+(Date.now()-re)/1e3)%c.total:Q,ke=Z=>{let J=0;return c.steps.forEach((se,de)=>{se.start<=Z&&(J=de)}),J},Me=()=>{let Z=m[D];F.textContent=So(D,f),j.textContent=Z?.title??"",x.textContent=Z?.body??"",w.setAttribute("aria-label",V?o.pause:o.play),w.textContent=V?Bt.pause:Bt.play,a.onStep?.(D)},E=(Z,J)=>{Q=Z,V=J,le(),Me()},O=Z=>{D=Math.min(f-1,Math.max(0,Z));let J=c.steps[D];E(V?J.start:c.stills[D]??J.start,V)},X=()=>{a.playOnce&&Q>=U&&(D=0,Q=0),E(Q,!0)};le(ye()),Me();let S=l?.setInterval(()=>{if(!V)return;if(a.playOnce&&Q+(Date.now()-re)/1e3>=U){D=f-1,E(U,!1);return}let Z=ke(ue());Z!==D&&(D=Z,Me())},120),H=()=>O(D-1),y=()=>O(D+1),G=()=>V?E(ue(),!1):X(),A=Z=>{let J=Z.target?.closest?.("[data-step]"),se=J?Number(J.getAttribute("data-step")):Number.NaN;Number.isInteger(se)&&O(se)};h.addEventListener("click",H),g.addEventListener("click",y),w.addEventListener("click",G),u.addEventListener("click",A);let z=l?.ResizeObserver,ae=z?new z(()=>{let Z=K(),J=W(),se=is(s,Z,J).mode;if(se===ee&&(ee==="fixed"||Z===C&&J===M))return;let de=ue();ee=se,C=Z,M=J,Q=de,le(ye())}):void 0;return ae?.observe(u),{get step(){return D},get playing(){return V},next:y,prev:H,play:()=>{V||X()},pause:()=>{V&&E(ue(),!1)},goTo:Z=>{V=!1,O(Z)},mark:Z=>{I=Z,oe()},destroy:()=>{S!==void 0&&l?.clearInterval(S),ae?.disconnect(),h.removeEventListener("click",H),g.removeEventListener("click",y),w.removeEventListener("click",G),u.removeEventListener("click",A),d.remove()}}}return Nr(Mo);})();