@marimo-team/frontend 0.10.10-dev25 → 0.10.10-dev27

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 (87) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-DjPhkJqW.js → ConnectedDataExplorerComponent-CCg6XOcw.js} +1 -1
  2. package/dist/assets/{VegaLite-BG-u5ZlF.js → VegaLite-DBr87L5r.js} +1 -1
  3. package/dist/assets/{_baseEach-lpwqwYjP.js → _baseEach-3nP5hAz4.js} +1 -1
  4. package/dist/assets/_baseMap-D-VSg21x.js +1 -0
  5. package/dist/assets/{_baseUniq-B0crVfzh.js → _baseUniq-CYlQ3Jj8.js} +1 -1
  6. package/dist/assets/{any-language-editor-4LGn8Gaq.js → any-language-editor-CNJ6ROby.js} +1 -1
  7. package/dist/assets/{architectureDiagram-IFBEXTG3-CsuoV-DZ.js → architectureDiagram-IFBEXTG3-DSYPDbDs.js} +1 -1
  8. package/dist/assets/{blockDiagram-TCMKQVZ6-RhppL4ki.js → blockDiagram-TCMKQVZ6-Bg7nOLek.js} +1 -1
  9. package/dist/assets/{c4Diagram-ZCSEYPFN-Bjr_OhIl.js → c4Diagram-ZCSEYPFN--xiL9QL2.js} +1 -1
  10. package/dist/assets/channel-rx5bpVev.js +1 -0
  11. package/dist/assets/{chunk-4LC2V6XN-C6bu2e_w.js → chunk-4LC2V6XN-DFOdhlCp.js} +1 -1
  12. package/dist/assets/{chunk-5RIWM3LS-B9D6L1LU.js → chunk-5RIWM3LS-D8m70Yul.js} +1 -1
  13. package/dist/assets/{chunk-6JKP7OK7-CgdQsV6n.js → chunk-6JKP7OK7-DQqV3FwZ.js} +1 -1
  14. package/dist/assets/{chunk-NGC4727B-BfYIrHQS.js → chunk-NGC4727B-Gtc3TLXV.js} +1 -1
  15. package/dist/assets/{chunk-REEJFE46-BWy7Po4o.js → chunk-REEJFE46-CAQ8x2c3.js} +1 -1
  16. package/dist/assets/{chunk-RYO7GUH3-DrDhVO77.js → chunk-RYO7GUH3-CpecCW6m.js} +1 -1
  17. package/dist/assets/{chunk-V35ELUW5-CVVs8MJp.js → chunk-V35ELUW5-IgtX8VDg.js} +1 -1
  18. package/dist/assets/{classDiagram-Q73GJZWF-DTH67g7O.js → classDiagram-Q73GJZWF-DOCCN4lz.js} +1 -1
  19. package/dist/assets/{classDiagram-v2-C6QPLPW4-D1Ya6UVp.js → classDiagram-v2-C6QPLPW4-DAKZ6TYN.js} +1 -1
  20. package/dist/assets/clone-D_eeWPM8.js +1 -0
  21. package/dist/assets/{compile-CCJ1j7c6.js → compile-DN37aDIl.js} +1 -1
  22. package/dist/assets/{dagre-7KT5K2WU-Byorix3R.js → dagre-7KT5K2WU-BwaHXpws.js} +1 -1
  23. package/dist/assets/{data-editor--38exTQB.js → data-editor-Btg2HwhI.js} +1 -1
  24. package/dist/assets/{diagram-AVGMFHF7-BDXG3z2o.js → diagram-AVGMFHF7-C8e9vokJ.js} +1 -1
  25. package/dist/assets/{edit-page-Gtt2so25.js → edit-page-De_lAu54.js} +3 -3
  26. package/dist/assets/{erDiagram-DKC2X5TE-D82KK0AK.js → erDiagram-DKC2X5TE-B7u7Ns3B.js} +1 -1
  27. package/dist/assets/{feature-flag-9Cn1y0Q7.js → feature-flag-CY7qFTEn.js} +1 -1
  28. package/dist/assets/{flowDiagram-NWEUNK3L-DPBs8Tw_.js → flowDiagram-NWEUNK3L-DB_jTu8f.js} +1 -1
  29. package/dist/assets/{ganttDiagram-HLVPPPRE-CFMaZAMK.js → ganttDiagram-HLVPPPRE-Cd2aJo65.js} +1 -1
  30. package/dist/assets/{gitGraph-YCYPL57B-Cv9k52X6.js → gitGraph-YCYPL57B-BDfDM0at.js} +1 -1
  31. package/dist/assets/{gitGraphDiagram-JPZ3KUXI-BLfSM4wA.js → gitGraphDiagram-JPZ3KUXI-Lv5xVzXK.js} +1 -1
  32. package/dist/assets/{graph-BYOQ-VvA.js → graph-BIHyKnk1.js} +1 -1
  33. package/dist/assets/{home-page-DoraOOdw.js → home-page-C9S7KaFy.js} +1 -1
  34. package/dist/assets/{index-B5NYV6i1.js → index-0EcB9VRF.js} +1 -1
  35. package/dist/assets/{index-VgGjAcSc.js → index-5Oz_USPY.js} +1 -1
  36. package/dist/assets/{index-BuVfBJVY.js → index-B-dAarhd.js} +1 -1
  37. package/dist/assets/{index-C7IgAV3n.js → index-B9MWWGwS.js} +1 -1
  38. package/dist/assets/{index-DmLDHdw-.js → index-BTjdz_3U.js} +1 -1
  39. package/dist/assets/{index-DhTGw4u5.js → index-BUpg_tEP.js} +1 -1
  40. package/dist/assets/{index-BvIbo_Zb.js → index-BfpdsmA4.js} +1 -1
  41. package/dist/assets/{index-CmgG-7g6.js → index-BvBfElIL.js} +1 -1
  42. package/dist/assets/{index-g8o2rHLC.js → index-CGr2w34-.js} +1 -1
  43. package/dist/assets/{index-CfKS94AD.js → index-Cm8p-wsD.js} +4 -4
  44. package/dist/assets/{index-DHvSNbSH.js → index-CsCe9C71.js} +1 -1
  45. package/dist/assets/{index-BZ53m2Qh.js → index-CzK8Istl.js} +1 -1
  46. package/dist/assets/{index-BOujO_4H.js → index-DQKCu1h6.js} +1 -1
  47. package/dist/assets/{index-C5TWHHV0.js → index-Dq55U8zc.js} +1 -1
  48. package/dist/assets/{index-DwOPsVzP.js → index-JfYYnncv.js} +1 -1
  49. package/dist/assets/{index-ZK00QyLq.js → index-TVkw1r55.js} +1 -1
  50. package/dist/assets/{index-COc_Tb5X.js → index-mKCCTK_b.js} +1 -1
  51. package/dist/assets/{infoDiagram-RZZSJVI2-D_ni9w1w.js → infoDiagram-RZZSJVI2-DNGAFcIX.js} +1 -1
  52. package/dist/assets/{journeyDiagram-BLD6N6MZ-BU8RnCcZ.js → journeyDiagram-BLD6N6MZ-DHZk4HTw.js} +1 -1
  53. package/dist/assets/{json-DqeQY0Q5.js → json-C_DYieis.js} +1 -1
  54. package/dist/assets/{layout-DCaTUq-4.js → layout-BaJHLVvL.js} +1 -1
  55. package/dist/assets/{linear-BNroSunY.js → linear-B_EDWxYv.js} +1 -1
  56. package/dist/assets/{mermaid-BryxgLCw.js → mermaid-Bxg0C9t-.js} +3 -3
  57. package/dist/assets/{min-BI9SwEbc.js → min-CUMsBK76.js} +1 -1
  58. package/dist/assets/{mindmap-definition-OEB2RXX2-CypWYc5F.js → mindmap-definition-OEB2RXX2-VJN-prTk.js} +1 -1
  59. package/dist/assets/{pieDiagram-X7YZ5ZEZ-BngbAjQ3.js → pieDiagram-X7YZ5ZEZ-CIsOhBMh.js} +1 -1
  60. package/dist/assets/{quadrantDiagram-F36EZAVT-S6tTfeeu.js → quadrantDiagram-F36EZAVT-A1n6hqt5.js} +1 -1
  61. package/dist/assets/{react-plotly-D1a_lS_l.js → react-plotly-BqXzecdh.js} +1 -1
  62. package/dist/assets/{requirementDiagram-JG2LMPGF-DafTdK8q.js → requirementDiagram-JG2LMPGF-BzxZR2-v.js} +1 -1
  63. package/dist/assets/{run-page-Bd9mZ3Im.js → run-page-C1G5p5U_.js} +1 -1
  64. package/dist/assets/{sankeyDiagram-ATFNWWW6-DF2OT9ua.js → sankeyDiagram-ATFNWWW6-D5Jm5jYa.js} +1 -1
  65. package/dist/assets/save-worker-CBV2-DMU.js +1 -0
  66. package/dist/assets/{sequenceDiagram-WK7YDQ3N-3g_-IjHX.js → sequenceDiagram-WK7YDQ3N-BYrvGnAQ.js} +1 -1
  67. package/dist/assets/{slides-component-XND9nA1R.js → slides-component-BI1sQTiS.js} +1 -1
  68. package/dist/assets/{sortBy-B8emKE5-.js → sortBy-BRnQ975z.js} +1 -1
  69. package/dist/assets/{stateDiagram-4JV6CC6H-HnXSMD7H.js → stateDiagram-4JV6CC6H-DJJ9zaVx.js} +1 -1
  70. package/dist/assets/stateDiagram-v2-7KT6RKTD-BgR0ABcG.js +1 -0
  71. package/dist/assets/{terminal-CsDm3F3j.js → terminal-Do8jgHLl.js} +1 -1
  72. package/dist/assets/{time-jbAYznv6.js → time-DuHVA5Bj.js} +1 -1
  73. package/dist/assets/{timeline-definition-3ZMEY6HS-BEM9VkB3.js → timeline-definition-3ZMEY6HS-5AZjMDkF.js} +1 -1
  74. package/dist/assets/{tree-C_NZxpX2.js → tree-CPcvldTg.js} +1 -1
  75. package/dist/assets/{useMarimoWebSocket-TmiisLZG.js → useMarimoWebSocket-B2PEXLnF.js} +4 -4
  76. package/dist/assets/{vega-component-DCPrf_tD.js → vega-component-BXv1ZrB-.js} +1 -1
  77. package/dist/assets/worker-BQUWY2ZY.js +1 -0
  78. package/dist/assets/{worker-D4egYKvN.js → worker-CIUac72O.js} +1 -1
  79. package/dist/assets/{xychartDiagram-KECQ2H5Q-BQxZDz2F.js → xychartDiagram-KECQ2H5Q-BABnmVxg.js} +1 -1
  80. package/dist/index.html +1 -1
  81. package/package.json +2 -3
  82. package/dist/assets/_baseMap-DXRI4xuH.js +0 -1
  83. package/dist/assets/channel-C4SEXOv8.js +0 -1
  84. package/dist/assets/clone-DFuVUW4_.js +0 -1
  85. package/dist/assets/save-worker-Ca3hRSVQ.js +0 -1
  86. package/dist/assets/stateDiagram-v2-7KT6RKTD-BEj-EKMA.js +0 -1
  87. package/dist/assets/worker-BxJ8HeOy.js +0 -1
@@ -1 +1 @@
1
- var t,i,e,s,n,a,o,h,r,l;import{_ as c,ai as g,l as u,I as x,D as d,B as p,A as f,i as m,q as y,s as b,g as A,p as S,b as w,c as C,t as k,G as _,j as T}from"./mermaid-BryxgLCw.js";import"./transform-C6EuPmuu.js";import{i as R}from"./init-DLRA0X12.js";import{o as D}from"./ordinal-DDUp3AbE.js";import{r as L}from"./range-CtcPcB_L.js";import{l as P}from"./linear-BNroSunY.js";import{l as v}from"./step-DY8hpDjU.js";import"./index-CfKS94AD.js";function E(){var t,i,e=D().unknown(void 0),s=e.domain,n=e.range,a=0,o=1,h=!1,r=0,l=0,c=.5;function g(){var e=s().length,g=o<a,u=g?o:a,x=g?a:o;t=(x-u)/Math.max(1,e-r+2*l),h&&(t=Math.floor(t)),u+=(x-u-t*(e-r))*c,i=t*(1-r),h&&(u=Math.round(u),i=Math.round(i));var d=L(e).map((function(i){return u+t*i}));return n(g?d.reverse():d)}return delete e.unknown,e.domain=function(t){return arguments.length?(s(t),g()):s()},e.range=function(t){return arguments.length?([a,o]=t,a=+a,o=+o,g()):[a,o]},e.rangeRound=function(t){return[a,o]=t,a=+a,o=+o,h=!0,g()},e.bandwidth=function(){return i},e.step=function(){return t},e.round=function(t){return arguments.length?(h=!!t,g()):h},e.padding=function(t){return arguments.length?(r=Math.min(1,l=+t),g()):r},e.paddingInner=function(t){return arguments.length?(r=Math.min(1,t),g()):r},e.paddingOuter=function(t){return arguments.length?(l=+t,g()):l},e.align=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),g()):c},e.copy=function(){return E(s(),[a,o]).round(h).paddingInner(r).paddingOuter(l).align(c)},R.apply(g(),arguments)}var M=function(){var t=c((function(t,i,e,s){for(e=e||{},s=t.length;s--;e[t[s]]=i);return e}),"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],n=[1,5],a=[1,6],o=[1,7],h=[1,5,10,12,14,16,18,19,21,23,34,35,36],r=[1,25],l=[1,26],g=[1,28],u=[1,29],x=[1,30],d=[1,31],p=[1,32],f=[1,33],m=[1,34],y=[1,35],b=[1,36],A=[1,37],S=[1,43],w=[1,42],C=[1,47],k=[1,50],_=[1,10,12,14,16,18,19,21,23,34,35,36],T=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],R=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],D=[1,64],L={trace:c((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:c((function(t,i,e,s,n,a,o){var h=a.length-1;switch(n){case 5:s.setOrientation(a[h]);break;case 9:s.setDiagramTitle(a[h].text.trim());break;case 12:s.setLineData({text:"",type:"text"},a[h]);break;case 13:s.setLineData(a[h-1],a[h]);break;case 14:s.setBarData({text:"",type:"text"},a[h]);break;case 15:s.setBarData(a[h-1],a[h]);break;case 16:this.$=a[h].trim(),s.setAccTitle(this.$);break;case 17:case 18:this.$=a[h].trim(),s.setAccDescription(this.$);break;case 19:case 27:this.$=a[h-1];break;case 20:this.$=[Number(a[h-2]),...a[h]];break;case 21:this.$=[Number(a[h])];break;case 22:s.setXAxisTitle(a[h]);break;case 23:s.setXAxisTitle(a[h-1]);break;case 24:s.setXAxisTitle({type:"text",text:""});break;case 25:s.setXAxisBand(a[h]);break;case 26:s.setXAxisRangeData(Number(a[h-2]),Number(a[h]));break;case 28:this.$=[a[h-2],...a[h]];break;case 29:this.$=[a[h]];break;case 30:s.setYAxisTitle(a[h]);break;case 31:s.setYAxisTitle(a[h-1]);break;case 32:s.setYAxisTitle({type:"text",text:""});break;case 33:s.setYAxisRangeData(Number(a[h-2]),Number(a[h]));break;case 37:case 38:this.$={text:a[h],type:"text"};break;case 39:this.$={text:a[h],type:"markdown"};break;case 40:this.$=a[h];break;case 41:this.$=a[h-1]+""+a[h]}}),"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,34:n,35:a,36:o}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,34:n,35:a,36:o}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:a,36:o}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(h,[2,34]),t(h,[2,35]),t(h,[2,36]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,34:n,35:a,36:o}),{1:[2,3]},t(h,[2,5]),t(i,[2,7],{4:22,34:n,35:a,36:o}),{11:23,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},{11:39,13:38,24:S,27:w,29:40,30:41,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},{11:45,15:44,27:C,33:46,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},{11:49,17:48,24:k,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},{11:52,17:51,24:k,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},{20:[1,53]},{22:[1,54]},t(_,[2,18]),{1:[2,2]},t(_,[2,8]),t(_,[2,9]),t(T,[2,37],{40:55,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A}),t(T,[2,38]),t(T,[2,39]),t(R,[2,40]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(_,[2,10]),t(_,[2,22],{30:41,29:56,24:S,27:w}),t(_,[2,24]),t(_,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},t(_,[2,11]),t(_,[2,30],{33:60,27:C}),t(_,[2,32]),{31:[1,61]},t(_,[2,12]),{17:62,24:k},{25:63,27:D},t(_,[2,14]),{17:65,24:k},t(_,[2,16]),t(_,[2,17]),t(R,[2,41]),t(_,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(_,[2,31]),{27:[1,69]},t(_,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(_,[2,15]),t(_,[2,26]),t(_,[2,27]),{11:59,32:72,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},t(_,[2,33]),t(_,[2,19]),{25:73,27:D},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:c((function(t,i){if(!i.recoverable){var e=new Error(t);throw e.hash=i,e}this.trace(t)}),"parseError"),parse:c((function(t){var i=this,e=[0],s=[],n=[null],a=[],o=this.table,h="",r=0,l=0,g=a.slice.call(arguments,1),u=Object.create(this.lexer),x={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(x.yy[d]=this.yy[d]);u.setInput(t,x.yy),x.yy.lexer=u,x.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;a.push(p);var f=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||u.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof x.yy.parseError?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,c((function(t){e.length=e.length-2*t,n.length=n.length-t,a.length=a.length-t}),"popStack"),c(m,"lex");for(var y,b,A,S,w,C,k,_,T={};;){if(b=e[e.length-1],this.defaultActions[b]?A=this.defaultActions[b]:(null==y&&(y=m()),A=o[b]&&o[b][y]),void 0===A||!A.length||!A[0]){var R="";for(w in _=[],o[b])this.terminals_[w]&&w>2&&_.push("'"+this.terminals_[w]+"'");R=u.showPosition?"Parse error on line "+(r+1)+":\n"+u.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(r+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(R,{text:u.match,token:this.terminals_[y]||y,line:u.yylineno,loc:p,expected:_})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+y);switch(A[0]){case 1:e.push(y),n.push(u.yytext),a.push(u.yylloc),e.push(A[1]),y=null,l=u.yyleng,h=u.yytext,r=u.yylineno,p=u.yylloc;break;case 2:if(C=this.productions_[A[1]][1],T.$=n[n.length-C],T._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},f&&(T._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(S=this.performAction.apply(T,[h,l,r,x.yy,A[1],n,a].concat(g))))return S;C&&(e=e.slice(0,-1*C*2),n=n.slice(0,-1*C),a=a.slice(0,-1*C)),e.push(this.productions_[A[1]][0]),n.push(T.$),a.push(T._$),k=o[e[e.length-2]][e[e.length-1]],e.push(k);break;case 3:return!0}}return!0}),"parse")},P=function(){return{EOF:1,parseError:c((function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)}),"parseError"),setInput:c((function(t,i){return this.yy=i||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:c((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:c((function(t){var i=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var 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:e?(e.length===s.length?this.yylloc.first_column:0)+s[s.length-e.length].length-e[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this}),"unput"),more:c((function(){return this._more=!0,this}),"more"),reject:c((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:c((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:c((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:c((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:c((function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"}),"showPosition"),test_match:c((function(t,i){var e,s,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))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var a in n)this[a]=n[a];return!1}return!1}),"test_match"),next:c((function(){if(this.done)return this.EOF;var t,i,e,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),a=0;a<n.length;a++)if((e=this._input.match(this.rules[n[a]]))&&(!i||e[0].length>i[0].length)){if(i=e,s=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,n[a])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,n[s]))&&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:c((function(){var t=this.next();return t||this.lex()}),"lex"),begin:c((function(t){this.conditionStack.push(t)}),"begin"),popState:c((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:c((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:c((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:c((function(t){this.begin(t)}),"pushState"),stateStackSize:c((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:c((function(t,i,e,s){switch(e){case 0:case 1:case 5:case 43:break;case 2:case 3:return this.popState(),34;case 4:return 34;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 25:case 27:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 8;case 16:return this.pushState("axis_data"),"X_AXIS";case 17:return this.pushState("axis_data"),"Y_AXIS";case 18:return this.pushState("axis_band_data"),24;case 19:return 31;case 20:return this.pushState("data"),16;case 21:return this.pushState("data"),18;case 22:return this.pushState("data_inner"),24;case 23:return 27;case 24:return this.popState(),26;case 26:this.pushState("string");break;case 28:return"STR";case 29:return 24;case 30:return 26;case 31:return 43;case 32:return"COLON";case 33:return 44;case 34:return 28;case 35:return 45;case 36:return 46;case 37:return 48;case 38:return 50;case 39:return 47;case 40:return 41;case 41:return 49;case 42:return 42;case 44:return 35;case 45:return 36}}),"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[27,28],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}}}();function v(){this.yy={}}return L.lexer=P,c(v,"Parser"),v.prototype=L,L.Parser=v,new v}();M.parser=M;var I=M;function $(t){return"bar"===t.type}function B(t){return"band"===t.type}function z(t){return"linear"===t.type}c($,"isBarPlot"),c(B,"isBandAxisData"),c(z,"isLinearAxisData");var O=(c(t=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce(((t,i)=>Math.max(i.length,t)),0)*i,height:i};const e={width:0,height:0},s=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const n of t){const t=g(s,1,n),a=t?t.width:n.length*i,o=t?t.height:i;e.width=Math.max(e.width,a),e.height=Math.max(e.height,o)}return s.remove(),e}},"TextDimensionCalculatorWithFont"),t),W=(c(i=class{constructor(t,i,e,s){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((t=>t.toString())),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=.2*t.width;this.outerPadding=Math.min(e.width/2,s);const n=e.height+2*this.axisConfig.labelPadding;this.labelTextHeight=e.height,n<=i&&(i-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),e=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,e<=i&&(i-=e,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=.2*t.height;this.outerPadding=Math.min(e.height/2,s);const n=e.width+2*this.axisConfig.labelPadding;n<=i&&(i-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),e=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,e<=i&&(i-=e,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"})))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"})))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"})))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},"BaseAxis"),i),F=(c(e=class extends W{constructor(t,i,e,s,n){super(t,s,n,i),this.categories=e,this.scale=E().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=E().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),u.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},"BandAxis"),e),N=(c(s=class extends W{constructor(t,i,e,s,n){super(t,s,n,i),this.domain=e,this.scale=P().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=P().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},"LinearAxis"),s);function X(t,i,e,s){const n=new O(s);return B(t)?new F(i,e,t.categories,t.title,n):new N(i,e,[t.min,t.max],t.title,n)}c(X,"getAxis");var V=(c(n=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),s=i.height+2*this.chartConfig.titlePadding;return i.width<=e&&i.height<=s&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=s,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},"ChartTitle"),n);function Y(t,i,e,s){const n=new O(s);return new V(n,t,i,e)}c(Y,"getChartTitleComponent");var U=(c(a=class{constructor(t,i,e,s,n){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=s,this.plotIndex=n}getDrawableElement(){const t=this.plotData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]));let i;return i="horizontal"===this.orientation?v().y((t=>t[0])).x((t=>t[1]))(t):v().x((t=>t[0])).y((t=>t[1]))(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},"LinePlot"),a),H=(c(o=class{constructor(t,i,e,s,n,a){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=s,this.orientation=n,this.plotIndex=a}getDrawableElement(){const t=this.barData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])])),i=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),e=i/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:this.boundingRect.x,y:t[0]-e,height:i,width:t[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:t[0]-e,y:t[1],width:i,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]}},"BarPlot"),o),j=(c(h=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!this.xAxis||!this.yAxis)throw Error("Axes must be passed to render Plots");const t=[];for(const[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{const s=new U(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break;case"bar":{const s=new H(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}}return t}},"BasePlot"),h);function G(t,i,e){return new j(t,i,e)}c(G,"getPlotComponent");var Q,K=(c(r=class{constructor(t,i,e,s){this.chartConfig=t,this.chartData=i,this.componentStore={title:Y(t,i,e,s),plot:G(t,i,e),xAxis:X(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},s),yAxis:X(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},s)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:n,height:a});t-=o.width,i-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=o.height,i-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=o.width,t-=o.width,t>0&&(n+=t,t=0),i>0&&(a+=i,i=0),this.componentStore.plot.calculateSpace({width:n,height:a}),this.componentStore.plot.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([e,e+n]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:s+a}),this.componentStore.yAxis.setRange([s,s+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some((t=>$(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n=0,a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),h=this.componentStore.plot.calculateSpace({width:a,height:o});t-=h.width,i-=h.height,h=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=h.height,i-=h.height,this.componentStore.xAxis.setAxisPosition("left"),h=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=h.width,s=h.width,this.componentStore.yAxis.setAxisPosition("top"),h=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=h.height,n=e+h.height,t>0&&(a+=t,t=0),i>0&&(o+=i,i=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.yAxis.setRange([s,s+a]),this.componentStore.yAxis.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([n,n+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((t=>$(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},"Orchestrator"),r),q=(c(l=class{static build(t,i,e,s){return new K(t,i,e,s).getDrawableElement()}},"XYChartBuilder"),l),Z=0,J=ot(),tt=at(),it=ht(),et=tt.plotColorPalette.split(",").map((t=>t.trim())),st=!1,nt=!1;function at(){const t=x(),i=d();return p(t.xyChart,i.themeVariables.xyChart)}function ot(){const t=d();return p(f.xyChart,t.xyChart)}function ht(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function rt(t){const i=d();return m(t.trim(),i)}function lt(t){Q=t}function ct(t){J.chartOrientation="horizontal"===t?"horizontal":"vertical"}function gt(t){it.xAxis.title=rt(t.text)}function ut(t,i){it.xAxis={type:"linear",title:it.xAxis.title,min:t,max:i},st=!0}function xt(t){it.xAxis={type:"band",title:it.xAxis.title,categories:t.map((t=>rt(t.text)))},st=!0}function dt(t){it.yAxis.title=rt(t.text)}function pt(t,i){it.yAxis={type:"linear",title:it.yAxis.title,min:t,max:i},nt=!0}function ft(t){const i=Math.min(...t),e=Math.max(...t),s=z(it.yAxis)?it.yAxis.min:1/0,n=z(it.yAxis)?it.yAxis.max:-1/0;it.yAxis={type:"linear",title:it.yAxis.title,min:Math.min(s,i),max:Math.max(n,e)}}function mt(t){let i=[];if(0===t.length)return i;if(!st){const i=z(it.xAxis)?it.xAxis.min:1/0,e=z(it.xAxis)?it.xAxis.max:-1/0;ut(Math.min(i,1),Math.max(e,t.length))}if(nt||ft(t),B(it.xAxis)&&(i=it.xAxis.categories.map(((i,e)=>[i,t[e]]))),z(it.xAxis)){const e=it.xAxis.min,s=it.xAxis.max,n=(s-e)/(t.length-1),a=[];for(let t=e;t<=s;t+=n)a.push(`${t}`);i=a.map(((i,e)=>[i,t[e]]))}return i}function yt(t){return et[0===t?0:t%et.length]}function bt(t,i){const e=mt(i);it.plots.push({type:"line",strokeFill:yt(Z),strokeWidth:2,data:e}),Z++}function At(t,i){const e=mt(i);it.plots.push({type:"bar",fill:yt(Z),data:e}),Z++}function St(){if(0===it.plots.length)throw Error("No Plot to render, please provide a plot with some data");return it.title=y(),q.build(J,it,tt,Q)}function wt(){return tt}function Ct(){return J}c(at,"getChartDefaultThemeConfig"),c(ot,"getChartDefaultConfig"),c(ht,"getChartDefaultData"),c(rt,"textSanitizer"),c(lt,"setTmpSVGG"),c(ct,"setOrientation"),c(gt,"setXAxisTitle"),c(ut,"setXAxisRangeData"),c(xt,"setXAxisBand"),c(dt,"setYAxisTitle"),c(pt,"setYAxisRangeData"),c(ft,"setYAxisRangeFromPlotData"),c(mt,"transformDataWithoutCategory"),c(yt,"getPlotColorFromPalette"),c(bt,"setLineData"),c(At,"setBarData"),c(St,"getDrawableElem"),c(wt,"getChartThemeConfig"),c(Ct,"getChartConfig");var kt={parser:I,db:{getDrawableElem:St,clear:c((function(){k(),Z=0,J=ot(),it={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},tt=at(),et=tt.plotColorPalette.split(",").map((t=>t.trim())),st=!1,nt=!1}),"clear"),setAccTitle:b,getAccTitle:A,setDiagramTitle:S,getDiagramTitle:y,getAccDescription:w,setAccDescription:C,setOrientation:ct,setXAxisTitle:gt,setXAxisRangeData:ut,setXAxisBand:xt,setYAxisTitle:dt,setYAxisRangeData:pt,setLineData:bt,setBarData:At,setTmpSVGG:lt,getChartThemeConfig:wt,getChartConfig:Ct},renderer:{draw:c(((t,i,e,s)=>{const n=s.db,a=n.getChartThemeConfig(),o=n.getChartConfig();function h(t){return"top"===t?"text-before-edge":"middle"}function r(t){return"left"===t?"start":"right"===t?"end":"middle"}function l(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}c(h,"getDominantBaseLine"),c(r,"getTextAnchor"),c(l,"getTextTransformation"),u.debug("Rendering xychart chart\n"+t);const g=_(i),x=g.append("g").attr("class","main"),d=x.append("rect").attr("width",o.width).attr("height",o.height).attr("class","background");T(g,o.height,o.width,!0),g.attr("viewBox",`0 0 ${o.width} ${o.height}`),d.attr("fill",a.backgroundColor),n.setTmpSVGG(g.append("g").attr("class","mermaid-tmp-group"));const p=n.getDrawableElem(),f={};function m(t){let i=x,e="";for(const[s]of t.entries()){let n=x;s>0&&f[e]&&(n=f[e]),e+=t[s],i=f[e],i||(i=f[e]=n.append("g").attr("class",t[s]))}return i}c(m,"getGroup");for(const c of p){if(0===c.data.length)continue;const t=m(c.groupTexts);switch(c.type){case"rect":t.selectAll("rect").data(c.data).enter().append("rect").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("fill",(t=>t.fill)).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth));break;case"text":t.selectAll("text").data(c.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(t=>t.fill)).attr("font-size",(t=>t.fontSize)).attr("dominant-baseline",(t=>h(t.verticalPos))).attr("text-anchor",(t=>r(t.horizontalPos))).attr("transform",(t=>l(t))).text((t=>t.text));break;case"path":t.selectAll("path").data(c.data).enter().append("path").attr("d",(t=>t.path)).attr("fill",(t=>t.fill?t.fill:"none")).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth))}}}),"draw")}};export{kt as diagram};
1
+ var t,i,e,s,n,a,o,h,r,l;import{_ as c,ai as g,l as u,I as x,D as d,B as p,A as f,i as m,q as y,s as b,g as A,p as S,b as w,c as C,t as k,G as _,j as T}from"./mermaid-Bxg0C9t-.js";import"./transform-C6EuPmuu.js";import{i as R}from"./init-DLRA0X12.js";import{o as D}from"./ordinal-DDUp3AbE.js";import{r as L}from"./range-CtcPcB_L.js";import{l as P}from"./linear-B_EDWxYv.js";import{l as v}from"./step-DY8hpDjU.js";import"./index-Cm8p-wsD.js";function E(){var t,i,e=D().unknown(void 0),s=e.domain,n=e.range,a=0,o=1,h=!1,r=0,l=0,c=.5;function g(){var e=s().length,g=o<a,u=g?o:a,x=g?a:o;t=(x-u)/Math.max(1,e-r+2*l),h&&(t=Math.floor(t)),u+=(x-u-t*(e-r))*c,i=t*(1-r),h&&(u=Math.round(u),i=Math.round(i));var d=L(e).map((function(i){return u+t*i}));return n(g?d.reverse():d)}return delete e.unknown,e.domain=function(t){return arguments.length?(s(t),g()):s()},e.range=function(t){return arguments.length?([a,o]=t,a=+a,o=+o,g()):[a,o]},e.rangeRound=function(t){return[a,o]=t,a=+a,o=+o,h=!0,g()},e.bandwidth=function(){return i},e.step=function(){return t},e.round=function(t){return arguments.length?(h=!!t,g()):h},e.padding=function(t){return arguments.length?(r=Math.min(1,l=+t),g()):r},e.paddingInner=function(t){return arguments.length?(r=Math.min(1,t),g()):r},e.paddingOuter=function(t){return arguments.length?(l=+t,g()):l},e.align=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),g()):c},e.copy=function(){return E(s(),[a,o]).round(h).paddingInner(r).paddingOuter(l).align(c)},R.apply(g(),arguments)}var M=function(){var t=c((function(t,i,e,s){for(e=e||{},s=t.length;s--;e[t[s]]=i);return e}),"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],n=[1,5],a=[1,6],o=[1,7],h=[1,5,10,12,14,16,18,19,21,23,34,35,36],r=[1,25],l=[1,26],g=[1,28],u=[1,29],x=[1,30],d=[1,31],p=[1,32],f=[1,33],m=[1,34],y=[1,35],b=[1,36],A=[1,37],S=[1,43],w=[1,42],C=[1,47],k=[1,50],_=[1,10,12,14,16,18,19,21,23,34,35,36],T=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],R=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],D=[1,64],L={trace:c((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:c((function(t,i,e,s,n,a,o){var h=a.length-1;switch(n){case 5:s.setOrientation(a[h]);break;case 9:s.setDiagramTitle(a[h].text.trim());break;case 12:s.setLineData({text:"",type:"text"},a[h]);break;case 13:s.setLineData(a[h-1],a[h]);break;case 14:s.setBarData({text:"",type:"text"},a[h]);break;case 15:s.setBarData(a[h-1],a[h]);break;case 16:this.$=a[h].trim(),s.setAccTitle(this.$);break;case 17:case 18:this.$=a[h].trim(),s.setAccDescription(this.$);break;case 19:case 27:this.$=a[h-1];break;case 20:this.$=[Number(a[h-2]),...a[h]];break;case 21:this.$=[Number(a[h])];break;case 22:s.setXAxisTitle(a[h]);break;case 23:s.setXAxisTitle(a[h-1]);break;case 24:s.setXAxisTitle({type:"text",text:""});break;case 25:s.setXAxisBand(a[h]);break;case 26:s.setXAxisRangeData(Number(a[h-2]),Number(a[h]));break;case 28:this.$=[a[h-2],...a[h]];break;case 29:this.$=[a[h]];break;case 30:s.setYAxisTitle(a[h]);break;case 31:s.setYAxisTitle(a[h-1]);break;case 32:s.setYAxisTitle({type:"text",text:""});break;case 33:s.setYAxisRangeData(Number(a[h-2]),Number(a[h]));break;case 37:case 38:this.$={text:a[h],type:"text"};break;case 39:this.$={text:a[h],type:"markdown"};break;case 40:this.$=a[h];break;case 41:this.$=a[h-1]+""+a[h]}}),"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,34:n,35:a,36:o}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,34:n,35:a,36:o}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:a,36:o}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(h,[2,34]),t(h,[2,35]),t(h,[2,36]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,34:n,35:a,36:o}),{1:[2,3]},t(h,[2,5]),t(i,[2,7],{4:22,34:n,35:a,36:o}),{11:23,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},{11:39,13:38,24:S,27:w,29:40,30:41,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},{11:45,15:44,27:C,33:46,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},{11:49,17:48,24:k,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},{11:52,17:51,24:k,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},{20:[1,53]},{22:[1,54]},t(_,[2,18]),{1:[2,2]},t(_,[2,8]),t(_,[2,9]),t(T,[2,37],{40:55,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A}),t(T,[2,38]),t(T,[2,39]),t(R,[2,40]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(_,[2,10]),t(_,[2,22],{30:41,29:56,24:S,27:w}),t(_,[2,24]),t(_,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},t(_,[2,11]),t(_,[2,30],{33:60,27:C}),t(_,[2,32]),{31:[1,61]},t(_,[2,12]),{17:62,24:k},{25:63,27:D},t(_,[2,14]),{17:65,24:k},t(_,[2,16]),t(_,[2,17]),t(R,[2,41]),t(_,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(_,[2,31]),{27:[1,69]},t(_,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(_,[2,15]),t(_,[2,26]),t(_,[2,27]),{11:59,32:72,37:24,38:r,39:l,40:27,41:g,42:u,43:x,44:d,45:p,46:f,47:m,48:y,49:b,50:A},t(_,[2,33]),t(_,[2,19]),{25:73,27:D},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:c((function(t,i){if(!i.recoverable){var e=new Error(t);throw e.hash=i,e}this.trace(t)}),"parseError"),parse:c((function(t){var i=this,e=[0],s=[],n=[null],a=[],o=this.table,h="",r=0,l=0,g=a.slice.call(arguments,1),u=Object.create(this.lexer),x={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(x.yy[d]=this.yy[d]);u.setInput(t,x.yy),x.yy.lexer=u,x.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;a.push(p);var f=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||u.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof x.yy.parseError?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,c((function(t){e.length=e.length-2*t,n.length=n.length-t,a.length=a.length-t}),"popStack"),c(m,"lex");for(var y,b,A,S,w,C,k,_,T={};;){if(b=e[e.length-1],this.defaultActions[b]?A=this.defaultActions[b]:(null==y&&(y=m()),A=o[b]&&o[b][y]),void 0===A||!A.length||!A[0]){var R="";for(w in _=[],o[b])this.terminals_[w]&&w>2&&_.push("'"+this.terminals_[w]+"'");R=u.showPosition?"Parse error on line "+(r+1)+":\n"+u.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(r+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(R,{text:u.match,token:this.terminals_[y]||y,line:u.yylineno,loc:p,expected:_})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+y);switch(A[0]){case 1:e.push(y),n.push(u.yytext),a.push(u.yylloc),e.push(A[1]),y=null,l=u.yyleng,h=u.yytext,r=u.yylineno,p=u.yylloc;break;case 2:if(C=this.productions_[A[1]][1],T.$=n[n.length-C],T._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},f&&(T._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(S=this.performAction.apply(T,[h,l,r,x.yy,A[1],n,a].concat(g))))return S;C&&(e=e.slice(0,-1*C*2),n=n.slice(0,-1*C),a=a.slice(0,-1*C)),e.push(this.productions_[A[1]][0]),n.push(T.$),a.push(T._$),k=o[e[e.length-2]][e[e.length-1]],e.push(k);break;case 3:return!0}}return!0}),"parse")},P=function(){return{EOF:1,parseError:c((function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)}),"parseError"),setInput:c((function(t,i){return this.yy=i||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:c((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:c((function(t){var i=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var 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:e?(e.length===s.length?this.yylloc.first_column:0)+s[s.length-e.length].length-e[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this}),"unput"),more:c((function(){return this._more=!0,this}),"more"),reject:c((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:c((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:c((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:c((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:c((function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"}),"showPosition"),test_match:c((function(t,i){var e,s,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))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var a in n)this[a]=n[a];return!1}return!1}),"test_match"),next:c((function(){if(this.done)return this.EOF;var t,i,e,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),a=0;a<n.length;a++)if((e=this._input.match(this.rules[n[a]]))&&(!i||e[0].length>i[0].length)){if(i=e,s=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,n[a])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,n[s]))&&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:c((function(){var t=this.next();return t||this.lex()}),"lex"),begin:c((function(t){this.conditionStack.push(t)}),"begin"),popState:c((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:c((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:c((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:c((function(t){this.begin(t)}),"pushState"),stateStackSize:c((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:c((function(t,i,e,s){switch(e){case 0:case 1:case 5:case 43:break;case 2:case 3:return this.popState(),34;case 4:return 34;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 25:case 27:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 8;case 16:return this.pushState("axis_data"),"X_AXIS";case 17:return this.pushState("axis_data"),"Y_AXIS";case 18:return this.pushState("axis_band_data"),24;case 19:return 31;case 20:return this.pushState("data"),16;case 21:return this.pushState("data"),18;case 22:return this.pushState("data_inner"),24;case 23:return 27;case 24:return this.popState(),26;case 26:this.pushState("string");break;case 28:return"STR";case 29:return 24;case 30:return 26;case 31:return 43;case 32:return"COLON";case 33:return 44;case 34:return 28;case 35:return 45;case 36:return 46;case 37:return 48;case 38:return 50;case 39:return 47;case 40:return 41;case 41:return 49;case 42:return 42;case 44:return 35;case 45:return 36}}),"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[27,28],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}}}();function v(){this.yy={}}return L.lexer=P,c(v,"Parser"),v.prototype=L,L.Parser=v,new v}();M.parser=M;var I=M;function $(t){return"bar"===t.type}function B(t){return"band"===t.type}function z(t){return"linear"===t.type}c($,"isBarPlot"),c(B,"isBandAxisData"),c(z,"isLinearAxisData");var O=(c(t=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce(((t,i)=>Math.max(i.length,t)),0)*i,height:i};const e={width:0,height:0},s=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const n of t){const t=g(s,1,n),a=t?t.width:n.length*i,o=t?t.height:i;e.width=Math.max(e.width,a),e.height=Math.max(e.height,o)}return s.remove(),e}},"TextDimensionCalculatorWithFont"),t),W=(c(i=class{constructor(t,i,e,s){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((t=>t.toString())),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=.2*t.width;this.outerPadding=Math.min(e.width/2,s);const n=e.height+2*this.axisConfig.labelPadding;this.labelTextHeight=e.height,n<=i&&(i-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),e=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,e<=i&&(i-=e,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=.2*t.height;this.outerPadding=Math.min(e.height/2,s);const n=e.width+2*this.axisConfig.labelPadding;n<=i&&(i-=n,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),e=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,e<=i&&(i-=e,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"})))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"})))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"})))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},"BaseAxis"),i),F=(c(e=class extends W{constructor(t,i,e,s,n){super(t,s,n,i),this.categories=e,this.scale=E().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=E().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),u.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},"BandAxis"),e),N=(c(s=class extends W{constructor(t,i,e,s,n){super(t,s,n,i),this.domain=e,this.scale=P().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=P().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},"LinearAxis"),s);function X(t,i,e,s){const n=new O(s);return B(t)?new F(i,e,t.categories,t.title,n):new N(i,e,[t.min,t.max],t.title,n)}c(X,"getAxis");var V=(c(n=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),s=i.height+2*this.chartConfig.titlePadding;return i.width<=e&&i.height<=s&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=s,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},"ChartTitle"),n);function Y(t,i,e,s){const n=new O(s);return new V(n,t,i,e)}c(Y,"getChartTitleComponent");var U=(c(a=class{constructor(t,i,e,s,n){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=s,this.plotIndex=n}getDrawableElement(){const t=this.plotData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]));let i;return i="horizontal"===this.orientation?v().y((t=>t[0])).x((t=>t[1]))(t):v().x((t=>t[0])).y((t=>t[1]))(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},"LinePlot"),a),H=(c(o=class{constructor(t,i,e,s,n,a){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=s,this.orientation=n,this.plotIndex=a}getDrawableElement(){const t=this.barData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])])),i=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),e=i/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:this.boundingRect.x,y:t[0]-e,height:i,width:t[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:t[0]-e,y:t[1],width:i,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]}},"BarPlot"),o),j=(c(h=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!this.xAxis||!this.yAxis)throw Error("Axes must be passed to render Plots");const t=[];for(const[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{const s=new U(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break;case"bar":{const s=new H(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}}return t}},"BasePlot"),h);function G(t,i,e){return new j(t,i,e)}c(G,"getPlotComponent");var Q,K=(c(r=class{constructor(t,i,e,s){this.chartConfig=t,this.chartData=i,this.componentStore={title:Y(t,i,e,s),plot:G(t,i,e),xAxis:X(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},s),yAxis:X(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},s)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:n,height:a});t-=o.width,i-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=o.height,i-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=o.width,t-=o.width,t>0&&(n+=t,t=0),i>0&&(a+=i,i=0),this.componentStore.plot.calculateSpace({width:n,height:a}),this.componentStore.plot.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([e,e+n]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:s+a}),this.componentStore.yAxis.setRange([s,s+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some((t=>$(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,n=0,a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),h=this.componentStore.plot.calculateSpace({width:a,height:o});t-=h.width,i-=h.height,h=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=h.height,i-=h.height,this.componentStore.xAxis.setAxisPosition("left"),h=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=h.width,s=h.width,this.componentStore.yAxis.setAxisPosition("top"),h=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=h.height,n=e+h.height,t>0&&(a+=t,t=0),i>0&&(o+=i,i=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.yAxis.setRange([s,s+a]),this.componentStore.yAxis.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([n,n+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((t=>$(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},"Orchestrator"),r),q=(c(l=class{static build(t,i,e,s){return new K(t,i,e,s).getDrawableElement()}},"XYChartBuilder"),l),Z=0,J=ot(),tt=at(),it=ht(),et=tt.plotColorPalette.split(",").map((t=>t.trim())),st=!1,nt=!1;function at(){const t=x(),i=d();return p(t.xyChart,i.themeVariables.xyChart)}function ot(){const t=d();return p(f.xyChart,t.xyChart)}function ht(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function rt(t){const i=d();return m(t.trim(),i)}function lt(t){Q=t}function ct(t){J.chartOrientation="horizontal"===t?"horizontal":"vertical"}function gt(t){it.xAxis.title=rt(t.text)}function ut(t,i){it.xAxis={type:"linear",title:it.xAxis.title,min:t,max:i},st=!0}function xt(t){it.xAxis={type:"band",title:it.xAxis.title,categories:t.map((t=>rt(t.text)))},st=!0}function dt(t){it.yAxis.title=rt(t.text)}function pt(t,i){it.yAxis={type:"linear",title:it.yAxis.title,min:t,max:i},nt=!0}function ft(t){const i=Math.min(...t),e=Math.max(...t),s=z(it.yAxis)?it.yAxis.min:1/0,n=z(it.yAxis)?it.yAxis.max:-1/0;it.yAxis={type:"linear",title:it.yAxis.title,min:Math.min(s,i),max:Math.max(n,e)}}function mt(t){let i=[];if(0===t.length)return i;if(!st){const i=z(it.xAxis)?it.xAxis.min:1/0,e=z(it.xAxis)?it.xAxis.max:-1/0;ut(Math.min(i,1),Math.max(e,t.length))}if(nt||ft(t),B(it.xAxis)&&(i=it.xAxis.categories.map(((i,e)=>[i,t[e]]))),z(it.xAxis)){const e=it.xAxis.min,s=it.xAxis.max,n=(s-e)/(t.length-1),a=[];for(let t=e;t<=s;t+=n)a.push(`${t}`);i=a.map(((i,e)=>[i,t[e]]))}return i}function yt(t){return et[0===t?0:t%et.length]}function bt(t,i){const e=mt(i);it.plots.push({type:"line",strokeFill:yt(Z),strokeWidth:2,data:e}),Z++}function At(t,i){const e=mt(i);it.plots.push({type:"bar",fill:yt(Z),data:e}),Z++}function St(){if(0===it.plots.length)throw Error("No Plot to render, please provide a plot with some data");return it.title=y(),q.build(J,it,tt,Q)}function wt(){return tt}function Ct(){return J}c(at,"getChartDefaultThemeConfig"),c(ot,"getChartDefaultConfig"),c(ht,"getChartDefaultData"),c(rt,"textSanitizer"),c(lt,"setTmpSVGG"),c(ct,"setOrientation"),c(gt,"setXAxisTitle"),c(ut,"setXAxisRangeData"),c(xt,"setXAxisBand"),c(dt,"setYAxisTitle"),c(pt,"setYAxisRangeData"),c(ft,"setYAxisRangeFromPlotData"),c(mt,"transformDataWithoutCategory"),c(yt,"getPlotColorFromPalette"),c(bt,"setLineData"),c(At,"setBarData"),c(St,"getDrawableElem"),c(wt,"getChartThemeConfig"),c(Ct,"getChartConfig");var kt={parser:I,db:{getDrawableElem:St,clear:c((function(){k(),Z=0,J=ot(),it={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},tt=at(),et=tt.plotColorPalette.split(",").map((t=>t.trim())),st=!1,nt=!1}),"clear"),setAccTitle:b,getAccTitle:A,setDiagramTitle:S,getDiagramTitle:y,getAccDescription:w,setAccDescription:C,setOrientation:ct,setXAxisTitle:gt,setXAxisRangeData:ut,setXAxisBand:xt,setYAxisTitle:dt,setYAxisRangeData:pt,setLineData:bt,setBarData:At,setTmpSVGG:lt,getChartThemeConfig:wt,getChartConfig:Ct},renderer:{draw:c(((t,i,e,s)=>{const n=s.db,a=n.getChartThemeConfig(),o=n.getChartConfig();function h(t){return"top"===t?"text-before-edge":"middle"}function r(t){return"left"===t?"start":"right"===t?"end":"middle"}function l(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}c(h,"getDominantBaseLine"),c(r,"getTextAnchor"),c(l,"getTextTransformation"),u.debug("Rendering xychart chart\n"+t);const g=_(i),x=g.append("g").attr("class","main"),d=x.append("rect").attr("width",o.width).attr("height",o.height).attr("class","background");T(g,o.height,o.width,!0),g.attr("viewBox",`0 0 ${o.width} ${o.height}`),d.attr("fill",a.backgroundColor),n.setTmpSVGG(g.append("g").attr("class","mermaid-tmp-group"));const p=n.getDrawableElem(),f={};function m(t){let i=x,e="";for(const[s]of t.entries()){let n=x;s>0&&f[e]&&(n=f[e]),e+=t[s],i=f[e],i||(i=f[e]=n.append("g").attr("class",t[s]))}return i}c(m,"getGroup");for(const c of p){if(0===c.data.length)continue;const t=m(c.groupTexts);switch(c.type){case"rect":t.selectAll("rect").data(c.data).enter().append("rect").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("fill",(t=>t.fill)).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth));break;case"text":t.selectAll("text").data(c.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(t=>t.fill)).attr("font-size",(t=>t.fontSize)).attr("dominant-baseline",(t=>h(t.verticalPos))).attr("text-anchor",(t=>r(t.horizontalPos))).attr("transform",(t=>l(t))).text((t=>t.text));break;case"path":t.selectAll("path").data(c.data).enter().append("path").attr("d",(t=>t.path)).attr("fill",(t=>t.fill?t.fill:"none")).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth))}}}),"draw")}};export{kt as diagram};
package/dist/index.html CHANGED
@@ -59,7 +59,7 @@
59
59
  <marimo-app-config data-config='{{ app_config }}' hidden></marimo-app-config>
60
60
  <marimo-server-token data-token='{{ server_token }}' hidden></marimo-server-token>
61
61
  <title>{{ title }}</title>
62
- <script type="module" crossorigin src="./assets/index-CfKS94AD.js"></script>
62
+ <script type="module" crossorigin src="./assets/index-Cm8p-wsD.js"></script>
63
63
  <link rel="stylesheet" crossorigin href="./assets/index-C7Hj70vM.css">
64
64
  </head>
65
65
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/frontend",
3
- "version": "0.10.10-dev25",
3
+ "version": "0.10.10-dev27",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -114,7 +114,7 @@
114
114
  "partysocket": "1.0.2",
115
115
  "path-to-regexp": "^8.0.0",
116
116
  "plotly.js": "^2.35.2",
117
- "pyodide": "^0.26.2",
117
+ "pyodide": "^0.27.0",
118
118
  "react-arborist": "^3.4.0",
119
119
  "react-aria-components": "^1.5.0",
120
120
  "react-codemirror-merge": "^4.23.5",
@@ -189,7 +189,6 @@
189
189
  "@swc-jotai/react-refresh": "^0.1.1",
190
190
  "@testing-library/react": "^16.0.0",
191
191
  "@testing-library/react-hooks": "^8.0.1",
192
- "@types/emscripten": "^1.39.13",
193
192
  "@types/katex": "^0.16.7",
194
193
  "@types/lodash-es": "^4.17.12",
195
194
  "@types/node": "^20.16.1",
@@ -1 +0,0 @@
1
- import{b as r}from"./_baseEach-lpwqwYjP.js";import{n}from"./index-CfKS94AD.js";function a(a,o){var t=-1,s=n(a)?Array(a.length):[];return r(a,(function(r,n,a){s[++t]=o(r,n,a)})),s}export{a as b};
@@ -1 +0,0 @@
1
- import{U as a,C as r}from"./mermaid-BryxgLCw.js";const s=(s,o)=>a.lang.round(r.parse(s)[o]);export{s as c};
@@ -1 +0,0 @@
1
- import{b as r}from"./_baseUniq-B0crVfzh.js";function n(n){return r(n,4)}export{n as c};
@@ -1 +0,0 @@
1
- var e,t,n=Object.getOwnPropertyNames,r=(e={"assets/save-worker-Ca3hRSVQ.js"(e,t){var n,r,a;(r=n||(n={})).assertEqual=e=>e,r.assertIs=function(e){},r.assertNever=function(e){throw new Error},r.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},r.getValidEnumValues=e=>{const t=r.objectKeys(e).filter((t=>"number"!=typeof e[e[t]])),n={};for(const r of t)n[r]=e[r];return r.objectValues(n)},r.objectValues=e=>r.objectKeys(e).map((function(t){return e[t]})),r.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},r.find=(e,t)=>{for(const n of e)if(t(n))return n},r.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,r.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},r.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(a||(a={})).mergeShapes=(e,t)=>({...e,...t});const s=n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":return Array.isArray(e)?s.array:null===e?s.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?s.promise:"undefined"!=typeof Map&&e instanceof Map?s.map:"undefined"!=typeof Set&&e instanceof Set?s.set:"undefined"!=typeof Date&&e instanceof Date?s.date:s.object;default:return s.unknown}},o=n.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class d extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){const n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof d))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,n.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}d.create=e=>new d(e);const c=(e,t)=>{let r;switch(e.code){case o.invalid_type:r=e.received===s.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case o.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,n.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:r=`Unrecognized key(s) in object: ${n.joinValues(e.keys,", ")}`;break;case o.invalid_union:r="Invalid input";break;case o.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${n.joinValues(e.options)}`;break;case o.invalid_enum_value:r=`Invalid enum value. Expected ${n.joinValues(e.options)}, received '${e.received}'`;break;case o.invalid_arguments:r="Invalid function arguments";break;case o.invalid_return_type:r="Invalid function return type";break;case o.invalid_date:r="Invalid date";break;case o.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:n.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case o.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case o.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case o.custom:r="Invalid input";break;case o.invalid_intersection_types:r="Intersection results could not be merged";break;case o.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case o.not_finite:r="Number must be finite";break;default:r=t.defaultError,n.assertNever(e)}return{message:r}};let u=c;function l(){return u}const p=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,s=[...n,...a.path||[]],i={...a,path:s};if(void 0!==a.message)return{...a,path:s,message:a.message};let o="";const d=r.filter((e=>!!e)).slice().reverse();for(const c of d)o=c(i,{data:t,defaultError:o}).message;return{...a,path:s,message:o}};function h(e,t){const n=l(),r=p({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===c?void 0:c].filter((e=>!!e))});e.common.issues.push(r)}class m{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return f;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const e=await r.key,t=await r.value;n.push({key:e,value:t})}return m.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:a}=r;if("aborted"===t.status)return f;if("aborted"===a.status)return f;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!r.alwaysSet||(n[t.value]=a.value)}return{status:e.value,value:n}}}const f=Object.freeze({status:"aborted"}),y=e=>({status:"dirty",value:e}),g=e=>({status:"valid",value:e}),v=e=>"aborted"===e.status,_=e=>"dirty"===e.status,w=e=>"valid"===e.status,b=e=>"undefined"!=typeof Promise&&e instanceof Promise;function k(e,t,n,r){if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function x(e,t,n,r,a){if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var S,T,E,O;"function"==typeof SuppressedError&&SuppressedError,(T=S||(S={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},T.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class Z{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const N=(e,t)=>{if(w(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new d(e.common.issues);return this._error=t,this._error}}};function j(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:a}:{errorMap:(t,a)=>{var s,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:a.defaultError}:void 0===a.data?{message:null!==(s=null!=o?o:r)&&void 0!==s?s:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(i=null!=o?o:n)&&void 0!==i?i:a.defaultError}},description:a}}class P{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new m,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(b(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},a=this._parseSync({data:e,path:r.path,parent:r});return N(r,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await(b(r)?r:Promise.resolve(r));return N(n,a)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const a=e(t),s=()=>r.addIssue({code:o.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Te({schema:this,typeName:Le.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ee.create(this,this._def)}nullable(){return Oe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ie.create(this,this._def)}promise(){return Se.create(this,this._def)}or(e){return ce.create([this,e],this._def)}and(e){return he.create(this,e,this._def)}transform(e){return new Te({...j(this._def),schema:this,typeName:Le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ze({...j(this._def),innerType:this,defaultValue:t,typeName:Le.ZodDefault})}brand(){return new Ce({typeName:Le.ZodBranded,type:this,...j(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ne({...j(this._def),innerType:this,catchValue:t,typeName:Le.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Re.create(this,e)}readonly(){return Ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const C=/^c[^\s-]{8,}$/i,R=/^[0-9a-z]+$/,I=/^[0-9A-HJKMNP-TV-Z]{26}$/,$=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,A=/^[a-z0-9_-]{21}$/i,L=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,F=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let M;const D=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,U=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,q=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",V=new RegExp(`^${z}$`);function H(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function W(e){let t=`${z}T${H(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}class B extends P{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.string){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.string,received:t.parsedType}),f}const t=new m;let r;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("max"===s.kind)e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("length"===s.kind){const n=e.data.length>s.value,a=e.data.length<s.value;(n||a)&&(r=this._getOrReturnCtx(e,r),n?h(r,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&h(r,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if("email"===s.kind)F.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"email",code:o.invalid_string,message:s.message}),t.dirty());else if("emoji"===s.kind)M||(M=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),M.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"emoji",code:o.invalid_string,message:s.message}),t.dirty());else if("uuid"===s.kind)$.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"uuid",code:o.invalid_string,message:s.message}),t.dirty());else if("nanoid"===s.kind)A.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"nanoid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid"===s.kind)C.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"cuid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid2"===s.kind)R.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"cuid2",code:o.invalid_string,message:s.message}),t.dirty());else if("ulid"===s.kind)I.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"ulid",code:o.invalid_string,message:s.message}),t.dirty());else if("url"===s.kind)try{new URL(e.data)}catch(d){r=this._getOrReturnCtx(e,r),h(r,{validation:"url",code:o.invalid_string,message:s.message}),t.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"regex",code:o.invalid_string,message:s.message}),t.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),h(r,{code:o.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),h(r,{code:o.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),h(r,{code:o.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):"datetime"===s.kind?W(s).test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{code:o.invalid_string,validation:"datetime",message:s.message}),t.dirty()):"date"===s.kind?V.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{code:o.invalid_string,validation:"date",message:s.message}),t.dirty()):"time"===s.kind?new RegExp(`^${H(s)}$`).test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{code:o.invalid_string,validation:"time",message:s.message}),t.dirty()):"duration"===s.kind?L.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"duration",code:o.invalid_string,message:s.message}),t.dirty()):"ip"===s.kind?(a=e.data,("v4"!==(i=s.version)&&i||!D.test(a))&&("v6"!==i&&i||!U.test(a))&&(r=this._getOrReturnCtx(e,r),h(r,{validation:"ip",code:o.invalid_string,message:s.message}),t.dirty())):"base64"===s.kind?q.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"base64",code:o.invalid_string,message:s.message}),t.dirty()):n.assertNever(s);var a,i;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:o.invalid_string,...S.errToObj(n)})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...S.errToObj(e)})}url(e){return this._addCheck({kind:"url",...S.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...S.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...S.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...S.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...S.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...S.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...S.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...S.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...S.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...S.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...S.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...S.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...S.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...S.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...S.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...S.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...S.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...S.errToObj(t)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new B({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new B({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new B({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function K(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}B.create=e=>{var t;return new B({checks:[],typeName:Le.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...j(e)})};class J extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==s.number){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.number,received:t.parsedType}),f}let t;const r=new m;for(const a of this._def.checks)"int"===a.kind?n.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),h(t,{code:o.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"multipleOf"===a.kind?0!==K(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),h(t,{code:o.not_finite,message:a.message}),r.dirty()):n.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,n,r){return new J({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:S.toString(r)}]})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:S.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:S.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&n.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}J.create=e=>new J({checks:[],typeName:Le.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...j(e)});class Y extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==s.bigint){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.bigint,received:t.parsedType}),f}let t;const r=new m;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):n.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,n,r){return new Y({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:S.toString(r)}]})}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Y.create=e=>{var t;return new Y({checks:[],typeName:Le.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...j(e)})};class G extends P{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==s.boolean){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.boolean,received:t.parsedType}),f}return g(e.data)}}G.create=e=>new G({typeName:Le.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...j(e)});class X extends P{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.date){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.date,received:t.parsedType}),f}if(isNaN(e.data.getTime()))return h(this._getOrReturnCtx(e),{code:o.invalid_date}),f;const t=new m;let r;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),h(r,{code:o.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):n.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:S.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}X.create=e=>new X({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Le.ZodDate,...j(e)});class Q extends P{_parse(e){if(this._getType(e)!==s.symbol){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.symbol,received:t.parsedType}),f}return g(e.data)}}Q.create=e=>new Q({typeName:Le.ZodSymbol,...j(e)});class ee extends P{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.undefined,received:t.parsedType}),f}return g(e.data)}}ee.create=e=>new ee({typeName:Le.ZodUndefined,...j(e)});class te extends P{_parse(e){if(this._getType(e)!==s.null){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.null,received:t.parsedType}),f}return g(e.data)}}te.create=e=>new te({typeName:Le.ZodNull,...j(e)});class ne extends P{constructor(){super(...arguments),this._any=!0}_parse(e){return g(e.data)}}ne.create=e=>new ne({typeName:Le.ZodAny,...j(e)});class re extends P{constructor(){super(...arguments),this._unknown=!0}_parse(e){return g(e.data)}}re.create=e=>new re({typeName:Le.ZodUnknown,...j(e)});class ae extends P{_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.never,received:t.parsedType}),f}}ae.create=e=>new ae({typeName:Le.ZodNever,...j(e)});class se extends P{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.void,received:t.parsedType}),f}return g(e.data)}}se.create=e=>new se({typeName:Le.ZodVoid,...j(e)});class ie extends P{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==s.array)return h(t,{code:o.invalid_type,expected:s.array,received:t.parsedType}),f;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(h(t,{code:e?o.too_big:o.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(h(t,{code:o.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(h(t,{code:o.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new Z(t,e,t.path,n))))).then((e=>m.mergeArray(n,e)));const a=[...t.data].map(((e,n)=>r.type._parseSync(new Z(t,e,t.path,n))));return m.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new ie({...this._def,minLength:{value:e,message:S.toString(t)}})}max(e,t){return new ie({...this._def,maxLength:{value:e,message:S.toString(t)}})}length(e,t){return new ie({...this._def,exactLength:{value:e,message:S.toString(t)}})}nonempty(e){return this.min(1,e)}}function oe(e){if(e instanceof de){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ee.create(oe(r))}return new de({...e._def,shape:()=>t})}return e instanceof ie?new ie({...e._def,type:oe(e.element)}):e instanceof Ee?Ee.create(oe(e.unwrap())):e instanceof Oe?Oe.create(oe(e.unwrap())):e instanceof me?me.create(e.items.map((e=>oe(e)))):e}ie.create=(e,t)=>new ie({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Le.ZodArray,...j(t)});class de extends P{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=n.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==s.object){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),f}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof ae&&"strip"===this._def.unknownKeys))for(const s in n.data)a.includes(s)||i.push(s);const d=[];for(const s of a){const e=r[s],t=n.data[s];d.push({key:{status:"valid",value:s},value:e._parse(new Z(n,t,n.path,s)),alwaysSet:s in n.data})}if(this._def.catchall instanceof ae){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of i)d.push({key:{status:"valid",value:t},value:{status:"valid",value:n.data[t]}});else if("strict"===e)i.length>0&&(h(n,{code:o.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const r=n.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new Z(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of d){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>m.mergeObjectSync(t,e))):m.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return S.errToObj,new de({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,a,s,i;const o=null!==(s=null===(a=(r=this._def).errorMap)||void 0===a?void 0:a.call(r,t,n).message)&&void 0!==s?s:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=S.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new de({...this._def,unknownKeys:"strip"})}passthrough(){return new de({...this._def,unknownKeys:"passthrough"})}extend(e){return new de({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new de({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Le.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new de({...this._def,catchall:e})}pick(e){const t={};return n.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new de({...this._def,shape:()=>t})}omit(e){const t={};return n.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new de({...this._def,shape:()=>t})}deepPartial(){return oe(this)}partial(e){const t={};return n.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new de({...this._def,shape:()=>t})}required(e){const t={};return n.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Ee;)e=e._def.innerType;t[n]=e}})),new de({...this._def,shape:()=>t})}keyof(){return be(n.objectKeys(this.shape))}}de.create=(e,t)=>new de({shape:()=>e,unknownKeys:"strip",catchall:ae.create(),typeName:Le.ZodObject,...j(t)}),de.strictCreate=(e,t)=>new de({shape:()=>e,unknownKeys:"strict",catchall:ae.create(),typeName:Le.ZodObject,...j(t)}),de.lazycreate=(e,t)=>new de({shape:e,unknownKeys:"strip",catchall:ae.create(),typeName:Le.ZodObject,...j(t)});class ce extends P{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const n=e.map((e=>new d(e.ctx.common.issues)));return h(t,{code:o.invalid_union,unionErrors:n}),f}));{let e;const r=[];for(const s of n){const n={...t,common:{...t.common,issues:[]},parent:null},a=s._parseSync({data:t.data,path:t.path,parent:n});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=r.map((e=>new d(e)));return h(t,{code:o.invalid_union,unionErrors:a}),f}}get options(){return this._def.options}}ce.create=(e,t)=>new ce({options:e,typeName:Le.ZodUnion,...j(t)});const ue=e=>e instanceof _e?ue(e.schema):e instanceof Te?ue(e.innerType()):e instanceof we?[e.value]:e instanceof ke?e.options:e instanceof xe?n.objectValues(e.enum):e instanceof Ze?ue(e._def.innerType):e instanceof ee?[void 0]:e instanceof te?[null]:e instanceof Ee?[void 0,...ue(e.unwrap())]:e instanceof Oe?[null,...ue(e.unwrap())]:e instanceof Ce||e instanceof Ie?ue(e.unwrap()):e instanceof Ne?ue(e._def.innerType):[];class le extends P{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.object)return h(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),f;const n=this.discriminator,r=t.data[n],a=this.optionsMap.get(r);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(h(t,{code:o.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),f)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const a of t){const t=ue(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(r.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);r.set(n,a)}}return new le({typeName:Le.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...j(n)})}}function pe(e,t){const r=i(e),a=i(t);if(e===t)return{valid:!0,data:e};if(r===s.object&&a===s.object){const r=n.objectKeys(t),a=n.objectKeys(e).filter((e=>-1!==r.indexOf(e))),s={...e,...t};for(const n of a){const r=pe(e[n],t[n]);if(!r.valid)return{valid:!1};s[n]=r.data}return{valid:!0,data:s}}if(r===s.array&&a===s.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const a=pe(e[r],t[r]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}return r===s.date&&a===s.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class he extends P{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(v(e)||v(r))return f;const a=pe(e.value,r.value);return a.valid?((_(e)||_(r))&&t.dirty(),{status:t.value,value:a.data}):(h(n,{code:o.invalid_intersection_types}),f)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}he.create=(e,t,n)=>new he({left:e,right:t,typeName:Le.ZodIntersection,...j(n)});class me extends P{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.array)return h(n,{code:o.invalid_type,expected:s.array,received:n.parsedType}),f;if(n.data.length<this._def.items.length)return h(n,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f;!this._def.rest&&n.data.length>this._def.items.length&&(h(n,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new Z(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>m.mergeArray(t,e))):m.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new me({...this._def,rest:e})}}me.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new me({items:e,typeName:Le.ZodTuple,rest:null,...j(t)})};class fe extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.object)return h(n,{code:o.invalid_type,expected:s.object,received:n.parsedType}),f;const r=[],a=this._def.keyType,i=this._def.valueType;for(const s in n.data)r.push({key:a._parse(new Z(n,s,n.path,s)),value:i._parse(new Z(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?m.mergeObjectAsync(t,r):m.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new fe(t instanceof P?{keyType:e,valueType:t,typeName:Le.ZodRecord,...j(n)}:{keyType:B.create(),valueType:e,typeName:Le.ZodRecord,...j(t)})}}class ye extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.map)return h(n,{code:o.invalid_type,expected:s.map,received:n.parsedType}),f;const r=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map((([e,t],s)=>({key:r._parse(new Z(n,e,n.path,[s,"key"])),value:a._parse(new Z(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of i){const r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return f;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of i){const r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return f;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}ye.create=(e,t,n)=>new ye({valueType:t,keyType:e,typeName:Le.ZodMap,...j(n)});class ge extends P{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.set)return h(n,{code:o.invalid_type,expected:s.set,received:n.parsedType}),f;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(h(n,{code:o.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(h(n,{code:o.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const a=this._def.valueType;function i(e){const n=new Set;for(const r of e){if("aborted"===r.status)return f;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const d=[...n.data.values()].map(((e,t)=>a._parse(new Z(n,e,n.path,t))));return n.common.async?Promise.all(d).then((e=>i(e))):i(d)}min(e,t){return new ge({...this._def,minSize:{value:e,message:S.toString(t)}})}max(e,t){return new ge({...this._def,maxSize:{value:e,message:S.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ge.create=(e,t)=>new ge({valueType:e,minSize:null,maxSize:null,typeName:Le.ZodSet,...j(t)});class ve extends P{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.function)return h(t,{code:o.invalid_type,expected:s.function,received:t.parsedType}),f;function n(e,n){return p({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l(),c].filter((e=>!!e)),issueData:{code:o.invalid_arguments,argumentsError:n}})}function r(e,n){return p({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l(),c].filter((e=>!!e)),issueData:{code:o.invalid_return_type,returnTypeError:n}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Se){const e=this;return g((async function(...t){const s=new d([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw s.addIssue(n(t,e)),s})),c=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(c,a).catch((e=>{throw s.addIssue(r(c,e)),s}))}))}{const e=this;return g((function(...t){const s=e._def.args.safeParse(t,a);if(!s.success)throw new d([n(t,s.error)]);const o=Reflect.apply(i,this,s.data),c=e._def.returns.safeParse(o,a);if(!c.success)throw new d([r(o,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ve({...this._def,args:me.create(e).rest(re.create())})}returns(e){return new ve({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ve({args:e||me.create([]).rest(re.create()),returns:t||re.create(),typeName:Le.ZodFunction,...j(n)})}}class _e extends P{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_e.create=(e,t)=>new _e({getter:e,typeName:Le.ZodLazy,...j(t)});class we extends P{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:o.invalid_literal,expected:this._def.value}),f}return{status:"valid",value:e.data}}get value(){return this._def.value}}function be(e,t){return new ke({values:e,typeName:Le.ZodEnum,...j(t)})}we.create=(e,t)=>new we({value:e,typeName:Le.ZodLiteral,...j(t)});class ke extends P{constructor(){super(...arguments),E.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return h(t,{expected:n.joinValues(r),received:t.parsedType,code:o.invalid_type}),f}if(k(this,E)||x(this,E,new Set(this._def.values)),!k(this,E).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return h(t,{received:t.data,code:o.invalid_enum_value,options:n}),f}return g(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ke.create(e,{...this._def,...t})}exclude(e,t=this._def){return ke.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}E=new WeakMap,ke.create=be;class xe extends P{constructor(){super(...arguments),O.set(this,void 0)}_parse(e){const t=n.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==s.string&&r.parsedType!==s.number){const e=n.objectValues(t);return h(r,{expected:n.joinValues(e),received:r.parsedType,code:o.invalid_type}),f}if(k(this,O)||x(this,O,new Set(n.getValidEnumValues(this._def.values))),!k(this,O).has(e.data)){const e=n.objectValues(t);return h(r,{received:r.data,code:o.invalid_enum_value,options:e}),f}return g(e.data)}get enum(){return this._def.values}}O=new WeakMap,xe.create=(e,t)=>new xe({values:e,typeName:Le.ZodNativeEnum,...j(t)});class Se extends P{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.promise&&!1===t.common.async)return h(t,{code:o.invalid_type,expected:s.promise,received:t.parsedType}),f;const n=t.parsedType===s.promise?t.data:Promise.resolve(t.data);return g(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Se.create=(e,t)=>new Se({type:e,typeName:Le.ZodPromise,...j(t)});class Te extends P{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:e=>{h(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){const e=a.transform(r.data,s);if(r.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return f;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?f:"dirty"===n.status||"dirty"===t.value?y(n.value):n}));{if("aborted"===t.value)return f;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?f:"dirty"===n.status||"dirty"===t.value?y(n.value):n}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,s);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?f:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((n=>"aborted"===n.status?f:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===a.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!w(e))return e;const n=a.transform(e.value,s);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:n}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>w(e)?Promise.resolve(a.transform(e.value,s)).then((e=>({status:t.value,value:e}))):e))}n.assertNever(a)}}Te.create=(e,t,n)=>new Te({schema:e,typeName:Le.ZodEffects,effect:t,...j(n)}),Te.createWithPreprocess=(e,t,n)=>new Te({schema:t,effect:{type:"preprocess",transform:e},typeName:Le.ZodEffects,...j(n)});class Ee extends P{_parse(e){return this._getType(e)===s.undefined?g(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ee.create=(e,t)=>new Ee({innerType:e,typeName:Le.ZodOptional,...j(t)});class Oe extends P{_parse(e){return this._getType(e)===s.null?g(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oe.create=(e,t)=>new Oe({innerType:e,typeName:Le.ZodNullable,...j(t)});class Ze extends P{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===s.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:Le.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...j(t)});class Ne extends P{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return b(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new d(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new d(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ne.create=(e,t)=>new Ne({innerType:e,typeName:Le.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...j(t)});class je extends P{_parse(e){if(this._getType(e)!==s.nan){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.nan,received:t.parsedType}),f}return{status:"valid",value:e.data}}}je.create=e=>new je({typeName:Le.ZodNaN,...j(e)});const Pe=Symbol("zod_brand");class Ce extends P{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Re extends P{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),y(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Re({in:e,out:t,typeName:Le.ZodPipeline})}}class Ie extends P{_parse(e){const t=this._def.innerType._parse(e),n=e=>(w(e)&&(e.value=Object.freeze(e.value)),e);return b(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function $e(e,t={},n){return e?ne.create().superRefine(((r,a)=>{var s,i;if(!e(r)){const e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i,d="string"==typeof e?{message:e}:e;a.addIssue({code:"custom",...d,fatal:o})}})):ne.create()}Ie.create=(e,t)=>new Ie({innerType:e,typeName:Le.ZodReadonly,...j(t)});const Ae={object:de.lazycreate};var Le,Fe;(Fe=Le||(Le={})).ZodString="ZodString",Fe.ZodNumber="ZodNumber",Fe.ZodNaN="ZodNaN",Fe.ZodBigInt="ZodBigInt",Fe.ZodBoolean="ZodBoolean",Fe.ZodDate="ZodDate",Fe.ZodSymbol="ZodSymbol",Fe.ZodUndefined="ZodUndefined",Fe.ZodNull="ZodNull",Fe.ZodAny="ZodAny",Fe.ZodUnknown="ZodUnknown",Fe.ZodNever="ZodNever",Fe.ZodVoid="ZodVoid",Fe.ZodArray="ZodArray",Fe.ZodObject="ZodObject",Fe.ZodUnion="ZodUnion",Fe.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Fe.ZodIntersection="ZodIntersection",Fe.ZodTuple="ZodTuple",Fe.ZodRecord="ZodRecord",Fe.ZodMap="ZodMap",Fe.ZodSet="ZodSet",Fe.ZodFunction="ZodFunction",Fe.ZodLazy="ZodLazy",Fe.ZodLiteral="ZodLiteral",Fe.ZodEnum="ZodEnum",Fe.ZodEffects="ZodEffects",Fe.ZodNativeEnum="ZodNativeEnum",Fe.ZodOptional="ZodOptional",Fe.ZodNullable="ZodNullable",Fe.ZodDefault="ZodDefault",Fe.ZodCatch="ZodCatch",Fe.ZodPromise="ZodPromise",Fe.ZodBranded="ZodBranded",Fe.ZodPipeline="ZodPipeline",Fe.ZodReadonly="ZodReadonly";const Me=B.create,De=J.create,Ue=je.create,qe=Y.create,ze=G.create,Ve=X.create,He=Q.create,We=ee.create,Be=te.create,Ke=ne.create,Je=re.create,Ye=ae.create,Ge=se.create,Xe=ie.create,Qe=de.create,et=de.strictCreate,tt=ce.create,nt=le.create,rt=he.create,at=me.create,st=fe.create,it=ye.create,ot=ge.create,dt=ve.create,ct=_e.create,ut=we.create,lt=ke.create,pt=xe.create,ht=Se.create,mt=Te.create,ft=Ee.create,yt=Oe.create,gt=Te.createWithPreprocess,vt=Re.create,_t={string:e=>B.create({...e,coerce:!0}),number:e=>J.create({...e,coerce:!0}),boolean:e=>G.create({...e,coerce:!0}),bigint:e=>Y.create({...e,coerce:!0}),date:e=>X.create({...e,coerce:!0})},wt=f;var bt=Object.freeze({__proto__:null,defaultErrorMap:c,setErrorMap:function(e){u=e},getErrorMap:l,makeIssue:p,EMPTY_PATH:[],addIssueToContext:h,ParseStatus:m,INVALID:f,DIRTY:y,OK:g,isAborted:v,isDirty:_,isValid:w,isAsync:b,get util(){return n},get objectUtil(){return a},ZodParsedType:s,getParsedType:i,ZodType:P,datetimeRegex:W,ZodString:B,ZodNumber:J,ZodBigInt:Y,ZodBoolean:G,ZodDate:X,ZodSymbol:Q,ZodUndefined:ee,ZodNull:te,ZodAny:ne,ZodUnknown:re,ZodNever:ae,ZodVoid:se,ZodArray:ie,ZodObject:de,ZodUnion:ce,ZodDiscriminatedUnion:le,ZodIntersection:he,ZodTuple:me,ZodRecord:fe,ZodMap:ye,ZodSet:ge,ZodFunction:ve,ZodLazy:_e,ZodLiteral:we,ZodEnum:ke,ZodNativeEnum:xe,ZodPromise:Se,ZodEffects:Te,ZodTransformer:Te,ZodOptional:Ee,ZodNullable:Oe,ZodDefault:Ze,ZodCatch:Ne,ZodNaN:je,BRAND:Pe,ZodBranded:Ce,ZodPipeline:Re,ZodReadonly:Ie,custom:$e,Schema:P,ZodSchema:P,late:Ae,get ZodFirstPartyTypeKind(){return Le},coerce:_t,any:Ke,array:Xe,bigint:qe,boolean:ze,date:Ve,discriminatedUnion:nt,effect:mt,enum:lt,function:dt,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>$e((t=>t instanceof e),t),intersection:rt,lazy:ct,literal:ut,map:it,nan:Ue,nativeEnum:pt,never:Ye,null:Be,nullable:yt,number:De,object:Qe,oboolean:()=>ze().optional(),onumber:()=>De().optional(),optional:ft,ostring:()=>Me().optional(),pipeline:vt,preprocess:gt,promise:ht,record:st,set:ot,strictObject:et,string:Me,symbol:He,transformer:mt,tuple:at,undefined:We,union:tt,unknown:Je,void:Ge,NEVER:wt,ZodIssueCode:o,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:d});const kt=bt.object({detail:bt.string()});function xt(e){if(!e)return"Unknown error";if(e instanceof Error){const t=kt.safeParse(e.cause);return t.success?t.data.detail:function(e){const t=function(e){try{return JSON.parse(e)}catch{return e}}(e);if(!t)return e;const n=kt.safeParse(t);return n.success?n.data.detail:e}(e.message)}if("object"==typeof e){const t=kt.safeParse(e);return t.success?t.data.detail:JSON.stringify(e)}try{return JSON.stringify(e)}catch{return String(e)}}const St=1e3;function Tt(e,t){const n=e.map((e=>`"${e}"`)).join(", ");return new Error(`This RPC instance cannot ${t} because the transport did not provide one or more of these methods: ${n}`)}function Et(e={}){let t={};function n(e){t=e}let r,a={};function s(e){var t;a.unregisterHandler&&a.unregisterHandler(),a=e,null==(t=a.registerHandler)||t.call(a,_)}function i(e){r="function"!=typeof e?(t,n)=>{const r=e[t];if(r)return r(n);const a=e._;if(!a)throw new Error(`The requested method has no handler: ${t}`);return a(t,n)}:e}const{maxRequestTime:o=St}=e;e.transport&&s(e.transport),e.requestHandler&&i(e.requestHandler),e._debugHooks&&n(e._debugHooks);let d=0;const c=new Map,u=new Map;function l(e,...n){const r=n[0];return new Promise(((n,s)=>{var i;if(!a.send)throw Tt(["send"],"make requests");const l=d<=1e10?++d:d=0,p={type:"request",id:l,method:e,params:r};c.set(l,{resolve:n,reject:s}),o!==1/0&&u.set(l,setTimeout((()=>{u.delete(l),s(new Error("RPC request timed out."))}),o)),null==(i=t.onSend)||i.call(t,p),a.send(p)}))}const p=new Proxy(l,{get:(e,t,n)=>t in e?Reflect.get(e,t,n):e=>l(t,e)}),h=p;function m(e,...n){var r;const s=n[0];if(!a.send)throw Tt(["send"],"send messages");const i={type:"message",id:e,payload:s};null==(r=t.onSend)||r.call(t,i),a.send(i)}const f=new Proxy(m,{get:(e,t,n)=>t in e?Reflect.get(e,t,n):e=>m(t,e)}),y=f,g=new Map,v=new Set;async function _(e){var n,s;if(null==(n=t.onReceive)||n.call(t,e),!("type"in e))throw new Error("Message does not contain a type.");if("request"===e.type){if(!a.send||!r)throw Tt(["send","requestHandler"],"handle requests");const{id:n,method:o,params:d}=e;let c;try{c={type:"response",id:n,success:!0,payload:await r(o,d)}}catch(i){if(!(i instanceof Error))throw i;c={type:"response",id:n,success:!1,error:i.message}}return null==(s=t.onSend)||s.call(t,c),void a.send(c)}if("response"!==e.type){if("message"!==e.type)throw new Error(`Unexpected RPC message type: ${e.type}`);{for(const n of v)n(e.id,e.payload);const t=g.get(e.id);if(!t)return;for(const n of t)n(e.payload)}}else{const t=u.get(e.id);null!=t&&clearTimeout(t);const{resolve:n,reject:r}=c.get(e.id)??{};e.success?null==n||n(e.payload):null==r||r(new Error(e.error))}}return{setTransport:s,setRequestHandler:i,request:p,requestProxy:h,send:f,sendProxy:y,addMessageListener:function(e,t){var n;if(!a.registerHandler)throw Tt(["registerHandler"],"register message listeners");"*"!==e?(g.has(e)||g.set(e,new Set),null==(n=g.get(e))||n.add(t)):v.add(t)},removeMessageListener:function(e,t){var n,r;"*"!==e?(null==(n=g.get(e))||n.delete(t),0===(null==(r=g.get(e))?void 0:r.size)&&g.delete(e)):v.delete(t)},proxy:{send:y,request:h},_setDebugHooks:n}}const Ot="[transport-id]";function Zt(e,t={}){const{transportId:n,filter:r,remotePort:a}=t,s=e,i=a??e;let o;return{send(e){i.postMessage(function(e,t){const{transportId:n}=t;return null!=n?{[Ot]:n,data:e}:e}(e,{transportId:n}))},registerHandler(e){o=t=>{const a=t.data,[s,i]=function(e,t){const{transportId:n,filter:r}=t,a=null==r?void 0:r();if(null!=n&&null!=a)throw new Error("Cannot use both `transportId` and `filter` at the same time");let s=e;if(n){if(e[Ot]!==n)return[!0];s=e.data}return!1===a?[!0]:[!1,s]}(a,{transportId:n,filter:()=>null==r?void 0:r(t)});s||e(i)},s.addEventListener("message",o)},unregisterHandler(){o&&s.removeEventListener("message",o)}}}const Nt={debug:(...e)=>{},log:(...e)=>{console.log(...e)},warn:(...e)=>{console.warn(...e)},error:(...e)=>{console.error(...e)},trace:(...e)=>{console.trace(...e)}},jt="undefined"!=typeof window&&window.Logger||Nt;var Pt,Ct=Object.defineProperty,Rt=(e,t)=>Ct(e,"name",{value:t,configurable:!0}),It=(Pt=function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')},typeof require<"u"?require:typeof Proxy<"u"?new Proxy(Pt,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):Pt);function $t(e){return!isNaN(parseFloat(e))&&isFinite(e)}function At(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Lt(e){return function(){return this[e]}}Rt($t,"_isNumber"),Rt(At,"_capitalize"),Rt(Lt,"_getter");var Ft,Mt,Dt=["isConstructor","isEval","isNative","isToplevel"],Ut=["columnNumber","lineNumber"],qt=["fileName","functionName","source"],zt=Dt.concat(Ut,qt,["args"],["evalOrigin"]);function Vt(e){if(e)for(var t=0;t<zt.length;t++)void 0!==e[zt[t]]&&this["set"+At(zt[t])](e[zt[t]])}for(Rt(Vt,"StackFrame"),Vt.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof Vt)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new Vt(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",n=this.getColumnNumber()||"",r=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+n+")":"[eval]:"+t+":"+n:r?r+" ("+e+":"+t+":"+n+")":e+":"+t+":"+n}},Vt.fromString=Rt((function(e){var t=e.indexOf("("),n=e.lastIndexOf(")"),r=e.substring(0,t),a=e.substring(t+1,n).split(","),s=e.substring(n+1);if(0===s.indexOf("@"))var i=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(s,""),o=i[1],d=i[2],c=i[3];return new Vt({functionName:r,args:a||void 0,fileName:o,lineNumber:d||void 0,columnNumber:c||void 0})}),"StackFrame$$fromString"),Ft=0;Ft<Dt.length;Ft++)Vt.prototype["get"+At(Dt[Ft])]=Lt(Dt[Ft]),Vt.prototype["set"+At(Dt[Ft])]=function(e){return function(t){this[e]=!!t}}(Dt[Ft]);for(Mt=0;Mt<Ut.length;Mt++)Vt.prototype["get"+At(Ut[Mt])]=Lt(Ut[Mt]),Vt.prototype["set"+At(Ut[Mt])]=function(e){return function(t){if(!$t(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(Ut[Mt]);for(Ht=0;Ht<qt.length;Ht++)Vt.prototype["get"+At(qt[Ht])]=Lt(qt[Ht]),Vt.prototype["set"+At(qt[Ht])]=function(e){return function(t){this[e]=String(t)}}(qt[Ht]);var Ht,Wt=Vt;function Bt(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:Rt((function(t){if(t.stack&&t.stack.match(e))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")}),"ErrorStackParser$$parse"),extractLocation:Rt((function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]}),"ErrorStackParser$$extractLocation"),parseV8OrIE:Rt((function(t){return t.stack.split("\n").filter((function(t){return!!t.match(e)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),n=t.match(/ (\(.+\)$)/);t=n?t.replace(n[0],""):t;var r=this.extractLocation(n?n[1]:t),a=n&&t||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new Wt({functionName:a,fileName:s,lineNumber:r[1],columnNumber:r[2],source:e})}),this)}),"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:Rt((function(e){return e.stack.split("\n").filter((function(e){return!e.match(t)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Wt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,a=this.extractLocation(e.replace(t,""));return new Wt({functionName:r,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:e})}),this)}),"ErrorStackParser$$parseFFOrSafari")}}Rt(Bt,"ErrorStackParser");var Kt,Jt,Yt,Gt,Xt,Qt,en,tn,nn,rn=new Bt,an="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&!process.browser,sn=an&&typeof t<"u"&&typeof t.exports<"u"&&typeof It<"u"&&typeof __dirname<"u",on=an&&!sn,dn=typeof Deno<"u",cn=!an&&!dn,un=cn&&"object"==typeof window&&"object"==typeof document&&"function"==typeof document.createElement&&"object"==typeof sessionStorage&&"function"!=typeof importScripts,ln=cn&&"function"==typeof importScripts&&"object"==typeof self;async function pn(){if(!an||(Kt=(await import("./__vite-browser-external-CIEyP2s7.js")).default,Gt=await import("./__vite-browser-external-CIEyP2s7.js"),Xt=await import("./__vite-browser-external-CIEyP2s7.js"),Yt=(await import("./__vite-browser-external-CIEyP2s7.js")).default,Jt=await import("./__vite-browser-external-CIEyP2s7.js"),en=Jt.sep,typeof It<"u"))return;let e={fs:Gt,crypto:await import("./__vite-browser-external-CIEyP2s7.js"),ws:await import("./__vite-browser-external-CIEyP2s7.js"),child_process:await import("./__vite-browser-external-CIEyP2s7.js")};globalThis.require=function(t){return e[t]}}function hn(e,t){return Jt.resolve(t||".",e)}function mn(e,t){return void 0===t&&(t=location),new URL(e,t).toString()}function fn(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:Xt.readFile(e).then((e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))}}function yn(e,t){let n=new URL(e,location);return{response:fetch(n,t?{integrity:t}:{})}}async function gn(e,t){let{response:n,binary:r}=tn(e,t);if(r)return r;let a=await n;if(!a.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await a.arrayBuffer())}if("object"==typeof navigator&&"string"==typeof navigator.userAgent&&-1==navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Safari"),Rt(pn,"initNodeModules"),Rt(hn,"node_resolvePath"),Rt(mn,"browser_resolvePath"),Qt=an?hn:mn,an||(en="/"),Rt(fn,"node_getBinaryResponse"),Rt(yn,"browser_getBinaryResponse"),tn=an?fn:yn,Rt(gn,"loadBinaryFile"),un)nn=Rt((async e=>await import(e)),"loadScript");else if(ln)nn=Rt((async e=>{try{globalThis.importScripts(e)}catch(t){if(!(t instanceof TypeError))throw t;await import(e)}}),"loadScript");else{if(!an)throw new Error("Cannot determine runtime environment");nn=vn}async function vn(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?Yt.runInThisContext(await(await fetch(e)).text()):await import(Kt.pathToFileURL(e).href)}async function _n(e){if(an){await pn();let t=await Xt.readFile(e,{encoding:"utf8"});return JSON.parse(t)}return await(await fetch(e)).json()}async function wn(){if(sn)return __dirname;let e;try{throw new Error}catch(r){e=r}let t=rn.parse(e)[0].fileName;if(an&&!t.startsWith("file://")&&(t=`file://${t}`),on){let e=await import("./__vite-browser-external-CIEyP2s7.js");return(await import("./__vite-browser-external-CIEyP2s7.js")).fileURLToPath(e.dirname(t))}let n=t.lastIndexOf(en);if(-1===n)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,n)}function bn(e){let t=e.FS,n=e.FS.filesystems.MEMFS,r=e.PATH,a={DIR_MODE:16895,FILE_MODE:33279,mount:function(e){if(!e.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return n.mount.apply(null,arguments)},syncfs:async(e,t,n)=>{try{let r=a.getLocalSet(e),s=await a.getRemoteSet(e),i=t?s:r,o=t?r:s;await a.reconcile(e,i,o),n(null)}catch(r){n(r)}},getLocalSet:e=>{let n=Object.create(null);function a(e){return"."!==e&&".."!==e}function s(e){return t=>r.join2(e,t)}Rt(a,"isRealDir"),Rt(s,"toAbsolute");let i=t.readdir(e.mountpoint).filter(a).map(s(e.mountpoint));for(;i.length;){let e=i.pop(),r=t.stat(e);t.isDir(r.mode)&&i.push.apply(i,t.readdir(e).filter(a).map(s(e))),n[e]={timestamp:r.mtime,mode:r.mode}}return{type:"local",entries:n}},getRemoteSet:async e=>{let t=Object.create(null),n=await kn(e.opts.fileSystemHandle);for(let[s,i]of n)"."!==s&&(t[r.join2(e.mountpoint,s)]={timestamp:"file"===i.kind?(await i.getFile()).lastModifiedDate:new Date,mode:"file"===i.kind?a.FILE_MODE:a.DIR_MODE});return{type:"remote",entries:t,handles:n}},loadLocalEntry:e=>{let r=t.lookupPath(e).node,a=t.stat(e);if(t.isDir(a.mode))return{timestamp:a.mtime,mode:a.mode};if(t.isFile(a.mode))return r.contents=n.getFileDataAsTypedArray(r),{timestamp:a.mtime,mode:a.mode,contents:r.contents};throw new Error("node type not supported")},storeLocalEntry:(e,n)=>{if(t.isDir(n.mode))t.mkdirTree(e,n.mode);else{if(!t.isFile(n.mode))throw new Error("node type not supported");t.writeFile(e,n.contents,{canOwn:!0})}t.chmod(e,n.mode),t.utime(e,n.timestamp,n.timestamp)},removeLocalEntry:e=>{var n=t.stat(e);t.isDir(n.mode)?t.rmdir(e):t.isFile(n.mode)&&t.unlink(e)},loadRemoteEntry:async e=>{if("file"===e.kind){let t=await e.getFile();return{contents:new Uint8Array(await t.arrayBuffer()),mode:a.FILE_MODE,timestamp:t.lastModifiedDate}}if("directory"===e.kind)return{mode:a.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+e.kind)},storeRemoteEntry:async(e,n,a)=>{let s=e.get(r.dirname(n)),i=t.isFile(a.mode)?await s.getFileHandle(r.basename(n),{create:!0}):await s.getDirectoryHandle(r.basename(n),{create:!0});if("file"===i.kind){let e=await i.createWritable();await e.write(a.contents),await e.close()}e.set(n,i)},removeRemoteEntry:async(e,t)=>{await e.get(r.dirname(t)).removeEntry(r.basename(t)),e.delete(t)},reconcile:async(e,n,s)=>{let i=0,o=[];Object.keys(n.entries).forEach((function(e){let r=n.entries[e],a=s.entries[e];(!a||t.isFile(r.mode)&&r.timestamp.getTime()>a.timestamp.getTime())&&(o.push(e),i++)})),o.sort();let d=[];if(Object.keys(s.entries).forEach((function(e){n.entries[e]||(d.push(e),i++)})),d.sort().reverse(),!i)return;let c="remote"===n.type?n.handles:s.handles;for(let t of o){let n=r.normalize(t.replace(e.mountpoint,"/")).substring(1);if("local"===s.type){let e=c.get(n),r=await a.loadRemoteEntry(e);a.storeLocalEntry(t,r)}else{let e=a.loadLocalEntry(t);await a.storeRemoteEntry(c,n,e)}}for(let t of d)if("local"===s.type)a.removeLocalEntry(t);else{let n=r.normalize(t.replace(e.mountpoint,"/")).substring(1);await a.removeRemoteEntry(c,n)}}};e.FS.filesystems.NATIVEFS_ASYNC=a}Rt(vn,"nodeLoadScript"),Rt(_n,"loadLockFile"),Rt(wn,"calculateDirname"),Rt(bn,"initializeNativeFS");var kn=Rt((async e=>{let t=[];async function n(e){for await(let r of e.values())t.push(r),"directory"===r.kind&&await n(r)}Rt(n,"collect"),await n(e);let r=new Map;r.set(".",e);for(let a of t){let t=(await e.resolve(a)).join("/");r.set(t,a)}return r}),"getFsHandles");function xn(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Zn(e),quit(e,n){throw t.exited={status:e,toThrow:n},n},print:e.stdout,printErr:e.stderr,arguments:e.args,API:{config:e},locateFile:t=>e.indexURL+t,instantiateWasm:Nn(e.indexURL)};return t}function Sn(e){return function(t){try{t.FS.mkdirTree(e)}catch(n){console.error(`Error occurred while making a home directory '${e}':`),console.error(n),console.error("Using '/' for a home directory instead"),e="/"}t.FS.chdir(e)}}function Tn(e){return function(t){Object.assign(t.ENV,e)}}function En(e){return t=>{for(let n of e)t.FS.mkdirTree(n),t.FS.mount(t.FS.filesystems.NODEFS,{root:n},n)}}function On(e){let t=gn(e);return e=>{let n=e._py_version_major(),r=e._py_version_minor();e.FS.mkdirTree("/lib"),e.FS.mkdirTree(`/lib/python${n}.${r}/site-packages`),e.addRunDependency("install-stdlib"),t.then((t=>{e.FS.writeFile(`/lib/python${n}${r}.zip`,t)})).catch((e=>{console.error("Error occurred while installing the standard library:"),console.error(e)})).finally((()=>{e.removeRunDependency("install-stdlib")}))}}function Zn(e){let t;return t=null!=e.stdLibURL?e.stdLibURL:e.indexURL+"python_stdlib.zip",[On(t),Sn(e.env.HOME),Tn(e.env),En(e._node_mounts),bn]}function Nn(e){let{binary:t,response:n}=tn(e+"pyodide.asm.wasm");return function(e,r){return async function(){try{let a;a=n?await WebAssembly.instantiateStreaming(n,e):await WebAssembly.instantiate(await t,e);let{instance:s,module:i}=a;typeof WasmOffsetConverter<"u"&&(wasmOffsetConverter=new WasmOffsetConverter(wasmBinary,i)),r(s,i)}catch(a){console.warn("wasm instantiation failed!"),console.warn(a)}}(),{}}}Rt(xn,"createSettings"),Rt(Sn,"createHomeDirectory"),Rt(Tn,"setEnvironment"),Rt(En,"mountLocalDirectories"),Rt(On,"installStdlib"),Rt(Zn,"getFileSystemInitializationFuncs"),Rt(Nn,"getInstantiateWasmFunc");var jn="0.26.2";async function Pn(e={}){var t,n;await pn();let r=e.indexURL||await wn();r=Qt(r),r.endsWith("/")||(r+="/"),e.indexURL=r;let a={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:r+"pyodide-lock.json",args:[],_node_mounts:[],env:{},packageCacheDir:r,packages:[],enableRunUntilComplete:!1,checkAPIVersion:!0},s=Object.assign(a,e);(t=s.env).HOME??(t.HOME="/home/pyodide"),(n=s.env).PYTHONINSPECT??(n.PYTHONINSPECT="1");let i,o=xn(s),d=o.API;if(d.lockFilePromise=_n(s.lockFileURL),"function"!=typeof _createPyodideModule){let e=`${s.indexURL}pyodide.asm.js`;await nn(e)}if(e._loadSnapshot){let t=await e._loadSnapshot;i=ArrayBuffer.isView(t)?t:new Uint8Array(t),o.noInitialRun=!0,o.INITIAL_MEMORY=i.length}let c,u=await _createPyodideModule(o);if(o.exited)throw o.exited.toThrow;if(e.pyproxyToStringRepr&&d.setPyProxyToStringMethod(!0),d.version!==jn&&s.checkAPIVersion)throw new Error(`Pyodide version does not match: '${jn}' <==> '${d.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);u.locateFile=e=>{throw new Error("Didn't expect to load any more file_packager files!")},i&&(c=d.restoreSnapshot(i));let l=d.finalizeBootstrap(c);return d.sys.path.insert(0,d.config.env.HOME),l.version.includes("dev")||d.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${l.version}/full/`),d._pyodide.set_excepthook(),await d.packageIndexReady,d.initializeStreams(s.stdin,s.stdout,s.stderr),l}function Cn(e){return e.FS}Rt(Pn,"loadPyodide");const Rn="notebook.py",In="/marimo",$n=Rn,An=e=>{const t=Cn(e);try{t.mkdir(In)}catch{}t.chdir(In)},Ln=e=>{Cn(e).mount(e.FS.filesystems.IDBFS,{root:"."},In)},Fn=async e=>{await qn(e,!0)},Mn=async e=>{await qn(e,!1)},Dn=e=>{const t=Cn(e),n=`${In}/${Rn}`;return t.readFile(n,{encoding:"utf8"})},Un=e=>{const{pyodide:t,filename:n,code:r}=e,a=Cn(t);if(n&&n!==Rn){const e=(e=>{try{return a.readFile(e,{encoding:"utf8"})}catch{return null}})(n);if(e)return{code:e,filename:n}}return a.writeFile(Rn,r),{code:r,filename:Rn}};function qn(e,t){return new Promise(((n,r)=>{Cn(e).syncfs(t,(e=>{e?r(e):n()}))}))}const zn=new class{constructor(){this.spans=[]}startSpan(e,t={}){const n={name:e,startTime:Date.now(),attributes:t,end:(e="ok")=>this.endSpan(n,e)};return this.spans.push(n),n}endSpan(e,t="ok"){e.endTime=Date.now(),e.status=t}getSpans(){return this.spans}wrap(e,t,n={}){const r=this.startSpan(t||e.name,n);try{const t=e();return this.endSpan(r),t}catch(a){throw this.endSpan(r,"error"),a}}wrapAsync(e,t,n={}){return async(...r)=>{const a=this.startSpan(t||e.name,n);try{const t=await e(...r);return this.endSpan(a),t}catch(s){throw this.endSpan(a,"error"),s}}}logSpans(){}};globalThis.t=zn;class Vn{constructor(){this.pyodide=null}get requirePyodide(){return function(e,t){if(!e)throw new Error(t)}(this.pyodide,"Pyodide not loaded"),this.pyodide}async bootstrap(e){return await this.loadPyodideAndPackages(e)}async loadPyodideAndPackages(e){if(!Pn)throw new Error("loadPyodide is not defined");const t=zn.startSpan("loadPyodide");try{const n=await Pn({packages:["micropip","marimo-base","Markdown","pymdown-extensions","narwhals","packaging"],_makeSnapshot:!1,lockFileURL:`https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,indexURL:`https://cdn.jsdelivr.net/pyodide/${e.pyodideVersion}/full/`});return this.pyodide=n,t.end("ok"),n}catch(n){throw jt.error("Failed to load Pyodide",n),n}}async mountFilesystem(e){const t=zn.startSpan("mountFilesystem");return An(this.requirePyodide),Ln(this.requirePyodide),await Fn(this.requirePyodide),t.end("ok"),Un({pyodide:this.requirePyodide,code:e.code,filename:e.filename})}async startSession(e){const{code:t,filename:n,onMessage:r,queryParameters:a,userConfig:s}=e;self.messenger={callback:r},self.query_params=a,self.user_config=s;const i=zn.startSpan("startSession.runPython"),o=n||$n,[d,c,u]=this.requirePyodide.runPython(`\n print("[py] Starting marimo...")\n import asyncio\n import js\n from marimo._pyodide.bootstrap import create_session, instantiate\n\n assert js.messenger, "messenger is not defined"\n assert js.query_params, "query_params is not defined"\n\n session, bridge = create_session(\n filename="${o}",\n query_params=js.query_params.to_py(),\n message_callback=js.messenger.callback,\n user_config=js.user_config.to_py(),\n )\n\n def init(auto_instantiate=True):\n instantiate(session, auto_instantiate)\n asyncio.create_task(session.start())\n\n # Find the packages to install\n with open("${o}", "r") as f:\n packages = session.find_packages(f.read())\n\n bridge, init, packages`);i.end();const l=new Set(u.toJs());return this.loadNotebookDeps(t,l).then((()=>c(s.runtime.auto_instantiate))),d}async loadNotebookDeps(e,t){const n=this.requirePyodide;e.includes("mo.sql")&&(e="import duckdb\n"+(e=`import pandas\n${e}`)),e="import pyodide_http\n"+(e="import jedi\n"+(e="import pygments\n"+(e=`import docutils\n${e}`)));const r=[...t];let a=zn.startSpan("pyodide.loadPackage");await n.loadPackagesFromImports(e,{errorCallback:jt.error,messageCallback:jt.log}),a.end(),a=zn.startSpan("micropip.install");const s=r.filter((e=>!n.loadedPackages[e]));s.length>0&&await n.runPythonAsync(`\n import micropip\n import sys\n # Filter out builtins\n missing = [p for p in ${JSON.stringify(s)} if p not in sys.modules]\n if len(missing) > 0:\n print("Loading from micropip:", missing)\n await micropip.install(missing)\n `).catch((e=>{jt.error("Failed to load packages from micropip",e)})),a.end()}}const Hn=async function(){var e;try{const t=self.name,n=function(e){return e.includes("dev"),`v${jn}`}(t),r=await async function(e){try{return await import(`/wasm/controller.js?version=${e}`)}catch{return new Vn}}(t);self.controller=r,self.pyodide=await r.bootstrap({version:t,pyodideVersion:n}),await(null==(e=r.mountFilesystem)?void 0:e.call(r,{code:"",filename:null})),Bn.send.initialized({})}catch(t){jt.error("Error bootstrapping",t),Bn.send.initializedError({error:xt(t)})}}(),Wn={readFile:async e=>(await Hn,self.pyodide.FS.readFile(e,{encoding:"utf8"})),readNotebook:async()=>(await Hn,Dn(self.pyodide)),saveNotebook:async e=>{await Hn;const t=self.pyodide.runPython("\n from marimo._pyodide.bootstrap import save_file\n\n save_file\n ");await t(JSON.stringify(e),$n),await Mn(self.pyodide)}},Bn=function(e){return Et(e)}({transport:(Kn={transportId:"marimo-transport"},Zt(self,Kn)),requestHandler:Wn});var Kn;Bn.send("ready",{})}},function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports});export default r();
@@ -1 +0,0 @@
1
- import{s as r,a as s,c as t,b as a}from"./chunk-5RIWM3LS-B9D6L1LU.js";import{_ as e}from"./mermaid-BryxgLCw.js";import"./transform-C6EuPmuu.js";import"./chunk-4LC2V6XN-C6bu2e_w.js";import"./index-CfKS94AD.js";import"./step-DY8hpDjU.js";var o={parser:r,db:s,renderer:t,styles:a,init:e((r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute,s.clear()}),"init")};export{o as diagram};