@marimo-team/frontend 0.12.1-dev0 → 0.12.1-dev10

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 (84) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-CVsKT6S3.js → ConnectedDataExplorerComponent-CJruiifD.js} +1 -1
  2. package/dist/assets/{VegaLite-BasL8bOR.js → VegaLite-BE8iaI6d.js} +1 -1
  3. package/dist/assets/{_baseEach-BxidLc34.js → _baseEach-CHGr95h3.js} +1 -1
  4. package/dist/assets/_baseMap-CJD4EB23.js +1 -0
  5. package/dist/assets/{_baseUniq-DRGCPgTu.js → _baseUniq-DBsNFMLI.js} +1 -1
  6. package/dist/assets/{any-language-editor-ydZB5vW5.js → any-language-editor-C44KD8Jd.js} +1 -1
  7. package/dist/assets/{architectureDiagram-UYN6MBPD-3uNJsVbm.js → architectureDiagram-UYN6MBPD-BgbOosfX.js} +1 -1
  8. package/dist/assets/{blockDiagram-ZHA2E4KO-C7O1SDY_.js → blockDiagram-ZHA2E4KO-9FMsNisX.js} +1 -1
  9. package/dist/assets/{c4Diagram-6F5ED5ID-Ct9ADwNZ.js → c4Diagram-6F5ED5ID-Bbqvpa8H.js} +1 -1
  10. package/dist/assets/channel-Cr4w4fr-.js +1 -0
  11. package/dist/assets/{chunk-5HRBRIJM-DCljQIR4.js → chunk-5HRBRIJM-X4M2qmib.js} +1 -1
  12. package/dist/assets/{chunk-7U56Z5CX-D5wHboSV.js → chunk-7U56Z5CX-C5qQ_O2_.js} +1 -1
  13. package/dist/assets/{chunk-ASOPGD6M-CYxRhcjL.js → chunk-ASOPGD6M-DewGTxkr.js} +1 -1
  14. package/dist/assets/{chunk-KFBOBJHC-BlSJa9lw.js → chunk-KFBOBJHC-DOfnAPal.js} +1 -1
  15. package/dist/assets/{chunk-T2TOU4HS-Bt7XCx8N.js → chunk-T2TOU4HS-DrSTkPX7.js} +1 -1
  16. package/dist/assets/{chunk-TMUBEWPD-g5OGnScM.js → chunk-TMUBEWPD-D_YLueZ5.js} +1 -1
  17. package/dist/assets/classDiagram-LNE6IOMH-D--jW1ZB.js +1 -0
  18. package/dist/assets/classDiagram-v2-MQ7JQ4JX-D--jW1ZB.js +1 -0
  19. package/dist/assets/clone-D6AulMZy.js +1 -0
  20. package/dist/assets/{compile-DFYK5xVw.js → compile-Cb-2V0aD.js} +1 -1
  21. package/dist/assets/{dagre-4EVJKHTY-t_u27lJo.js → dagre-4EVJKHTY-DiF_5n5x.js} +1 -1
  22. package/dist/assets/{data-editor-C4L34dFt.js → data-editor-CGJ9_7_q.js} +1 -1
  23. package/dist/assets/{diagram-QW4FP2JN-OlMq8jDO.js → diagram-QW4FP2JN-fVKWzjDQ.js} +1 -1
  24. package/dist/assets/edit-page-DX4QoMwC.js +8 -0
  25. package/dist/assets/{erDiagram-6RL3IURR-DRupzzpa.js → erDiagram-6RL3IURR-tkYxbOwJ.js} +1 -1
  26. package/dist/assets/{flowDiagram-7ASYPVHJ-IbYmgWIO.js → flowDiagram-7ASYPVHJ-wCWrRB02.js} +1 -1
  27. package/dist/assets/{ganttDiagram-NTVNEXSI-DNXi3Qyf.js → ganttDiagram-NTVNEXSI-CipIDMvM.js} +1 -1
  28. package/dist/assets/{gitGraph-YCYPL57B-C8bY-sRH.js → gitGraph-YCYPL57B-B2gBFbEc.js} +1 -1
  29. package/dist/assets/{gitGraphDiagram-NRZ2UAAF-BLuPI92O.js → gitGraphDiagram-NRZ2UAAF-CzfIrjrb.js} +1 -1
  30. package/dist/assets/{graph-DARHf5FF.js → graph-4-Vg1Aiz.js} +1 -1
  31. package/dist/assets/{home-page-3jSiUOSU.js → home-page-DHrqvZ5M.js} +1 -1
  32. package/dist/assets/{index-VBBdVXwI.js → index-BEGeiwsG.js} +1 -1
  33. package/dist/assets/{index-_8Ks4m3w.js → index-BH9A8KuI.js} +1 -1
  34. package/dist/assets/{index-CKynd3sK.js → index-BiPdUed2.js} +1 -1
  35. package/dist/assets/{index-DnH16fnI.js → index-CHAfPpeC.js} +1 -1
  36. package/dist/assets/{index-DpDaX05Y.js → index-CO1xz3xH.js} +1 -1
  37. package/dist/assets/{index-B_DpqRlz.js → index-CWohOS_e.js} +1 -1
  38. package/dist/assets/{index-CH5ughaP.js → index-CYjr_k0H.js} +1 -1
  39. package/dist/assets/{index-Clh1UGp_.js → index-CZQNf_us.js} +1 -1
  40. package/dist/assets/{index-CpFE_Q0n.js → index-CkAdNdK9.js} +1 -1
  41. package/dist/assets/{index-CN_BgDyp.js → index-DKriXlXA.js} +1 -1
  42. package/dist/assets/{index-z8lXQvfi.js → index-DRtvMp6Z.js} +1 -1
  43. package/dist/assets/{index-4PVLKZcw.js → index-Ddv63gQw.js} +1 -1
  44. package/dist/assets/{index-BoTcJdZC.js → index-DoaFBt3g.js} +1 -1
  45. package/dist/assets/{index-BrP1xDjh.js → index-DuktNpRm.js} +1 -1
  46. package/dist/assets/{index-DSWQoYBB.js → index-DwShl_Rl.js} +1 -1
  47. package/dist/assets/{index-BO2M1ddO.js → index-DxHC9_BU.js} +1 -1
  48. package/dist/assets/index-M-fa6gqH.js +80 -0
  49. package/dist/assets/{infoDiagram-A4XQUW5V-BlD21afJ.js → infoDiagram-A4XQUW5V-Cq17uMjs.js} +1 -1
  50. package/dist/assets/{journeyDiagram-G5WM74LC-CwF3jfPt.js → journeyDiagram-G5WM74LC-CTXVfGIj.js} +1 -1
  51. package/dist/assets/{kanban-definition-QRCXZQQD-XxKBZY6u.js → kanban-definition-QRCXZQQD-ELngktM2.js} +1 -1
  52. package/dist/assets/{layout-2W-wT2Ws.js → layout-CGBTZO_E.js} +1 -1
  53. package/dist/assets/{linear-DQcn4dud.js → linear-BbegsqX1.js} +1 -1
  54. package/dist/assets/{mermaid-CYElsmZp.js → mermaid-NCa4Btby.js} +3 -3
  55. package/dist/assets/{min--mjCwyM_.js → min-CABlFD1H.js} +1 -1
  56. package/dist/assets/{mindmap-definition-GWI6TPTV-C7lB29b2.js → mindmap-definition-GWI6TPTV-DLlhxG7q.js} +1 -1
  57. package/dist/assets/{pieDiagram-YF2LJOPJ-DdOMBTyF.js → pieDiagram-YF2LJOPJ-BPY4ab3U.js} +1 -1
  58. package/dist/assets/{quadrantDiagram-OS5C2QUG-9roG1Ayx.js → quadrantDiagram-OS5C2QUG-DNcT7n4n.js} +1 -1
  59. package/dist/assets/{react-plotly-Cpel_TqV.js → react-plotly-D49PuaDp.js} +1 -1
  60. package/dist/assets/{requirementDiagram-MIRIMTAZ-CVtz6B2A.js → requirementDiagram-MIRIMTAZ-BiwgQpI6.js} +1 -1
  61. package/dist/assets/{run-page-D1w26f6w.js → run-page-_t2pqoib.js} +1 -1
  62. package/dist/assets/{sankeyDiagram-Y46BX6SQ-dCiYKdXN.js → sankeyDiagram-Y46BX6SQ-Yek58mqV.js} +1 -1
  63. package/dist/assets/{sequenceDiagram-G6AWOVSC-C5tloD74.js → sequenceDiagram-G6AWOVSC-CS1ohKZS.js} +1 -1
  64. package/dist/assets/{slides-component-CM2e6T2v.js → slides-component-BhUqdm2K.js} +1 -1
  65. package/dist/assets/{sortBy-BIWls_3f.js → sortBy-DeAoOjrt.js} +1 -1
  66. package/dist/assets/{stateDiagram-MAYHULR4-B-C3z4bX.js → stateDiagram-MAYHULR4-C25IIyJY.js} +1 -1
  67. package/dist/assets/stateDiagram-v2-4JROLMXI-Du1ne-Iw.js +1 -0
  68. package/dist/assets/{terminal-dTGgzk51.js → terminal-B5M_jESV.js} +1 -1
  69. package/dist/assets/{time-BVKBupAc.js → time-Cg9ECQUX.js} +1 -1
  70. package/dist/assets/{timeline-definition-U7ZMHBDA-CS6loX7O.js → timeline-definition-U7ZMHBDA-bNrrM9Xd.js} +1 -1
  71. package/dist/assets/{tree-ClIq_Gew.js → tree-DXPs25GO.js} +2 -2
  72. package/dist/assets/{useMarimoWebSocket-DZ1JodWi.js → useMarimoWebSocket-UUW24I6P.js} +4 -4
  73. package/dist/assets/{vega-component-B5iZxWjK.js → vega-component-DBMPlOJo.js} +1 -1
  74. package/dist/assets/{xychartDiagram-6QU3TZC5-YmRCS7TZ.js → xychartDiagram-6QU3TZC5-vQAUXteB.js} +1 -1
  75. package/dist/index.html +1 -1
  76. package/package.json +1 -1
  77. package/dist/assets/_baseMap-Cu7qHcLU.js +0 -1
  78. package/dist/assets/channel-LBzfy5Qe.js +0 -1
  79. package/dist/assets/classDiagram-LNE6IOMH-DBtiwBb5.js +0 -1
  80. package/dist/assets/classDiagram-v2-MQ7JQ4JX-DBtiwBb5.js +0 -1
  81. package/dist/assets/clone-CrIDEQt7.js +0 -1
  82. package/dist/assets/edit-page-DZbg6XM8.js +0 -8
  83. package/dist/assets/index-B-iFJyXq.js +0 -80
  84. package/dist/assets/stateDiagram-v2-4JROLMXI-C8w2_aHm.js +0 -1
@@ -1 +1 @@
1
- import{_ as t,g as e,s as i,a as n,b as r,c as s,d as a,v as o,l,j as h}from"./mermaid-CYElsmZp.js";import{s as c}from"./transform-CdY8z5kT.js";import{G as u}from"./graph-DARHf5FF.js";import{l as d}from"./layout-2W-wT2Ws.js";import{l as p}from"./step-xJWGRC3d.js";import"./index-B-iFJyXq.js";import"./_baseUniq-DRGCPgTu.js";import"./_baseEach-BxidLc34.js";import"./min--mjCwyM_.js";import"./_baseMap-Cu7qHcLU.js";import"./sortBy-BIWls_3f.js";var y=function(){var e=t((function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i}),"o"),i=[1,3],n=[1,4],r=[1,5],s=[1,6],a=[5,6,8,9,11,13,31,32,33,34,35,36,44,62,63],o=[1,18],l=[2,7],h=[1,22],c=[1,23],u=[1,24],d=[1,25],p=[1,26],y=[1,27],_=[1,20],g=[1,28],E=[1,29],m=[62,63],R=[5,8,9,11,13,31,32,33,34,35,36,44,51,53,62,63],f=[1,47],I=[1,48],S=[1,49],b=[1,50],N=[1,51],T=[1,52],k=[1,53],x=[53,54],A=[1,64],w=[1,60],q=[1,61],v=[1,62],$=[1,63],O=[1,65],L=[1,69],C=[1,70],M=[1,67],F=[1,68],D=[5,8,9,11,13,31,32,33,34,35,36,44,62,63],P={trace:t((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,requirementType:17,requirementName:18,STRUCT_START:19,requirementBody:20,ID:21,COLONSEP:22,id:23,TEXT:24,text:25,RISK:26,riskLevel:27,VERIFYMTHD:28,verifyType:29,STRUCT_STOP:30,REQUIREMENT:31,FUNCTIONAL_REQUIREMENT:32,INTERFACE_REQUIREMENT:33,PERFORMANCE_REQUIREMENT:34,PHYSICAL_REQUIREMENT:35,DESIGN_CONSTRAINT:36,LOW_RISK:37,MED_RISK:38,HIGH_RISK:39,VERIFY_ANALYSIS:40,VERIFY_DEMONSTRATION:41,VERIFY_INSPECTION:42,VERIFY_TEST:43,ELEMENT:44,elementName:45,elementBody:46,TYPE:47,type:48,DOCREF:49,ref:50,END_ARROW_L:51,relationship:52,LINE:53,END_ARROW_R:54,CONTAINS:55,COPIES:56,DERIVES:57,SATISFIES:58,VERIFIES:59,REFINES:60,TRACES:61,unqString:62,qString:63,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",19:"STRUCT_START",21:"ID",22:"COLONSEP",24:"TEXT",26:"RISK",28:"VERIFYMTHD",30:"STRUCT_STOP",31:"REQUIREMENT",32:"FUNCTIONAL_REQUIREMENT",33:"INTERFACE_REQUIREMENT",34:"PERFORMANCE_REQUIREMENT",35:"PHYSICAL_REQUIREMENT",36:"DESIGN_CONSTRAINT",37:"LOW_RISK",38:"MED_RISK",39:"HIGH_RISK",40:"VERIFY_ANALYSIS",41:"VERIFY_DEMONSTRATION",42:"VERIFY_INSPECTION",43:"VERIFY_TEST",44:"ELEMENT",47:"TYPE",49:"DOCREF",51:"END_ARROW_L",53:"LINE",54:"END_ARROW_R",55:"CONTAINS",56:"COPIES",57:"DERIVES",58:"SATISFIES",59:"VERIFIES",60:"REFINES",61:"TRACES",62:"unqString",63:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[14,5],[20,5],[20,5],[20,5],[20,5],[20,2],[20,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[27,1],[27,1],[27,1],[29,1],[29,1],[29,1],[29,1],[15,5],[46,5],[46,5],[46,2],[46,1],[16,5],[16,5],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[18,1],[18,1],[23,1],[23,1],[25,1],[25,1],[45,1],[45,1],[48,1],[48,1],[50,1],[50,1]],performAction:t((function(t,e,i,n,r,s,a){var o=s.length-1;switch(r){case 4:this.$=s[o].trim(),n.setAccTitle(this.$);break;case 5:case 6:this.$=s[o].trim(),n.setAccDescription(this.$);break;case 7:this.$=[];break;case 13:n.addRequirement(s[o-3],s[o-4]);break;case 14:n.setNewReqId(s[o-2]);break;case 15:n.setNewReqText(s[o-2]);break;case 16:n.setNewReqRisk(s[o-2]);break;case 17:n.setNewReqVerifyMethod(s[o-2]);break;case 20:this.$=n.RequirementType.REQUIREMENT;break;case 21:this.$=n.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 22:this.$=n.RequirementType.INTERFACE_REQUIREMENT;break;case 23:this.$=n.RequirementType.PERFORMANCE_REQUIREMENT;break;case 24:this.$=n.RequirementType.PHYSICAL_REQUIREMENT;break;case 25:this.$=n.RequirementType.DESIGN_CONSTRAINT;break;case 26:this.$=n.RiskLevel.LOW_RISK;break;case 27:this.$=n.RiskLevel.MED_RISK;break;case 28:this.$=n.RiskLevel.HIGH_RISK;break;case 29:this.$=n.VerifyType.VERIFY_ANALYSIS;break;case 30:this.$=n.VerifyType.VERIFY_DEMONSTRATION;break;case 31:this.$=n.VerifyType.VERIFY_INSPECTION;break;case 32:this.$=n.VerifyType.VERIFY_TEST;break;case 33:n.addElement(s[o-3]);break;case 34:n.setNewElementType(s[o-2]);break;case 35:n.setNewElementDocRef(s[o-2]);break;case 38:n.addRelationship(s[o-2],s[o],s[o-4]);break;case 39:n.addRelationship(s[o-2],s[o-4],s[o]);break;case 40:this.$=n.Relationships.CONTAINS;break;case 41:this.$=n.Relationships.COPIES;break;case 42:this.$=n.Relationships.DERIVES;break;case 43:this.$=n.Relationships.SATISFIES;break;case 44:this.$=n.Relationships.VERIFIES;break;case 45:this.$=n.Relationships.REFINES;break;case 46:this.$=n.Relationships.TRACES}}),"anonymous"),table:[{3:1,4:2,6:i,9:n,11:r,13:s},{1:[3]},{3:8,4:2,5:[1,7],6:i,9:n,11:r,13:s},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(a,[2,6]),{3:12,4:2,6:i,9:n,11:r,13:s},{1:[2,2]},{4:17,5:o,7:13,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},e(a,[2,4]),e(a,[2,5]),{1:[2,1]},{8:[1,30]},{4:17,5:o,7:31,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:32,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:33,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:34,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:35,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{18:36,62:[1,37],63:[1,38]},{45:39,62:[1,40],63:[1,41]},{51:[1,42],53:[1,43]},e(m,[2,20]),e(m,[2,21]),e(m,[2,22]),e(m,[2,23]),e(m,[2,24]),e(m,[2,25]),e(R,[2,49]),e(R,[2,50]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{19:[1,44]},{19:[2,47]},{19:[2,48]},{19:[1,45]},{19:[2,53]},{19:[2,54]},{52:46,55:f,56:I,57:S,58:b,59:N,60:T,61:k},{52:54,55:f,56:I,57:S,58:b,59:N,60:T,61:k},{5:[1,55]},{5:[1,56]},{53:[1,57]},e(x,[2,40]),e(x,[2,41]),e(x,[2,42]),e(x,[2,43]),e(x,[2,44]),e(x,[2,45]),e(x,[2,46]),{54:[1,58]},{5:A,20:59,21:w,24:q,26:v,28:$,30:O},{5:L,30:C,46:66,47:M,49:F},{23:71,62:g,63:E},{23:72,62:g,63:E},e(D,[2,13]),{22:[1,73]},{22:[1,74]},{22:[1,75]},{22:[1,76]},{5:A,20:77,21:w,24:q,26:v,28:$,30:O},e(D,[2,19]),e(D,[2,33]),{22:[1,78]},{22:[1,79]},{5:L,30:C,46:80,47:M,49:F},e(D,[2,37]),e(D,[2,38]),e(D,[2,39]),{23:81,62:g,63:E},{25:82,62:[1,83],63:[1,84]},{27:85,37:[1,86],38:[1,87],39:[1,88]},{29:89,40:[1,90],41:[1,91],42:[1,92],43:[1,93]},e(D,[2,18]),{48:94,62:[1,95],63:[1,96]},{50:97,62:[1,98],63:[1,99]},e(D,[2,36]),{5:[1,100]},{5:[1,101]},{5:[2,51]},{5:[2,52]},{5:[1,102]},{5:[2,26]},{5:[2,27]},{5:[2,28]},{5:[1,103]},{5:[2,29]},{5:[2,30]},{5:[2,31]},{5:[2,32]},{5:[1,104]},{5:[2,55]},{5:[2,56]},{5:[1,105]},{5:[2,57]},{5:[2,58]},{5:A,20:106,21:w,24:q,26:v,28:$,30:O},{5:A,20:107,21:w,24:q,26:v,28:$,30:O},{5:A,20:108,21:w,24:q,26:v,28:$,30:O},{5:A,20:109,21:w,24:q,26:v,28:$,30:O},{5:L,30:C,46:110,47:M,49:F},{5:L,30:C,46:111,47:M,49:F},e(D,[2,14]),e(D,[2,15]),e(D,[2,16]),e(D,[2,17]),e(D,[2,34]),e(D,[2,35])],defaultActions:{8:[2,2],12:[2,1],30:[2,3],31:[2,8],32:[2,9],33:[2,10],34:[2,11],35:[2,12],37:[2,47],38:[2,48],40:[2,53],41:[2,54],83:[2,51],84:[2,52],86:[2,26],87:[2,27],88:[2,28],90:[2,29],91:[2,30],92:[2,31],93:[2,32],95:[2,55],96:[2,56],98:[2,57],99:[2,58]},parseError:t((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:t((function(e){var i=this,n=[0],r=[],s=[null],a=[],o=this.table,l="",h=0,c=0,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);d.setInput(e,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var _=d.yylloc;a.push(_);var g=d.options&&d.options.ranges;function E(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t((function(t){n.length=n.length-2*t,s.length=s.length-t,a.length=a.length-t}),"popStack"),t(E,"lex");for(var m,R,f,I,S,b,N,T,k={};;){if(R=n[n.length-1],this.defaultActions[R]?f=this.defaultActions[R]:(null==m&&(m=E()),f=o[R]&&o[R][m]),void 0===f||!f.length||!f[0]){var x="";for(S in T=[],o[R])this.terminals_[S]&&S>2&&T.push("'"+this.terminals_[S]+"'");x=d.showPosition?"Parse error on line "+(h+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(x,{text:d.match,token:this.terminals_[m]||m,line:d.yylineno,loc:_,expected:T})}if(f[0]instanceof Array&&f.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+m);switch(f[0]){case 1:n.push(m),s.push(d.yytext),a.push(d.yylloc),n.push(f[1]),m=null,c=d.yyleng,l=d.yytext,h=d.yylineno,_=d.yylloc;break;case 2:if(b=this.productions_[f[1]][1],k.$=s[s.length-b],k._$={first_line:a[a.length-(b||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(b||1)].first_column,last_column:a[a.length-1].last_column},g&&(k._$.range=[a[a.length-(b||1)].range[0],a[a.length-1].range[1]]),void 0!==(I=this.performAction.apply(k,[l,c,h,p.yy,f[1],s,a].concat(u))))return I;b&&(n=n.slice(0,-1*b*2),s=s.slice(0,-1*b),a=a.slice(0,-1*b)),n.push(this.productions_[f[1]][0]),s.push(k.$),a.push(k._$),N=o[n[n.length-2]][n[n.length-1]],n.push(N);break;case 3:return!0}}return!0}),"parse")},V=function(){return{EOF:1,parseError:t((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:t((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:t((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:t((function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:t((function(){return this._more=!0,this}),"more"),reject:t((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:t((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:t((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:t((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:t((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:t((function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1}),"test_match"),next:t((function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((i=this._input.match(this.rules[r[s]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:t((function(){var t=this.next();return t||this.lex()}),"lex"),begin:t((function(t){this.conditionStack.push(t)}),"begin"),popState:t((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:t((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:t((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:t((function(t){this.begin(t)}),"pushState"),stateStackSize:t((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:t((function(t,e,i,n){switch(i){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 48:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 5;case 9:case 10:case 11:break;case 12:return 8;case 13:return 6;case 14:return 19;case 15:return 30;case 16:return 22;case 17:return 21;case 18:return 24;case 19:return 26;case 20:return 28;case 21:return 31;case 22:return 32;case 23:return 33;case 24:return 34;case 25:return 35;case 26:return 36;case 27:return 37;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 41;case 32:return 42;case 33:return 43;case 34:return 44;case 35:return 55;case 36:return 56;case 37:return 57;case 38:return 58;case 39:return 59;case 40:return 60;case 41:return 61;case 42:return 47;case 43:return 49;case 44:return 51;case 45:return 54;case 46:return 53;case 47:this.begin("string");break;case 49:return"qString";case 50:return e.yytext=e.yytext.trim(),62}}),"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[48,49],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,50],inclusive:!0}}}}();function U(){this.yy={}}return P.lexer=V,t(U,"Parser"),U.prototype=P,P.Parser=U,new U}();y.parser=y;var _=y,g=[],E={},m=new Map,R={},f=new Map,I=t(((t,e)=>(m.has(t)||m.set(t,{name:t,type:e,id:E.id,text:E.text,risk:E.risk,verifyMethod:E.verifyMethod}),E={},m.get(t))),"addRequirement"),S=t((()=>m),"getRequirements"),b=t((t=>{void 0!==E&&(E.id=t)}),"setNewReqId"),N=t((t=>{void 0!==E&&(E.text=t)}),"setNewReqText"),T=t((t=>{void 0!==E&&(E.risk=t)}),"setNewReqRisk"),k=t((t=>{void 0!==E&&(E.verifyMethod=t)}),"setNewReqVerifyMethod"),x=t((t=>(f.has(t)||(f.set(t,{name:t,type:R.type,docRef:R.docRef}),l.info("Added new requirement: ",t)),R={},f.get(t))),"addElement"),A=t((()=>f),"getElements"),w=t((t=>{void 0!==R&&(R.type=t)}),"setNewElementType"),q=t((t=>{void 0!==R&&(R.docRef=t)}),"setNewElementDocRef"),v=t(((t,e,i)=>{g.push({type:t,src:e,dst:i})}),"addRelationship"),$=t((()=>g),"getRelationships"),O=t((()=>{g=[],E={},m=new Map,R={},f=new Map,o()}),"clear"),L={RequirementType:{REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},RiskLevel:{LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},VerifyType:{VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Relationships:{CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},getConfig:t((()=>s().req),"getConfig"),addRequirement:I,getRequirements:S,setNewReqId:b,setNewReqText:N,setNewReqRisk:T,setNewReqVerifyMethod:k,setAccTitle:r,getAccTitle:n,setAccDescription:i,getAccDescription:e,addElement:x,getElements:A,setNewElementType:w,setNewElementDocRef:q,addRelationship:v,getRelationships:$,clear:O},C=t((t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n\n`),"getStyles"),M={CONTAINS:"contains",ARROW:"arrow"},F={ReqMarkers:M,insertLineEndings:t(((t,e)=>{let i=t.append("defs").append("marker").attr("id",M.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");i.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),i.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),i.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",M.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0\n L${e.line_height},${e.line_height/2}\n M${e.line_height},${e.line_height/2}\n L0,${e.line_height}`).attr("stroke-width",1)}),"insertLineEndings")},D={},P=0,V=t(((t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",D.rect_min_width+"px").attr("height",D.rect_min_height+"px")),"newRectNode"),U=t(((t,e,i)=>{let n=D.rect_min_width/2,r=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",n).attr("y",D.rect_padding).attr("dominant-baseline","hanging"),s=0;i.forEach((t=>{0==s?r.append("tspan").attr("text-anchor","middle").attr("x",D.rect_min_width/2).attr("dy",0).text(t):r.append("tspan").attr("text-anchor","middle").attr("x",D.rect_min_width/2).attr("dy",.75*D.line_height).text(t),s++}));let a=1.5*D.rect_padding+s*D.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",D.rect_min_width).attr("y1",a).attr("y2",a),{titleNode:r,y:a}}),"newTitleNode"),Y=t(((t,e,i,n)=>{let r=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",D.rect_padding).attr("y",n).attr("dominant-baseline","hanging"),s=0;let a=[];return i.forEach((t=>{let e=t.length;for(;e>30&&s<3;){let i=t.substring(0,30);e=(t=t.substring(30,t.length)).length,a[a.length]=i,s++}if(3==s){let t=a[a.length-1];a[a.length-1]=t.substring(0,t.length-4)+"..."}else a[a.length]=t;s=0})),a.forEach((t=>{r.append("tspan").attr("x",D.rect_padding).attr("dy",D.line_height).text(t)})),r}),"newBodyNode"),B=t(((t,e,i,n)=>{const r=e.node().getTotalLength(),s=e.node().getPointAtLength(.5*r),a="rel"+P;P++;const o=t.append("text").attr("class","req relationshipLabel").attr("id",a).attr("x",s.x).attr("y",s.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(n).node().getBBox();t.insert("rect","#"+a).attr("class","req reqLabelBox").attr("x",s.x-o.width/2).attr("y",s.y-o.height/2).attr("width",o.width).attr("height",o.height).attr("fill","white").attr("fill-opacity","85%")}),"addEdgeLabel"),j=t((function(t,e,i,n,r){const s=i.edge(G(e.src),G(e.dst)),a=p().x((function(t){return t.x})).y((function(t){return t.y})),o=t.insert("path","#"+n).attr("class","er relationshipLine").attr("d",a(s.points)).attr("fill","none");e.type==r.db.Relationships.CONTAINS?o.attr("marker-start","url("+h.getUrl(D.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+h.getUrl(D.arrowMarkerAbsolute)+"#"+F.ReqMarkers.ARROW+"_line_ending)")),B(t,o,D,`<<${e.type}>>`)}),"drawRelationshipFromLayout"),Q=t(((t,e,i)=>{t.forEach(((t,n)=>{n=G(n),l.info("Added new requirement: ",n);const r=i.append("g").attr("id",n),s=V(r,"req-"+n);let a=[],o=U(r,n+"_title",[`<<${t.type}>>`,`${t.name}`]);a.push(o.titleNode);let h=Y(r,n+"_body",[`Id: ${t.id}`,`Text: ${t.text}`,`Risk: ${t.risk}`,`Verification: ${t.verifyMethod}`],o.y);a.push(h);const c=s.node().getBBox();e.setNode(n,{width:c.width,height:c.height,shape:"rect",id:n})}))}),"drawReqs"),H=t(((t,e,i)=>{t.forEach(((t,n)=>{const r=G(n),s=i.append("g").attr("id",r),a="element-"+r,o=V(s,a);let l=[],h=U(s,a+"_title",["<<Element>>",`${n}`]);l.push(h.titleNode);let c=Y(s,a+"_body",[`Type: ${t.type||"Not Specified"}`,`Doc Ref: ${t.docRef||"None"}`],h.y);l.push(c);const u=o.node().getBBox();e.setNode(r,{width:u.width,height:u.height,shape:"rect",id:r})}))}),"drawElements"),W=t(((t,e)=>(t.forEach((function(t){let i=G(t.src),n=G(t.dst);e.setEdge(i,n,{relationship:t})})),t)),"addRelationships"),K=t((function(t,e){e.nodes().forEach((function(i){void 0!==i&&void 0!==e.node(i)&&(t.select("#"+i),t.select("#"+i).attr("transform","translate("+(e.node(i).x-e.node(i).width/2)+","+(e.node(i).y-e.node(i).height/2)+" )"))}))}),"adjustEntities"),G=t((t=>t.replace(/\s/g,"").replace(/\./g,"_")),"elementString"),z={parser:_,db:L,renderer:{draw:t(((t,e,i,n)=>{const r=(D=s().requirement).securityLevel;let o;"sandbox"===r&&(o=c("#i"+e));const l=c("sandbox"===r?o.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);F.insertLineEndings(l,D);const h=new u({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:D.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));let p=n.db.getRequirements(),y=n.db.getElements(),_=n.db.getRelationships();Q(p,h,l),H(y,h,l),W(_,h),d(h),K(l,h),_.forEach((function(t){j(l,t,h,e,n)}));const g=D.rect_padding,E=l.node().getBBox(),m=E.width+2*g,R=E.height+2*g;a(l,R,m,D.useMaxWidth),l.attr("viewBox",`${E.x-g} ${E.y-g} ${m} ${R}`)}),"draw")},styles:C};export{z as diagram};
1
+ import{_ as t,g as e,s as i,a as n,b as r,c as s,d as a,v as o,l,j as h}from"./mermaid-NCa4Btby.js";import{s as c}from"./transform-CdY8z5kT.js";import{G as u}from"./graph-4-Vg1Aiz.js";import{l as d}from"./layout-CGBTZO_E.js";import{l as p}from"./step-xJWGRC3d.js";import"./index-M-fa6gqH.js";import"./_baseUniq-DBsNFMLI.js";import"./_baseEach-CHGr95h3.js";import"./min-CABlFD1H.js";import"./_baseMap-CJD4EB23.js";import"./sortBy-DeAoOjrt.js";var y=function(){var e=t((function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i}),"o"),i=[1,3],n=[1,4],r=[1,5],s=[1,6],a=[5,6,8,9,11,13,31,32,33,34,35,36,44,62,63],o=[1,18],l=[2,7],h=[1,22],c=[1,23],u=[1,24],d=[1,25],p=[1,26],y=[1,27],_=[1,20],g=[1,28],E=[1,29],m=[62,63],R=[5,8,9,11,13,31,32,33,34,35,36,44,51,53,62,63],f=[1,47],I=[1,48],S=[1,49],b=[1,50],N=[1,51],T=[1,52],k=[1,53],x=[53,54],A=[1,64],w=[1,60],q=[1,61],v=[1,62],$=[1,63],O=[1,65],L=[1,69],C=[1,70],M=[1,67],F=[1,68],D=[5,8,9,11,13,31,32,33,34,35,36,44,62,63],P={trace:t((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,requirementType:17,requirementName:18,STRUCT_START:19,requirementBody:20,ID:21,COLONSEP:22,id:23,TEXT:24,text:25,RISK:26,riskLevel:27,VERIFYMTHD:28,verifyType:29,STRUCT_STOP:30,REQUIREMENT:31,FUNCTIONAL_REQUIREMENT:32,INTERFACE_REQUIREMENT:33,PERFORMANCE_REQUIREMENT:34,PHYSICAL_REQUIREMENT:35,DESIGN_CONSTRAINT:36,LOW_RISK:37,MED_RISK:38,HIGH_RISK:39,VERIFY_ANALYSIS:40,VERIFY_DEMONSTRATION:41,VERIFY_INSPECTION:42,VERIFY_TEST:43,ELEMENT:44,elementName:45,elementBody:46,TYPE:47,type:48,DOCREF:49,ref:50,END_ARROW_L:51,relationship:52,LINE:53,END_ARROW_R:54,CONTAINS:55,COPIES:56,DERIVES:57,SATISFIES:58,VERIFIES:59,REFINES:60,TRACES:61,unqString:62,qString:63,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",19:"STRUCT_START",21:"ID",22:"COLONSEP",24:"TEXT",26:"RISK",28:"VERIFYMTHD",30:"STRUCT_STOP",31:"REQUIREMENT",32:"FUNCTIONAL_REQUIREMENT",33:"INTERFACE_REQUIREMENT",34:"PERFORMANCE_REQUIREMENT",35:"PHYSICAL_REQUIREMENT",36:"DESIGN_CONSTRAINT",37:"LOW_RISK",38:"MED_RISK",39:"HIGH_RISK",40:"VERIFY_ANALYSIS",41:"VERIFY_DEMONSTRATION",42:"VERIFY_INSPECTION",43:"VERIFY_TEST",44:"ELEMENT",47:"TYPE",49:"DOCREF",51:"END_ARROW_L",53:"LINE",54:"END_ARROW_R",55:"CONTAINS",56:"COPIES",57:"DERIVES",58:"SATISFIES",59:"VERIFIES",60:"REFINES",61:"TRACES",62:"unqString",63:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[14,5],[20,5],[20,5],[20,5],[20,5],[20,2],[20,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[27,1],[27,1],[27,1],[29,1],[29,1],[29,1],[29,1],[15,5],[46,5],[46,5],[46,2],[46,1],[16,5],[16,5],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[18,1],[18,1],[23,1],[23,1],[25,1],[25,1],[45,1],[45,1],[48,1],[48,1],[50,1],[50,1]],performAction:t((function(t,e,i,n,r,s,a){var o=s.length-1;switch(r){case 4:this.$=s[o].trim(),n.setAccTitle(this.$);break;case 5:case 6:this.$=s[o].trim(),n.setAccDescription(this.$);break;case 7:this.$=[];break;case 13:n.addRequirement(s[o-3],s[o-4]);break;case 14:n.setNewReqId(s[o-2]);break;case 15:n.setNewReqText(s[o-2]);break;case 16:n.setNewReqRisk(s[o-2]);break;case 17:n.setNewReqVerifyMethod(s[o-2]);break;case 20:this.$=n.RequirementType.REQUIREMENT;break;case 21:this.$=n.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 22:this.$=n.RequirementType.INTERFACE_REQUIREMENT;break;case 23:this.$=n.RequirementType.PERFORMANCE_REQUIREMENT;break;case 24:this.$=n.RequirementType.PHYSICAL_REQUIREMENT;break;case 25:this.$=n.RequirementType.DESIGN_CONSTRAINT;break;case 26:this.$=n.RiskLevel.LOW_RISK;break;case 27:this.$=n.RiskLevel.MED_RISK;break;case 28:this.$=n.RiskLevel.HIGH_RISK;break;case 29:this.$=n.VerifyType.VERIFY_ANALYSIS;break;case 30:this.$=n.VerifyType.VERIFY_DEMONSTRATION;break;case 31:this.$=n.VerifyType.VERIFY_INSPECTION;break;case 32:this.$=n.VerifyType.VERIFY_TEST;break;case 33:n.addElement(s[o-3]);break;case 34:n.setNewElementType(s[o-2]);break;case 35:n.setNewElementDocRef(s[o-2]);break;case 38:n.addRelationship(s[o-2],s[o],s[o-4]);break;case 39:n.addRelationship(s[o-2],s[o-4],s[o]);break;case 40:this.$=n.Relationships.CONTAINS;break;case 41:this.$=n.Relationships.COPIES;break;case 42:this.$=n.Relationships.DERIVES;break;case 43:this.$=n.Relationships.SATISFIES;break;case 44:this.$=n.Relationships.VERIFIES;break;case 45:this.$=n.Relationships.REFINES;break;case 46:this.$=n.Relationships.TRACES}}),"anonymous"),table:[{3:1,4:2,6:i,9:n,11:r,13:s},{1:[3]},{3:8,4:2,5:[1,7],6:i,9:n,11:r,13:s},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(a,[2,6]),{3:12,4:2,6:i,9:n,11:r,13:s},{1:[2,2]},{4:17,5:o,7:13,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},e(a,[2,4]),e(a,[2,5]),{1:[2,1]},{8:[1,30]},{4:17,5:o,7:31,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:32,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:33,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:34,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:35,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{18:36,62:[1,37],63:[1,38]},{45:39,62:[1,40],63:[1,41]},{51:[1,42],53:[1,43]},e(m,[2,20]),e(m,[2,21]),e(m,[2,22]),e(m,[2,23]),e(m,[2,24]),e(m,[2,25]),e(R,[2,49]),e(R,[2,50]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{19:[1,44]},{19:[2,47]},{19:[2,48]},{19:[1,45]},{19:[2,53]},{19:[2,54]},{52:46,55:f,56:I,57:S,58:b,59:N,60:T,61:k},{52:54,55:f,56:I,57:S,58:b,59:N,60:T,61:k},{5:[1,55]},{5:[1,56]},{53:[1,57]},e(x,[2,40]),e(x,[2,41]),e(x,[2,42]),e(x,[2,43]),e(x,[2,44]),e(x,[2,45]),e(x,[2,46]),{54:[1,58]},{5:A,20:59,21:w,24:q,26:v,28:$,30:O},{5:L,30:C,46:66,47:M,49:F},{23:71,62:g,63:E},{23:72,62:g,63:E},e(D,[2,13]),{22:[1,73]},{22:[1,74]},{22:[1,75]},{22:[1,76]},{5:A,20:77,21:w,24:q,26:v,28:$,30:O},e(D,[2,19]),e(D,[2,33]),{22:[1,78]},{22:[1,79]},{5:L,30:C,46:80,47:M,49:F},e(D,[2,37]),e(D,[2,38]),e(D,[2,39]),{23:81,62:g,63:E},{25:82,62:[1,83],63:[1,84]},{27:85,37:[1,86],38:[1,87],39:[1,88]},{29:89,40:[1,90],41:[1,91],42:[1,92],43:[1,93]},e(D,[2,18]),{48:94,62:[1,95],63:[1,96]},{50:97,62:[1,98],63:[1,99]},e(D,[2,36]),{5:[1,100]},{5:[1,101]},{5:[2,51]},{5:[2,52]},{5:[1,102]},{5:[2,26]},{5:[2,27]},{5:[2,28]},{5:[1,103]},{5:[2,29]},{5:[2,30]},{5:[2,31]},{5:[2,32]},{5:[1,104]},{5:[2,55]},{5:[2,56]},{5:[1,105]},{5:[2,57]},{5:[2,58]},{5:A,20:106,21:w,24:q,26:v,28:$,30:O},{5:A,20:107,21:w,24:q,26:v,28:$,30:O},{5:A,20:108,21:w,24:q,26:v,28:$,30:O},{5:A,20:109,21:w,24:q,26:v,28:$,30:O},{5:L,30:C,46:110,47:M,49:F},{5:L,30:C,46:111,47:M,49:F},e(D,[2,14]),e(D,[2,15]),e(D,[2,16]),e(D,[2,17]),e(D,[2,34]),e(D,[2,35])],defaultActions:{8:[2,2],12:[2,1],30:[2,3],31:[2,8],32:[2,9],33:[2,10],34:[2,11],35:[2,12],37:[2,47],38:[2,48],40:[2,53],41:[2,54],83:[2,51],84:[2,52],86:[2,26],87:[2,27],88:[2,28],90:[2,29],91:[2,30],92:[2,31],93:[2,32],95:[2,55],96:[2,56],98:[2,57],99:[2,58]},parseError:t((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:t((function(e){var i=this,n=[0],r=[],s=[null],a=[],o=this.table,l="",h=0,c=0,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);d.setInput(e,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var _=d.yylloc;a.push(_);var g=d.options&&d.options.ranges;function E(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t((function(t){n.length=n.length-2*t,s.length=s.length-t,a.length=a.length-t}),"popStack"),t(E,"lex");for(var m,R,f,I,S,b,N,T,k={};;){if(R=n[n.length-1],this.defaultActions[R]?f=this.defaultActions[R]:(null==m&&(m=E()),f=o[R]&&o[R][m]),void 0===f||!f.length||!f[0]){var x="";for(S in T=[],o[R])this.terminals_[S]&&S>2&&T.push("'"+this.terminals_[S]+"'");x=d.showPosition?"Parse error on line "+(h+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(x,{text:d.match,token:this.terminals_[m]||m,line:d.yylineno,loc:_,expected:T})}if(f[0]instanceof Array&&f.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+m);switch(f[0]){case 1:n.push(m),s.push(d.yytext),a.push(d.yylloc),n.push(f[1]),m=null,c=d.yyleng,l=d.yytext,h=d.yylineno,_=d.yylloc;break;case 2:if(b=this.productions_[f[1]][1],k.$=s[s.length-b],k._$={first_line:a[a.length-(b||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(b||1)].first_column,last_column:a[a.length-1].last_column},g&&(k._$.range=[a[a.length-(b||1)].range[0],a[a.length-1].range[1]]),void 0!==(I=this.performAction.apply(k,[l,c,h,p.yy,f[1],s,a].concat(u))))return I;b&&(n=n.slice(0,-1*b*2),s=s.slice(0,-1*b),a=a.slice(0,-1*b)),n.push(this.productions_[f[1]][0]),s.push(k.$),a.push(k._$),N=o[n[n.length-2]][n[n.length-1]],n.push(N);break;case 3:return!0}}return!0}),"parse")},V=function(){return{EOF:1,parseError:t((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:t((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:t((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:t((function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:t((function(){return this._more=!0,this}),"more"),reject:t((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:t((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:t((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:t((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:t((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:t((function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1}),"test_match"),next:t((function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((i=this._input.match(this.rules[r[s]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:t((function(){var t=this.next();return t||this.lex()}),"lex"),begin:t((function(t){this.conditionStack.push(t)}),"begin"),popState:t((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:t((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:t((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:t((function(t){this.begin(t)}),"pushState"),stateStackSize:t((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:t((function(t,e,i,n){switch(i){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 48:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 5;case 9:case 10:case 11:break;case 12:return 8;case 13:return 6;case 14:return 19;case 15:return 30;case 16:return 22;case 17:return 21;case 18:return 24;case 19:return 26;case 20:return 28;case 21:return 31;case 22:return 32;case 23:return 33;case 24:return 34;case 25:return 35;case 26:return 36;case 27:return 37;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 41;case 32:return 42;case 33:return 43;case 34:return 44;case 35:return 55;case 36:return 56;case 37:return 57;case 38:return 58;case 39:return 59;case 40:return 60;case 41:return 61;case 42:return 47;case 43:return 49;case 44:return 51;case 45:return 54;case 46:return 53;case 47:this.begin("string");break;case 49:return"qString";case 50:return e.yytext=e.yytext.trim(),62}}),"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[48,49],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,50],inclusive:!0}}}}();function U(){this.yy={}}return P.lexer=V,t(U,"Parser"),U.prototype=P,P.Parser=U,new U}();y.parser=y;var _=y,g=[],E={},m=new Map,R={},f=new Map,I=t(((t,e)=>(m.has(t)||m.set(t,{name:t,type:e,id:E.id,text:E.text,risk:E.risk,verifyMethod:E.verifyMethod}),E={},m.get(t))),"addRequirement"),S=t((()=>m),"getRequirements"),b=t((t=>{void 0!==E&&(E.id=t)}),"setNewReqId"),N=t((t=>{void 0!==E&&(E.text=t)}),"setNewReqText"),T=t((t=>{void 0!==E&&(E.risk=t)}),"setNewReqRisk"),k=t((t=>{void 0!==E&&(E.verifyMethod=t)}),"setNewReqVerifyMethod"),x=t((t=>(f.has(t)||(f.set(t,{name:t,type:R.type,docRef:R.docRef}),l.info("Added new requirement: ",t)),R={},f.get(t))),"addElement"),A=t((()=>f),"getElements"),w=t((t=>{void 0!==R&&(R.type=t)}),"setNewElementType"),q=t((t=>{void 0!==R&&(R.docRef=t)}),"setNewElementDocRef"),v=t(((t,e,i)=>{g.push({type:t,src:e,dst:i})}),"addRelationship"),$=t((()=>g),"getRelationships"),O=t((()=>{g=[],E={},m=new Map,R={},f=new Map,o()}),"clear"),L={RequirementType:{REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},RiskLevel:{LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},VerifyType:{VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Relationships:{CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},getConfig:t((()=>s().req),"getConfig"),addRequirement:I,getRequirements:S,setNewReqId:b,setNewReqText:N,setNewReqRisk:T,setNewReqVerifyMethod:k,setAccTitle:r,getAccTitle:n,setAccDescription:i,getAccDescription:e,addElement:x,getElements:A,setNewElementType:w,setNewElementDocRef:q,addRelationship:v,getRelationships:$,clear:O},C=t((t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n\n`),"getStyles"),M={CONTAINS:"contains",ARROW:"arrow"},F={ReqMarkers:M,insertLineEndings:t(((t,e)=>{let i=t.append("defs").append("marker").attr("id",M.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");i.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),i.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),i.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",M.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0\n L${e.line_height},${e.line_height/2}\n M${e.line_height},${e.line_height/2}\n L0,${e.line_height}`).attr("stroke-width",1)}),"insertLineEndings")},D={},P=0,V=t(((t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",D.rect_min_width+"px").attr("height",D.rect_min_height+"px")),"newRectNode"),U=t(((t,e,i)=>{let n=D.rect_min_width/2,r=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",n).attr("y",D.rect_padding).attr("dominant-baseline","hanging"),s=0;i.forEach((t=>{0==s?r.append("tspan").attr("text-anchor","middle").attr("x",D.rect_min_width/2).attr("dy",0).text(t):r.append("tspan").attr("text-anchor","middle").attr("x",D.rect_min_width/2).attr("dy",.75*D.line_height).text(t),s++}));let a=1.5*D.rect_padding+s*D.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",D.rect_min_width).attr("y1",a).attr("y2",a),{titleNode:r,y:a}}),"newTitleNode"),Y=t(((t,e,i,n)=>{let r=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",D.rect_padding).attr("y",n).attr("dominant-baseline","hanging"),s=0;let a=[];return i.forEach((t=>{let e=t.length;for(;e>30&&s<3;){let i=t.substring(0,30);e=(t=t.substring(30,t.length)).length,a[a.length]=i,s++}if(3==s){let t=a[a.length-1];a[a.length-1]=t.substring(0,t.length-4)+"..."}else a[a.length]=t;s=0})),a.forEach((t=>{r.append("tspan").attr("x",D.rect_padding).attr("dy",D.line_height).text(t)})),r}),"newBodyNode"),B=t(((t,e,i,n)=>{const r=e.node().getTotalLength(),s=e.node().getPointAtLength(.5*r),a="rel"+P;P++;const o=t.append("text").attr("class","req relationshipLabel").attr("id",a).attr("x",s.x).attr("y",s.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(n).node().getBBox();t.insert("rect","#"+a).attr("class","req reqLabelBox").attr("x",s.x-o.width/2).attr("y",s.y-o.height/2).attr("width",o.width).attr("height",o.height).attr("fill","white").attr("fill-opacity","85%")}),"addEdgeLabel"),j=t((function(t,e,i,n,r){const s=i.edge(G(e.src),G(e.dst)),a=p().x((function(t){return t.x})).y((function(t){return t.y})),o=t.insert("path","#"+n).attr("class","er relationshipLine").attr("d",a(s.points)).attr("fill","none");e.type==r.db.Relationships.CONTAINS?o.attr("marker-start","url("+h.getUrl(D.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+h.getUrl(D.arrowMarkerAbsolute)+"#"+F.ReqMarkers.ARROW+"_line_ending)")),B(t,o,D,`<<${e.type}>>`)}),"drawRelationshipFromLayout"),Q=t(((t,e,i)=>{t.forEach(((t,n)=>{n=G(n),l.info("Added new requirement: ",n);const r=i.append("g").attr("id",n),s=V(r,"req-"+n);let a=[],o=U(r,n+"_title",[`<<${t.type}>>`,`${t.name}`]);a.push(o.titleNode);let h=Y(r,n+"_body",[`Id: ${t.id}`,`Text: ${t.text}`,`Risk: ${t.risk}`,`Verification: ${t.verifyMethod}`],o.y);a.push(h);const c=s.node().getBBox();e.setNode(n,{width:c.width,height:c.height,shape:"rect",id:n})}))}),"drawReqs"),H=t(((t,e,i)=>{t.forEach(((t,n)=>{const r=G(n),s=i.append("g").attr("id",r),a="element-"+r,o=V(s,a);let l=[],h=U(s,a+"_title",["<<Element>>",`${n}`]);l.push(h.titleNode);let c=Y(s,a+"_body",[`Type: ${t.type||"Not Specified"}`,`Doc Ref: ${t.docRef||"None"}`],h.y);l.push(c);const u=o.node().getBBox();e.setNode(r,{width:u.width,height:u.height,shape:"rect",id:r})}))}),"drawElements"),W=t(((t,e)=>(t.forEach((function(t){let i=G(t.src),n=G(t.dst);e.setEdge(i,n,{relationship:t})})),t)),"addRelationships"),K=t((function(t,e){e.nodes().forEach((function(i){void 0!==i&&void 0!==e.node(i)&&(t.select("#"+i),t.select("#"+i).attr("transform","translate("+(e.node(i).x-e.node(i).width/2)+","+(e.node(i).y-e.node(i).height/2)+" )"))}))}),"adjustEntities"),G=t((t=>t.replace(/\s/g,"").replace(/\./g,"_")),"elementString"),z={parser:_,db:L,renderer:{draw:t(((t,e,i,n)=>{const r=(D=s().requirement).securityLevel;let o;"sandbox"===r&&(o=c("#i"+e));const l=c("sandbox"===r?o.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);F.insertLineEndings(l,D);const h=new u({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:D.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));let p=n.db.getRequirements(),y=n.db.getElements(),_=n.db.getRelationships();Q(p,h,l),H(y,h,l),W(_,h),d(h),K(l,h),_.forEach((function(t){j(l,t,h,e,n)}));const g=D.rect_padding,E=l.node().getBBox(),m=E.width+2*g,R=E.height+2*g;a(l,R,m,D.useMaxWidth),l.attr("viewBox",`${E.x-g} ${E.y-g} ${m} ${R}`)}),"draw")},styles:C};export{z as diagram};
@@ -1 +1 @@
1
- import{G as e,H as s,J as a,K as o,M as t,O as r,P as n,Q as i,S as l,T as c,U as m,V as d,W as h,X as b,Y as x,Z as f,_ as y,$ as p,a0 as u,a1 as g,a2 as _,a3 as j,a4 as k,a5 as v,a6 as w,a7 as S}from"./index-B-iFJyXq.js";import{u as N,A as C,R as I,a as P,C as T}from"./useMarimoWebSocket-DZ1JodWi.js";const A=n=>{const l=e.c(14),{appConfig:c}=n,{setCells:m}=s();let d,h,b;l[0]===Symbol.for("react.memo_cache_sentinel")?(d=[],l[0]=d):d=l[0],a.useEffect(E,d),l[1]===Symbol.for("react.memo_cache_sentinel")?(h=i(),l[1]=h):h=l[1],l[2]!==m?(b={autoInstantiate:!0,setCells:m,sessionId:h},l[2]=m,l[3]=b):b=l[3];const{connection:x}=N(b),f=o(t);let y,p,u;return l[4]!==x?(y=r.jsx(P,{connection:x,className:"sm:pt-8"}),l[4]=x,l[5]=y):y=l[5],l[6]!==c?(p=r.jsx(T,{appConfig:c,mode:"read"}),l[6]=c,l[7]=p):p=l[7],l[8]!==c.width||l[9]!==x||l[10]!==f||l[11]!==y||l[12]!==p?(u=r.jsxs(C,{connection:x,isRunning:f,width:c.width,children:[y,p]}),l[8]=c.width,l[9]=x,l[10]=f,l[11]=y,l[12]=p,l[13]=u):u=l[13],u};function W(){I.INSTANCE.stop()}function E(){return I.INSTANCE.start(n),W}const R=()=>{const s=e.c(4);if(!l())return null;let a;s[0]===Symbol.for("react.memo_cache_sentinel")?(a=c(),s[0]=a):a=s[0];const o=a;if(!o)return null;let t,n,i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx("a",{href:m.githubPage,target:"_blank",className:"underline",rel:"noreferrer",children:"marimo"}),s[1]=t):t=s[1],s[2]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsxs("span",{children:["This is a static Python notebook built using"," ",t,".",r.jsx("br",{}),"Some interactive features may not work, see ways to run or edit this."]}),s[2]=n):n=s[2],s[3]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsxs("div",{className:"px-4 py-2 bg-[var(--sky-2)] border-b border-[var(--sky-7)] text-md text-[var(--sky-11)] font-semibold flex justify-between items-center gap-4 no-print",children:[n,r.jsx("span",{className:"flex-shrink-0",children:r.jsx(B,{code:o})})]}),s[3]=i):i=s[3],i},B=s=>{const a=e.c(81),{code:o}=s;let t;if(a[0]===Symbol.for("react.memo_cache_sentinel")){t=d()||"notebook.py";const e=t.lastIndexOf("/");-1!==e&&(t=t.slice(e+1)),a[0]=t}else t=a[0];const n=window.location.href;let i,l,c,S,N,C,I,P,T,A,W,E,R,B,F,M,O,Y,z,D,G,H,J,K,Q,U,V,X,Z,$,q,L,ee,se,ae,oe,te;if(a[1]!==o){const e=h({code:o});let s;S=b,a[25]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsx(x,{asChild:!0,children:r.jsx(f,{"data-testid":"static-notebook-dialog-trigger",variant:"secondary",children:"Run or edit this notebook"})}),a[25]=F):F=a[25],c=y,l=p,a[26]===Symbol.for("react.memo_cache_sentinel")?(B=r.jsx(u,{children:t}),a[26]=B):B=a[26],i=g,D="pt-4 text-md text-left",G="This is a static notebook built using",H=" ",a[27]===Symbol.for("react.memo_cache_sentinel")?(J=r.jsx("a",{href:m.githubPage,target:"_blank",className:"text-link hover:underline",rel:"noreferrer",children:"marimo"}),a[27]=J):J=a[27],C=". marimo is an open-source next-generation Python notebook.",a[28]===Symbol.for("react.memo_cache_sentinel")?(I=r.jsx("hr",{className:"my-3"}),a[28]=I):I=a[28],P="In order to edit this notebook, you will need to download the code locally, install marimo, and run the following in your terminal:",a[29]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx("br",{}),a[29]=s):s=a[29],a[30]===Symbol.for("react.memo_cache_sentinel")?(T=r.jsxs("div",{className:"font-mono text-sm bg-[var(--sky-2)] rounded-md my-3 p-2 border border-[var(--sky-7)]",children:["pip install marimo",s,"marimo edit ",t]}),A=!n.endsWith(".html")&&r.jsxs(r.Fragment,{children:["or",r.jsxs("div",{className:"font-mono text-sm bg-[var(--sky-2)] rounded-md my-3 p-2 border border-[var(--sky-7)] break-all",children:["marimo edit ",window.location.href]})]}),W=r.jsx("hr",{className:"my-3"}),a[30]=T,a[31]=A,a[32]=W):(T=a[30],A=a[31],W=a[32]),E="You may also be able to run this notebook entirely in the browser via WebAssembly at:",R=" ",N=e,M="_blank",O="text-link hover:underline",Y="noreferrer",z=e.slice(0,40),a[1]=o,a[2]=i,a[3]=l,a[4]=c,a[5]=S,a[6]=N,a[7]=C,a[8]=I,a[9]=P,a[10]=T,a[11]=A,a[12]=W,a[13]=E,a[14]=R,a[15]=B,a[16]=F,a[17]=M,a[18]=O,a[19]=Y,a[20]=z,a[21]=D,a[22]=G,a[23]=H,a[24]=J}else i=a[2],l=a[3],c=a[4],S=a[5],N=a[6],C=a[7],I=a[8],P=a[9],T=a[10],A=a[11],W=a[12],E=a[13],R=a[14],B=a[15],F=a[16],M=a[17],O=a[18],Y=a[19],z=a[20],D=a[21],G=a[22],H=a[23],J=a[24];return a[33]!==N||a[34]!==M||a[35]!==O||a[36]!==Y||a[37]!==z?(K=r.jsxs("a",{href:N,target:M,className:O,rel:Y,children:[z,"..."]}),a[33]=N,a[34]=M,a[35]=O,a[36]=Y,a[37]=z,a[38]=K):K=a[38],a[39]===Symbol.for("react.memo_cache_sentinel")?(Q=r.jsx("br",{}),a[39]=Q):Q=a[39],a[40]===Symbol.for("react.memo_cache_sentinel")?(U=r.jsxs("div",{className:"text-sm text-muted-foreground pt-2",children:[r.jsx("strong",{children:"Note:"})," This feature is experimental and may not work for all notebooks. Additionally, some dependencies may not be available in the browser."]}),a[40]=U):U=a[40],a[41]!==i||a[42]!==C||a[43]!==I||a[44]!==P||a[45]!==T||a[46]!==A||a[47]!==W||a[48]!==E||a[49]!==R||a[50]!==K||a[51]!==D||a[52]!==G||a[53]!==H||a[54]!==J?(V=r.jsxs(i,{className:D,children:[G,H,J,C,I,P,T,A,W,E,R,K,Q,U]}),a[41]=i,a[42]=C,a[43]=I,a[44]=P,a[45]=T,a[46]=A,a[47]=W,a[48]=E,a[49]=R,a[50]=K,a[51]=D,a[52]=G,a[53]=H,a[54]=J,a[55]=V):V=a[55],a[56]!==l||a[57]!==B||a[58]!==V?(X=r.jsxs(l,{children:[B,V]}),a[56]=l,a[57]=B,a[58]=V,a[59]=X):X=a[59],a[60]!==o?(Z=async()=>{await _(o),j({title:"Copied to clipboard"})},a[60]=o,a[61]=Z):Z=a[61],a[62]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(k,{className:"w-4 h-4 mr-1"}),a[62]=$):$=a[62],a[63]!==Z?(q=r.jsxs(f,{"data-testid":"copy-static-notebook-dialog-button",variant:"secondary",onClick:Z,children:[$,"Copy code"]}),a[63]=Z,a[64]=q):q=a[64],a[65]!==o?(L=()=>{v(new Blob([o],{type:"text/plain"}),t)},a[65]=o,a[66]=L):L=a[66],a[67]===Symbol.for("react.memo_cache_sentinel")?(ee=r.jsx(w,{className:"w-4 h-4 mr-1"}),a[67]=ee):ee=a[67],a[68]!==L?(se=r.jsxs(f,{"data-testid":"download-static-notebook-dialog-button",variant:"secondary",onClick:L,children:[ee,"Download code"]}),a[68]=L,a[69]=se):se=a[69],a[70]!==q||a[71]!==se?(ae=r.jsxs("div",{className:"flex gap-4 flex-wrap",children:[q,se]}),a[70]=q,a[71]=se,a[72]=ae):ae=a[72],a[73]!==c||a[74]!==X||a[75]!==ae?(oe=r.jsxs(c,{children:[X,ae]}),a[73]=c,a[74]=X,a[75]=ae,a[76]=oe):oe=a[76],a[77]!==S||a[78]!==F||a[79]!==oe?(te=r.jsxs(S,{children:[F,oe]}),a[77]=S,a[78]=F,a[79]=oe,a[80]=te):te=a[80],te},F=S()||l(),M=s=>{const a=e.c(6);let o,t,n,i;return a[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(R,{}),a[0]=o):o=a[0],a[1]!==s.appConfig?(t=r.jsx(A,{appConfig:s.appConfig}),a[1]=s.appConfig,a[2]=t):t=a[2],a[3]===Symbol.for("react.memo_cache_sentinel")?(n=F&&r.jsx(O,{}),a[3]=n):n=a[3],a[4]!==t?(i=r.jsxs(r.Fragment,{children:[o,t,n]}),a[4]=t,a[5]=i):i=a[5],i},O=()=>{const s=e.c(1);let a;return s[0]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("div",{className:"fixed bottom-0 right-0 z-50",children:r.jsxs("a",{href:m.githubPage,target:"_blank",className:"text-sm text-[var(--grass-11)] font-bold tracking-wide transition-colors bg-[var(--grass-4)] hover:bg-[var(--grass-5)] border-t border-l border-[var(--grass-8)] px-3 py-1 rounded-tl-md flex items-center gap-2",rel:"noreferrer",children:[r.jsx("span",{className:"pb-[2px]",children:"made with marimo"}),r.jsx("img",{src:"./favicon.ico",alt:"marimo",className:"h-4 w-auto"})]})}),s[0]=a):a=s[0],a};export{M as default};
1
+ import{G as e,H as s,J as a,K as o,M as t,O as r,P as n,Q as i,S as l,T as c,U as m,V as d,W as h,X as b,Y as x,Z as f,_ as y,$ as p,a0 as u,a1 as g,a2 as _,a3 as j,a4 as k,a5 as v,a6 as w,a7 as S}from"./index-M-fa6gqH.js";import{u as N,A as C,R as I,a as P,C as T}from"./useMarimoWebSocket-UUW24I6P.js";const A=n=>{const l=e.c(14),{appConfig:c}=n,{setCells:m}=s();let d,h,b;l[0]===Symbol.for("react.memo_cache_sentinel")?(d=[],l[0]=d):d=l[0],a.useEffect(E,d),l[1]===Symbol.for("react.memo_cache_sentinel")?(h=i(),l[1]=h):h=l[1],l[2]!==m?(b={autoInstantiate:!0,setCells:m,sessionId:h},l[2]=m,l[3]=b):b=l[3];const{connection:x}=N(b),f=o(t);let y,p,u;return l[4]!==x?(y=r.jsx(P,{connection:x,className:"sm:pt-8"}),l[4]=x,l[5]=y):y=l[5],l[6]!==c?(p=r.jsx(T,{appConfig:c,mode:"read"}),l[6]=c,l[7]=p):p=l[7],l[8]!==c.width||l[9]!==x||l[10]!==f||l[11]!==y||l[12]!==p?(u=r.jsxs(C,{connection:x,isRunning:f,width:c.width,children:[y,p]}),l[8]=c.width,l[9]=x,l[10]=f,l[11]=y,l[12]=p,l[13]=u):u=l[13],u};function W(){I.INSTANCE.stop()}function E(){return I.INSTANCE.start(n),W}const R=()=>{const s=e.c(4);if(!l())return null;let a;s[0]===Symbol.for("react.memo_cache_sentinel")?(a=c(),s[0]=a):a=s[0];const o=a;if(!o)return null;let t,n,i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx("a",{href:m.githubPage,target:"_blank",className:"underline",rel:"noreferrer",children:"marimo"}),s[1]=t):t=s[1],s[2]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsxs("span",{children:["This is a static Python notebook built using"," ",t,".",r.jsx("br",{}),"Some interactive features may not work, see ways to run or edit this."]}),s[2]=n):n=s[2],s[3]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsxs("div",{className:"px-4 py-2 bg-[var(--sky-2)] border-b border-[var(--sky-7)] text-md text-[var(--sky-11)] font-semibold flex justify-between items-center gap-4 no-print",children:[n,r.jsx("span",{className:"flex-shrink-0",children:r.jsx(B,{code:o})})]}),s[3]=i):i=s[3],i},B=s=>{const a=e.c(81),{code:o}=s;let t;if(a[0]===Symbol.for("react.memo_cache_sentinel")){t=d()||"notebook.py";const e=t.lastIndexOf("/");-1!==e&&(t=t.slice(e+1)),a[0]=t}else t=a[0];const n=window.location.href;let i,l,c,S,N,C,I,P,T,A,W,E,R,B,F,M,O,Y,z,D,G,H,J,K,Q,U,V,X,Z,$,q,L,ee,se,ae,oe,te;if(a[1]!==o){const e=h({code:o});let s;S=b,a[25]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsx(x,{asChild:!0,children:r.jsx(f,{"data-testid":"static-notebook-dialog-trigger",variant:"secondary",children:"Run or edit this notebook"})}),a[25]=F):F=a[25],c=y,l=p,a[26]===Symbol.for("react.memo_cache_sentinel")?(B=r.jsx(u,{children:t}),a[26]=B):B=a[26],i=g,D="pt-4 text-md text-left",G="This is a static notebook built using",H=" ",a[27]===Symbol.for("react.memo_cache_sentinel")?(J=r.jsx("a",{href:m.githubPage,target:"_blank",className:"text-link hover:underline",rel:"noreferrer",children:"marimo"}),a[27]=J):J=a[27],C=". marimo is an open-source next-generation Python notebook.",a[28]===Symbol.for("react.memo_cache_sentinel")?(I=r.jsx("hr",{className:"my-3"}),a[28]=I):I=a[28],P="In order to edit this notebook, you will need to download the code locally, install marimo, and run the following in your terminal:",a[29]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx("br",{}),a[29]=s):s=a[29],a[30]===Symbol.for("react.memo_cache_sentinel")?(T=r.jsxs("div",{className:"font-mono text-sm bg-[var(--sky-2)] rounded-md my-3 p-2 border border-[var(--sky-7)]",children:["pip install marimo",s,"marimo edit ",t]}),A=!n.endsWith(".html")&&r.jsxs(r.Fragment,{children:["or",r.jsxs("div",{className:"font-mono text-sm bg-[var(--sky-2)] rounded-md my-3 p-2 border border-[var(--sky-7)] break-all",children:["marimo edit ",window.location.href]})]}),W=r.jsx("hr",{className:"my-3"}),a[30]=T,a[31]=A,a[32]=W):(T=a[30],A=a[31],W=a[32]),E="You may also be able to run this notebook entirely in the browser via WebAssembly at:",R=" ",N=e,M="_blank",O="text-link hover:underline",Y="noreferrer",z=e.slice(0,40),a[1]=o,a[2]=i,a[3]=l,a[4]=c,a[5]=S,a[6]=N,a[7]=C,a[8]=I,a[9]=P,a[10]=T,a[11]=A,a[12]=W,a[13]=E,a[14]=R,a[15]=B,a[16]=F,a[17]=M,a[18]=O,a[19]=Y,a[20]=z,a[21]=D,a[22]=G,a[23]=H,a[24]=J}else i=a[2],l=a[3],c=a[4],S=a[5],N=a[6],C=a[7],I=a[8],P=a[9],T=a[10],A=a[11],W=a[12],E=a[13],R=a[14],B=a[15],F=a[16],M=a[17],O=a[18],Y=a[19],z=a[20],D=a[21],G=a[22],H=a[23],J=a[24];return a[33]!==N||a[34]!==M||a[35]!==O||a[36]!==Y||a[37]!==z?(K=r.jsxs("a",{href:N,target:M,className:O,rel:Y,children:[z,"..."]}),a[33]=N,a[34]=M,a[35]=O,a[36]=Y,a[37]=z,a[38]=K):K=a[38],a[39]===Symbol.for("react.memo_cache_sentinel")?(Q=r.jsx("br",{}),a[39]=Q):Q=a[39],a[40]===Symbol.for("react.memo_cache_sentinel")?(U=r.jsxs("div",{className:"text-sm text-muted-foreground pt-2",children:[r.jsx("strong",{children:"Note:"})," This feature is experimental and may not work for all notebooks. Additionally, some dependencies may not be available in the browser."]}),a[40]=U):U=a[40],a[41]!==i||a[42]!==C||a[43]!==I||a[44]!==P||a[45]!==T||a[46]!==A||a[47]!==W||a[48]!==E||a[49]!==R||a[50]!==K||a[51]!==D||a[52]!==G||a[53]!==H||a[54]!==J?(V=r.jsxs(i,{className:D,children:[G,H,J,C,I,P,T,A,W,E,R,K,Q,U]}),a[41]=i,a[42]=C,a[43]=I,a[44]=P,a[45]=T,a[46]=A,a[47]=W,a[48]=E,a[49]=R,a[50]=K,a[51]=D,a[52]=G,a[53]=H,a[54]=J,a[55]=V):V=a[55],a[56]!==l||a[57]!==B||a[58]!==V?(X=r.jsxs(l,{children:[B,V]}),a[56]=l,a[57]=B,a[58]=V,a[59]=X):X=a[59],a[60]!==o?(Z=async()=>{await _(o),j({title:"Copied to clipboard"})},a[60]=o,a[61]=Z):Z=a[61],a[62]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(k,{className:"w-4 h-4 mr-1"}),a[62]=$):$=a[62],a[63]!==Z?(q=r.jsxs(f,{"data-testid":"copy-static-notebook-dialog-button",variant:"secondary",onClick:Z,children:[$,"Copy code"]}),a[63]=Z,a[64]=q):q=a[64],a[65]!==o?(L=()=>{v(new Blob([o],{type:"text/plain"}),t)},a[65]=o,a[66]=L):L=a[66],a[67]===Symbol.for("react.memo_cache_sentinel")?(ee=r.jsx(w,{className:"w-4 h-4 mr-1"}),a[67]=ee):ee=a[67],a[68]!==L?(se=r.jsxs(f,{"data-testid":"download-static-notebook-dialog-button",variant:"secondary",onClick:L,children:[ee,"Download code"]}),a[68]=L,a[69]=se):se=a[69],a[70]!==q||a[71]!==se?(ae=r.jsxs("div",{className:"flex gap-4 flex-wrap",children:[q,se]}),a[70]=q,a[71]=se,a[72]=ae):ae=a[72],a[73]!==c||a[74]!==X||a[75]!==ae?(oe=r.jsxs(c,{children:[X,ae]}),a[73]=c,a[74]=X,a[75]=ae,a[76]=oe):oe=a[76],a[77]!==S||a[78]!==F||a[79]!==oe?(te=r.jsxs(S,{children:[F,oe]}),a[77]=S,a[78]=F,a[79]=oe,a[80]=te):te=a[80],te},F=S()||l(),M=s=>{const a=e.c(6);let o,t,n,i;return a[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(R,{}),a[0]=o):o=a[0],a[1]!==s.appConfig?(t=r.jsx(A,{appConfig:s.appConfig}),a[1]=s.appConfig,a[2]=t):t=a[2],a[3]===Symbol.for("react.memo_cache_sentinel")?(n=F&&r.jsx(O,{}),a[3]=n):n=a[3],a[4]!==t?(i=r.jsxs(r.Fragment,{children:[o,t,n]}),a[4]=t,a[5]=i):i=a[5],i},O=()=>{const s=e.c(1);let a;return s[0]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("div",{className:"fixed bottom-0 right-0 z-50",children:r.jsxs("a",{href:m.githubPage,target:"_blank",className:"text-sm text-[var(--grass-11)] font-bold tracking-wide transition-colors bg-[var(--grass-4)] hover:bg-[var(--grass-5)] border-t border-l border-[var(--grass-8)] px-3 py-1 rounded-tl-md flex items-center gap-2",rel:"noreferrer",children:[r.jsx("span",{className:"pb-[2px]",children:"made with marimo"}),r.jsx("img",{src:"./favicon.ico",alt:"marimo",className:"h-4 w-auto"})]})}),s[0]=a):a=s[0],a};export{M as default};
@@ -1 +1 @@
1
- var t,n,e;import{_ as i,o as r,n as s,s as o,g as a,b as l,a as c,c as h,t as u,R as f,v as y,j as d}from"./mermaid-CYElsmZp.js";import{s as p}from"./transform-CdY8z5kT.js";import{o as g}from"./ordinal-DDUp3AbE.js";import{c as _}from"./colors-bszWmPJw.js";import"./index-B-iFJyXq.js";import"./step-xJWGRC3d.js";import"./init-DLRA0X12.js";const m=_("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function x(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}var k,v;function b(t,n){var e,i,r=t.length,s=-1;if(null==n){for(;++s<r;)if(null!=(e=t[s])&&e>=e)for(i=e;++s<r;)null!=(e=t[s])&&e>i&&(i=e)}else for(;++s<r;)if(null!=(e=n(t[s],s,t))&&e>=e)for(i=e;++s<r;)null!=(e=n(t[s],s,t))&&e>i&&(i=e);return i}function w(t,n){var e,i,r=t.length,s=-1;if(null==n){for(;++s<r;)if(null!=(e=t[s])&&e>=e)for(i=e;++s<r;)null!=(e=t[s])&&i>e&&(i=e)}else for(;++s<r;)if(null!=(e=n(t[s],s,t))&&e>=e)for(i=e;++s<r;)null!=(e=n(t[s],s,t))&&i>e&&(i=e);return i}function S(t,n){var e,i=t.length,r=-1,s=0;if(null==n)for(;++r<i;)(e=+t[r])&&(s+=e);else for(;++r<i;)(e=+n(t[r],r,t))&&(s+=e);return s}function E(t){return t.target.depth}function L(t,n){return t.sourceLinks.length?t.depth:n-1}function A(t){return function(){return t}}function M(t,n){return T(t.source,n.source)||t.index-n.index}function I(t,n){return T(t.target,n.target)||t.index-n.index}function T(t,n){return t.y0-n.y0}function N(t){return t.value}function j(t){return t.index}function P(t){return t.nodes}function O(t){return t.links}function C(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function D({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const i of n.sourceLinks)i.y0=t+i.width/2,t+=i.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function $(){let t,n,e,i=0,r=0,s=1,o=1,a=24,l=8,c=j,h=L,u=P,f=O,y=6;function d(){const d={nodes:u.apply(null,arguments),links:f.apply(null,arguments)};return function({nodes:t,links:n}){for(const[e,r]of t.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const i=new Map(t.map(((n,e)=>[c(n,e,t),n])));for(const[e,r]of n.entries()){r.index=e;let{source:t,target:n}=r;"object"!=typeof t&&(t=r.source=C(i,t)),"object"!=typeof n&&(n=r.target=C(i,n)),t.sourceLinks.push(r),n.targetLinks.push(r)}if(null!=e)for(const{sourceLinks:r,targetLinks:s}of t)r.sort(e),s.sort(e)}(d),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(S(n.sourceLinks,N),S(n.targetLinks,N)):n.fixedValue}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.depth=r;for(const{target:n}of t.sourceLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.height=r;for(const{source:n}of t.targetLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function(e){const c=function({nodes:t}){const e=b(t,(t=>t.depth))+1,r=(s-i-a)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+a,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const i of o)i.sort(n);return o}(e);t=Math.min(l,(o-r)/(b(c,(t=>t.length))-1)),function(n){const e=w(n,(n=>(o-r-(n.length-1)*t)/S(n,N)));for(const i of n){let n=r;for(const r of i){r.y0=n,r.y1=n+r.value*e,n=r.y1+t;for(const t of r.sourceLinks)t.width=t.value*e}n=(o-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}v(i)}}(c);for(let t=0;t<y;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/y);g(c,n,e),p(c,n,e)}}(d),D(d),d}function p(t,e,i){for(let r=1,s=t.length;r<s;++r){const s=t[r];for(const t of s){let n=0,i=0;for(const{source:e,value:s}of t.targetLinks){let r=s*(t.layer-e.layer);n+=E(e,t)*r,i+=r}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,k(t)}void 0===n&&s.sort(T),_(s,i)}}function g(t,e,i){for(let r=t.length-2;r>=0;--r){const s=t[r];for(const t of s){let n=0,i=0;for(const{target:e,value:s}of t.sourceLinks){let r=s*(e.layer-t.layer);n+=$(t,e)*r,i+=r}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,k(t)}void 0===n&&s.sort(T),_(s,i)}}function _(n,e){const i=n.length>>1,s=n[i];x(n,s.y0-t,i-1,e),m(n,s.y1+t,i+1,e),x(n,o,n.length-1,e),m(n,r,0,e)}function m(n,e,i,r){for(;i<n.length;++i){const s=n[i],o=(e-s.y0)*r;o>1e-6&&(s.y0+=o,s.y1+=o),e=s.y1+t}}function x(n,e,i,r){for(;i>=0;--i){const s=n[i],o=(s.y1-e)*r;o>1e-6&&(s.y0-=o,s.y1-=o),e=s.y0-t}}function k({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(I);for(const{target:{targetLinks:n}}of t)n.sort(M)}}function v(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(I),e.sort(M)}function E(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:r,width:s}of n.sourceLinks){if(r===e)break;i+=s+t}for(const{source:t,width:r}of e.targetLinks){if(t===n)break;i-=r}return i}function $(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:r,width:s}of e.targetLinks){if(r===n)break;i+=s+t}for(const{target:t,width:r}of n.sourceLinks){if(t===e)break;i-=r}return i}return d.update=function(t){return D(t),t},d.nodeId=function(t){return arguments.length?(c="function"==typeof t?t:A(t),d):c},d.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:A(t),d):h},d.nodeSort=function(t){return arguments.length?(n=t,d):n},d.nodeWidth=function(t){return arguments.length?(a=+t,d):a},d.nodePadding=function(n){return arguments.length?(l=t=+n,d):l},d.nodes=function(t){return arguments.length?(u="function"==typeof t?t:A(t),d):u},d.links=function(t){return arguments.length?(f="function"==typeof t?t:A(t),d):f},d.linkSort=function(t){return arguments.length?(e=t,d):e},d.size=function(t){return arguments.length?(i=r=0,s=+t[0],o=+t[1],d):[s-i,o-r]},d.extent=function(t){return arguments.length?(i=+t[0][0],s=+t[1][0],r=+t[0][1],o=+t[1][1],d):[[i,r],[s,o]]},d.iterations=function(t){return arguments.length?(y=+t,d):y},d}1===(k=x).length&&(v=k,k=function(t,n){return x(v(t),n)});var z=Math.PI,F=2*z,U=1e-6,W=F-U;function G(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function X(){return new G}function R(t){return function(){return t}}function V(t){return t[0]}function q(t){return t[1]}G.prototype=X.prototype={constructor:G,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,r,s){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,n,e,i,r){t=+t,n=+n,e=+e,i=+i,r=+r;var s=this._x1,o=this._y1,a=e-t,l=i-n,c=s-t,h=o-n,u=c*c+h*h;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>U)if(Math.abs(h*a-l*c)>U&&r){var f=e-s,y=i-o,d=a*a+l*l,p=f*f+y*y,g=Math.sqrt(d),_=Math.sqrt(u),m=r*Math.tan((z-Math.acos((d+u-p)/(2*g*_)))/2),x=m/_,k=m/g;Math.abs(x-1)>U&&(this._+="L"+(t+x*c)+","+(n+x*h)),this._+="A"+r+","+r+",0,0,"+ +(h*f>c*y)+","+(this._x1=t+k*a)+","+(this._y1=n+k*l)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,i,r,s){t=+t,n=+n,s=!!s;var o=(e=+e)*Math.cos(i),a=e*Math.sin(i),l=t+o,c=n+a,h=1^s,u=s?i-r:r-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>U||Math.abs(this._y1-c)>U)&&(this._+="L"+l+","+c),e&&(u<0&&(u=u%F+F),u>W?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>U&&(this._+="A"+e+","+e+",0,"+ +(u>=z)+","+h+","+(this._x1=t+e*Math.cos(r))+","+(this._y1=n+e*Math.sin(r))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var Q=Array.prototype.slice;function Y(t){return t.source}function B(t){return t.target}function K(t,n,e,i,r){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,r,i,r)}function Z(){return function(t){var n=Y,e=B,i=V,r=q,s=null;function o(){var o,a=Q.call(arguments),l=n.apply(this,a),c=e.apply(this,a);if(s||(s=o=X()),t(s,+i.apply(this,(a[0]=l,a)),+r.apply(this,a),+i.apply(this,(a[0]=c,a)),+r.apply(this,a)),o)return s=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:R(+t),o):i},o.y=function(t){return arguments.length?(r="function"==typeof t?t:R(+t),o):r},o.context=function(t){return arguments.length?(s=null==t?null:t,o):s},o}(K)}function H(t){return[t.source.x1,t.y0]}function J(t){return[t.target.x0,t.y1]}var tt=function(){var t=i((function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e}),"o"),n=[1,9],e=[1,10],r=[1,5,10,12],s={trace:i((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:i((function(t,n,e,i,r,s,o){var a=s.length-1;switch(r){case 7:const t=i.findOrCreateNode(s[a-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(s[a-2].trim().replaceAll('""','"')),e=parseFloat(s[a].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=s[a];break;case 10:this.$=s[a-1]}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(r,[2,8]),t(r,[2,9]),{19:[1,16]},t(r,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(r,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:i((function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)}),"parseError"),parse:i((function(t){var n=this,e=[0],r=[],s=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),f=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);f.setInput(t,y.yy),y.yy.lexer=f,y.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var p=f.yylloc;o.push(p);var g=f.options&&f.options.ranges;function _(){var t;return"number"!=typeof(t=r.pop()||f.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,i((function(t){e.length=e.length-2*t,s.length=s.length-t,o.length=o.length-t}),"popStack"),i(_,"lex");for(var m,x,k,v,b,w,S,E,L={};;){if(x=e[e.length-1],this.defaultActions[x]?k=this.defaultActions[x]:(null==m&&(m=_()),k=a[x]&&a[x][m]),void 0===k||!k.length||!k[0]){var A="";for(b in E=[],a[x])this.terminals_[b]&&b>2&&E.push("'"+this.terminals_[b]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:p,expected:E})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+m);switch(k[0]){case 1:e.push(m),s.push(f.yytext),o.push(f.yylloc),e.push(k[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,p=f.yylloc;break;case 2:if(w=this.productions_[k[1]][1],L.$=s[s.length-w],L._$={first_line:o[o.length-(w||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(w||1)].first_column,last_column:o[o.length-1].last_column},g&&(L._$.range=[o[o.length-(w||1)].range[0],o[o.length-1].range[1]]),void 0!==(v=this.performAction.apply(L,[l,h,c,y.yy,k[1],s,o].concat(u))))return v;w&&(e=e.slice(0,-1*w*2),s=s.slice(0,-1*w),o=o.slice(0,-1*w)),e.push(this.productions_[k[1]][0]),s.push(L.$),o.push(L._$),S=a[e[e.length-2]][e[e.length-1]],e.push(S);break;case 3:return!0}}return!0}),"parse")},o=function(){return{EOF:1,parseError:i((function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)}),"parseError"),setInput:i((function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:i((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:i((function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this}),"unput"),more:i((function(){return this._more=!0,this}),"more"),reject:i((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:i((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:i((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:i((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:i((function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"}),"showPosition"),test_match:i((function(t,n){var e,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1}),"test_match"),next:i((function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((e=this._input.match(this.rules[r[s]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,r[s])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:i((function(){var t=this.next();return t||this.lex()}),"lex"),begin:i((function(t){this.conditionStack.push(t)}),"begin"),popState:i((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:i((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:i((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:i((function(t){this.begin(t)}),"pushState"),stateStackSize:i((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:i((function(t,n,e,i){switch(e){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}}),"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function a(){this.yy={}}return s.lexer=o,i(a,"Parser"),a.prototype=s,s.Parser=a,new a}();tt.parser=tt;var nt=tt,et=[],it=[],rt=new Map,st=i((()=>{et=[],it=[],rt=new Map,y()}),"clear"),ot=(i(t=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}},"SankeyLink"),t),at=i(((t,n,e)=>{et.push(new ot(t,n,e))}),"addLink"),lt=(i(n=class{constructor(t){this.ID=t}},"SankeyNode"),n),ct=i((t=>{t=d.sanitizeText(t,h());let n=rt.get(t);return void 0===n&&(n=new lt(t),rt.set(t,n),it.push(n)),n}),"findOrCreateNode"),ht=i((()=>it),"getNodes"),ut=i((()=>et),"getLinks"),ft=i((()=>({nodes:it.map((t=>({id:t.ID}))),links:et.map((t=>({source:t.source.ID,target:t.target.ID,value:t.value})))})),"getGraph"),yt={nodesMap:rt,getConfig:i((()=>h().sankey),"getConfig"),getNodes:ht,getLinks:ut,getGraph:ft,addLink:at,findOrCreateNode:ct,getAccTitle:c,setAccTitle:l,getAccDescription:a,setAccDescription:o,getDiagramTitle:s,setDiagramTitle:r,clear:st},dt=(i(e=class{static next(t){return new e(t+ ++e.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},"Uid"),e.count=0,e),pt={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?w(t.sourceLinks,E)-1:0},justify:L},gt={draw:i((function(t,n,e,r){const{securityLevel:s,sankey:o}=h(),a=u.sankey;let l;"sandbox"===s&&(l=p("#i"+n));const c=p("sandbox"===s?l.nodes()[0].contentDocument.body:"body"),y="sandbox"===s?c.select(`[id="${n}"]`):p(`[id="${n}"]`),d=(null==o?void 0:o.width)??a.width,_=(null==o?void 0:o.height)??a.width,x=(null==o?void 0:o.useMaxWidth)??a.useMaxWidth,k=(null==o?void 0:o.nodeAlignment)??a.nodeAlignment,v=(null==o?void 0:o.prefix)??a.prefix,b=(null==o?void 0:o.suffix)??a.suffix,w=(null==o?void 0:o.showValues)??a.showValues,S=r.db.getGraph(),E=pt[k];$().nodeId((t=>t.id)).nodeWidth(10).nodePadding(10+(w?15:0)).nodeAlign(E).extent([[0,0],[d,_]])(S);const L=g(m);y.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",(t=>(t.uid=dt.next("node-")).id)).attr("transform",(function(t){return"translate("+t.x0+","+t.y0+")"})).attr("x",(t=>t.x0)).attr("y",(t=>t.y0)).append("rect").attr("height",(t=>t.y1-t.y0)).attr("width",(t=>t.x1-t.x0)).attr("fill",(t=>L(t.id)));const A=i((({id:t,value:n})=>w?`${t}\n${v}${Math.round(100*n)/100}${b}`:t),"getText");y.append("g").attr("class","node-labels").attr("font-family","sans-serif").attr("font-size",14).selectAll("text").data(S.nodes).join("text").attr("x",(t=>t.x0<d/2?t.x1+6:t.x0-6)).attr("y",(t=>(t.y1+t.y0)/2)).attr("dy",(w?"0":"0.35")+"em").attr("text-anchor",(t=>t.x0<d/2?"start":"end")).text(A);const M=y.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),I=(null==o?void 0:o.linkColor)??"gradient";if("gradient"===I){const t=M.append("linearGradient").attr("id",(t=>(t.uid=dt.next("linearGradient-")).id)).attr("gradientUnits","userSpaceOnUse").attr("x1",(t=>t.source.x1)).attr("x2",(t=>t.target.x0));t.append("stop").attr("offset","0%").attr("stop-color",(t=>L(t.source.id))),t.append("stop").attr("offset","100%").attr("stop-color",(t=>L(t.target.id)))}let T;switch(I){case"gradient":T=i((t=>t.uid),"coloring");break;case"source":T=i((t=>L(t.source.id)),"coloring");break;case"target":T=i((t=>L(t.target.id)),"coloring");break;default:T=I}M.append("path").attr("d",Z().source(H).target(J)).attr("stroke",T).attr("stroke-width",(t=>Math.max(1,t.width))),f(void 0,y,0,x)}),"draw")},_t=i((t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim()),"prepareTextForParsing"),mt=nt.parse.bind(nt);nt.parse=t=>mt(_t(t));var xt={parser:nt,db:yt,renderer:gt};export{xt as diagram};
1
+ var t,n,e;import{_ as i,o as r,n as s,s as o,g as a,b as l,a as c,c as h,t as u,R as f,v as y,j as d}from"./mermaid-NCa4Btby.js";import{s as p}from"./transform-CdY8z5kT.js";import{o as g}from"./ordinal-DDUp3AbE.js";import{c as _}from"./colors-bszWmPJw.js";import"./index-M-fa6gqH.js";import"./step-xJWGRC3d.js";import"./init-DLRA0X12.js";const m=_("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function x(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}var k,v;function b(t,n){var e,i,r=t.length,s=-1;if(null==n){for(;++s<r;)if(null!=(e=t[s])&&e>=e)for(i=e;++s<r;)null!=(e=t[s])&&e>i&&(i=e)}else for(;++s<r;)if(null!=(e=n(t[s],s,t))&&e>=e)for(i=e;++s<r;)null!=(e=n(t[s],s,t))&&e>i&&(i=e);return i}function w(t,n){var e,i,r=t.length,s=-1;if(null==n){for(;++s<r;)if(null!=(e=t[s])&&e>=e)for(i=e;++s<r;)null!=(e=t[s])&&i>e&&(i=e)}else for(;++s<r;)if(null!=(e=n(t[s],s,t))&&e>=e)for(i=e;++s<r;)null!=(e=n(t[s],s,t))&&i>e&&(i=e);return i}function S(t,n){var e,i=t.length,r=-1,s=0;if(null==n)for(;++r<i;)(e=+t[r])&&(s+=e);else for(;++r<i;)(e=+n(t[r],r,t))&&(s+=e);return s}function E(t){return t.target.depth}function L(t,n){return t.sourceLinks.length?t.depth:n-1}function A(t){return function(){return t}}function M(t,n){return T(t.source,n.source)||t.index-n.index}function I(t,n){return T(t.target,n.target)||t.index-n.index}function T(t,n){return t.y0-n.y0}function N(t){return t.value}function j(t){return t.index}function P(t){return t.nodes}function O(t){return t.links}function C(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function D({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const i of n.sourceLinks)i.y0=t+i.width/2,t+=i.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function $(){let t,n,e,i=0,r=0,s=1,o=1,a=24,l=8,c=j,h=L,u=P,f=O,y=6;function d(){const d={nodes:u.apply(null,arguments),links:f.apply(null,arguments)};return function({nodes:t,links:n}){for(const[e,r]of t.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const i=new Map(t.map(((n,e)=>[c(n,e,t),n])));for(const[e,r]of n.entries()){r.index=e;let{source:t,target:n}=r;"object"!=typeof t&&(t=r.source=C(i,t)),"object"!=typeof n&&(n=r.target=C(i,n)),t.sourceLinks.push(r),n.targetLinks.push(r)}if(null!=e)for(const{sourceLinks:r,targetLinks:s}of t)r.sort(e),s.sort(e)}(d),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(S(n.sourceLinks,N),S(n.targetLinks,N)):n.fixedValue}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.depth=r;for(const{target:n}of t.sourceLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.height=r;for(const{source:n}of t.targetLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function(e){const c=function({nodes:t}){const e=b(t,(t=>t.depth))+1,r=(s-i-a)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+a,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const i of o)i.sort(n);return o}(e);t=Math.min(l,(o-r)/(b(c,(t=>t.length))-1)),function(n){const e=w(n,(n=>(o-r-(n.length-1)*t)/S(n,N)));for(const i of n){let n=r;for(const r of i){r.y0=n,r.y1=n+r.value*e,n=r.y1+t;for(const t of r.sourceLinks)t.width=t.value*e}n=(o-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}v(i)}}(c);for(let t=0;t<y;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/y);g(c,n,e),p(c,n,e)}}(d),D(d),d}function p(t,e,i){for(let r=1,s=t.length;r<s;++r){const s=t[r];for(const t of s){let n=0,i=0;for(const{source:e,value:s}of t.targetLinks){let r=s*(t.layer-e.layer);n+=E(e,t)*r,i+=r}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,k(t)}void 0===n&&s.sort(T),_(s,i)}}function g(t,e,i){for(let r=t.length-2;r>=0;--r){const s=t[r];for(const t of s){let n=0,i=0;for(const{target:e,value:s}of t.sourceLinks){let r=s*(e.layer-t.layer);n+=$(t,e)*r,i+=r}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,k(t)}void 0===n&&s.sort(T),_(s,i)}}function _(n,e){const i=n.length>>1,s=n[i];x(n,s.y0-t,i-1,e),m(n,s.y1+t,i+1,e),x(n,o,n.length-1,e),m(n,r,0,e)}function m(n,e,i,r){for(;i<n.length;++i){const s=n[i],o=(e-s.y0)*r;o>1e-6&&(s.y0+=o,s.y1+=o),e=s.y1+t}}function x(n,e,i,r){for(;i>=0;--i){const s=n[i],o=(s.y1-e)*r;o>1e-6&&(s.y0-=o,s.y1-=o),e=s.y0-t}}function k({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(I);for(const{target:{targetLinks:n}}of t)n.sort(M)}}function v(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(I),e.sort(M)}function E(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:r,width:s}of n.sourceLinks){if(r===e)break;i+=s+t}for(const{source:t,width:r}of e.targetLinks){if(t===n)break;i-=r}return i}function $(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:r,width:s}of e.targetLinks){if(r===n)break;i+=s+t}for(const{target:t,width:r}of n.sourceLinks){if(t===e)break;i-=r}return i}return d.update=function(t){return D(t),t},d.nodeId=function(t){return arguments.length?(c="function"==typeof t?t:A(t),d):c},d.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:A(t),d):h},d.nodeSort=function(t){return arguments.length?(n=t,d):n},d.nodeWidth=function(t){return arguments.length?(a=+t,d):a},d.nodePadding=function(n){return arguments.length?(l=t=+n,d):l},d.nodes=function(t){return arguments.length?(u="function"==typeof t?t:A(t),d):u},d.links=function(t){return arguments.length?(f="function"==typeof t?t:A(t),d):f},d.linkSort=function(t){return arguments.length?(e=t,d):e},d.size=function(t){return arguments.length?(i=r=0,s=+t[0],o=+t[1],d):[s-i,o-r]},d.extent=function(t){return arguments.length?(i=+t[0][0],s=+t[1][0],r=+t[0][1],o=+t[1][1],d):[[i,r],[s,o]]},d.iterations=function(t){return arguments.length?(y=+t,d):y},d}1===(k=x).length&&(v=k,k=function(t,n){return x(v(t),n)});var z=Math.PI,F=2*z,U=1e-6,W=F-U;function G(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function X(){return new G}function R(t){return function(){return t}}function V(t){return t[0]}function q(t){return t[1]}G.prototype=X.prototype={constructor:G,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,r,s){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,n,e,i,r){t=+t,n=+n,e=+e,i=+i,r=+r;var s=this._x1,o=this._y1,a=e-t,l=i-n,c=s-t,h=o-n,u=c*c+h*h;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>U)if(Math.abs(h*a-l*c)>U&&r){var f=e-s,y=i-o,d=a*a+l*l,p=f*f+y*y,g=Math.sqrt(d),_=Math.sqrt(u),m=r*Math.tan((z-Math.acos((d+u-p)/(2*g*_)))/2),x=m/_,k=m/g;Math.abs(x-1)>U&&(this._+="L"+(t+x*c)+","+(n+x*h)),this._+="A"+r+","+r+",0,0,"+ +(h*f>c*y)+","+(this._x1=t+k*a)+","+(this._y1=n+k*l)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,i,r,s){t=+t,n=+n,s=!!s;var o=(e=+e)*Math.cos(i),a=e*Math.sin(i),l=t+o,c=n+a,h=1^s,u=s?i-r:r-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>U||Math.abs(this._y1-c)>U)&&(this._+="L"+l+","+c),e&&(u<0&&(u=u%F+F),u>W?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>U&&(this._+="A"+e+","+e+",0,"+ +(u>=z)+","+h+","+(this._x1=t+e*Math.cos(r))+","+(this._y1=n+e*Math.sin(r))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var Q=Array.prototype.slice;function Y(t){return t.source}function B(t){return t.target}function K(t,n,e,i,r){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,r,i,r)}function Z(){return function(t){var n=Y,e=B,i=V,r=q,s=null;function o(){var o,a=Q.call(arguments),l=n.apply(this,a),c=e.apply(this,a);if(s||(s=o=X()),t(s,+i.apply(this,(a[0]=l,a)),+r.apply(this,a),+i.apply(this,(a[0]=c,a)),+r.apply(this,a)),o)return s=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:R(+t),o):i},o.y=function(t){return arguments.length?(r="function"==typeof t?t:R(+t),o):r},o.context=function(t){return arguments.length?(s=null==t?null:t,o):s},o}(K)}function H(t){return[t.source.x1,t.y0]}function J(t){return[t.target.x0,t.y1]}var tt=function(){var t=i((function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e}),"o"),n=[1,9],e=[1,10],r=[1,5,10,12],s={trace:i((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:i((function(t,n,e,i,r,s,o){var a=s.length-1;switch(r){case 7:const t=i.findOrCreateNode(s[a-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(s[a-2].trim().replaceAll('""','"')),e=parseFloat(s[a].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=s[a];break;case 10:this.$=s[a-1]}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(r,[2,8]),t(r,[2,9]),{19:[1,16]},t(r,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(r,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:i((function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)}),"parseError"),parse:i((function(t){var n=this,e=[0],r=[],s=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),f=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);f.setInput(t,y.yy),y.yy.lexer=f,y.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var p=f.yylloc;o.push(p);var g=f.options&&f.options.ranges;function _(){var t;return"number"!=typeof(t=r.pop()||f.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,i((function(t){e.length=e.length-2*t,s.length=s.length-t,o.length=o.length-t}),"popStack"),i(_,"lex");for(var m,x,k,v,b,w,S,E,L={};;){if(x=e[e.length-1],this.defaultActions[x]?k=this.defaultActions[x]:(null==m&&(m=_()),k=a[x]&&a[x][m]),void 0===k||!k.length||!k[0]){var A="";for(b in E=[],a[x])this.terminals_[b]&&b>2&&E.push("'"+this.terminals_[b]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:p,expected:E})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+m);switch(k[0]){case 1:e.push(m),s.push(f.yytext),o.push(f.yylloc),e.push(k[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,p=f.yylloc;break;case 2:if(w=this.productions_[k[1]][1],L.$=s[s.length-w],L._$={first_line:o[o.length-(w||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(w||1)].first_column,last_column:o[o.length-1].last_column},g&&(L._$.range=[o[o.length-(w||1)].range[0],o[o.length-1].range[1]]),void 0!==(v=this.performAction.apply(L,[l,h,c,y.yy,k[1],s,o].concat(u))))return v;w&&(e=e.slice(0,-1*w*2),s=s.slice(0,-1*w),o=o.slice(0,-1*w)),e.push(this.productions_[k[1]][0]),s.push(L.$),o.push(L._$),S=a[e[e.length-2]][e[e.length-1]],e.push(S);break;case 3:return!0}}return!0}),"parse")},o=function(){return{EOF:1,parseError:i((function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)}),"parseError"),setInput:i((function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:i((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:i((function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this}),"unput"),more:i((function(){return this._more=!0,this}),"more"),reject:i((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:i((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:i((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:i((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:i((function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"}),"showPosition"),test_match:i((function(t,n){var e,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1}),"test_match"),next:i((function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((e=this._input.match(this.rules[r[s]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,r[s])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:i((function(){var t=this.next();return t||this.lex()}),"lex"),begin:i((function(t){this.conditionStack.push(t)}),"begin"),popState:i((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:i((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:i((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:i((function(t){this.begin(t)}),"pushState"),stateStackSize:i((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:i((function(t,n,e,i){switch(e){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}}),"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function a(){this.yy={}}return s.lexer=o,i(a,"Parser"),a.prototype=s,s.Parser=a,new a}();tt.parser=tt;var nt=tt,et=[],it=[],rt=new Map,st=i((()=>{et=[],it=[],rt=new Map,y()}),"clear"),ot=(i(t=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}},"SankeyLink"),t),at=i(((t,n,e)=>{et.push(new ot(t,n,e))}),"addLink"),lt=(i(n=class{constructor(t){this.ID=t}},"SankeyNode"),n),ct=i((t=>{t=d.sanitizeText(t,h());let n=rt.get(t);return void 0===n&&(n=new lt(t),rt.set(t,n),it.push(n)),n}),"findOrCreateNode"),ht=i((()=>it),"getNodes"),ut=i((()=>et),"getLinks"),ft=i((()=>({nodes:it.map((t=>({id:t.ID}))),links:et.map((t=>({source:t.source.ID,target:t.target.ID,value:t.value})))})),"getGraph"),yt={nodesMap:rt,getConfig:i((()=>h().sankey),"getConfig"),getNodes:ht,getLinks:ut,getGraph:ft,addLink:at,findOrCreateNode:ct,getAccTitle:c,setAccTitle:l,getAccDescription:a,setAccDescription:o,getDiagramTitle:s,setDiagramTitle:r,clear:st},dt=(i(e=class{static next(t){return new e(t+ ++e.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},"Uid"),e.count=0,e),pt={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?w(t.sourceLinks,E)-1:0},justify:L},gt={draw:i((function(t,n,e,r){const{securityLevel:s,sankey:o}=h(),a=u.sankey;let l;"sandbox"===s&&(l=p("#i"+n));const c=p("sandbox"===s?l.nodes()[0].contentDocument.body:"body"),y="sandbox"===s?c.select(`[id="${n}"]`):p(`[id="${n}"]`),d=(null==o?void 0:o.width)??a.width,_=(null==o?void 0:o.height)??a.width,x=(null==o?void 0:o.useMaxWidth)??a.useMaxWidth,k=(null==o?void 0:o.nodeAlignment)??a.nodeAlignment,v=(null==o?void 0:o.prefix)??a.prefix,b=(null==o?void 0:o.suffix)??a.suffix,w=(null==o?void 0:o.showValues)??a.showValues,S=r.db.getGraph(),E=pt[k];$().nodeId((t=>t.id)).nodeWidth(10).nodePadding(10+(w?15:0)).nodeAlign(E).extent([[0,0],[d,_]])(S);const L=g(m);y.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",(t=>(t.uid=dt.next("node-")).id)).attr("transform",(function(t){return"translate("+t.x0+","+t.y0+")"})).attr("x",(t=>t.x0)).attr("y",(t=>t.y0)).append("rect").attr("height",(t=>t.y1-t.y0)).attr("width",(t=>t.x1-t.x0)).attr("fill",(t=>L(t.id)));const A=i((({id:t,value:n})=>w?`${t}\n${v}${Math.round(100*n)/100}${b}`:t),"getText");y.append("g").attr("class","node-labels").attr("font-family","sans-serif").attr("font-size",14).selectAll("text").data(S.nodes).join("text").attr("x",(t=>t.x0<d/2?t.x1+6:t.x0-6)).attr("y",(t=>(t.y1+t.y0)/2)).attr("dy",(w?"0":"0.35")+"em").attr("text-anchor",(t=>t.x0<d/2?"start":"end")).text(A);const M=y.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),I=(null==o?void 0:o.linkColor)??"gradient";if("gradient"===I){const t=M.append("linearGradient").attr("id",(t=>(t.uid=dt.next("linearGradient-")).id)).attr("gradientUnits","userSpaceOnUse").attr("x1",(t=>t.source.x1)).attr("x2",(t=>t.target.x0));t.append("stop").attr("offset","0%").attr("stop-color",(t=>L(t.source.id))),t.append("stop").attr("offset","100%").attr("stop-color",(t=>L(t.target.id)))}let T;switch(I){case"gradient":T=i((t=>t.uid),"coloring");break;case"source":T=i((t=>L(t.source.id)),"coloring");break;case"target":T=i((t=>L(t.target.id)),"coloring");break;default:T=I}M.append("path").attr("d",Z().source(H).target(J)).attr("stroke",T).attr("stroke-width",(t=>Math.max(1,t.width))),f(void 0,y,0,x)}),"draw")},_t=i((t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim()),"prepareTextForParsing"),mt=nt.parse.bind(nt);nt.parse=t=>mt(_t(t));var xt={parser:nt,db:yt,renderer:gt};export{xt as diagram};