khoj 1.33.3.dev35__py3-none-any.whl → 1.33.3.dev51__py3-none-any.whl

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 (108) hide show
  1. khoj/configure.py +1 -1
  2. khoj/database/adapters/__init__.py +1 -1
  3. khoj/database/migrations/0080_speechtotextmodeloptions_ai_model_api.py +24 -0
  4. khoj/database/models/__init__.py +2 -0
  5. khoj/interface/compiled/404/index.html +1 -1
  6. khoj/interface/compiled/_next/static/chunks/0d8bff65.4b1018183a8be7c2.js +1 -0
  7. khoj/interface/compiled/_next/static/chunks/1243.ea2826fb35adb15a.js +1 -0
  8. khoj/interface/compiled/_next/static/chunks/133.392ae90c3b2a67f2.js +1 -0
  9. khoj/interface/compiled/_next/static/chunks/1592.b069bdb7aaddd2eb.js +5 -0
  10. khoj/interface/compiled/_next/static/chunks/2069.f060659791c0c484.js +1 -0
  11. khoj/interface/compiled/_next/static/chunks/2170.45431769330fa5b7.js +134 -0
  12. khoj/interface/compiled/_next/static/chunks/2327-17d5d7dc987c0645.js +1 -0
  13. khoj/interface/compiled/_next/static/chunks/3237.c4754f02f1a388cb.js +1 -0
  14. khoj/interface/compiled/_next/static/chunks/3305.1fc7297ba154ee95.js +1 -0
  15. khoj/interface/compiled/_next/static/chunks/3332.6313db5217bb1b67.js +29 -0
  16. khoj/interface/compiled/_next/static/chunks/3451.421db0b49fdbd881.js +252 -0
  17. khoj/interface/compiled/_next/static/chunks/3460.39c2b9b6a3898384.js +159 -0
  18. khoj/interface/compiled/_next/static/chunks/4270-28ab75d62e71521c.js +1 -0
  19. khoj/interface/compiled/_next/static/chunks/4299.2aaa569416cfc208.js +2 -0
  20. khoj/interface/compiled/_next/static/chunks/4327.238d15c09a039b8b.js +60 -0
  21. khoj/interface/compiled/_next/static/chunks/4415.e0c0da5eedae4dd7.js +47 -0
  22. khoj/interface/compiled/_next/static/chunks/4610.196691887afb7fea.js +1 -0
  23. khoj/interface/compiled/_next/static/chunks/4650.41f041da0ad365ad.js +215 -0
  24. khoj/interface/compiled/_next/static/chunks/4872.5422e8324272ab40.js +1 -0
  25. khoj/interface/compiled/_next/static/chunks/4986-24b37356a9642ebb.js +1 -0
  26. khoj/interface/compiled/_next/static/chunks/5061.79a660faed0e16a9.js +1 -0
  27. khoj/interface/compiled/_next/static/chunks/5279.85d537880b8041ae.js +24 -0
  28. khoj/interface/compiled/_next/static/chunks/5402.b9460f1b16b57e92.js +63 -0
  29. khoj/interface/compiled/_next/static/chunks/5555.f7cf9795d675de51.js +88 -0
  30. khoj/interface/compiled/_next/static/chunks/58.f4bd8a3c9d88f5fe.js +46 -0
  31. khoj/interface/compiled/_next/static/chunks/5978.ddc72cd73130aadc.js +1 -0
  32. khoj/interface/compiled/_next/static/chunks/6002-7e3115f142731625.js +78 -0
  33. khoj/interface/compiled/_next/static/chunks/6434.e6cd986d690f2cef.js +1 -0
  34. khoj/interface/compiled/_next/static/chunks/7140.4be689873f6a2d1f.js +116 -0
  35. khoj/interface/compiled/_next/static/chunks/7647-5a935022fa3da0a6.js +1 -0
  36. khoj/interface/compiled/_next/static/chunks/7836.86884157d53d23a1.js +117 -0
  37. khoj/interface/compiled/_next/static/chunks/7890.f681eb1d1f83bea2.js +1 -0
  38. khoj/interface/compiled/_next/static/chunks/7953.f6fc335a23efb959.js +1 -0
  39. khoj/interface/compiled/_next/static/chunks/8254.3145a4fbdcfdca46.js +1 -0
  40. khoj/interface/compiled/_next/static/chunks/8400.c95e4e79bcd79a56.js +78 -0
  41. khoj/interface/compiled/_next/static/chunks/8673.be44c4d9e4f1d084.js +56 -0
  42. khoj/interface/compiled/_next/static/chunks/8698.a088118fef40d302.js +1 -0
  43. khoj/interface/compiled/_next/static/chunks/9022.33974a513a281fd2.js +151 -0
  44. khoj/interface/compiled/_next/static/chunks/90542734.fecd4dc1a89ed166.js +1 -0
  45. khoj/interface/compiled/_next/static/chunks/9433.b1b5f5d050c43e3c.js +36 -0
  46. khoj/interface/compiled/_next/static/chunks/9822.34f293973c4e9b04.js +1 -0
  47. khoj/interface/compiled/_next/static/chunks/app/agents/layout-e00fb81dca656a10.js +1 -0
  48. khoj/interface/compiled/_next/static/chunks/app/agents/{page-f6b7a9ce4a8b2bf7.js → page-05e8780174a478e6.js} +1 -1
  49. khoj/interface/compiled/_next/static/chunks/app/automations/{page-f3c16eb399159215.js → page-a951c331320b870a.js} +1 -1
  50. khoj/interface/compiled/_next/static/chunks/app/chat/layout-33934fc2d6ae6838.js +1 -0
  51. khoj/interface/compiled/_next/static/chunks/app/chat/{page-2917c081fd43ac17.js → page-f68d20917788cbbc.js} +1 -1
  52. khoj/interface/compiled/_next/static/chunks/app/{page-07395c7f0d25d7d4.js → page-0c6346ba12c1b885.js} +1 -1
  53. khoj/interface/compiled/_next/static/chunks/app/search/layout-f5881c7ae3ba0795.js +1 -0
  54. khoj/interface/compiled/_next/static/chunks/app/search/{page-2a09ae0883b04242.js → page-62be289d4136a73a.js} +1 -1
  55. khoj/interface/compiled/_next/static/chunks/app/settings/{page-827fe7bea045fefe.js → page-c244a441045a593e.js} +1 -1
  56. khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-abb6c5f4239ad7be.js +1 -0
  57. khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-ce8299b35835ed71.js → page-075278404a3f37b8.js} +1 -1
  58. khoj/interface/compiled/_next/static/chunks/ebbfb5c1-a73c51b6a41a5ff6.js +10 -0
  59. khoj/interface/compiled/_next/static/chunks/webpack-63793f58b6bd33ee.js +1 -0
  60. khoj/interface/compiled/_next/static/css/37a73b87f02df402.css +1 -0
  61. khoj/interface/compiled/_next/static/css/70b2e9482d96d4c2.css +25 -0
  62. khoj/interface/compiled/_next/static/css/9c164d9727dd8092.css +1 -0
  63. khoj/interface/compiled/_next/static/css/a85b8d56fc9ae551.css +1 -0
  64. khoj/interface/compiled/_next/static/css/df4b47a2d0d85eae.css +1 -0
  65. khoj/interface/compiled/agents/index.html +1 -1
  66. khoj/interface/compiled/agents/index.txt +2 -2
  67. khoj/interface/compiled/automations/index.html +1 -1
  68. khoj/interface/compiled/automations/index.txt +2 -2
  69. khoj/interface/compiled/chat/index.html +1 -1
  70. khoj/interface/compiled/chat/index.txt +2 -2
  71. khoj/interface/compiled/index.html +1 -1
  72. khoj/interface/compiled/index.txt +2 -2
  73. khoj/interface/compiled/search/index.html +1 -1
  74. khoj/interface/compiled/search/index.txt +2 -2
  75. khoj/interface/compiled/settings/index.html +1 -1
  76. khoj/interface/compiled/settings/index.txt +2 -2
  77. khoj/interface/compiled/share/chat/index.html +1 -1
  78. khoj/interface/compiled/share/chat/index.txt +2 -2
  79. khoj/processor/conversation/prompts.py +118 -1
  80. khoj/processor/conversation/utils.py +9 -4
  81. khoj/processor/image/generate.py +9 -7
  82. khoj/routers/api.py +13 -3
  83. khoj/routers/api_chat.py +9 -9
  84. khoj/routers/helpers.py +135 -7
  85. khoj/utils/initialization.py +6 -6
  86. {khoj-1.33.3.dev35.dist-info → khoj-1.33.3.dev51.dist-info}/METADATA +1 -1
  87. {khoj-1.33.3.dev35.dist-info → khoj-1.33.3.dev51.dist-info}/RECORD +92 -55
  88. khoj/interface/compiled/_next/static/chunks/1010-8f39bb4648b5ba10.js +0 -1
  89. khoj/interface/compiled/_next/static/chunks/2581-455000f8aeb08fc3.js +0 -1
  90. khoj/interface/compiled/_next/static/chunks/3789-a09e37a819171a9d.js +0 -1
  91. khoj/interface/compiled/_next/static/chunks/4124-6c28322ce218d2d5.js +0 -1
  92. khoj/interface/compiled/_next/static/chunks/6293-469dd16402ea8a6f.js +0 -3
  93. khoj/interface/compiled/_next/static/chunks/app/agents/layout-e3d72f0edda6aa0c.js +0 -1
  94. khoj/interface/compiled/_next/static/chunks/app/chat/layout-d5ae861e1ade9d08.js +0 -1
  95. khoj/interface/compiled/_next/static/chunks/app/search/layout-4505b79deb734a30.js +0 -1
  96. khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-95998f0bdc22bb13.js +0 -1
  97. khoj/interface/compiled/_next/static/chunks/webpack-fddb78e7c09fff16.js +0 -1
  98. khoj/interface/compiled/_next/static/css/0f0e5dbeda138161.css +0 -1
  99. khoj/interface/compiled/_next/static/css/3b65ca1e74e399bd.css +0 -1
  100. khoj/interface/compiled/_next/static/css/41d6fe14d2c6b14d.css +0 -1
  101. khoj/interface/compiled/_next/static/css/8d02837c730f8d13.css +0 -25
  102. khoj/interface/compiled/_next/static/css/ba1602594aa7828f.css +0 -1
  103. khoj/interface/compiled/_next/static/css/dac88c17aaee5fcf.css +0 -1
  104. /khoj/interface/compiled/_next/static/{oqqUYx3DaH2vt9Te5vFEg → s3dazBmeqIlcdf6ERGzFs}/_buildManifest.js +0 -0
  105. /khoj/interface/compiled/_next/static/{oqqUYx3DaH2vt9Te5vFEg → s3dazBmeqIlcdf6ERGzFs}/_ssgManifest.js +0 -0
  106. {khoj-1.33.3.dev35.dist-info → khoj-1.33.3.dev51.dist-info}/WHEEL +0 -0
  107. {khoj-1.33.3.dev35.dist-info → khoj-1.33.3.dev51.dist-info}/entry_points.txt +0 -0
  108. {khoj-1.33.3.dev35.dist-info → khoj-1.33.3.dev51.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,47 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4415],{34415:function(e,t,i){i.d(t,{diagram:function(){return U}});var r=i(30086),n=i(15440),s=i(56434),a=i(68406),l=function(){var e=(0,r.eW)(function(e,t,i,r){for(i=i||{},r=e.length;r--;i[e[r]]=t);return i},"o"),t=[1,3],i=[1,4],n=[1,5],s=[1,6],a=[5,6,8,9,11,13,31,32,33,34,35,36,44,62,63],l=[1,18],h=[2,7],o=[1,22],c=[1,23],u=[1,24],y=[1,25],d=[1,26],p=[1,27],_=[1,20],g=[1,28],E=[1,29],R=[62,63],m=[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],k=[1,51],N=[1,52],T=[1,53],x=[53,54],A=[1,64],v=[1,60],w=[1,61],W=[1,62],q=[1,63],$=[1,65],O=[1,69],C=[1,70],L=[1,67],M=[1,68],F=[5,8,9,11,13,31,32,33,34,35,36,44,62,63],D={trace:(0,r.eW)(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:(0,r.eW)(function(e,t,i,r,n,s,a){var l=s.length-1;switch(n){case 4:this.$=s[l].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=s[l].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 13:r.addRequirement(s[l-3],s[l-4]);break;case 14:r.setNewReqId(s[l-2]);break;case 15:r.setNewReqText(s[l-2]);break;case 16:r.setNewReqRisk(s[l-2]);break;case 17:r.setNewReqVerifyMethod(s[l-2]);break;case 20:this.$=r.RequirementType.REQUIREMENT;break;case 21:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 22:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 23:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 24:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 25:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 26:this.$=r.RiskLevel.LOW_RISK;break;case 27:this.$=r.RiskLevel.MED_RISK;break;case 28:this.$=r.RiskLevel.HIGH_RISK;break;case 29:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 30:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 31:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 32:this.$=r.VerifyType.VERIFY_TEST;break;case 33:r.addElement(s[l-3]);break;case 34:r.setNewElementType(s[l-2]);break;case 35:r.setNewElementDocRef(s[l-2]);break;case 38:r.addRelationship(s[l-2],s[l],s[l-4]);break;case 39:r.addRelationship(s[l-2],s[l-4],s[l]);break;case 40:this.$=r.Relationships.CONTAINS;break;case 41:this.$=r.Relationships.COPIES;break;case 42:this.$=r.Relationships.DERIVES;break;case 43:this.$=r.Relationships.SATISFIES;break;case 44:this.$=r.Relationships.VERIFIES;break;case 45:this.$=r.Relationships.REFINES;break;case 46:this.$=r.Relationships.TRACES}},"anonymous"),table:[{3:1,4:2,6:t,9:i,11:n,13:s},{1:[3]},{3:8,4:2,5:[1,7],6:t,9:i,11:n,13:s},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(a,[2,6]),{3:12,4:2,6:t,9:i,11:n,13:s},{1:[2,2]},{4:17,5:l,7:13,8:h,9:i,11:n,13:s,14:14,15:15,16:16,17:19,23:21,31:o,32:c,33:u,34:y,35:d,36:p,44:_,62:g,63:E},e(a,[2,4]),e(a,[2,5]),{1:[2,1]},{8:[1,30]},{4:17,5:l,7:31,8:h,9:i,11:n,13:s,14:14,15:15,16:16,17:19,23:21,31:o,32:c,33:u,34:y,35:d,36:p,44:_,62:g,63:E},{4:17,5:l,7:32,8:h,9:i,11:n,13:s,14:14,15:15,16:16,17:19,23:21,31:o,32:c,33:u,34:y,35:d,36:p,44:_,62:g,63:E},{4:17,5:l,7:33,8:h,9:i,11:n,13:s,14:14,15:15,16:16,17:19,23:21,31:o,32:c,33:u,34:y,35:d,36:p,44:_,62:g,63:E},{4:17,5:l,7:34,8:h,9:i,11:n,13:s,14:14,15:15,16:16,17:19,23:21,31:o,32:c,33:u,34:y,35:d,36:p,44:_,62:g,63:E},{4:17,5:l,7:35,8:h,9:i,11:n,13:s,14:14,15:15,16:16,17:19,23:21,31:o,32:c,33:u,34:y,35:d,36:p,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(R,[2,20]),e(R,[2,21]),e(R,[2,22]),e(R,[2,23]),e(R,[2,24]),e(R,[2,25]),e(m,[2,49]),e(m,[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:k,60:N,61:T},{52:54,55:f,56:I,57:S,58:b,59:k,60:N,61:T},{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:v,24:w,26:W,28:q,30:$},{5:O,30:C,46:66,47:L,49:M},{23:71,62:g,63:E},{23:72,62:g,63:E},e(F,[2,13]),{22:[1,73]},{22:[1,74]},{22:[1,75]},{22:[1,76]},{5:A,20:77,21:v,24:w,26:W,28:q,30:$},e(F,[2,19]),e(F,[2,33]),{22:[1,78]},{22:[1,79]},{5:O,30:C,46:80,47:L,49:M},e(F,[2,37]),e(F,[2,38]),e(F,[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(F,[2,18]),{48:94,62:[1,95],63:[1,96]},{50:97,62:[1,98],63:[1,99]},e(F,[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:v,24:w,26:W,28:q,30:$},{5:A,20:107,21:v,24:w,26:W,28:q,30:$},{5:A,20:108,21:v,24:w,26:W,28:q,30:$},{5:A,20:109,21:v,24:w,26:W,28:q,30:$},{5:O,30:C,46:110,47:L,49:M},{5:O,30:C,46:111,47:L,49:M},e(F,[2,14]),e(F,[2,15]),e(F,[2,16]),e(F,[2,17]),e(F,[2,34]),e(F,[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:(0,r.eW)(function(e,t){if(t.recoverable)this.trace(e);else{var i=Error(e);throw i.hash=t,i}},"parseError"),parse:(0,r.eW)(function(e){var t=this,i=[0],n=[],s=[null],a=[],l=this.table,h="",o=0,c=0,u=0,y=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(p.yy[_]=this.yy[_]);d.setInput(e,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;a.push(g);var E=d.options&&d.options.ranges;function R(){var e;return"number"!=typeof(e=n.pop()||d.lex()||1)&&(e instanceof Array&&(e=(n=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,r.eW)(function(e){i.length=i.length-2*e,s.length=s.length-e,a.length=a.length-e},"popStack"),(0,r.eW)(R,"lex");for(var m,f,I,S,b,k,N,T,x,A={};;){if(I=i[i.length-1],this.defaultActions[I]?S=this.defaultActions[I]:(null==m&&(m=R()),S=l[I]&&l[I][m]),void 0===S||!S.length||!S[0]){var v="";for(k in x=[],l[I])this.terminals_[k]&&k>2&&x.push("'"+this.terminals_[k]+"'");v=d.showPosition?"Parse error on line "+(o+1)+":\n"+d.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(v,{text:d.match,token:this.terminals_[m]||m,line:d.yylineno,loc:g,expected:x})}if(S[0]instanceof Array&&S.length>1)throw Error("Parse Error: multiple actions possible at state: "+I+", token: "+m);switch(S[0]){case 1:i.push(m),s.push(d.yytext),a.push(d.yylloc),i.push(S[1]),m=null,f?(m=f,f=null):(c=d.yyleng,h=d.yytext,o=d.yylineno,g=d.yylloc,u>0&&u--);break;case 2:if(N=this.productions_[S[1]][1],A.$=s[s.length-N],A._$={first_line:a[a.length-(N||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(N||1)].first_column,last_column:a[a.length-1].last_column},E&&(A._$.range=[a[a.length-(N||1)].range[0],a[a.length-1].range[1]]),void 0!==(b=this.performAction.apply(A,[h,c,o,p.yy,S[1],s,a].concat(y))))return b;N&&(i=i.slice(0,-1*N*2),s=s.slice(0,-1*N),a=a.slice(0,-1*N)),i.push(this.productions_[S[1]][0]),s.push(A.$),a.push(A._$),T=l[i[i.length-2]][i[i.length-1]],i.push(T);break;case 3:return!0}}return!0},"parse")},P={EOF:1,parseError:(0,r.eW)(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},"parseError"),setInput:(0,r.eW)(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:(0,r.eW)(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.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),e},"input"),unput:(0,r.eW)(function(e){var t=e.length,i=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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 n=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===r.length?this.yylloc.first_column:0)+r[r.length-i.length].length-i[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:(0,r.eW)(function(){return this._more=!0,this},"more"),reject:(0,r.eW)(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:(0,r.eW)(function(e){this.unput(this.match.slice(e))},"less"),pastInput:(0,r.eW)(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,r.eW)(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,r.eW)(function(){var e=this.pastInput(),t=Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:(0,r.eW)(function(e,t){var i,r,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],i=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack)for(var s in n)this[s]=n[s];return!1},"test_match"),next:(0,r.eW)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e,t,i,r,n=this._currentRules(),s=0;s<n.length;s++)if((i=this._input.match(this.rules[n[s]]))&&(!t||i[0].length>t[0].length)){if(t=i,r=s,this.options.backtrack_lexer){if(!1!==(e=this.test_match(i,n[s])))return e;if(!this._backtrack)return!1;t=!1;continue}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,n[r]))&&e:""===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:(0,r.eW)(function(){return this.next()||this.lex()},"lex"),begin:(0,r.eW)(function(e){this.conditionStack.push(e)},"begin"),popState:(0,r.eW)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,r.eW)(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:(0,r.eW)(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:(0,r.eW)(function(e){this.begin(e)},"pushState"),stateStackSize:(0,r.eW)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,r.eW)(function(e,t,i,r){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 t.yytext=t.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 V(){this.yy={}}return D.lexer=P,(0,r.eW)(V,"Parser"),V.prototype=D,D.Parser=V,new V}();l.parser=l;var h=[],o={},c=new Map,u={},y=new Map,d=(0,r.eW)((e,t)=>(c.has(e)||c.set(e,{name:e,type:t,id:o.id,text:o.text,risk:o.risk,verifyMethod:o.verifyMethod}),o={},c.get(e)),"addRequirement"),p=(0,r.eW)(()=>c,"getRequirements"),_=(0,r.eW)(e=>{void 0!==o&&(o.id=e)},"setNewReqId"),g=(0,r.eW)(e=>{void 0!==o&&(o.text=e)},"setNewReqText"),E=(0,r.eW)(e=>{void 0!==o&&(o.risk=e)},"setNewReqRisk"),R=(0,r.eW)(e=>{void 0!==o&&(o.verifyMethod=e)},"setNewReqVerifyMethod"),m=(0,r.eW)(e=>(y.has(e)||(y.set(e,{name:e,type:u.type,docRef:u.docRef}),r.cM.info("Added new requirement: ",e)),u={},y.get(e)),"addElement"),f=(0,r.eW)(()=>y,"getElements"),I=(0,r.eW)(e=>{void 0!==u&&(u.type=e)},"setNewElementType"),S=(0,r.eW)(e=>{void 0!==u&&(u.docRef=e)},"setNewElementDocRef"),b=(0,r.eW)((e,t,i)=>{h.push({type:e,src:t,dst:i})},"addRelationship"),k=(0,r.eW)(()=>h,"getRelationships"),N=(0,r.eW)(()=>{h=[],o={},c=new Map,u={},y=new Map,(0,r.ZH)()},"clear"),T={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:(0,r.eW)(()=>(0,r.nV)().req,"getConfig"),addRequirement:d,getRequirements:p,setNewReqId:_,setNewReqText:g,setNewReqRisk:E,setNewReqVerifyMethod:R,setAccTitle:r.GN,getAccTitle:r.eu,setAccDescription:r.U$,getAccDescription:r.Mx,addElement:m,getElements:f,setNewElementType:I,setNewElementDocRef:S,addRelationship:b,getRelationships:k,clear:N},x=(0,r.eW)(e=>`
2
+
3
+ marker {
4
+ fill: ${e.relationColor};
5
+ stroke: ${e.relationColor};
6
+ }
7
+
8
+ marker.cross {
9
+ stroke: ${e.lineColor};
10
+ }
11
+
12
+ svg {
13
+ font-family: ${e.fontFamily};
14
+ font-size: ${e.fontSize};
15
+ }
16
+
17
+ .reqBox {
18
+ fill: ${e.requirementBackground};
19
+ fill-opacity: 1.0;
20
+ stroke: ${e.requirementBorderColor};
21
+ stroke-width: ${e.requirementBorderSize};
22
+ }
23
+
24
+ .reqTitle, .reqLabel{
25
+ fill: ${e.requirementTextColor};
26
+ }
27
+ .reqLabelBox {
28
+ fill: ${e.relationLabelBackground};
29
+ fill-opacity: 1.0;
30
+ }
31
+
32
+ .req-title-line {
33
+ stroke: ${e.requirementBorderColor};
34
+ stroke-width: ${e.requirementBorderSize};
35
+ }
36
+ .relationshipLine {
37
+ stroke: ${e.relationColor};
38
+ stroke-width: 1;
39
+ }
40
+ .relationshipLabel {
41
+ fill: ${e.relationLabelColor};
42
+ }
43
+
44
+ `,"getStyles"),A={CONTAINS:"contains",ARROW:"arrow"},v=(0,r.eW)((e,t)=>{let i=e.append("defs").append("marker").attr("id",A.CONTAINS+"_line_ending").attr("refX",0).attr("refY",t.line_height/2).attr("markerWidth",t.line_height).attr("markerHeight",t.line_height).attr("orient","auto").append("g");i.append("circle").attr("cx",t.line_height/2).attr("cy",t.line_height/2).attr("r",t.line_height/2).attr("fill","none"),i.append("line").attr("x1",0).attr("x2",t.line_height).attr("y1",t.line_height/2).attr("y2",t.line_height/2).attr("stroke-width",1),i.append("line").attr("y1",0).attr("y2",t.line_height).attr("x1",t.line_height/2).attr("x2",t.line_height/2).attr("stroke-width",1),e.append("defs").append("marker").attr("id",A.ARROW+"_line_ending").attr("refX",t.line_height).attr("refY",.5*t.line_height).attr("markerWidth",t.line_height).attr("markerHeight",t.line_height).attr("orient","auto").append("path").attr("d",`M0,0
45
+ L${t.line_height},${t.line_height/2}
46
+ M${t.line_height},${t.line_height/2}
47
+ L0,${t.line_height}`).attr("stroke-width",1)},"insertLineEndings"),w={ReqMarkers:A,insertLineEndings:v},W={},q=0,$=(0,r.eW)((e,t)=>e.insert("rect","#"+t).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",W.rect_min_width+"px").attr("height",W.rect_min_height+"px"),"newRectNode"),O=(0,r.eW)((e,t,i)=>{let r=W.rect_min_width/2,n=e.append("text").attr("class","req reqLabel reqTitle").attr("id",t).attr("x",r).attr("y",W.rect_padding).attr("dominant-baseline","hanging"),s=0;i.forEach(e=>{0==s?n.append("tspan").attr("text-anchor","middle").attr("x",W.rect_min_width/2).attr("dy",0).text(e):n.append("tspan").attr("text-anchor","middle").attr("x",W.rect_min_width/2).attr("dy",.75*W.line_height).text(e),s++});let a=1.5*W.rect_padding+s*W.line_height*.75;return e.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",W.rect_min_width).attr("y1",a).attr("y2",a),{titleNode:n,y:a}},"newTitleNode"),C=(0,r.eW)((e,t,i,r)=>{let n=e.append("text").attr("class","req reqLabel").attr("id",t).attr("x",W.rect_padding).attr("y",r).attr("dominant-baseline","hanging"),s=0,a=[];return i.forEach(e=>{let t=e.length;for(;t>30&&s<3;){let i=e.substring(0,30);t=(e=e.substring(30,e.length)).length,a[a.length]=i,s++}if(3==s){let e=a[a.length-1];a[a.length-1]=e.substring(0,e.length-4)+"..."}else a[a.length]=e;s=0}),a.forEach(e=>{n.append("tspan").attr("x",W.rect_padding).attr("dy",W.line_height).text(e)}),n},"newBodyNode"),L=(0,r.eW)((e,t,i,r)=>{let n=t.node().getTotalLength(),s=t.node().getPointAtLength(.5*n),a="rel"+q;q++;let l=e.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(r).node().getBBox();e.insert("rect","#"+a).attr("class","req reqLabelBox").attr("x",s.x-l.width/2).attr("y",s.y-l.height/2).attr("width",l.width).attr("height",l.height).attr("fill","white").attr("fill-opacity","85%")},"addEdgeLabel"),M=(0,r.eW)(function(e,t,i,s,a){let l=i.edge(Y(t.src),Y(t.dst)),h=(0,n.jvg)().x(function(e){return e.x}).y(function(e){return e.y}),o=e.insert("path","#"+s).attr("class","er relationshipLine").attr("d",h(l.points)).attr("fill","none");t.type==a.db.Relationships.CONTAINS?o.attr("marker-start","url("+r.SY.getUrl(W.arrowMarkerAbsolute)+"#"+t.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+r.SY.getUrl(W.arrowMarkerAbsolute)+"#"+w.ReqMarkers.ARROW+"_line_ending)")),L(e,o,W,`<<${t.type}>>`)},"drawRelationshipFromLayout"),F=(0,r.eW)((e,t,i)=>{e.forEach((e,n)=>{n=Y(n),r.cM.info("Added new requirement: ",n);let s=i.append("g").attr("id",n),a=$(s,"req-"+n),l=[],h=O(s,n+"_title",[`<<${e.type}>>`,`${e.name}`]);l.push(h.titleNode),l.push(C(s,n+"_body",[`Id: ${e.id}`,`Text: ${e.text}`,`Risk: ${e.risk}`,`Verification: ${e.verifyMethod}`],h.y));let o=a.node().getBBox();t.setNode(n,{width:o.width,height:o.height,shape:"rect",id:n})})},"drawReqs"),D=(0,r.eW)((e,t,i)=>{e.forEach((e,r)=>{let n=Y(r),s=i.append("g").attr("id",n),a="element-"+n,l=$(s,a),h=[],o=O(s,a+"_title",["<<Element>>",`${r}`]);h.push(o.titleNode),h.push(C(s,a+"_body",[`Type: ${e.type||"Not Specified"}`,`Doc Ref: ${e.docRef||"None"}`],o.y));let c=l.node().getBBox();t.setNode(n,{width:c.width,height:c.height,shape:"rect",id:n})})},"drawElements"),P=(0,r.eW)((e,t)=>(e.forEach(function(e){let i=Y(e.src),r=Y(e.dst);t.setEdge(i,r,{relationship:e})}),e),"addRelationships"),V=(0,r.eW)(function(e,t){t.nodes().forEach(function(i){void 0!==i&&void 0!==t.node(i)&&(e.select("#"+i),e.select("#"+i).attr("transform","translate("+(t.node(i).x-t.node(i).width/2)+","+(t.node(i).y-t.node(i).height/2)+" )"))})},"adjustEntities"),Y=(0,r.eW)(e=>e.replace(/\s/g,"").replace(/\./g,"_"),"elementString"),U={parser:l,db:T,renderer:{draw:(0,r.eW)((e,t,i,l)=>{let h;let o=(W=(0,r.nV)().requirement).securityLevel;"sandbox"===o&&(h=(0,n.Ys)("#i"+t));let c=("sandbox"===o?(0,n.Ys)(h.nodes()[0].contentDocument.body):(0,n.Ys)("body")).select(`[id='${t}']`);w.insertLineEndings(c,W);let u=new a.k({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:W.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel(function(){return{}}),y=l.db.getRequirements(),d=l.db.getElements(),p=l.db.getRelationships();F(y,u,c),D(d,u,c),P(p,u),(0,s.bK)(u),V(c,u),p.forEach(function(e){M(c,e,u,t,l)});let _=W.rect_padding,g=c.node().getBBox(),E=g.width+2*_,R=g.height+2*_;(0,r.v2)(c,R,E,W.useMaxWidth),c.attr("viewBox",`${g.x-_} ${g.y-_} ${E} ${R}`)},"draw")},styles:x}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4610],{25770:function(n,t,r){r.d(t,{Z:function(){return o}});var e=r(98721);function u(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new e.Z;++t<r;)this.add(n[t])}u.prototype.add=u.prototype.push=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this},u.prototype.has=function(n){return this.__data__.has(n)};var o=u},64364:function(n,t){t.Z=function(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&!1!==t(n[r],r,n););return n}},84168:function(n,t){t.Z=function(n,t){for(var r=-1,e=null==n?0:n.length,u=0,o=[];++r<e;){var c=n[r];t(c,r,n)&&(o[u++]=c)}return o}},88576:function(n,t,r){var e=r(75763);t.Z=function(n,t){return!!(null==n?0:n.length)&&(0,e.Z)(n,t,0)>-1}},30985:function(n,t){t.Z=function(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}},80659:function(n,t){t.Z=function(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}},36366:function(n,t){t.Z=function(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}},77395:function(n,t){t.Z=function(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}},13606:function(n,t,r){r.d(t,{Z:function(){return R}});var e=r(8883),u=r(64364),o=r(54646),c=r(66554),i=r(47799),f=r(49625),a=r(36686),Z=r(63783),l=r(35038),v=r(66443),b=r(1782),s=r(41879),j=r(68748),p=Object.prototype.hasOwnProperty,h=function(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&p.call(n,"index")&&(r.index=n.index,r.input=n.input),r},y=r(15403),d=function(n,t){var r=t?(0,y.Z)(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)},g=/\w*$/,w=function(n){var t=new n.constructor(n.source,g.exec(n));return t.lastIndex=n.lastIndex,t},_=r(40856),A=_.Z?_.Z.prototype:void 0,O=A?A.valueOf:void 0,m=r(76399),S=function(n,t,r){var e=n.constructor;switch(t){case"[object ArrayBuffer]":return(0,y.Z)(n);case"[object Boolean]":case"[object Date]":return new e(+n);case"[object DataView]":return d(n,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return(0,m.Z)(n,r);case"[object Map]":case"[object Set]":return new e;case"[object Number]":case"[object String]":return new e(n);case"[object RegExp]":return w(n);case"[object Symbol]":return O?Object(O.call(n)):{}}},k=r(51700),E=r(28070),x=r(23605),I=r(82370),U=r(65832),B=r(94914),C=B.Z&&B.Z.isMap,D=C?(0,U.Z)(C):function(n){return(0,I.Z)(n)&&"[object Map]"==(0,j.Z)(n)},F=r(7632),M=B.Z&&B.Z.isSet,z=M?(0,U.Z)(M):function(n){return(0,I.Z)(n)&&"[object Set]"==(0,j.Z)(n)},L="[object Arguments]",N="[object Function]",P="[object Object]",$={};$[L]=$["[object Array]"]=$["[object ArrayBuffer]"]=$["[object DataView]"]=$["[object Boolean]"]=$["[object Date]"]=$["[object Float32Array]"]=$["[object Float64Array]"]=$["[object Int8Array]"]=$["[object Int16Array]"]=$["[object Int32Array]"]=$["[object Map]"]=$["[object Number]"]=$[P]=$["[object RegExp]"]=$["[object Set]"]=$["[object String]"]=$["[object Symbol]"]=$["[object Uint8Array]"]=$["[object Uint8ClampedArray]"]=$["[object Uint16Array]"]=$["[object Uint32Array]"]=!0,$["[object Error]"]=$[N]=$["[object WeakMap]"]=!1;var R=function n(t,r,p,y,d,g){var w,_=1&r,A=2&r,O=4&r;if(p&&(w=d?p(t,y,d,g):p(t)),void 0!==w)return w;if(!(0,F.Z)(t))return t;var m=(0,E.Z)(t);if(m){if(w=h(t),!_)return(0,Z.Z)(t,w)}else{var I,U,B,C,M=(0,j.Z)(t),R=M==N||"[object GeneratorFunction]"==M;if((0,x.Z)(t))return(0,a.Z)(t,_);if(M==P||M==L||R&&!d){if(w=A||R?{}:(0,k.Z)(t),!_)return A?(U=(I=w)&&(0,c.Z)(t,(0,f.Z)(t),I),(0,c.Z)(t,(0,v.Z)(t),U)):(C=(B=w)&&(0,c.Z)(t,(0,i.Z)(t),B),(0,c.Z)(t,(0,l.Z)(t),C))}else{if(!$[M])return d?t:{};w=S(t,M,_)}}g||(g=new e.Z);var V=g.get(t);if(V)return V;g.set(t,w),z(t)?t.forEach(function(e){w.add(n(e,r,p,e,t,g))}):D(t)&&t.forEach(function(e,u){w.set(u,n(e,r,p,u,t,g))});var G=O?A?s.Z:b.Z:A?f.Z:i.Z,W=m?void 0:G(t);return(0,u.Z)(W||t,function(e,u){W&&(e=t[u=e]),(0,o.Z)(w,u,n(e,r,p,u,t,g))}),w}},50388:function(n,t,r){r.d(t,{Z:function(){return i}});var e,u,o=r(2369),c=r(82025),i=(e=o.Z,function(n,t){if(null==n)return n;if(!(0,c.Z)(n))return e(n,t);for(var r=n.length,o=-1,i=Object(n);(u?o--:++o<r)&&!1!==t(i[o],o,i););return n})},82673:function(n,t,r){var e=r(50388);t.Z=function(n,t){var r=[];return(0,e.Z)(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}},41764:function(n,t){t.Z=function(n,t,r,e){for(var u=n.length,o=r+(e?1:-1);e?o--:++o<u;)if(t(n[o],o,n))return o;return -1}},28491:function(n,t,r){r.d(t,{Z:function(){return a}});var e=r(36366),u=r(40856),o=r(70351),c=r(28070),i=u.Z?u.Z.isConcatSpreadable:void 0,f=function(n){return(0,c.Z)(n)||(0,o.Z)(n)||!!(i&&n&&n[i])},a=function n(t,r,u,o,c){var i=-1,a=t.length;for(u||(u=f),c||(c=[]);++i<a;){var Z=t[i];r>0&&u(Z)?r>1?n(Z,r-1,u,o,c):(0,e.Z)(c,Z):o||(c[c.length]=Z)}return c}},2369:function(n,t,r){var e=r(19045),u=r(47799);t.Z=function(n,t){return n&&(0,e.Z)(n,t,u.Z)}},83613:function(n,t,r){var e=r(87439),u=r(47373);t.Z=function(n,t){t=(0,e.Z)(t,n);for(var r=0,o=t.length;null!=n&&r<o;)n=n[(0,u.Z)(t[r++])];return r&&r==o?n:void 0}},34635:function(n,t,r){var e=r(36366),u=r(28070);t.Z=function(n,t,r){var o=t(n);return(0,u.Z)(n)?o:(0,e.Z)(o,r(n))}},75763:function(n,t,r){r.d(t,{Z:function(){return c}});var e=r(41764),u=function(n){return n!=n},o=function(n,t,r){for(var e=r-1,u=n.length;++e<u;)if(n[e]===t)return e;return -1},c=function(n,t,r){return t==t?o(n,t,r):(0,e.Z)(n,u,r)}},18856:function(n,t,r){r.d(t,{Z:function(){return G}});var e=r(8883),u=r(25770),o=r(77395),c=r(92363),i=function(n,t,r,e,i,f){var a=1&r,Z=n.length,l=t.length;if(Z!=l&&!(a&&l>Z))return!1;var v=f.get(n),b=f.get(t);if(v&&b)return v==t&&b==n;var s=-1,j=!0,p=2&r?new u.Z:void 0;for(f.set(n,t),f.set(t,n);++s<Z;){var h=n[s],y=t[s];if(e)var d=a?e(y,h,s,t,n,f):e(h,y,s,n,t,f);if(void 0!==d){if(d)continue;j=!1;break}if(p){if(!(0,o.Z)(t,function(n,t){if(!(0,c.Z)(p,t)&&(h===n||i(h,n,r,e,f)))return p.push(t)})){j=!1;break}}else if(!(h===y||i(h,y,r,e,f))){j=!1;break}}return f.delete(n),f.delete(t),j},f=r(40856),a=r(6408),Z=r(84338),l=function(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r},v=r(64088),b=f.Z?f.Z.prototype:void 0,s=b?b.valueOf:void 0,j=function(n,t,r,e,u,o,c){switch(r){case"[object DataView]":if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)break;n=n.buffer,t=t.buffer;case"[object ArrayBuffer]":if(n.byteLength!=t.byteLength||!o(new a.Z(n),new a.Z(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return(0,Z.Z)(+n,+t);case"[object Error]":return n.name==t.name&&n.message==t.message;case"[object RegExp]":case"[object String]":return n==t+"";case"[object Map]":var f=l;case"[object Set]":var b=1&e;if(f||(f=v.Z),n.size!=t.size&&!b)break;var j=c.get(n);if(j)return j==t;e|=2,c.set(n,t);var p=i(f(n),f(t),e,u,o,c);return c.delete(n),p;case"[object Symbol]":if(s)return s.call(n)==s.call(t)}return!1},p=r(1782),h=Object.prototype.hasOwnProperty,y=function(n,t,r,e,u,o){var c=1&r,i=(0,p.Z)(n),f=i.length;if(f!=(0,p.Z)(t).length&&!c)return!1;for(var a=f;a--;){var Z=i[a];if(!(c?Z in t:h.call(t,Z)))return!1}var l=o.get(n),v=o.get(t);if(l&&v)return l==t&&v==n;var b=!0;o.set(n,t),o.set(t,n);for(var s=c;++a<f;){var j=n[Z=i[a]],y=t[Z];if(e)var d=c?e(y,j,Z,t,n,o):e(j,y,Z,n,t,o);if(!(void 0===d?j===y||u(j,y,r,e,o):d)){b=!1;break}s||(s="constructor"==Z)}if(b&&!s){var g=n.constructor,w=t.constructor;g!=w&&"constructor"in n&&"constructor"in t&&!("function"==typeof g&&g instanceof g&&"function"==typeof w&&w instanceof w)&&(b=!1)}return o.delete(n),o.delete(t),b},d=r(68748),g=r(28070),w=r(23605),_=r(9798),A="[object Arguments]",O="[object Array]",m="[object Object]",S=Object.prototype.hasOwnProperty,k=function(n,t,r,u,o,c){var f=(0,g.Z)(n),a=(0,g.Z)(t),Z=f?O:(0,d.Z)(n),l=a?O:(0,d.Z)(t);Z=Z==A?m:Z,l=l==A?m:l;var v=Z==m,b=l==m,s=Z==l;if(s&&(0,w.Z)(n)){if(!(0,w.Z)(t))return!1;f=!0,v=!1}if(s&&!v)return c||(c=new e.Z),f||(0,_.Z)(n)?i(n,t,r,u,o,c):j(n,t,Z,r,u,o,c);if(!(1&r)){var p=v&&S.call(n,"__wrapped__"),h=b&&S.call(t,"__wrapped__");if(p||h){var k=p?n.value():n,E=h?t.value():t;return c||(c=new e.Z),o(k,E,r,u,c)}}return!!s&&(c||(c=new e.Z),y(n,t,r,u,o,c))},E=r(82370),x=function n(t,r,e,u,o){return t===r||(null!=t&&null!=r&&((0,E.Z)(t)||(0,E.Z)(r))?k(t,r,e,u,n,o):t!=t&&r!=r)},I=function(n,t,r,u){var o=r.length,c=o,i=!u;if(null==n)return!c;for(n=Object(n);o--;){var f=r[o];if(i&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++o<c;){var a=(f=r[o])[0],Z=n[a],l=f[1];if(i&&f[2]){if(void 0===Z&&!(a in n))return!1}else{var v=new e.Z;if(u)var b=u(Z,l,a,n,t,v);if(!(void 0===b?x(l,Z,3,u,v):b))return!1}}return!0},U=r(7632),B=function(n){return n==n&&!(0,U.Z)(n)},C=r(47799),D=function(n){for(var t=(0,C.Z)(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,B(u)]}return t},F=function(n,t){return function(r){return null!=r&&r[n]===t&&(void 0!==t||n in Object(r))}},M=function(n){var t=D(n);return 1==t.length&&t[0][2]?F(t[0][0],t[0][1]):function(r){return r===n||I(r,n,t)}},z=r(83613),L=function(n,t,r){var e=null==n?void 0:(0,z.Z)(n,t);return void 0===e?r:e},N=r(95222),P=r(19823),$=r(47373),R=r(20937),V=r(62838),G=function(n){var t,r,e;if("function"==typeof n)return n;if(null==n)return R.Z;if("object"==typeof n){;return(0,g.Z)(n)?(t=n[0],r=n[1],(0,P.Z)(t)&&B(r)?F((0,$.Z)(t),r):function(n){var e=L(n,t);return void 0===e&&e===r?(0,N.Z)(n,t):x(r,e,3)}):M(n)}return e=n,(0,P.Z)(e)?(0,V.Z)((0,$.Z)(e)):function(n){return(0,z.Z)(n,e)}}},62838:function(n,t){t.Z=function(n){return function(t){return null==t?void 0:t[n]}}},3394:function(n,t,r){r.d(t,{Z:function(){return l}});var e=r(25770),u=r(88576),o=r(30985),c=r(92363),i=r(32974),f=r(26161),a=r(64088),Z=i.Z&&1/(0,a.Z)(new i.Z([,-0]))[1]==1/0?function(n){return new i.Z(n)}:f.Z,l=function(n,t,r){var i=-1,f=u.Z,l=n.length,v=!0,b=[],s=b;if(r)v=!1,f=o.Z;else if(l>=200){var j=t?null:Z(n);if(j)return(0,a.Z)(j);v=!1,f=c.Z,s=new e.Z}else s=t?[]:b;n:for(;++i<l;){var p=n[i],h=t?t(p):p;if(p=r||0!==p?p:0,v&&h==h){for(var y=s.length;y--;)if(s[y]===h)continue n;t&&s.push(h),b.push(p)}else f(s,h,r)||(s!==b&&s.push(h),b.push(p))}return b}},92363:function(n,t){t.Z=function(n,t){return n.has(t)}},45900:function(n,t,r){var e=r(20937);t.Z=function(n){return"function"==typeof n?n:e.Z}},87439:function(n,t,r){r.d(t,{Z:function(){return b}});var e,u,o,c=r(28070),i=r(19823),f=r(98509),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Z=/\\(\\)?/g,l=(e=function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(a,function(n,r,e,u){t.push(e?u.replace(Z,"$1"):r||n)}),t},o=(u=(0,f.Z)(e,function(n){return 500===o.size&&o.clear(),n})).cache,u),v=r(36720),b=function(n,t){return(0,c.Z)(n)?n:(0,i.Z)(n,t)?[n]:l((0,v.Z)(n))}},1782:function(n,t,r){var e=r(34635),u=r(35038),o=r(47799);t.Z=function(n){return(0,e.Z)(n,o.Z,u.Z)}},41879:function(n,t,r){var e=r(34635),u=r(66443),o=r(49625);t.Z=function(n){return(0,e.Z)(n,o.Z,u.Z)}},35038:function(n,t,r){var e=r(84168),u=r(88157),o=Object.prototype.propertyIsEnumerable,c=Object.getOwnPropertySymbols,i=c?function(n){return null==n?[]:(n=Object(n),(0,e.Z)(c(n),function(t){return o.call(n,t)}))}:u.Z;t.Z=i},66443:function(n,t,r){var e=r(36366),u=r(91408),o=r(35038),c=r(88157),i=Object.getOwnPropertySymbols?function(n){for(var t=[];n;)(0,e.Z)(t,(0,o.Z)(n)),n=(0,u.Z)(n);return t}:c.Z;t.Z=i},93025:function(n,t,r){var e=r(87439),u=r(70351),o=r(28070),c=r(65482),i=r(53934),f=r(47373);t.Z=function(n,t,r){t=(0,e.Z)(t,n);for(var a=-1,Z=t.length,l=!1;++a<Z;){var v=(0,f.Z)(t[a]);if(!(l=null!=n&&r(n,v)))break;n=n[v]}return l||++a!=Z?l:!!(Z=null==n?0:n.length)&&(0,i.Z)(Z)&&(0,c.Z)(v,Z)&&((0,o.Z)(n)||(0,u.Z)(n))}},19823:function(n,t,r){var e=r(28070),u=r(82245),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/;t.Z=function(n,t){if((0,e.Z)(n))return!1;var r=typeof n;return!!("number"==r||"symbol"==r||"boolean"==r||null==n||(0,u.Z)(n))||c.test(n)||!o.test(n)||null!=t&&n in Object(t)}},64088:function(n,t){t.Z=function(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=n}),r}},47373:function(n,t,r){var e=r(82245),u=1/0;t.Z=function(n){if("string"==typeof n||(0,e.Z)(n))return n;var t=n+"";return"0"==t&&1/n==-u?"-0":t}},52422:function(n,t,r){var e=r(84168),u=r(82673),o=r(18856),c=r(28070);t.Z=function(n,t){return((0,c.Z)(n)?e.Z:u.Z)(n,(0,o.Z)(t,3))}},81585:function(n,t,r){var e=r(64364),u=r(50388),o=r(45900),c=r(28070);t.Z=function(n,t){return((0,c.Z)(n)?e.Z:u.Z)(n,(0,o.Z)(t))}},95222:function(n,t,r){r.d(t,{Z:function(){return o}});var e=function(n,t){return null!=n&&t in Object(n)},u=r(93025),o=function(n,t){return null!=n&&(0,u.Z)(n,t,e)}},82245:function(n,t,r){var e=r(59576),u=r(82370);t.Z=function(n){return"symbol"==typeof n||(0,u.Z)(n)&&"[object Symbol]"==(0,e.Z)(n)}},87826:function(n,t){t.Z=function(n){return void 0===n}},47799:function(n,t,r){var e=r(70836),u=r(35400),o=r(82025);t.Z=function(n){return(0,o.Z)(n)?(0,e.Z)(n):(0,u.Z)(n)}},26161:function(n,t){t.Z=function(){}},49579:function(n,t,r){r.d(t,{Z:function(){return f}});var e=function(n,t,r,e){var u=-1,o=null==n?0:n.length;for(e&&o&&(r=n[++u]);++u<o;)r=t(r,n[u],u,n);return r},u=r(50388),o=r(18856),c=function(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=!1,n):t(r,n,u,o)}),r},i=r(28070),f=function(n,t,r){var f=(0,i.Z)(n)?e:c,a=arguments.length<3;return f(n,(0,o.Z)(t,4),r,a,u.Z)}},88157:function(n,t){t.Z=function(){return[]}},36720:function(n,t,r){r.d(t,{Z:function(){return l}});var e=r(40856),u=r(80659),o=r(28070),c=r(82245),i=1/0,f=e.Z?e.Z.prototype:void 0,a=f?f.toString:void 0,Z=function n(t){if("string"==typeof t)return t;if((0,o.Z)(t))return(0,u.Z)(t,n)+"";if((0,c.Z)(t))return a?a.call(t):"";var r=t+"";return"0"==r&&1/t==-i?"-0":r},l=function(n){return null==n?"":Z(n)}},33625:function(n,t,r){r.d(t,{Z:function(){return o}});var e=r(80659),u=r(47799),o=function(n){var t;return null==n?[]:(t=(0,u.Z)(n),(0,e.Z)(t,function(t){return n[t]}))}}}]);
@@ -0,0 +1,215 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4650],{3434:function(t,e,s){s.d(e,{j:function(){return a},q:function(){return n}});var i=s(30086),r=s(15440),n=(0,i.eW)((t,e)=>{let s;return"sandbox"===e&&(s=(0,r.Ys)("#i"+t)),("sandbox"===e?(0,r.Ys)(s.nodes()[0].contentDocument.body):(0,r.Ys)("body")).select(`[id="${t}"]`)},"getDiagramElement"),a=(0,i.eW)((t,e,s,r)=>{t.attr("class",s);let{width:n,height:a,x:c,y:h}=o(t,e);(0,i.v2)(t,a,n,r);let u=l(c,h,n,a,e);t.attr("viewBox",u),i.cM.debug(`viewBox configured: ${u} with padding: ${e}`)},"setupViewPortForSVG"),o=(0,i.eW)((t,e)=>{let s=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*e,height:s.height+2*e,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),l=(0,i.eW)((t,e,s,i,r)=>`${t-r} ${e-r} ${s} ${i}`,"createViewBox")},24650:function(t,e,s){s.d(e,{Ee:function(){return tB},J8:function(){return l},_$:function(){return N},bH:function(){return tR}});var i=s(3434),r=s(91936),n=s(86954),a=s(30086),o=function(){var t=(0,a.eW)(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,2],s=[1,3],i=[1,4],r=[2,4],n=[1,9],o=[1,11],l=[1,16],c=[1,17],h=[1,18],u=[1,19],d=[1,32],p=[1,20],y=[1,21],g=[1,22],f=[1,23],S=[1,24],m=[1,26],_=[1,27],b=[1,28],T=[1,29],k=[1,30],E=[1,31],x=[1,34],$=[1,35],C=[1,36],D=[1,37],v=[1,33],L=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],A=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],W={trace:(0,a.eW)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,classDef:38,CLASSDEF_ID:39,CLASSDEF_STYLEOPTS:40,DEFAULT:41,style:42,STYLE_IDS:43,STYLEDEF_STYLEOPTS:44,class:45,CLASSENTITY_IDS:46,STYLECLASS:47,direction_tb:48,direction_bt:49,direction_rl:50,direction_lr:51,eol:52,";":53,EDGE_STATE:54,STYLE_SEPARATOR:55,left_of:56,right_of:57,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"classDef",39:"CLASSDEF_ID",40:"CLASSDEF_STYLEOPTS",41:"DEFAULT",42:"style",43:"STYLE_IDS",44:"STYLEDEF_STYLEOPTS",45:"class",46:"CLASSENTITY_IDS",47:"STYLECLASS",48:"direction_tb",49:"direction_bt",50:"direction_rl",51:"direction_lr",53:";",54:"EDGE_STATE",55:"STYLE_SEPARATOR",56:"left_of",57:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[52,1],[52,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:(0,a.eW)(function(t,e,s,i,r,n,a){var o=n.length-1;switch(r){case 3:return i.setRootDoc(n[o]),n[o];case 4:this.$=[];break;case 5:"nl"!=n[o]&&(n[o-1].push(n[o]),this.$=n[o-1]);break;case 6:case 7:case 12:this.$=n[o];break;case 8:this.$="nl";break;case 13:let l=n[o-1];l.description=i.trimColon(n[o]),this.$=l;break;case 14:this.$={stmt:"relation",state1:n[o-2],state2:n[o]};break;case 15:let c=i.trimColon(n[o]);this.$={stmt:"relation",state1:n[o-3],state2:n[o-1],description:c};break;case 19:this.$={stmt:"state",id:n[o-3],type:"default",description:"",doc:n[o-1]};break;case 20:var h=n[o],u=n[o-2].trim();if(n[o].match(":")){var d=n[o].split(":");h=d[0],u=[u,d[1]]}this.$={stmt:"state",id:h,type:"default",description:u};break;case 21:this.$={stmt:"state",id:n[o-3],type:"default",description:n[o-5],doc:n[o-1]};break;case 22:this.$={stmt:"state",id:n[o],type:"fork"};break;case 23:this.$={stmt:"state",id:n[o],type:"join"};break;case 24:this.$={stmt:"state",id:n[o],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:n[o-1].trim(),note:{position:n[o-2].trim(),text:n[o].trim()}};break;case 29:this.$=n[o].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=n[o].trim(),i.setAccDescription(this.$);break;case 32:case 33:this.$={stmt:"classDef",id:n[o-1].trim(),classes:n[o].trim()};break;case 34:this.$={stmt:"style",id:n[o-1].trim(),styleClass:n[o].trim()};break;case 35:this.$={stmt:"applyClass",id:n[o-1].trim(),styleClass:n[o].trim()};break;case 36:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 37:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 38:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 39:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 42:case 43:this.$={stmt:"state",id:n[o].trim(),type:"default",description:""};break;case 44:case 45:this.$={stmt:"state",id:n[o-2].trim(),classes:[n[o].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:e,5:s,6:i},{1:[3]},{3:5,4:e,5:s,6:i},{3:6,4:e,5:s,6:i},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:u,24:d,25:p,26:y,27:g,28:f,29:S,32:25,33:m,35:_,37:b,38:T,42:k,45:E,48:x,49:$,50:C,51:D,54:v},t(L,[2,5]),{9:38,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:u,24:d,25:p,26:y,27:g,28:f,29:S,32:25,33:m,35:_,37:b,38:T,42:k,45:E,48:x,49:$,50:C,51:D,54:v},t(L,[2,7]),t(L,[2,8]),t(L,[2,9]),t(L,[2,10]),t(L,[2,11]),t(L,[2,12],{14:[1,39],15:[1,40]}),t(L,[2,16]),{18:[1,41]},t(L,[2,18],{20:[1,42]}),{23:[1,43]},t(L,[2,22]),t(L,[2,23]),t(L,[2,24]),t(L,[2,25]),{30:44,31:[1,45],56:[1,46],57:[1,47]},t(L,[2,28]),{34:[1,48]},{36:[1,49]},t(L,[2,31]),{39:[1,50],41:[1,51]},{43:[1,52]},{46:[1,53]},t(A,[2,42],{55:[1,54]}),t(A,[2,43],{55:[1,55]}),t(L,[2,36]),t(L,[2,37]),t(L,[2,38]),t(L,[2,39]),t(L,[2,6]),t(L,[2,13]),{13:56,24:d,54:v},t(L,[2,17]),t(I,r,{7:57}),{24:[1,58]},{24:[1,59]},{23:[1,60]},{24:[2,46]},{24:[2,47]},t(L,[2,29]),t(L,[2,30]),{40:[1,61]},{40:[1,62]},{44:[1,63]},{47:[1,64]},{24:[1,65]},{24:[1,66]},t(L,[2,14],{14:[1,67]}),{4:n,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,68],22:u,24:d,25:p,26:y,27:g,28:f,29:S,32:25,33:m,35:_,37:b,38:T,42:k,45:E,48:x,49:$,50:C,51:D,54:v},t(L,[2,20],{20:[1,69]}),{31:[1,70]},{24:[1,71]},t(L,[2,32]),t(L,[2,33]),t(L,[2,34]),t(L,[2,35]),t(A,[2,44]),t(A,[2,45]),t(L,[2,15]),t(L,[2,19]),t(I,r,{7:72}),t(L,[2,26]),t(L,[2,27]),{4:n,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,73],22:u,24:d,25:p,26:y,27:g,28:f,29:S,32:25,33:m,35:_,37:b,38:T,42:k,45:E,48:x,49:$,50:C,51:D,54:v},t(L,[2,21])],defaultActions:{5:[2,1],6:[2,2],46:[2,46],47:[2,47]},parseError:(0,a.eW)(function(t,e){if(e.recoverable)this.trace(t);else{var s=Error(t);throw s.hash=e,s}},"parseError"),parse:(0,a.eW)(function(t){var e=this,s=[0],i=[],r=[null],n=[],o=this.table,l="",c=0,h=0,u=0,d=n.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;n.push(f);var S=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,a.eW)(function(t){s.length=s.length-2*t,r.length=r.length-t,n.length=n.length-t},"popStack"),(0,a.eW)(m,"lex");for(var _,b,T,k,E,x,$,C,D,v={};;){if(T=s[s.length-1],this.defaultActions[T]?k=this.defaultActions[T]:(null==_&&(_=m()),k=o[T]&&o[T][_]),void 0===k||!k.length||!k[0]){var L="";for(x in D=[],o[T])this.terminals_[x]&&x>2&&D.push("'"+this.terminals_[x]+"'");L=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==_?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(L,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:f,expected:D})}if(k[0]instanceof Array&&k.length>1)throw Error("Parse Error: multiple actions possible at state: "+T+", token: "+_);switch(k[0]){case 1:s.push(_),r.push(p.yytext),n.push(p.yylloc),s.push(k[1]),_=null,b?(_=b,b=null):(h=p.yyleng,l=p.yytext,c=p.yylineno,f=p.yylloc,u>0&&u--);break;case 2:if($=this.productions_[k[1]][1],v.$=r[r.length-$],v._$={first_line:n[n.length-($||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-($||1)].first_column,last_column:n[n.length-1].last_column},S&&(v._$.range=[n[n.length-($||1)].range[0],n[n.length-1].range[1]]),void 0!==(E=this.performAction.apply(v,[l,h,c,y.yy,k[1],r,n].concat(d))))return E;$&&(s=s.slice(0,-1*$*2),r=r.slice(0,-1*$),n=n.slice(0,-1*$)),s.push(this.productions_[k[1]][0]),r.push(v.$),n.push(v._$),C=o[s[s.length-2]][s[s.length-1]],s.push(C);break;case 3:return!0}}return!0},"parse")},w={EOF:1,parseError:(0,a.eW)(function(t,e){if(this.yy.parser)this.yy.parser.parseError(t,e);else throw Error(t)},"parseError"),setInput:(0,a.eW)(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:(0,a.eW)(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:(0,a.eW)(function(t){var e=t.length,s=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 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),s.length-1&&(this.yylineno-=s.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:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[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:(0,a.eW)(function(){return this._more=!0,this},"more"),reject:(0,a.eW)(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:(0,a.eW)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,a.eW)(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:(0,a.eW)(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:(0,a.eW)(function(){var t=this.pastInput(),e=Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,a.eW)(function(t,e){var s,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],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack)for(var n in r)this[n]=r[n];return!1},"test_match"),next:(0,a.eW)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,s,i,r=this._currentRules(),n=0;n<r.length;n++)if((s=this._input.match(this.rules[r[n]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,r[n])))return t;if(!this._backtrack)return!1;e=!1;continue}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,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:(0,a.eW)(function(){return this.next()||this.lex()},"lex"),begin:(0,a.eW)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,a.eW)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,a.eW)(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:(0,a.eW)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,a.eW)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,a.eW)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,a.eW)(function(t,e,s,i){switch(s){case 0:return 41;case 1:case 42:return 48;case 2:case 43:return 49;case 3:case 44:return 50;case 4:case 45:return 51;case 5:case 6:case 8:case 9:case 10:case 11:case 54:case 56:case 62:break;case 7:case 77:return 5;case 12:case 32:return this.pushState("SCALE"),17;case 13:case 33:return 18;case 14:case 20:case 34:case 49:case 52:this.popState();break;case 15:return this.begin("acc_title"),33;case 16:return this.popState(),"acc_title_value";case 17:return this.begin("acc_descr"),35;case 18:return this.popState(),"acc_descr_value";case 19:this.begin("acc_descr_multiline");break;case 21:return"acc_descr_multiline_value";case 22:return this.pushState("CLASSDEF"),38;case 23:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 24:return this.popState(),this.pushState("CLASSDEFID"),39;case 25:return this.popState(),40;case 26:return this.pushState("CLASS"),45;case 27:return this.popState(),this.pushState("CLASS_STYLE"),46;case 28:return this.popState(),47;case 29:return this.pushState("STYLE"),42;case 30:return this.popState(),this.pushState("STYLEDEF_STYLES"),43;case 31:return this.popState(),44;case 35:this.pushState("STATE");break;case 36:case 39:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 46:this.pushState("STATE_STRING");break;case 47:return this.pushState("STATE_ID"),"AS";case 48:case 64:return this.popState(),"ID";case 50:return"STATE_DESCR";case 51:return 19;case 53:return this.popState(),this.pushState("struct"),20;case 55:return this.popState(),21;case 57:return this.begin("NOTE"),29;case 58:return this.popState(),this.pushState("NOTE_ID"),56;case 59:return this.popState(),this.pushState("NOTE_ID"),57;case 60:this.popState(),this.pushState("FLOATING_NOTE");break;case 61:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:return"NOTE_TEXT";case 65:return this.popState(),this.pushState("NOTE_TEXT"),24;case 66:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 67:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 68:case 69:return 6;case 70:return 16;case 71:return 54;case 72:return 24;case 73:return e.yytext=e.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 55;case 78:return"INVALID"}},"anonymous"),rules:[/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[9,10],inclusive:!1},struct:{rules:[9,10,22,26,29,35,42,43,44,45,54,55,56,57,71,72,73,74,75],inclusive:!1},FLOATING_NOTE_ID:{rules:[64],inclusive:!1},FLOATING_NOTE:{rules:[61,62,63],inclusive:!1},NOTE_TEXT:{rules:[66,67],inclusive:!1},NOTE_ID:{rules:[65],inclusive:!1},NOTE:{rules:[58,59,60],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[31],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[30],inclusive:!1},CLASS_STYLE:{rules:[28],inclusive:!1},CLASS:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[25],inclusive:!1},CLASSDEF:{rules:[23,24],inclusive:!1},acc_descr_multiline:{rules:[20,21],inclusive:!1},acc_descr:{rules:[18],inclusive:!1},acc_title:{rules:[16],inclusive:!1},SCALE:{rules:[13,14,33,34],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[48],inclusive:!1},STATE_STRING:{rules:[49,50],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[9,10,36,37,38,39,40,41,46,47,51,52,53],inclusive:!1},ID:{rules:[9,10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,10,11,12,15,17,19,22,26,29,32,35,53,57,68,69,70,71,72,73,74,76,77,78],inclusive:!0}}};function O(){this.yy={}}return W.lexer=w,(0,a.eW)(O,"Parser"),O.prototype=W,W.Parser=O,new O}();o.parser=o;var l=o,c="TB",h="state",u="relation",d="default",p="divider",y="fill:none",g="fill: #333",f="text",S="normal",m="rect",_="rectWithTitle",b="divider",T="roundedWithTitle",k="statediagram",E=`${k}-state`,x="transition",$=`${x} note-edge`,C=`${k}-note`,D=`${k}-cluster`,v=`${k}-cluster-alt`,L="parent",A="note",I="----",W=`${I}${A}`,w=`${I}${L}`,O=(0,a.eW)((t,e=c)=>{if(!t.doc)return e;let s=e;for(let e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir"),N={getClasses:(0,a.eW)(function(t,e){return e.db.extract(e.db.getRootDocV2()),e.db.getClasses()},"getClasses"),draw:(0,a.eW)(async function(t,e,s,o){a.cM.info("REF0:"),a.cM.info("Drawing state diagram (v2)",e);let{securityLevel:l,state:c,layout:h}=(0,a.nV)();o.db.extract(o.db.getRootDocV2());let u=o.db.getData(),d=(0,i.q)(e,l);u.type=o.type,u.layoutAlgorithm=h,u.nodeSpacing=c?.nodeSpacing||50,u.rankSpacing=c?.rankSpacing||50,u.markers=["barb"],u.diagramId=e,await (0,r.sY)(u,d),n.w8.insertTitle(d,"statediagramTitleText",c?.titleTopMargin??25,o.db.getDiagramTitle()),(0,i.j)(d,8,k,c?.useMaxWidth??!0)},"draw"),getDir:O},R=new Map,B=0;function Y(t="",e=0,s="",i=I){let r=null!==s&&s.length>0?`${i}${s}`:"";return`state-${t}${r}-${e}`}(0,a.eW)(Y,"stateDomId");var F=(0,a.eW)((t,e,s,i,r,n,o,l)=>{a.cM.trace("items",e),e.forEach(e=>{switch(e.stmt){case h:case d:V(t,e,s,i,r,n,o,l);break;case u:{V(t,e.state1,s,i,r,n,o,l),V(t,e.state2,s,i,r,n,o,l);let c={id:"edge"+B,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:y,labelStyle:"",label:a.SY.sanitizeText(e.description,(0,a.nV)()),arrowheadStyle:g,labelpos:"c",labelType:f,thickness:S,classes:x,look:o};r.push(c),B++}}})},"setupDoc"),P=(0,a.eW)((t,e=c)=>{let s=e;if(t.doc)for(let e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir");function M(t,e,s){if(!e.id||"</join></fork>"===e.id||"</choice>"===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(t=>{if(s.get(t)){let i=s.get(t);e.cssCompiledStyles=[...e.cssCompiledStyles,...i.styles]}}));let i=t.find(t=>t.id===e.id);i?Object.assign(i,e):t.push(e)}function G(t){return t?.classes?.join(" ")??""}function j(t){return t?.styles??[]}(0,a.eW)(M,"insertOrUpdateNode"),(0,a.eW)(G,"getClassesFromDbInfo"),(0,a.eW)(j,"getStylesFromDbInfo");var V=(0,a.eW)((t,e,s,i,r,n,o,l)=>{let c=e.id,h=s.get(c),u=G(h),k=j(h);if(a.cM.info("dataFetcher parsedItem",e,h,k),"root"!==c){let s=m;!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==d&&(s=e.type),R.get(c)||R.set(c,{id:c,shape:s,description:a.SY.sanitizeText(c,(0,a.nV)()),cssClasses:`${u} ${E}`,cssStyles:k});let h=R.get(c);e.description&&(Array.isArray(h.description)?(h.shape=_,h.description.push(e.description)):h.description?.length>0?(h.shape=_,h.description===c?h.description=[e.description]:h.description=[h.description,e.description]):(h.shape=m,h.description=e.description),h.description=a.SY.sanitizeTextOrArray(h.description,(0,a.nV)())),h.description?.length===1&&h.shape===_&&("group"===h.type?h.shape=T:h.shape=m),!h.type&&e.doc&&(a.cM.info("Setting cluster for XCX",c,P(e)),h.type="group",h.isGroup=!0,h.dir=P(e),h.shape=e.type===p?b:T,h.cssClasses=`${h.cssClasses} ${D} ${n?v:""}`);let x={labelStyle:"",shape:h.shape,label:h.description,cssClasses:h.cssClasses,cssCompiledStyles:[],cssStyles:h.cssStyles,id:c,dir:h.dir,domId:Y(c,B),type:h.type,isGroup:"group"===h.type,padding:8,rx:10,ry:10,look:o};if(x.shape===b&&(x.label=""),t&&"root"!==t.id&&(a.cM.trace("Setting node ",c," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){let t={labelStyle:"",shape:"note",label:e.note.text,cssClasses:C,cssStyles:[],cssCompilesStyles:[],id:c+W+"-"+B,domId:Y(c,B,A),type:h.type,isGroup:"group"===h.type,padding:(0,a.nV)().flowchart.padding,look:o,position:e.note.position},s=c+w,n={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:h.cssClasses,cssStyles:[],id:c+w,domId:Y(c,B,L),type:"group",isGroup:!0,padding:16,look:o,position:e.note.position};B++,n.id=s,t.parentId=s,M(i,n,l),M(i,t,l),M(i,x,l);let u=c,d=t.id;"left of"===e.note.position&&(u=t.id,d=c),r.push({id:u+"-"+d,start:u,end:d,arrowhead:"none",arrowTypeEnd:"",style:y,labelStyle:"",classes:$,arrowheadStyle:g,labelpos:"c",labelType:f,thickness:S,look:o})}else M(i,x,l)}e.doc&&(a.cM.trace("Adding nodes children "),F(e,e.doc,s,i,r,!n,o,l))},"dataFetcher"),z=(0,a.eW)(()=>{R.clear(),B=0},"reset"),U="start",H="color",X="fill";function J(){return new Map}(0,a.eW)(J,"newClassesList");var K=[],q=[],Z="LR",Q=[],tt=J(),te=(0,a.eW)(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),ts={root:te()},ti=ts.root,tr=0,tn=0,ta=(0,a.eW)(t=>JSON.parse(JSON.stringify(t)),"clone"),to=(0,a.eW)(t=>{a.cM.info("Setting root doc",t),Q=t},"setRootDoc"),tl=(0,a.eW)(()=>Q,"getRootDoc"),tc=(0,a.eW)((t,e,s)=>{if(e.stmt===u)tc(t,e.state1,!0),tc(t,e.state2,!1);else if(e.stmt===h&&("[*]"===e.id?(e.id=s?t.id+"_start":t.id+"_end",e.start=s):e.id=e.id.trim()),e.doc){let t;let s=[],i=[];for(t=0;t<e.doc.length;t++)if(e.doc[t].type===p){let r=ta(e.doc[t]);r.doc=ta(i),s.push(r),i=[]}else i.push(e.doc[t]);if(s.length>0&&i.length>0){let t={stmt:h,id:(0,n.Ox)(),type:"divider",doc:ta(i)};s.push(ta(t)),e.doc=s}e.doc.forEach(t=>tc(e,t,!0))}},"docTranslator"),th=(0,a.eW)(()=>(tc({id:"root"},{id:"root",doc:Q},!0),{id:"root",doc:Q}),"getRootDocV2"),tu=(0,a.eW)(t=>{let e;e=t.doc?t.doc:t,a.cM.info(e),tp(!0),a.cM.info("Extract initial document:",e),e.forEach(t=>{switch(a.cM.warn("Statement",t.stmt),t.stmt){case h:td(t.id.trim(),t.type,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);break;case u:tE(t.state1,t.state2,t.description);break;case"classDef":tD(t.id.trim(),t.classes);break;case"style":{let e=t.id.trim().split(","),s=t.styleClass.split(",");e.forEach(t=>{let e=ty(t);if(void 0===e){let s=t.trim();td(s),e=ty(s)}e.styles=s.map(t=>t.replace(/;/g,"")?.trim())})}break;case"applyClass":tL(t.id.trim(),t.styleClass)}});let s=tg(),i=(0,a.nV)().look;z(),V(void 0,th(),s,K,q,!0,i,tt),K.forEach(t=>{if(Array.isArray(t.label)){if(t.description=t.label.slice(1),t.isGroup&&t.description.length>0)throw Error("Group nodes can only have label. Remove the additional description for node ["+t.id+"]");t.label=t.label[0]}})},"extract"),td=(0,a.eW)(function(t,e=d,s=null,i=null,r=null,n=null,o=null,l=null){let c=t?.trim();if(ti.states.has(c)?(ti.states.get(c).doc||(ti.states.get(c).doc=s),ti.states.get(c).type||(ti.states.get(c).type=e)):(a.cM.info("Adding state ",c,i),ti.states.set(c,{id:c,descriptions:[],type:e,doc:s,note:r,classes:[],styles:[],textStyles:[]})),i&&(a.cM.info("Setting state description",c,i),"string"==typeof i&&tx(c,i.trim()),"object"==typeof i&&i.forEach(t=>tx(c,t.trim()))),r){let t=ti.states.get(c);t.note=r,t.note.text=a.SY.sanitizeText(t.note.text,(0,a.nV)())}n&&(a.cM.info("Setting state classes",c,n),("string"==typeof n?[n]:n).forEach(t=>tL(c,t.trim()))),o&&(a.cM.info("Setting state styles",c,o),("string"==typeof o?[o]:o).forEach(t=>tA(c,t.trim()))),l&&(a.cM.info("Setting state styles",c,o),("string"==typeof l?[l]:l).forEach(t=>tI(c,t.trim())))},"addState"),tp=(0,a.eW)(function(t){K=[],q=[],ti=(ts={root:te()}).root,tr=0,tt=J(),t||(0,a.ZH)()},"clear"),ty=(0,a.eW)(function(t){return ti.states.get(t)},"getState"),tg=(0,a.eW)(function(){return ti.states},"getStates"),tf=(0,a.eW)(function(){a.cM.info("Documents = ",ts)},"logDocuments"),tS=(0,a.eW)(function(){return ti.relations},"getRelations");function tm(t=""){let e=t;return"[*]"===t&&(tr++,e=`${U}${tr}`),e}function t_(t="",e=d){return"[*]"===t?U:e}function tb(t=""){let e=t;return"[*]"===t&&(tr++,e=`end${tr}`),e}function tT(t="",e=d){return"[*]"===t?"end":e}function tk(t,e,s){let i=tm(t.id.trim()),r=t_(t.id.trim(),t.type),n=tm(e.id.trim()),o=t_(e.id.trim(),e.type);td(i,r,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),td(n,o,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),ti.relations.push({id1:i,id2:n,relationTitle:a.SY.sanitizeText(s,(0,a.nV)())})}(0,a.eW)(tm,"startIdIfNeeded"),(0,a.eW)(t_,"startTypeIfNeeded"),(0,a.eW)(tb,"endIdIfNeeded"),(0,a.eW)(tT,"endTypeIfNeeded"),(0,a.eW)(tk,"addRelationObjs");var tE=(0,a.eW)(function(t,e,s){if("object"==typeof t)tk(t,e,s);else{let i=tm(t.trim()),r=t_(t),n=tb(e.trim()),o=tT(e);td(i,r),td(n,o),ti.relations.push({id1:i,id2:n,title:a.SY.sanitizeText(s,(0,a.nV)())})}},"addRelation"),tx=(0,a.eW)(function(t,e){let s=ti.states.get(t),i=e.startsWith(":")?e.replace(":","").trim():e;s.descriptions.push(a.SY.sanitizeText(i,(0,a.nV)()))},"addDescription"),t$=(0,a.eW)(function(t){return":"===t.substring(0,1)?t.substr(2).trim():t.trim()},"cleanupLabel"),tC=(0,a.eW)(()=>"divider-id-"+ ++tn,"getDividerId"),tD=(0,a.eW)(function(t,e=""){tt.has(t)||tt.set(t,{id:t,styles:[],textStyles:[]});let s=tt.get(t);null!=e&&e.split(",").forEach(t=>{let e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(H).exec(t)){let t=e.replace(X,"bgFill").replace(H,X);s.textStyles.push(t)}s.styles.push(e)})},"addStyleClass"),tv=(0,a.eW)(function(){return tt},"getClasses"),tL=(0,a.eW)(function(t,e){t.split(",").forEach(function(t){let s=ty(t);if(void 0===s){let e=t.trim();td(e),s=ty(e)}s.classes.push(e)})},"setCssClass"),tA=(0,a.eW)(function(t,e){let s=ty(t);void 0!==s&&s.styles.push(e)},"setStyle"),tI=(0,a.eW)(function(t,e){let s=ty(t);void 0!==s&&s.textStyles.push(e)},"setTextStyle"),tW=(0,a.eW)(()=>Z,"getDirection"),tw=(0,a.eW)(t=>{Z=t},"setDirection"),tO=(0,a.eW)(t=>t&&":"===t[0]?t.substr(1).trim():t.trim(),"trimColon"),tN=(0,a.eW)(()=>{let t=(0,a.nV)();return{nodes:K,edges:q,other:{},config:t,direction:O(th())}},"getData"),tR={getConfig:(0,a.eW)(()=>(0,a.nV)().state,"getConfig"),getData:tN,addState:td,clear:tp,getState:ty,getStates:tg,getRelations:tS,getClasses:tv,getDirection:tW,addRelation:tE,getDividerId:tC,setDirection:tw,cleanupLabel:t$,lineType:{LINE:0,DOTTED_LINE:1},relationType:{AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},logDocuments:tf,getRootDoc:tl,setRootDoc:to,getRootDocV2:th,extract:tu,trimColon:tO,getAccTitle:a.eu,setAccTitle:a.GN,getAccDescription:a.Mx,setAccDescription:a.U$,addStyleClass:tD,setCssClass:tL,addDescription:tx,setDiagramTitle:a.g2,getDiagramTitle:a.Kr},tB=(0,a.eW)(t=>`
2
+ defs #statediagram-barbEnd {
3
+ fill: ${t.transitionColor};
4
+ stroke: ${t.transitionColor};
5
+ }
6
+ g.stateGroup text {
7
+ fill: ${t.nodeBorder};
8
+ stroke: none;
9
+ font-size: 10px;
10
+ }
11
+ g.stateGroup text {
12
+ fill: ${t.textColor};
13
+ stroke: none;
14
+ font-size: 10px;
15
+
16
+ }
17
+ g.stateGroup .state-title {
18
+ font-weight: bolder;
19
+ fill: ${t.stateLabelColor};
20
+ }
21
+
22
+ g.stateGroup rect {
23
+ fill: ${t.mainBkg};
24
+ stroke: ${t.nodeBorder};
25
+ }
26
+
27
+ g.stateGroup line {
28
+ stroke: ${t.lineColor};
29
+ stroke-width: 1;
30
+ }
31
+
32
+ .transition {
33
+ stroke: ${t.transitionColor};
34
+ stroke-width: 1;
35
+ fill: none;
36
+ }
37
+
38
+ .stateGroup .composit {
39
+ fill: ${t.background};
40
+ border-bottom: 1px
41
+ }
42
+
43
+ .stateGroup .alt-composit {
44
+ fill: #e0e0e0;
45
+ border-bottom: 1px
46
+ }
47
+
48
+ .state-note {
49
+ stroke: ${t.noteBorderColor};
50
+ fill: ${t.noteBkgColor};
51
+
52
+ text {
53
+ fill: ${t.noteTextColor};
54
+ stroke: none;
55
+ font-size: 10px;
56
+ }
57
+ }
58
+
59
+ .stateLabel .box {
60
+ stroke: none;
61
+ stroke-width: 0;
62
+ fill: ${t.mainBkg};
63
+ opacity: 0.5;
64
+ }
65
+
66
+ .edgeLabel .label rect {
67
+ fill: ${t.labelBackgroundColor};
68
+ opacity: 0.5;
69
+ }
70
+ .edgeLabel {
71
+ background-color: ${t.edgeLabelBackground};
72
+ p {
73
+ background-color: ${t.edgeLabelBackground};
74
+ }
75
+ rect {
76
+ opacity: 0.5;
77
+ background-color: ${t.edgeLabelBackground};
78
+ fill: ${t.edgeLabelBackground};
79
+ }
80
+ text-align: center;
81
+ }
82
+ .edgeLabel .label text {
83
+ fill: ${t.transitionLabelColor||t.tertiaryTextColor};
84
+ }
85
+ .label div .edgeLabel {
86
+ color: ${t.transitionLabelColor||t.tertiaryTextColor};
87
+ }
88
+
89
+ .stateLabel text {
90
+ fill: ${t.stateLabelColor};
91
+ font-size: 10px;
92
+ font-weight: bold;
93
+ }
94
+
95
+ .node circle.state-start {
96
+ fill: ${t.specialStateColor};
97
+ stroke: ${t.specialStateColor};
98
+ }
99
+
100
+ .node .fork-join {
101
+ fill: ${t.specialStateColor};
102
+ stroke: ${t.specialStateColor};
103
+ }
104
+
105
+ .node circle.state-end {
106
+ fill: ${t.innerEndBackground};
107
+ stroke: ${t.background};
108
+ stroke-width: 1.5
109
+ }
110
+ .end-state-inner {
111
+ fill: ${t.compositeBackground||t.background};
112
+ // stroke: ${t.background};
113
+ stroke-width: 1.5
114
+ }
115
+
116
+ .node rect {
117
+ fill: ${t.stateBkg||t.mainBkg};
118
+ stroke: ${t.stateBorder||t.nodeBorder};
119
+ stroke-width: 1px;
120
+ }
121
+ .node polygon {
122
+ fill: ${t.mainBkg};
123
+ stroke: ${t.stateBorder||t.nodeBorder};;
124
+ stroke-width: 1px;
125
+ }
126
+ #statediagram-barbEnd {
127
+ fill: ${t.lineColor};
128
+ }
129
+
130
+ .statediagram-cluster rect {
131
+ fill: ${t.compositeTitleBackground};
132
+ stroke: ${t.stateBorder||t.nodeBorder};
133
+ stroke-width: 1px;
134
+ }
135
+
136
+ .cluster-label, .nodeLabel {
137
+ color: ${t.stateLabelColor};
138
+ // line-height: 1;
139
+ }
140
+
141
+ .statediagram-cluster rect.outer {
142
+ rx: 5px;
143
+ ry: 5px;
144
+ }
145
+ .statediagram-state .divider {
146
+ stroke: ${t.stateBorder||t.nodeBorder};
147
+ }
148
+
149
+ .statediagram-state .title-state {
150
+ rx: 5px;
151
+ ry: 5px;
152
+ }
153
+ .statediagram-cluster.statediagram-cluster .inner {
154
+ fill: ${t.compositeBackground||t.background};
155
+ }
156
+ .statediagram-cluster.statediagram-cluster-alt .inner {
157
+ fill: ${t.altBackground?t.altBackground:"#efefef"};
158
+ }
159
+
160
+ .statediagram-cluster .inner {
161
+ rx:0;
162
+ ry:0;
163
+ }
164
+
165
+ .statediagram-state rect.basic {
166
+ rx: 5px;
167
+ ry: 5px;
168
+ }
169
+ .statediagram-state rect.divider {
170
+ stroke-dasharray: 10,10;
171
+ fill: ${t.altBackground?t.altBackground:"#efefef"};
172
+ }
173
+
174
+ .note-edge {
175
+ stroke-dasharray: 5;
176
+ }
177
+
178
+ .statediagram-note rect {
179
+ fill: ${t.noteBkgColor};
180
+ stroke: ${t.noteBorderColor};
181
+ stroke-width: 1px;
182
+ rx: 0;
183
+ ry: 0;
184
+ }
185
+ .statediagram-note rect {
186
+ fill: ${t.noteBkgColor};
187
+ stroke: ${t.noteBorderColor};
188
+ stroke-width: 1px;
189
+ rx: 0;
190
+ ry: 0;
191
+ }
192
+
193
+ .statediagram-note text {
194
+ fill: ${t.noteTextColor};
195
+ }
196
+
197
+ .statediagram-note .nodeLabel {
198
+ color: ${t.noteTextColor};
199
+ }
200
+ .statediagram .edgeLabel {
201
+ color: red; // ${t.noteTextColor};
202
+ }
203
+
204
+ #dependencyStart, #dependencyEnd {
205
+ fill: ${t.lineColor};
206
+ stroke: ${t.lineColor};
207
+ stroke-width: 1;
208
+ }
209
+
210
+ .statediagramTitleText {
211
+ text-anchor: middle;
212
+ font-size: 18px;
213
+ fill: ${t.textColor};
214
+ }
215
+ `,"getStyles")}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4872],{14872:function(t,e,a){a.d(e,{diagram:function(){return z}});var n,i=a(24650);a(3434),a(91936),a(21783),a(65903),a(66384),a(19529),a(75794),a(1816);var r=a(86954),d=a(30086),s=a(15440),o=a(56434),g=a(68406),l={},p=(0,d.eW)((t,e)=>{l[t]=e},"set"),h=(t=>l[t],(0,d.eW)(()=>Object.keys(l),"keys")),c=(()=>h().length,(0,d.eW)(t=>t.append("circle").attr("class","start-state").attr("r",(0,d.nV)().state.sizeUnit).attr("cx",(0,d.nV)().state.padding+(0,d.nV)().state.sizeUnit).attr("cy",(0,d.nV)().state.padding+(0,d.nV)().state.sizeUnit),"drawStartState")),x=(0,d.eW)(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",(0,d.nV)().state.textHeight).attr("class","divider").attr("x2",2*(0,d.nV)().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),V=(0,d.eW)((t,e)=>{let a=t.append("text").attr("x",2*(0,d.nV)().state.padding).attr("y",(0,d.nV)().state.textHeight+2*(0,d.nV)().state.padding).attr("font-size",(0,d.nV)().state.fontSize).attr("class","state-title").text(e.id),n=a.node().getBBox();return t.insert("rect",":first-child").attr("x",(0,d.nV)().state.padding).attr("y",(0,d.nV)().state.padding).attr("width",n.width+2*(0,d.nV)().state.padding).attr("height",n.height+2*(0,d.nV)().state.padding).attr("rx",(0,d.nV)().state.radius),a},"drawSimpleState"),u=(0,d.eW)((t,e)=>{let a=(0,d.eW)(function(t,e,a){let n=t.append("tspan").attr("x",2*(0,d.nV)().state.padding).text(e);a||n.attr("dy",(0,d.nV)().state.textHeight)},"addTspan"),n=t.append("text").attr("x",2*(0,d.nV)().state.padding).attr("y",(0,d.nV)().state.textHeight+1.3*(0,d.nV)().state.padding).attr("font-size",(0,d.nV)().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),i=n.height,r=t.append("text").attr("x",(0,d.nV)().state.padding).attr("y",i+.4*(0,d.nV)().state.padding+(0,d.nV)().state.dividerMargin+(0,d.nV)().state.textHeight).attr("class","state-description"),s=!0,o=!0;e.descriptions.forEach(function(t){s||(a(r,t,o),o=!1),s=!1});let g=t.append("line").attr("x1",(0,d.nV)().state.padding).attr("y1",(0,d.nV)().state.padding+i+(0,d.nV)().state.dividerMargin/2).attr("y2",(0,d.nV)().state.padding+i+(0,d.nV)().state.dividerMargin/2).attr("class","descr-divider"),l=r.node().getBBox(),p=Math.max(l.width,n.width);return g.attr("x2",p+3*(0,d.nV)().state.padding),t.insert("rect",":first-child").attr("x",(0,d.nV)().state.padding).attr("y",(0,d.nV)().state.padding).attr("width",p+2*(0,d.nV)().state.padding).attr("height",l.height+i+2*(0,d.nV)().state.padding).attr("rx",(0,d.nV)().state.radius),t},"drawDescrState"),f=(0,d.eW)((t,e,a)=>{let n;let i=(0,d.nV)().state.padding,r=2*(0,d.nV)().state.padding,s=t.node().getBBox(),o=s.width,g=s.x,l=t.append("text").attr("x",0).attr("y",(0,d.nV)().state.titleShift).attr("font-size",(0,d.nV)().state.fontSize).attr("class","state-title").text(e.id),p=l.node().getBBox().width+r,h=Math.max(p,o);h===o&&(h+=r);let c=t.node().getBBox();e.doc,n=g-i,p>o&&(n=(o-h)/2+i),Math.abs(g-c.x)<i&&p>o&&(n=g-(p-o)/2);let x=1-(0,d.nV)().state.textHeight;return t.insert("rect",":first-child").attr("x",n).attr("y",x).attr("class",a?"alt-composit":"composit").attr("width",h).attr("height",c.height+(0,d.nV)().state.textHeight+(0,d.nV)().state.titleShift+1).attr("rx","0"),l.attr("x",n+i),p<=o&&l.attr("x",g+(h-r)/2-p/2+i),t.insert("rect",":first-child").attr("x",n).attr("y",(0,d.nV)().state.titleShift-(0,d.nV)().state.textHeight-(0,d.nV)().state.padding).attr("width",h).attr("height",3*(0,d.nV)().state.textHeight).attr("rx",(0,d.nV)().state.radius),t.insert("rect",":first-child").attr("x",n).attr("y",(0,d.nV)().state.titleShift-(0,d.nV)().state.textHeight-(0,d.nV)().state.padding).attr("width",h).attr("height",c.height+3+2*(0,d.nV)().state.textHeight).attr("rx",(0,d.nV)().state.radius),t},"addTitleAndBox"),y=(0,d.eW)(t=>(t.append("circle").attr("class","end-state-outer").attr("r",(0,d.nV)().state.sizeUnit+(0,d.nV)().state.miniPadding).attr("cx",(0,d.nV)().state.padding+(0,d.nV)().state.sizeUnit+(0,d.nV)().state.miniPadding).attr("cy",(0,d.nV)().state.padding+(0,d.nV)().state.sizeUnit+(0,d.nV)().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",(0,d.nV)().state.sizeUnit).attr("cx",(0,d.nV)().state.padding+(0,d.nV)().state.sizeUnit+2).attr("cy",(0,d.nV)().state.padding+(0,d.nV)().state.sizeUnit+2)),"drawEndState"),w=(0,d.eW)((t,e)=>{let a=(0,d.nV)().state.forkWidth,n=(0,d.nV)().state.forkHeight;if(e.parentId){let t=a;a=n,n=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",a).attr("height",n).attr("x",(0,d.nV)().state.padding).attr("y",(0,d.nV)().state.padding)},"drawForkJoinState"),b=(0,d.eW)((t,e,a,n)=>{let i=0,r=n.append("text");r.style("text-anchor","start"),r.attr("class","noteText");let s=t.replace(/\r\n/g,"<br/>"),o=(s=s.replace(/\n/g,"<br/>")).split(d.SY.lineBreakRegex),g=1.25*(0,d.nV)().state.noteMargin;for(let t of o){let n=t.trim();if(n.length>0){let t=r.append("tspan");t.text(n),0===g&&(g+=t.node().getBBox().height),i+=g,t.attr("x",e+(0,d.nV)().state.noteMargin),t.attr("y",a+i+1.25*(0,d.nV)().state.noteMargin)}}return{textWidth:r.node().getBBox().width,textHeight:i}},"_drawLongText"),B=(0,d.eW)((t,e)=>{e.attr("class","state-note");let a=e.append("rect").attr("x",0).attr("y",(0,d.nV)().state.padding),{textWidth:n,textHeight:i}=b(t,0,0,e.append("g"));return a.attr("height",i+2*(0,d.nV)().state.noteMargin),a.attr("width",n+2*(0,d.nV)().state.noteMargin),a},"drawNote"),m=(0,d.eW)(function(t,e){let a=e.id,n={id:a,label:e.id,width:0,height:0},i=t.append("g").attr("id",a).attr("class","stateGroup");"start"===e.type&&c(i),"end"===e.type&&y(i),("fork"===e.type||"join"===e.type)&&w(i,e),"note"===e.type&&B(e.note.text,i),"divider"===e.type&&x(i),"default"===e.type&&0===e.descriptions.length&&V(i,e),"default"===e.type&&e.descriptions.length>0&&u(i,e);let r=i.node().getBBox();return n.width=r.width+2*(0,d.nV)().state.padding,n.height=r.height+2*(0,d.nV)().state.padding,p(a,n),n},"drawState"),k=0,M=(0,d.eW)(function(t,e,a){let n=(0,d.eW)(function(t){switch(t){case i.bH.relationType.AGGREGATION:return"aggregation";case i.bH.relationType.EXTENSION:return"extension";case i.bH.relationType.COMPOSITION:return"composition";case i.bH.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(t=>!Number.isNaN(t.y));let o=e.points,g=(0,s.jvg)().x(function(t){return t.x}).y(function(t){return t.y}).curve(s.$0Z),l=t.append("path").attr("d",g(o)).attr("id","edge"+k).attr("class","transition"),p="";if((0,d.nV)().state.arrowMarkerAbsolute&&(p=(p=(p=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)")),l.attr("marker-end","url("+p+"#"+n(i.bH.relationType.DEPENDENCY)+"End)"),void 0!==a.title){let n=t.append("g").attr("class","stateLabel"),{x:i,y:s}=r.w8.calcLabelPosition(e.points),o=d.SY.getRows(a.title),g=0,l=[],p=0,h=0;for(let t=0;t<=o.length;t++){let e=n.append("text").attr("text-anchor","middle").text(o[t]).attr("x",i).attr("y",s+g),a=e.node().getBBox();p=Math.max(p,a.width),h=Math.min(h,a.x),d.cM.info(a.x,i,s+g),0===g&&(g=e.node().getBBox().height,d.cM.info("Title height",g,s)),l.push(e)}let c=g*o.length;if(o.length>1){let t=(o.length-1)*g*.5;l.forEach((e,a)=>e.attr("y",s+a*g-t)),c=g*o.length}let x=n.node().getBBox();n.insert("rect",":first-child").attr("class","box").attr("x",i-p/2-(0,d.nV)().state.padding/2).attr("y",s-c/2-(0,d.nV)().state.padding/2-3.5).attr("width",p+(0,d.nV)().state.padding).attr("height",c+(0,d.nV)().state.padding),d.cM.info(x)}k++},"drawEdge"),S={},E=(0,d.eW)(function(){},"setConf"),N=(0,d.eW)(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),W=(0,d.eW)(function(t,e,a,i){let r;n=(0,d.nV)().state;let o=(0,d.nV)().securityLevel;"sandbox"===o&&(r=(0,s.Ys)("#i"+e));let g="sandbox"===o?(0,s.Ys)(r.nodes()[0].contentDocument.body):(0,s.Ys)("body"),l="sandbox"===o?r.nodes()[0].contentDocument:document;d.cM.debug("Rendering diagram "+t);let p=g.select(`[id='${e}']`);N(p),H(i.db.getRootDoc(),p,void 0,!1,g,l,i);let h=n.padding,c=p.node().getBBox(),x=c.width+2*h,V=c.height+2*h;(0,d.v2)(p,V,1.75*x,n.useMaxWidth),p.attr("viewBox",`${c.x-n.padding} ${c.y-n.padding} `+x+" "+V)},"draw"),v=(0,d.eW)(t=>t?t.length*n.fontSizeFactor:1,"getLabelWidth"),H=(0,d.eW)((t,e,a,i,r,s,l)=>{let p;let h=new g.k({compound:!0,multigraph:!0}),c=!0;for(p=0;p<t.length;p++)if("relation"===t[p].stmt){c=!1;break}a?h.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:c?1:n.edgeLengthFactor,nodeSep:c?1:50,isMultiGraph:!0}):h.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:c?1:n.edgeLengthFactor,nodeSep:c?1:50,ranker:"tight-tree",isMultiGraph:!0}),h.setDefaultEdgeLabel(function(){return{}}),l.db.extract(t);let x=l.db.getStates(),V=l.db.getRelations();for(let t of Object.keys(x)){let d;let o=x[t];if(a&&(o.parentId=a),o.doc){let t=e.append("g").attr("id",o.id).attr("class","stateGroup");d=H(o.doc,t,o.id,!i,r,s,l);{let e=(t=f(t,o,i)).node().getBBox();d.width=e.width,d.height=e.height+n.padding/2,S[o.id]={y:n.compositTitleSize}}}else d=m(e,o,h);if(o.note){let t=m(e,{descriptions:[],id:o.id+"-note",note:o.note,type:"note"},h);"left of"===o.note.position?(h.setNode(d.id+"-note",t),h.setNode(d.id,d)):(h.setNode(d.id,d),h.setNode(d.id+"-note",t)),h.setParent(d.id,d.id+"-group"),h.setParent(d.id+"-note",d.id+"-group")}else h.setNode(d.id,d)}d.cM.debug("Count=",h.nodeCount(),h);let u=0;V.forEach(function(t){u++,d.cM.debug("Setting edge",t),h.setEdge(t.id1,t.id2,{relation:t,width:v(t.title),height:n.labelHeight*d.SY.getRows(t.title).length,labelpos:"c"},"id"+u)}),(0,o.bK)(h),d.cM.debug("Graph after layout",h.nodes());let y=e.node();h.nodes().forEach(function(t){void 0!==t&&void 0!==h.node(t)?(d.cM.warn("Node "+t+": "+JSON.stringify(h.node(t))),r.select("#"+y.id+" #"+t).attr("transform","translate("+(h.node(t).x-h.node(t).width/2)+","+(h.node(t).y+(S[t]?S[t].y:0)-h.node(t).height/2)+" )"),r.select("#"+y.id+" #"+t).attr("data-x-shift",h.node(t).x-h.node(t).width/2),s.querySelectorAll("#"+y.id+" #"+t+" .divider").forEach(t=>{let e=t.parentElement,a=0,n=0;e&&(e.parentElement&&(a=e.parentElement.getBBox().width),Number.isNaN(n=parseInt(e.getAttribute("data-x-shift"),10))&&(n=0)),t.setAttribute("x1",0-n+8),t.setAttribute("x2",a-n-8)})):d.cM.debug("No Node "+t+": "+JSON.stringify(h.node(t)))});let w=y.getBBox();h.edges().forEach(function(t){void 0!==t&&void 0!==h.edge(t)&&(d.cM.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(h.edge(t))),M(e,h.edge(t),h.edge(t).relation))}),w=y.getBBox();let b={id:a||"root",label:a||"root",width:0,height:0};return b.width=w.width+2*n.padding,b.height=w.height+2*n.padding,d.cM.debug("Doc rendered",b,h),b},"renderDoc"),z={parser:i.J8,db:i.bH,renderer:{setConf:E,draw:W},styles:i.Ee,init:(0,d.eW)(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,i.bH.clear()},"init")}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4986],{74986:function(e,t,a){"use strict";a.d(t,{Z:function(){return ep}});var n=a(57437),s=a(42501),o=a.n(s),l=a(2265),r=a(91499),c=a.n(r),i=a(19983),d=a(13506),h=a.n(d),u=a(34040);a(2446);var m=a(5147),g=a(45178),f=a(66070),p=a(69304),x=a(57054),v=a(18848),j=a(42225);let w=new i.Z({html:!0,linkify:!0,typographer:!0});function b(e){let t=(0,j.Le)(e.title||".txt","w-6 h-6 text-muted-foreground inline-flex mr-2"),a=e.title.split("/").pop()||e.title,s=function(e){let t=["org","md","markdown"].includes(e.title.split(".").pop()||"")?e.content.split("\n").slice(1).join("\n"):e.content;return e.showFullContent?v.Z.sanitize(w.render(t)):v.Z.sanitize(t)}(e),[o,r]=(0,l.useState)(!1);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(x.J2,{open:o&&!e.showFullContent,onOpenChange:r,children:[(0,n.jsx)(x.xo,{asChild:!0,children:(0,n.jsxs)(f.Zb,{onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),className:"".concat(e.showFullContent?"w-auto":"w-[200px]"," overflow-hidden break-words text-balance rounded-lg border-none p-2 bg-muted"),children:[(0,n.jsxs)("h3",{className:"".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground}"),children:[t,e.showFullContent?e.title:a]}),(0,n.jsx)("p",{className:"text-sm ".concat(e.showFullContent?"overflow-x-auto block":"overflow-hidden line-clamp-2"),dangerouslySetInnerHTML:{__html:s}})]})}),(0,n.jsx)(x.yk,{className:"w-[400px] mx-2",children:(0,n.jsxs)(f.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,n.jsxs)("h3",{className:"line-clamp-2 text-muted-foreground}",children:[t,e.title]}),(0,n.jsx)("p",{className:"border-t mt-1 pt-1 text-sm overflow-hidden line-clamp-5",dangerouslySetInnerHTML:{__html:s}})]})})]})})}function y(e){var t,a,s,o,r,c;let i=(0,j.Le)(".py","!w-4 h-4 text-muted-foreground flex-shrink-0"),d=v.Z.sanitize(e.code),[h,u]=(0,l.useState)(!1),[g,p]=(0,l.useState)(!1),w=e=>{let t="text/plain",a=e.b64_data;e.filename.match(/\.(png|jpg|jpeg|webp)$/)?(t="image/".concat(e.filename.split(".").pop()),a=atob(e.b64_data)):e.filename.endsWith(".json")?t="application/json":e.filename.endsWith(".csv")&&(t="text/csv");let n=new ArrayBuffer(a.length),s=new Uint8Array(n);for(let e=0;e<a.length;e++)s[e]=a.charCodeAt(e);let o=new Blob([n],{type:t}),l=URL.createObjectURL(o),r=document.createElement("a");r.href=l,r.download=e.filename,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(l)},b=(t,a)=>(null==t?void 0:t.length)==0?null:(0,n.jsx)("div",{className:"".concat(a||e.showFullContent?"border-t mt-1 pt-1":void 0),children:t.slice(0,e.showFullContent?void 0:1).map((t,s)=>(0,n.jsxs)("div",{children:[(0,n.jsxs)("h4",{className:"text-sm text-muted-foreground flex items-center",children:[(0,n.jsx)("span",{className:"overflow-hidden mr-2 font-bold ".concat(e.showFullContent?void 0:"line-clamp-1"),children:t.filename}),(0,n.jsx)("button",{className:"".concat(a?"hidden":void 0),onClick:e=>{e.preventDefault(),w(t)},onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),title:"Download file: ".concat(t.filename),children:(0,n.jsx)(m.b,{className:"w-4 h-4",weight:g?"fill":"regular"})})]}),t.filename.match(/\.(txt|org|md|csv|json)$/)?(0,n.jsx)("pre",{className:"".concat(e.showFullContent?"block":"line-clamp-2"," text-sm mt-1 p-1 bg-background rounded overflow-x-auto"),children:t.b64_data}):t.filename.match(/\.(png|jpg|jpeg|webp)$/)?(0,n.jsx)("img",{src:"data:image/".concat(t.filename.split(".").pop(),";base64,").concat(t.b64_data),alt:t.filename,className:"mt-1 max-h-32 rounded"}):null]},"".concat(t.filename,"-").concat(s)))});return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(x.J2,{open:h&&!e.showFullContent,onOpenChange:u,children:[(0,n.jsx)(x.xo,{asChild:!0,children:(0,n.jsx)(f.Zb,{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:"".concat(e.showFullContent?"w-auto":"w-[200px]"," overflow-hidden break-words text-balance rounded-lg border-none p-2 bg-muted"),children:(0,n.jsxs)("div",{className:"flex flex-col px-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[i,(0,n.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(t=e.output_files)||void 0===t?void 0:t.length)>0?"artifacts":""]})]}),(0,n.jsx)("pre",{className:"text-xs pb-2 ".concat(e.showFullContent?"block overflow-x-auto":(null===(a=e.output_files)||void 0===a?void 0:a.length)>0?"hidden":"overflow-hidden line-clamp-3"),children:d}),(null===(s=e.output_files)||void 0===s?void 0:s.length)>0&&b(e.output_files,!1)]})})}),(0,n.jsx)(x.yk,{className:"w-[400px] mx-2",children:(0,n.jsxs)(f.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[i,(0,n.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(o=e.output_files)||void 0===o?void 0:o.length)>0?"artifact":""]})]}),(null===(r=e.output_files)||void 0===r?void 0:r.length)>0&&b(null===(c=e.output_files)||void 0===c?void 0:c.slice(0,1),!0)||(0,n.jsx)("pre",{className:"text-xs border-t mt-1 pt-1 verflow-hidden line-clamp-10",children:d})]})})]})})}function C(e){let[t,a]=(0,l.useState)(!1);if(!e.link||e.link.split(" ").length>1)return null;let s="https://www.google.com/s2/favicons?domain=globe",o="unknown";try{o=new URL(e.link).hostname,s="https://www.google.com/s2/favicons?domain=".concat(o)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(x.J2,{open:t&&!e.showFullContent,onOpenChange:a,children:[(0,n.jsx)(x.xo,{asChild:!0,children:(0,n.jsx)(f.Zb,{onMouseEnter:()=>{a(!0)},onMouseLeave:()=>{a(!1)},className:"".concat(e.showFullContent?"w-auto":"w-[200px]"," overflow-hidden break-words text-balance rounded-lg border-none p-2 bg-muted"),children:(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline px-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:o})]}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," font-bold"),children:e.title}),(0,n.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-2"),children:e.description})]})})})}),(0,n.jsx)(x.yk,{className:"w-[400px] mx-2",children:(0,n.jsx)(f.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none",children:(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline px-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," text-muted-foreground flex-grow"),children:o})]}),(0,n.jsx)("h3",{className:"border-t mt-1 pt-1 overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," font-bold"),children:e.title}),(0,n.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-5"),children:e.description})]})})})})]})})}function M(e){let[t,a]=(0,l.useState)(3);(0,l.useEffect)(()=>{a(e.isMobileWidth?1:3)},[e.isMobileWidth]);let s=e.codeReferenceCardData.slice(0,t),o=e.notesReferenceCardData.slice(0,t-s.length),r=o.length+s.length<t?e.onlineReferenceCardData.slice(0,t-s.length-o.length):[],c=e.notesReferenceCardData.length>0||e.codeReferenceCardData.length>0||e.onlineReferenceCardData.length>0,i=e.notesReferenceCardData.length+e.codeReferenceCardData.length+e.onlineReferenceCardData.length;return 0===i?null:(0,n.jsxs)("div",{className:"pt-0 px-4 pb-4 md:px-6",children:[(0,n.jsxs)("h3",{className:"inline-flex items-center",children:["References",(0,n.jsxs)("p",{className:"text-gray-400 m-2",children:[i," sources"]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[s.map((e,t)=>(0,l.createElement)(y,{showFullContent:!1,...e,key:"code-".concat(t)})),o.map((e,t)=>(0,l.createElement)(b,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),r.map((e,t)=>(0,l.createElement)(C,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),c&&(0,n.jsx)(N,{notesReferenceCardData:e.notesReferenceCardData,onlineReferenceCardData:e.onlineReferenceCardData,codeReferenceCardData:e.codeReferenceCardData})]})]})}function N(e){return e.notesReferenceCardData||e.onlineReferenceCardData?(0,n.jsxs)(p.yo,{children:[(0,n.jsxs)(p.aM,{className:"text-balance w-auto md:w-[200px] justify-start overflow-hidden break-words p-0 bg-transparent border-none text-gray-400 align-middle items-center !m-2 inline-flex",children:["View references",(0,n.jsx)(g.o,{className:"m-1"})]}),(0,n.jsxs)(p.ue,{className:"overflow-y-scroll",children:[(0,n.jsxs)(p.Tu,{children:[(0,n.jsx)(p.bC,{children:"References"}),(0,n.jsx)(p.Ei,{children:"View all references for this response"})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[e.codeReferenceCardData.map((e,t)=>(0,l.createElement)(y,{showFullContent:!0,...e,key:"code-".concat(t)})),e.notesReferenceCardData.map((e,t)=>(0,l.createElement)(b,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)})),e.onlineReferenceCardData.map((e,t)=>(0,l.createElement)(C,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)}))]})]})]}):null}var k=a(59199),_=a(62467),R=a(93893),E=a(2452),S=a(22105),I=a(52938),T=a(68950),L=a(63329),F=a(35099),D=a(46561),O=a(33758),B=a(58717),q=a(86018),U=a(51059),A=a(38513),Z=a(46732),z=a(47924),H=a(19841),W=a(88435),P=a(14308),G=a(84671),$=a(36663);let J=(0,a(30166).default)(()=>Promise.all([a.e(6555),a.e(7293),a.e(3727),a.e(9597)]).then(a.bind(a,99597)).then(e=>e.default),{loadableGenerated:{webpack:()=>[99597]},ssr:!1});function V(e){return(0,n.jsx)(l.Suspense,{fallback:(0,n.jsx)(P.Z,{}),children:(0,n.jsx)(J,{data:e.data})})}var Q=a(26110),K=a(49027),Y=a(7436),X=a(19378),ee=a(50656),et=a(75419),ea=a(41648),en=a(62869),es=e=>{let{chart:t}=e,[a,s]=(0,l.useState)(null),[o]=(0,l.useState)("mermaid-chart-".concat(Math.random().toString(12).substring(7))),r=(0,l.useRef)(null);(0,l.useEffect)(()=>{ee.Z.initialize({startOnLoad:!1}),ee.Z.parseError=e=>{let t;console.error("Mermaid errors:",e);try{t="string"==typeof e?JSON.parse(e):e}catch(a){t=(null==e?void 0:e.toString())||"Unknown error"}console.log("Mermaid error message:",t),"element is null"!==t.str?s("Something went wrong while rendering the diagram. Please try again later or downvote the message if the issue persists."):s(null)},ee.Z.contentLoaded()},[]);let c=async()=>{if(r.current)try{var e;let t=r.current.querySelector("svg");if(!t)throw Error("No SVG found");let[,,a,n]=(null===(e=t.getAttribute("viewBox"))||void 0===e?void 0:e.split(" ").map(Number))||[0,0,0,0],s=document.createElement("canvas");s.width=2*a,s.height=2*n;let o=s.getContext("2d");if(!o)throw Error("Failed to get canvas context");let l=new XMLSerializer().serializeToString(t),c=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(c),d=new Image;d.src=i,await new Promise((e,t)=>{d.onload=()=>{o.scale(2,2),o.drawImage(d,0,0,a,n),s.toBlob(a=>{if(!a){t(Error("Failed to create blob"));return}let n=URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download="mermaid-diagram-".concat(Date.now(),".png"),s.click(),URL.revokeObjectURL(n),URL.revokeObjectURL(i),e(!0)},"image/png")},d.onerror=()=>t(Error("Failed to load SVG"))})}catch(e){console.error("Error exporting diagram:",e),s("Failed to export diagram")}};return(0,l.useEffect)(()=>{r.current&&(r.current.removeAttribute("data-processed"),ee.Z.run({nodes:[r.current]}).then(()=>{s(null)}).catch(e=>{let t;try{t="string"==typeof e?JSON.parse(e):e}catch(a){t=(null==e?void 0:e.toString())||"Unknown error"}console.log("Mermaid error message:",t),"element is null"!==t.str?s("Something went wrong while rendering the diagram. Please try again later or downvote the message if the issue persists."):s(null)}))},[t]),(0,n.jsxs)("div",{children:[a?(0,n.jsxs)("div",{className:"flex items-center gap-2 bg-red-100 border border-red-500 rounded-md p-3 mt-3 text-red-900 text-sm",children:[(0,n.jsx)(et.k,{className:"w-12 h-12"}),(0,n.jsxs)("span",{children:["Error rendering diagram: ",a]})]}):(0,n.jsx)("div",{id:o,ref:r,className:"mermaid",style:{width:"auto",height:"auto",boxSizing:"border-box",overflow:"auto"},children:t}),!a&&(0,n.jsxs)(en.z,{onClick:c,variant:"secondary",className:"mt-3",children:[(0,n.jsx)(ea.U,{className:"w-5 h-5"}),"Export as PNG"]})]})};let eo=new i.Z({html:!0,linkify:!0,typographer:!0});function el(e,t,a){fetch("/api/chat/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uquery:e,kquery:t,sentiment:a})})}function er(e){let{uquery:t,kquery:a}=e,[s,o]=(0,l.useState)(null);return(0,l.useEffect)(()=>{null!==s&&setTimeout(()=>{o(null)},2e3)},[s]),(0,n.jsxs)("div",{className:"".concat(c().feedbackButtons," flex align-middle justify-center items-center"),children:[(0,n.jsx)("button",{title:"Like",className:c().thumbsUpButton,disabled:null!==s,onClick:()=>{el(t,a,"positive"),o(!0)},children:!0===s?(0,n.jsx)(_.V,{alt:"Liked Message",className:"text-green-500",weight:"fill"}):(0,n.jsx)(_.V,{alt:"Like Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),(0,n.jsx)("button",{title:"Dislike",className:c().thumbsDownButton,disabled:null!==s,onClick:()=>{el(t,a,"negative"),o(!1)},children:!1===s?(0,n.jsx)(R.L,{alt:"Disliked Message",className:"text-red-500",weight:"fill"}):(0,n.jsx)(R.L,{alt:"Dislike Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})})]})}function ec(e){let t=e.message.match(/\*\*(.*)\*\*/),a=function(e,t){let a=e.toLowerCase(),s="inline mt-1 mr-2 ".concat(t," h-4 w-4");return a.includes("understanding")?(0,n.jsx)(E.a,{className:"".concat(s)}):a.includes("generating")?(0,n.jsx)(S.Z,{className:"".concat(s)}):a.includes("tools")?(0,n.jsx)(I.v,{className:"".concat(s)}):a.includes("notes")?(0,n.jsx)(T.g,{className:"".concat(s)}):a.includes("read")?(0,n.jsx)(L.f,{className:"".concat(s)}):a.includes("search")?(0,n.jsx)(F.Y,{className:"".concat(s)}):a.includes("summary")||a.includes("summarize")||a.includes("enhanc")?(0,n.jsx)(D.u,{className:"".concat(s)}):a.includes("diagram")?(0,n.jsx)(O.j,{className:"".concat(s)}):a.includes("paint")?(0,n.jsx)(B.Y,{className:"".concat(s)}):a.includes("code")?(0,n.jsx)(q.E,{className:"".concat(s)}):(0,n.jsx)(E.a,{className:"".concat(s)})}(t?t[1]:"",e.primary?(0,G.oz)(e.agentColor):"text-gray-500"),s=v.Z.sanitize(eo.render(e.message));return s=s.replace(/<h[1-6].*?<\/h[1-6]>/g,""),(0,n.jsxs)("div",{className:"".concat(c().trainOfThoughtElement," break-words items-center ").concat(e.primary?"text-gray-400":"text-gray-300"," ").concat(c().trainOfThought," ").concat(e.primary?c().primary:""),children:[a,(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:s},className:"break-words"})]})}eo.use(h(),{inline:!0,code:!0});let ei=(0,l.forwardRef)((e,t)=>{var a,s;let o,r,i,d,h;let[m,g]=(0,l.useState)(!1),[f,p]=(0,l.useState)(!1),[x,w]=(0,l.useState)(""),[b,y]=(0,l.useState)(""),[C,N]=(0,l.useState)(!1),[_,R]=(0,l.useState)(!1),[E,S]=(0,l.useState)(""),[I,T]=(0,l.useState)(""),L=(0,l.useRef)(!1),F=(0,l.useRef)(null);async function D(){let t=e.chatMessage.message.match(/[^.!?]+[.!?]*/g)||[];if(!t||0===t.length||!t[0])return;N(!0);let a=O(t[0]);for(let e=0;e<t.length&&!L.current;e++){let n=a;e<t.length-1&&(a=O(t[e+1]));try{let e=await n,t=URL.createObjectURL(e);await function(e){return new Promise((t,a)=>{let n=new Audio(e);n.onended=t,n.onerror=a,n.play()})}(t)}catch(e){console.error("Error:",e);break}}N(!1),R(!1)}async function O(e){let t=await fetch("/api/chat/speech?text=".concat(encodeURIComponent(e)),{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("Network response was not ok");return await t.blob()}(0,l.useEffect)(()=>{L.current=_},[_]),(0,l.useEffect)(()=>{let e=new MutationObserver((e,t)=>{if(F.current)for(let t of e)"childList"===t.type&&t.addedNodes.length>0&&(0,$.Z)(F.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]})});return F.current&&e.observe(F.current,{childList:!0}),()=>e.disconnect()},[F.current]),(0,l.useEffect)(()=>{let t=e.chatMessage.message;e.chatMessage.excalidrawDiagram&&S(e.chatMessage.excalidrawDiagram),e.chatMessage.mermaidjsDiagram&&T(e.chatMessage.mermaidjsDiagram),t=t.replace(/\\\(/g,"LEFTPAREN").replace(/\\\)/g,"RIGHTPAREN").replace(/\\\[/g,"LEFTBRACKET").replace(/\\\]/g,"RIGHTBRACKET"),t=(0,k.AQ)(t,e.chatMessage.codeContext),e.chatMessage.codeContext&&Object.entries(e.chatMessage.codeContext).forEach(e=>{var a;let[n,s]=e;null===(a=s.results.output_files)||void 0===a||a.forEach(e=>{(e.filename.endsWith(".png")||e.filename.endsWith(".jpg"))&&!t.includes("![".concat(e.filename,"]("))&&(t+="\n\n![".concat(e.filename,"](data:image/png;base64,").concat(e.b64_data,")"))})});let a=t,n=t;if(e.chatMessage.images&&e.chatMessage.images.length>0){let t=e.chatMessage.images.map(e=>{let t=e.startsWith("data%3Aimage")?decodeURIComponent(e):e;return v.Z.sanitize(t)}),s=t.map((e,t)=>"![uploaded image ".concat(t+1,"](").concat(e,")")).join("\n"),o=t.map((e,t)=>'<div class="'.concat(c().imageWrapper,'"><img src="').concat(e,'" alt="uploaded image ').concat(t+1,'" /></div>')).join(""),l='<div class="'.concat(c().imagesContainer,'">').concat(o,"</div>");a="".concat(s,"\n\n").concat(a),n="".concat(l).concat(n)}w(a);let s=eo.render(n);s=s.replace(/LEFTPAREN/g,"\\(").replace(/RIGHTPAREN/g,"\\)").replace(/LEFTBRACKET/g,"\\[").replace(/RIGHTBRACKET/g,"\\]"),y(v.Z.sanitize(s))},[e.chatMessage.message,e.chatMessage.images,e.chatMessage.intent]),(0,l.useEffect)(()=>{m&&setTimeout(()=>{g(!1)},2e3)},[m]),(0,l.useEffect)(()=>{F.current&&(F.current.querySelectorAll("pre > .hljs").forEach(e=>{if(!e.querySelector("".concat(c().codeCopyButton))){let t=document.createElement("button"),a=(0,n.jsx)(U.w,{size:24});(0,u.createRoot)(t).render(a),t.className="hljs ".concat(c().codeCopyButton),t.addEventListener("click",()=>{let a=e.textContent||"";a=(a=(a=a.replace(/^\$+/,"")).replace(/^Copy/,"")).trim(),navigator.clipboard.writeText(a);let s=(0,n.jsx)(A.J,{size:24});(0,u.createRoot)(t).render(s)}),e.prepend(t)}}),(0,$.Z)(F.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]}))},[b,f,F]);let B=async t=>{let a=t.turnId||e.turnId;(await fetch("/api/chat/conversation/message",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversation_id:e.conversationId,turn_id:a})})).ok?e.onDeleteMessage(a):console.error("Failed to delete message")},q=function(e,t,a){let n=[],s=[],o=[];if(a)for(let[e,t]of Object.entries(a))t.results&&o.push({code:t.code,output:t.results.std_out,output_files:t.results.output_files,error:t.results.std_err});if(t){let e=[];for(let[a,n]of Object.entries(t)){if(n.answerBox&&e.push({title:n.answerBox.title,description:n.answerBox.answer,link:n.answerBox.source}),n.knowledgeGraph&&e.push({title:n.knowledgeGraph.title,description:n.knowledgeGraph.description,link:n.knowledgeGraph.descriptionLink}),n.webpages){if(n.webpages instanceof Array){let t=n.webpages.map(e=>({title:e.query,description:e.snippet,link:e.link}));e.push(...t)}else{let t=n.webpages;e.push({title:t.query,description:t.snippet,link:t.link})}}if(n.organic){let t=n.organic.map(e=>({title:e.title,description:e.snippet,link:e.link}));e.push(...t)}}n.push(...e)}if(e){let t=e.map(e=>e.compiled?{title:e.file,content:e.compiled}:{title:e.split("\n")[0],content:e.split("\n").slice(1).join("\n")});s.push(...t)}return{notesReferenceCardData:s,onlineReferenceCardData:n,codeReferenceCardData:o}}(e.chatMessage.context,e.chatMessage.onlineContext,e.chatMessage.codeContext);return(0,n.jsxs)("div",{ref:t,className:(a=e.chatMessage,(o=[c().chatMessageContainer,"shadow-md"]).push(c()[a.by]),a.message||o.push(c().emptyChatMessage),e.customClassName&&o.push(c()["".concat(a.by).concat(e.customClassName)]),o.join(" ")),onMouseLeave:e=>p(!1),onMouseEnter:e=>p(!0),children:[(0,n.jsxs)("div",{className:(s=e.chatMessage,(r=[c().chatMessageWrapper]).push(c()[s.by]),"khoj"===s.by&&r.push("border-l-4 border-opacity-50 ".concat("border-l-"+e.borderLeftColor)),r.join(" ")),children:[e.chatMessage.queryFiles&&e.chatMessage.queryFiles.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap flex-col mb-2 max-w-full",children:e.chatMessage.queryFiles.map((e,t)=>(0,n.jsxs)(Q.Vq,{children:[(0,n.jsx)(Q.hg,{asChild:!0,children:(0,n.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer bg-gray-500 bg-opacity-25 rounded-lg p-2 w-full ",children:[(0,n.jsx)("div",{className:"flex-shrink-0",children:(0,j.Le)(e.file_type)}),(0,n.jsx)("span",{className:"truncate flex-1 min-w-0 max-w-[200px]",children:e.name}),e.size&&(0,n.jsxs)("span",{className:"text-gray-400 flex-shrink-0",children:["(",(0,Y.xq)(e.size),")"]})]})}),(0,n.jsxs)(Q.cZ,{children:[(0,n.jsx)(Q.fK,{children:(0,n.jsx)(K.$N,{children:(0,n.jsx)("div",{className:"truncate min-w-0 break-words break-all text-wrap max-w-full whitespace-normal",children:e.name})})}),(0,n.jsx)(Q.Be,{children:(0,n.jsx)(X.x,{className:"h-72 w-full rounded-md break-words break-all text-wrap",children:e.content})})]})]},t))}),(0,n.jsx)("div",{ref:F,className:c().chatMessage,dangerouslySetInnerHTML:{__html:b}}),E&&(0,n.jsx)(V,{data:E}),I&&(0,n.jsx)(es,{chart:I})]}),(0,n.jsx)("div",{className:c().teaserReferencesContainer,children:(0,n.jsx)(M,{isMobileWidth:e.isMobileWidth,notesReferenceCardData:q.notesReferenceCardData,onlineReferenceCardData:q.onlineReferenceCardData,codeReferenceCardData:q.codeReferenceCardData})}),(0,n.jsx)("div",{className:c().chatFooter,children:(f||e.isMobileWidth||e.isLastMessage||C)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{title:(d=(i=new Date(e.chatMessage.created+"Z")).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).toUpperCase(),h=i.toLocaleString("en-US",{year:"numeric",month:"short",day:"2-digit"}).replaceAll("-"," "),"".concat(d," on ").concat(h)),className:"text-gray-400 relative top-0 left-4",children:function(e){e.endsWith("Z")||(e+="Z");let t=new Date(e),a=new Date().getTime()-t.getTime();return a<6e4?"Just now":a<36e5?"".concat(Math.round(a/6e4),"m ago"):a<864e5?"".concat(Math.round(a/36e5),"h ago"):"".concat(Math.round(a/864e5),"d ago")}(e.chatMessage.created)}),(0,n.jsxs)("div",{className:"".concat(c().chatButtons," shadow-sm"),children:["khoj"===e.chatMessage.by&&(C?_?(0,n.jsx)(P.l,{iconClassName:"p-0",className:"m-0"}):(0,n.jsx)("button",{title:"Pause Speech",onClick:e=>R(!0),children:(0,n.jsx)(Z.d,{alt:"Pause Message",className:"hsl(var(--muted-foreground))"})}):(0,n.jsx)("button",{title:"Speak",onClick:e=>D(),children:(0,n.jsx)(z.j,{alt:"Speak Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})})),e.chatMessage.turnId&&(0,n.jsx)("button",{title:"Delete",className:"".concat(c().deleteButton),onClick:()=>B(e.chatMessage),children:(0,n.jsx)(H.r,{alt:"Delete Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})}),(0,n.jsx)("button",{title:"Copy",className:"".concat(c().copyButton),onClick:()=>{navigator.clipboard.writeText(x),g(!0)},children:m?(0,n.jsx)(W.C,{alt:"Copied Message",weight:"fill",className:"text-green-500"}):(0,n.jsx)(W.C,{alt:"Copy Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),"khoj"===e.chatMessage.by&&(e.chatMessage.intent?(0,n.jsx)(er,{uquery:e.chatMessage.intent.query,kquery:e.chatMessage.message}):(0,n.jsx)(er,{uquery:e.chatMessage.rawQuery||e.chatMessage.message,kquery:e.chatMessage.message}))]})]})})]})});ei.displayName="ChatMessage";var ed=a(4243),eh=a(77168),eu=a(15483),em=a(81103),eg=e=>{let{name:t,avatar:a,link:s,description:o}=e;return(0,n.jsx)("div",{className:"relative group flex",children:(0,n.jsx)(em.pn,{children:(0,n.jsxs)(em.u,{delayDuration:0,children:[(0,n.jsx)(em.aJ,{asChild:!0,children:(0,n.jsxs)(en.z,{variant:"ghost",className:"flex items-center justify-center",children:[a,(0,n.jsx)("div",{children:t})]})}),(0,n.jsx)(em._v,{children:(0,n.jsxs)("div",{className:"w-80 h-30",children:[(0,n.jsx)("a",{href:s,target:"_blank",rel:"noreferrer",className:"mt-1 ml-2 block no-underline",children:(0,n.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[a,(0,n.jsxs)("div",{className:"mr-2 mt-1 flex justify-center items-center text-sm font-semibold text-gray-800",children:[t,(0,n.jsx)(g.o,{weight:"bold",className:"ml-1"})]})]})}),o&&(0,n.jsx)("p",{className:"mt-2 ml-6 text-sm text-gray-600 line-clamp-2",children:o||"A Khoj agent"})]})})]})})})};function ef(e){let t=e.trainOfThought.length-1,[a,s]=(0,l.useState)(e.completed);return(0,l.useEffect)(()=>{e.completed&&s(!0)},[e.completed]),(0,n.jsxs)("div",{className:"".concat(a?"":o().trainOfThought+" shadow-sm"),children:[!e.completed&&(0,n.jsx)(P.l,{className:"float-right"}),e.completed&&(a?(0,n.jsx)(en.z,{className:"w-fit text-left justify-start content-start text-xs",onClick:()=>s(!1),variant:"ghost",size:"sm",children:"What was my train of thought?"}):(0,n.jsxs)(en.z,{className:"w-fit text-left justify-start content-start text-xs p-0 h-fit",onClick:()=>s(!0),variant:"ghost",size:"sm",children:[(0,n.jsx)(ed.a,{size:16,className:"mr-1"}),"Close"]})),!a&&e.trainOfThought.map((a,s)=>(0,n.jsx)(ec,{message:a,primary:s===t&&e.lastMessage&&!e.completed,agentColor:e.agentColor},"train-".concat(s)))]},e.keyId)}function ep(e){var t,a,s,r,c,i,d,h,u;let[m,g]=(0,l.useState)(null),[f,p]=(0,l.useState)(0),[x,v]=(0,l.useState)(!0),[w,b]=(0,l.useState)(null),y=(0,l.useRef)(null),C=(0,l.useRef)(null),M=(0,l.useRef)(null),N=(0,l.useRef)(null),[k,_]=(0,l.useState)(null),[R,E]=(0,l.useState)(!1),[S,I]=(0,l.useState)(!0),T=(0,Y.IC)(),L="[data-radix-scroll-area-viewport]";(0,l.useEffect)(()=>{var e;let t=null===(e=C.current)||void 0===e?void 0:e.querySelector(L);if(!t)return;let a=()=>{let{scrollTop:e,scrollHeight:a,clientHeight:n}=t;I(a-(e+n)<=50)};return t.addEventListener("scroll",a),()=>t.removeEventListener("scroll",a)},[]),(0,l.useEffect)(()=>{e.incomingMessages&&e.incomingMessages.length>0&&S&&D()},[e.incomingMessages,S]),(0,l.useEffect)(()=>{m&&m.chat&&m.chat.length>0&&f<2&&requestAnimationFrame(()=>{var e;null===(e=M.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"})})},[m,f]),(0,l.useEffect)(()=>{if(!x||R)return;let t=new IntersectionObserver(t=>{t[0].isIntersecting&&x&&(E(!0),function(t){if(!x||R)return;let a=(t+1)*10,n="";if(e.conversationId)n="/api/chat/history?client=web&conversation_id=".concat(encodeURIComponent(e.conversationId),"&n=").concat(a);else{if(!e.publicConversationSlug)return;n="/api/chat/share/history?client=web&public_conversation_slug=".concat(e.publicConversationSlug,"&n=").concat(a)}fetch(n).then(e=>e.json()).then(a=>{if(e.setTitle(a.response.slug),a&&a.response&&a.response.chat&&a.response.chat.length>0){if(p(Math.ceil(a.response.chat.length/10)),a.response.chat.length===(null==m?void 0:m.chat.length)){v(!1),E(!1);return}e.setAgent(a.response.agent),g(a.response),E(!1),0===t?D(!0):F()}else{if(a.response.agent&&a.response.conversation_id){let t={chat:[],agent:a.response.agent,conversation_id:a.response.conversation_id,slug:a.response.slug};e.setAgent(a.response.agent),g(t)}v(!1),E(!1)}}).catch(e=>{console.error(e),window.location.href="/"})}(f))},{threshold:1});return y.current&&t.observe(y.current),()=>t.disconnect()},[x,f,R]),(0,l.useEffect)(()=>{v(!0),E(!1),p(0),g(null)},[e.conversationId]),(0,l.useEffect)(()=>{if(e.incomingMessages){let t=e.incomingMessages[e.incomingMessages.length-1];t&&!t.completed&&(_(e.incomingMessages.length-1),e.setTitle(t.rawQuery),t.turnId&&b(t.turnId))}},[e.incomingMessages]);let F=()=>{var e;let t=null===(e=C.current)||void 0===e?void 0:e.querySelector(L);requestAnimationFrame(()=>{var e;null===(e=N.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"}),null==t||t.scrollBy({behavior:"smooth",top:-150})})},D=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=null===(e=C.current)||void 0===e?void 0:e.querySelector(L);requestAnimationFrame(()=>{null==a||a.scrollTo({top:a.scrollHeight,behavior:t?"auto":"smooth"})}),I(!0)},O=t=>{t&&(g(e=>e&&t?{...e,chat:e.chat.filter(e=>e.turnId!==t)}:e),e.incomingMessages&&e.setIncomingMessages&&e.setIncomingMessages(e.incomingMessages.filter(e=>e.turnId!==t)))};return e.conversationId||e.publicConversationSlug?(0,n.jsx)(X.x,{className:"h-[73vh] relative",ref:C,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"".concat(o().chatHistory," ").concat(e.customClassName),children:[(0,n.jsx)("div",{ref:y,style:{height:"1px"},children:R&&(0,n.jsx)(P.l,{className:"opacity-50"})}),m&&m.chat&&m.chat.map((t,a)=>{var s,o,l;return(0,n.jsxs)(n.Fragment,{children:[t.trainOfThought&&"khoj"===t.by&&(0,n.jsx)(ef,{trainOfThought:null===(s=t.trainOfThought)||void 0===s?void 0:s.map(e=>e.data),lastMessage:!1,agentColor:(null==m?void 0:null===(o=m.agent)||void 0===o?void 0:o.color)||"orange",keyId:"".concat(a,"trainOfThought"),completed:!0},"".concat(a,"trainOfThought")),(0,n.jsx)(ei,{ref:a===m.chat.length-2?M:a===m.chat.length-(f-1)*10?N:null,isMobileWidth:T,chatMessage:t,customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(l=m.agent)||void 0===l?void 0:l.color,"-500"),isLastMessage:a===m.chat.length-1,onDeleteMessage:O,conversationId:e.conversationId},"".concat(a,"fullHistory"))]})}),e.incomingMessages&&e.incomingMessages.map((t,a)=>{var s,o,r,c,i;let d=null!==(i=null!==(c=t.turnId)&&void 0!==c?c:w)&&void 0!==i?i:void 0;return(0,n.jsxs)(l.Fragment,{children:[(0,n.jsx)(ei,{isMobileWidth:T,chatMessage:{message:t.rawQuery,context:[],onlineContext:{},codeContext:{},created:t.timestamp,by:"you",automationId:"",images:t.images,conversationId:e.conversationId,turnId:d,queryFiles:t.queryFiles},customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(s=m.agent)||void 0===s?void 0:s.color,"-500"),onDeleteMessage:O,conversationId:e.conversationId,turnId:d},"".concat(a,"outgoing")),t.trainOfThought&&(0,n.jsx)(ef,{trainOfThought:t.trainOfThought,lastMessage:a===k,agentColor:(null==m?void 0:null===(o=m.agent)||void 0===o?void 0:o.color)||"orange",keyId:"".concat(a,"trainOfThought"),completed:t.completed},"".concat(a,"trainOfThought")),(0,n.jsx)(ei,{isMobileWidth:T,chatMessage:{message:t.rawResponse,context:t.context,onlineContext:t.onlineContext,codeContext:t.codeContext,created:t.timestamp,by:"khoj",automationId:"",rawQuery:t.rawQuery,intent:{type:t.intentType||"",query:t.rawQuery,"memory-type":"","inferred-queries":t.inferredQueries||[]},conversationId:e.conversationId,images:t.generatedImages,queryFiles:t.generatedFiles,mermaidjsDiagram:t.generatedMermaidjsDiagram,turnId:d},conversationId:e.conversationId,turnId:d,onDeleteMessage:O,customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(r=m.agent)||void 0===r?void 0:r.color,"-500"),isLastMessage:!0},"".concat(a,"incoming"))]},"incomingMessage".concat(a))}),e.pendingMessage&&(0,n.jsx)(ei,{isMobileWidth:T,chatMessage:{message:e.pendingMessage,context:[],onlineContext:{},codeContext:{},created:new Date().getTime().toString(),by:"you",automationId:"",conversationId:e.conversationId,turnId:void 0},conversationId:e.conversationId,onDeleteMessage:O,customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(t=m.agent)||void 0===t?void 0:t.color,"-500"),isLastMessage:!0},"pendingMessage-".concat(e.pendingMessage.length)),m&&(0,n.jsx)("div",{className:"".concat(o().agentIndicator," pb-4"),children:(0,n.jsx)("div",{className:"relative group mx-2 cursor-pointer",children:(0,n.jsx)(eg,{name:m&&m.agent&&(null===(r=m.agent)||void 0===r?void 0:r.name)?null===(c=m.agent)||void 0===c?void 0:c.name:"Agent",link:m&&m.agent&&(null===(i=m.agent)||void 0===i?void 0:i.slug)?"/agents?agent=".concat(null===(d=m.agent)||void 0===d?void 0:d.slug):"/agents",avatar:(0,j.TI)(null===(a=m.agent)||void 0===a?void 0:a.icon,null===(s=m.agent)||void 0===s?void 0:s.color)||(0,n.jsx)(eh.v,{}),description:m&&m.agent&&(null===(h=m.agent)||void 0===h?void 0:h.persona)?null===(u=m.agent)||void 0===u?void 0:u.persona:"Your agent is no longer available. You will be reset to the default agent."})})})]}),(0,n.jsx)("div",{className:"".concat(e.customClassName," fixed bottom-[20%] z-10"),children:!S&&(0,n.jsx)("button",{title:"Scroll to bottom",className:"absolute bottom-0 right-0 bg-white dark:bg-[hsl(var(--background))] text-neutral-500 dark:text-white p-2 rounded-full shadow-xl",onClick:()=>{D(),I(!0)},children:(0,n.jsx)(eu.K,{size:24})})})]})}):null}},42501:function(e){e.exports={chatHistory:"chatHistory_chatHistory__CoaVT",agentIndicator:"chatHistory_agentIndicator__wOU1f",trainOfThought:"chatHistory_trainOfThought__mMWSR"}},91499:function(e){e.exports={chatMessageContainer:"chatMessage_chatMessageContainer__sAivf",chatMessageWrapper:"chatMessage_chatMessageWrapper__u5m8A",khojfullHistory:"chatMessage_khojfullHistory__NPu2l",youfullHistory:"chatMessage_youfullHistory__ioyfH",you:"chatMessage_you__6GUC4",khoj:"chatMessage_khoj__cjWON",khojChatMessage:"chatMessage_khojChatMessage__BabQz",emptyChatMessage:"chatMessage_emptyChatMessage__J9JRn",imagesContainer:"chatMessage_imagesContainer__HTRjT",imageWrapper:"chatMessage_imageWrapper__DF92M",author:"chatMessage_author__muRtC",chatFooter:"chatMessage_chatFooter__0vR8s",chatButtons:"chatMessage_chatButtons__Lbk8T",codeCopyButton:"chatMessage_codeCopyButton__Y_Ujv",feedbackButtons:"chatMessage_feedbackButtons___Brdy",copyButton:"chatMessage_copyButton__jd7q7",trainOfThought:"chatMessage_trainOfThought__mR2Gg",primary:"chatMessage_primary__WYPEb",trainOfThoughtElement:"chatMessage_trainOfThoughtElement__le_bC"}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5061],{89371:function(e,t,n){var r=n(13606);t.Z=function(e){return(0,r.Z)(e,4)}},65061:function(e,t,n){n.r(t),n.d(t,{render:function(){return D}});var r=n(21783),i=n(65903);n(66384),n(19529);var a=n(75794);n(1816),n(86954);var d=n(30086),c=n(56434),o=n(87826),s=n(89371),l=n(68692);function g(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:l.Z(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),i={v:t};return o.Z(n)||(i.value=n),o.Z(r)||(i.parent=r),i}),edges:l.Z(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return o.Z(t.name)||(r.name=t.name),o.Z(n)||(r.value=n),r})};return o.Z(e.graph())||(t.value=s.Z(e.graph())),t}n(35539);var f=n(68406),h=new Map,u=new Map,p=new Map,w=(0,d.eW)(()=>{u.clear(),p.clear(),h.clear()},"clear"),M=(0,d.eW)((e,t)=>{let n=u.get(t)||[];return d.cM.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),v=(0,d.eW)((e,t)=>{let n=u.get(t)||[];return d.cM.info("Descendants of ",t," is ",n),d.cM.info("Edge is ",e),e.v!==t&&e.w!==t&&(n?n.includes(e.v)||M(e.v,t)||M(e.w,t)||n.includes(e.w):(d.cM.debug("Tilt, ",t,",not in descendants"),!1))},"edgeInCluster"),y=(0,d.eW)((e,t,n,r)=>{d.cM.warn("Copying children of ",e,"root",r,"data",t.node(e),r);let i=t.children(e)||[];e!==r&&i.push(e),d.cM.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(i=>{if(t.children(i).length>0)y(i,t,n,r);else{let a=t.node(i);d.cM.info("cp ",i," to ",r," with parent ",e),n.setNode(i,a),r!==t.parent(i)&&(d.cM.warn("Setting parent",i,t.parent(i)),n.setParent(i,t.parent(i))),e!==r&&i!==e?(d.cM.debug("Setting parent",i,e),n.setParent(i,e)):(d.cM.info("In copy ",e,"root",r,"data",t.node(e),r),d.cM.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));let c=t.edges(i);d.cM.debug("Copying Edges",c),c.forEach(i=>{d.cM.info("Edge",i);let a=t.edge(i.v,i.w,i.name);d.cM.info("Edge data",a,r);try{v(i,r)?(d.cM.info("Copying as ",i.v,i.w,a,i.name),n.setEdge(i.v,i.w,a,i.name),d.cM.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):d.cM.info("Skipping copy of edge ",i.v,"-->",i.w," rootId: ",r," clusterId:",e)}catch(e){d.cM.error(e)}})}d.cM.debug("Removing node",i),t.removeNode(i)})},"copy"),X=(0,d.eW)((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)p.set(i,e),r=[...r,...X(i,t)];return r},"extractDescendants"),m=(0,d.eW)((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),d=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>d.some(t=>e.v===t.v&&e.w===t.w))},"findCommonEdges"),E=(0,d.eW)((e,t,n)=>{let r;let i=t.children(e);if(d.cM.trace("Searching children of id ",e,i),i.length<1)return e;for(let e of i){let i=E(e,t,n),a=m(t,n,i);if(i){if(!(a.length>0))return i;r=i}}return r},"findNonClusterChild"),N=(0,d.eW)(e=>h.has(e)&&h.get(e).externalConnections&&h.has(e)?h.get(e).id:e,"getAnchorId"),b=(0,d.eW)((e,t)=>{if(!e||t>10){d.cM.debug("Opting out, no graph ");return}for(let t of(d.cM.debug("Opting in, graph "),e.nodes().forEach(function(t){e.children(t).length>0&&(d.cM.warn("Cluster identified",t," Replacement id in edges: ",E(t,e,t)),u.set(t,X(t,e)),h.set(t,{id:E(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let n=e.children(t),r=e.edges();n.length>0?(d.cM.debug("Cluster identified",t,u),r.forEach(e=>{M(e.v,t)^M(e.w,t)&&(d.cM.warn("Edge: ",e," leaves cluster ",t),d.cM.warn("Descendants of XXX ",t,": ",u.get(t)),h.get(t).externalConnections=!0)})):d.cM.debug("Not a cluster ",t,u)}),h.keys())){let n=h.get(t).id,r=e.parent(n);r!==t&&h.has(r)&&!h.get(r).externalConnections&&(h.get(t).id=r)}e.edges().forEach(function(t){let n=e.edge(t);d.cM.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),d.cM.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(d.cM.warn("Fix XXX",h,"ids:",t.v,t.w,"Translating: ",h.get(t.v)," --- ",h.get(t.w)),h.get(t.v)||h.get(t.w)){if(d.cM.warn("Fixing and trying - removing XXX",t.v,t.w,t.name),r=N(t.v),i=N(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){let i=e.parent(r);h.get(i).externalConnections=!0,n.fromCluster=t.v}if(i!==t.w){let r=e.parent(i);h.get(r).externalConnections=!0,n.toCluster=t.w}d.cM.warn("Fix Replacing with XXX",r,i,t.name),e.setEdge(r,i,n,t.name)}}),d.cM.warn("Adjusted Graph",g(e)),C(e,0),d.cM.trace(h)},"adjustClustersAndEdges"),C=(0,d.eW)((e,t)=>{if(d.cM.warn("extractor - ",t,g(e),e.children("D")),t>10){d.cM.error("Bailing out");return}let n=e.nodes(),r=!1;for(let t of n){let n=e.children(t);r=r||n.length>0}if(!r){d.cM.debug("Done, no node has children",e.nodes());return}for(let r of(d.cM.debug("Nodes = ",n,t),n))if(d.cM.debug("Extracting node",r,h,h.has(r)&&!h.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),h.has(r)){if(!h.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){d.cM.warn("Cluster without external connections, without a parent and with children",r,t);let n="TB"===e.graph().rankdir?"LR":"TB";h.get(r)?.clusterData?.dir&&(n=h.get(r).clusterData.dir,d.cM.warn("Fixing dir",h.get(r).clusterData.dir,n));let i=new f.k({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});d.cM.warn("Old graph before copy",g(e)),y(r,e,i,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:h.get(r).clusterData,label:h.get(r).label,graph:i}),d.cM.warn("New graph after copy node: (",r,")",g(i)),d.cM.debug("Old graph after copy",g(e))}else d.cM.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!h.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),d.cM.debug(h)}else d.cM.debug("Not a cluster",r,t);for(let r of(n=e.nodes(),d.cM.warn("New list of nodes",n),n)){let n=e.node(r);d.cM.warn(" Now next level",r,n),n?.clusterNode&&C(n.graph,t+1)}},"extractor"),x=(0,d.eW)((e,t)=>{if(0===t.length)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=e.children(t),i=x(e,r);n=[...n,...i]}),n},"sorter"),S=(0,d.eW)(e=>x(e,e.children()),"sortNodesByHierarchy"),I=(0,d.eW)(async(e,t,n,o,s,l)=>{d.cM.warn("Graph in recursive render:XAX",g(t),s);let f=t.graph().rankdir;d.cM.trace("Dir in recursive render - dir:",f);let u=e.insert("g").attr("class","root");t.nodes()?d.cM.info("Recursive render XXX",t.nodes()):d.cM.info("No nodes found for",t),t.edges().length>0&&d.cM.info("Recursive edges",t.edge(t.edges()[0]));let p=u.insert("g").attr("class","clusters"),w=u.insert("g").attr("class","edgePaths"),M=u.insert("g").attr("class","edgeLabels"),v=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(e){let r=t.node(e);if(void 0!==s){let n=JSON.parse(JSON.stringify(s.clusterData));d.cM.trace("Setting data for parent cluster XXX\n Node.id = ",e,"\n data=",n.height,"\nParent cluster",s.height),t.setNode(s.id,n),t.parent(e)||(d.cM.trace("Setting parent",e,s.id),t.setParent(e,s.id,n))}if(d.cM.info("(Insert) Node XXX"+e+": "+JSON.stringify(t.node(e))),r?.clusterNode){d.cM.info("Cluster identified XBX",e,r.width,t.node(e));let{ranksep:a,nodesep:c}=t.graph();r.graph.setGraph({...r.graph.graph(),ranksep:a+25,nodesep:c});let s=await I(v,r.graph,n,o,t.node(e),l),g=s.elem;(0,i.jr)(r,g),r.diff=s.diff||0,d.cM.info("New compound node after recursive render XAX",e,"width",r.width,"height",r.height),(0,i.Yn)(g,r)}else t.children(e).length>0?(d.cM.trace("Cluster - the non recursive path XBX",e,r.id,r,r.width,"Graph:",t),d.cM.trace(E(r.id,t)),h.set(r.id,{id:E(r.id,t),node:r})):(d.cM.trace("Node - the non recursive path XAX",e,v,t.node(e),f),await (0,i.Lf)(v,t.node(e),{config:l,dir:f}))}));let y=(0,d.eW)(async()=>{let e=t.edges().map(async function(e){let n=t.edge(e.v,e.w,e.name);d.cM.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),d.cM.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),d.cM.info("Fix",h,"ids:",e.v,e.w,"Translating: ",h.get(e.v),h.get(e.w)),await (0,r.I_)(M,n)});await Promise.all(e)},"processEdges");await y(),d.cM.info("Graph before layout:",JSON.stringify(g(t))),d.cM.info("############################################# XXX"),d.cM.info("### Layout ### XXX"),d.cM.info("############################################# XXX"),(0,c.bK)(t),d.cM.info("Graph after layout:",JSON.stringify(g(t)));let X=0,{subGraphTitleTotalMargin:m}=(0,a.L)(l);return await Promise.all(S(t).map(async function(e){let n=t.node(e);if(d.cM.info("Position XBX => "+e+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n?.clusterNode)n.y+=m,d.cM.info("A tainted cluster node XBX1",e,n.id,n.width,n.height,n.x,n.y,t.parent(e)),h.get(n.id).node=n,(0,i.aH)(n);else if(t.children(e).length>0){d.cM.info("A pure cluster node XBX1",e,n.id,n.x,n.y,n.width,n.height,t.parent(e)),n.height+=m,t.node(n.parentId);let r=n?.padding/2||0,a=n?.labelBBox?.height||0;d.cM.debug("OffsetY",a-r||0,"labelHeight",a,"halfPadding",r),await (0,i.us)(p,n),h.get(n.id).node=n}else{let e=t.node(n.parentId);n.y+=m/2,d.cM.info("A regular node XBX1 - using the padding",n.id,"parent",n.parentId,n.width,n.height,n.x,n.y,"offsetY",n.offsetY,"parent",e,e?.offsetY,n),(0,i.aH)(n)}})),t.edges().forEach(function(e){let i=t.edge(e);d.cM.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(i),i),i.points.forEach(e=>e.y+=m/2);let a=t.node(e.v);var c=t.node(e.w);let s=(0,r.QP)(w,i,h,n,a,c,o);(0,r.Jj)(i,s)}),t.nodes().forEach(function(e){let n=t.node(e);d.cM.info(e,n.type,n.diff),n.isGroup&&(X=n.diff)}),d.cM.warn("Returning from recursive render XAX",u,X),{elem:u,diff:X}},"recursiveRender"),D=(0,d.eW)(async(e,t)=>{let n=new f.k({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=t.select("g");(0,r.DQ)(a,e.markers,e.type,e.diagramId),(0,i.gU)(),(0,r.ZH)(),(0,i.ZH)(),w(),e.nodes.forEach(e=>{n.setNode(e.id,{...e}),e.parentId&&n.setParent(e.id,e.parentId)}),d.cM.debug("Edges:",e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,r=t+"---"+t+"---1",i=t+"---"+t+"---2",a=n.node(t);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(i,a.parentId);let d=structuredClone(e),c=structuredClone(e),o=structuredClone(e);d.label="",d.arrowTypeEnd="none",d.id=t+"-cyclic-special-1",c.arrowTypeEnd="none",c.id=t+"-cyclic-special-mid",o.label="",a.isGroup&&(d.fromCluster=t,o.toCluster=t),o.id=t+"-cyclic-special-2",n.setEdge(t,r,d,t+"-cyclic-special-0"),n.setEdge(r,i,c,t+"-cyclic-special-1"),n.setEdge(i,t,o,t+"-cyc<lic-special-2")}else n.setEdge(e.start,e.end,{...e},e.id)}),d.cM.warn("Graph at first:",JSON.stringify(g(n))),b(n),d.cM.warn("Graph after XAX:",JSON.stringify(g(n)));let c=(0,d.nV)();await I(a,n,e.type,e.diagramId,void 0,c)},"render")}}]);