omni-context-cli 0.0.82 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/README.zh-CN.md +9 -7
- package/dist/agents/recall.md +49 -0
- package/dist/bin/aarch64-apple-darwin/reminders +0 -0
- package/dist/bin/x86_64-apple-darwin/reminders +0 -0
- package/dist/cli.js +7 -7
- package/dist/clients/extension.vsix +0 -0
- package/dist/clients/web/assets/{_baseUniq-BhucQAx8.js → _baseUniq-CXLGS_pA.js} +1 -1
- package/dist/clients/web/assets/{arc-DCXJhqjf.js → arc-4Z7JckQX.js} +1 -1
- package/dist/clients/web/assets/{architectureDiagram-VXUJARFQ-Co3KwSpb.js → architectureDiagram-VXUJARFQ-Dp64qP_w.js} +1 -1
- package/dist/clients/web/assets/{blockDiagram-VD42YOAC-DU6RRN8D.js → blockDiagram-VD42YOAC-CLQKEpqC.js} +1 -1
- package/dist/clients/web/assets/{c4Diagram-YG6GDRKO-16fd-x82.js → c4Diagram-YG6GDRKO-QgDkv6UE.js} +1 -1
- package/dist/clients/web/assets/channel-BpF6PGG7.js +1 -0
- package/dist/clients/web/assets/{chunk-4BX2VUAB-5g-HPCZY.js → chunk-4BX2VUAB-Dahw83LE.js} +1 -1
- package/dist/clients/web/assets/{chunk-55IACEB6-BaobwOT0.js → chunk-55IACEB6-DzaxJDHn.js} +1 -1
- package/dist/clients/web/assets/{chunk-B4BG7PRW-BXEqAVZ9.js → chunk-B4BG7PRW-D0vomqbV.js} +1 -1
- package/dist/clients/web/assets/{chunk-DI55MBZ5-CAVGoHdr.js → chunk-DI55MBZ5-qiVnK6p8.js} +1 -1
- package/dist/clients/web/assets/{chunk-FMBD7UC4-Bxj9xhWB.js → chunk-FMBD7UC4-C2sJxaxL.js} +1 -1
- package/dist/clients/web/assets/{chunk-QN33PNHL-BXnFDMFI.js → chunk-QN33PNHL-D5AwC2-G.js} +1 -1
- package/dist/clients/web/assets/{chunk-QZHKN3VN-dYBdLfue.js → chunk-QZHKN3VN-IFvcMven.js} +1 -1
- package/dist/clients/web/assets/{chunk-TZMSLE5B-CZiCZobU.js → chunk-TZMSLE5B-DMB_9lpR.js} +1 -1
- package/dist/clients/web/assets/classDiagram-2ON5EDUG-DyrQA-YS.js +1 -0
- package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-DyrQA-YS.js +1 -0
- package/dist/clients/web/assets/clone-i_-uxRn_.js +1 -0
- package/dist/clients/web/assets/{cose-bilkent-S5V4N54A-KkzA-wdk.js → cose-bilkent-S5V4N54A-kviy0s3Q.js} +1 -1
- package/dist/clients/web/assets/{dagre-6UL2VRFP-wkfpxi2i.js → dagre-6UL2VRFP-CH4Wzhwt.js} +1 -1
- package/dist/clients/web/assets/{diagram-PSM6KHXK-C4albtoO.js → diagram-PSM6KHXK-CJG0PuJC.js} +1 -1
- package/dist/clients/web/assets/{diagram-QEK2KX5R-DIT-iXzE.js → diagram-QEK2KX5R-Bfcdv7nY.js} +1 -1
- package/dist/clients/web/assets/{diagram-S2PKOQOG-B6vlDQWG.js → diagram-S2PKOQOG-CFAxMjgR.js} +1 -1
- package/dist/clients/web/assets/{erDiagram-Q2GNP2WA-C-i0tH4M.js → erDiagram-Q2GNP2WA-B1IZMS-3.js} +1 -1
- package/dist/clients/web/assets/{flowDiagram-NV44I4VS-D9QlDl7K.js → flowDiagram-NV44I4VS-B20jmVdi.js} +1 -1
- package/dist/clients/web/assets/{ganttDiagram-JELNMOA3-99ZXm_j4.js → ganttDiagram-JELNMOA3-CN_UmMdY.js} +1 -1
- package/dist/clients/web/assets/{gitGraphDiagram-NY62KEGX-BvG2b96g.js → gitGraphDiagram-NY62KEGX-4_JTxeSU.js} +1 -1
- package/dist/clients/web/assets/{graph-DskrZt2F.js → graph-q8jimC6O.js} +1 -1
- package/dist/clients/web/assets/index-BxRbZ9su.js +2 -0
- package/dist/clients/web/assets/{index-BgpKq9gl.css → index-CUmxgXdk.css} +1 -1
- package/dist/clients/web/assets/{infoDiagram-WHAUD3N6-CeaE3BIl.js → infoDiagram-WHAUD3N6-CZ6m9EkC.js} +1 -1
- package/dist/clients/web/assets/{journeyDiagram-XKPGCS4Q-BGvc13gp.js → journeyDiagram-XKPGCS4Q-DQDsc9_r.js} +1 -1
- package/dist/clients/web/assets/{kanban-definition-3W4ZIXB7-GRGUHFd_.js → kanban-definition-3W4ZIXB7-BnCFTjcI.js} +1 -1
- package/dist/clients/web/assets/{layout-Dqh7tXnS.js → layout-Cpghn7MH.js} +1 -1
- package/dist/clients/web/assets/{linear-CAvmmGuA.js → linear-CQh1t4yP.js} +1 -1
- package/dist/clients/web/assets/{min-CFmdQFhA.js → min-D8ZfxGeM.js} +1 -1
- package/dist/clients/web/assets/{mindmap-definition-VGOIOE7T-vizYavma.js → mindmap-definition-VGOIOE7T-B1wT0z3Z.js} +1 -1
- package/dist/clients/web/assets/{pieDiagram-ADFJNKIX-CIHUcxPM.js → pieDiagram-ADFJNKIX-D3fiR6Th.js} +1 -1
- package/dist/clients/web/assets/{quadrantDiagram-AYHSOK5B-Vo43uM-B.js → quadrantDiagram-AYHSOK5B-D9BQB94o.js} +1 -1
- package/dist/clients/web/assets/{requirementDiagram-UZGBJVZJ-BIx-xVfI.js → requirementDiagram-UZGBJVZJ-DUYZZiA1.js} +1 -1
- package/dist/clients/web/assets/{sankeyDiagram-TZEHDZUN-DZL45Cw0.js → sankeyDiagram-TZEHDZUN-B0sGIcH7.js} +1 -1
- package/dist/clients/web/assets/{sequenceDiagram-WL72ISMW-DiRfj68s.js → sequenceDiagram-WL72ISMW-D7SULYFs.js} +1 -1
- package/dist/clients/web/assets/{stateDiagram-FKZM4ZOC-BC6eofKf.js → stateDiagram-FKZM4ZOC-C3HTi2Ed.js} +1 -1
- package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-CBHbI6jw.js +1 -0
- package/dist/clients/web/assets/{timeline-definition-IT6M3QCI-D7FZfilq.js → timeline-definition-IT6M3QCI-C2-N2wnL.js} +1 -1
- package/dist/clients/web/assets/{treemap-KMMF4GRG-CxtUbtJF.js → treemap-KMMF4GRG-BTZXx0BR.js} +1 -1
- package/dist/clients/web/assets/{xychartDiagram-PRI3JC2R-Cqgj1cDw.js → xychartDiagram-PRI3JC2R-HRlOIi7r.js} +1 -1
- package/dist/clients/web/index.html +3 -3
- package/dist/skills/simplify/SKILL.md +6 -6
- package/dist/workflows/analytics.md +27 -0
- package/dist/workflows/general.md +22 -11
- package/dist/workflows/programming.md +16 -1
- package/dist/workflows/recall.md +21 -0
- package/package.json +3 -1
- package/scripts/wrap-prompts.mjs +98 -0
- package/dist/clients/web/assets/channel-CVFOemLv.js +0 -1
- package/dist/clients/web/assets/classDiagram-2ON5EDUG-DoLxPFQr.js +0 -1
- package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-DoLxPFQr.js +0 -1
- package/dist/clients/web/assets/clone-Dg0kyf3N.js +0 -1
- package/dist/clients/web/assets/index-whs1emOP.js +0 -2
- package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-uahq2mzE.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var t,i,s,e,h,r,a,n,o,c;import{s as l,g as u,q as f,p as x,a as p,b as d,_ as g,l as m,H as b,e as _,y,F as A,i as k,D as w,E as T,K as v,aA as S,R as M}from"./index-whs1emOP.js";import{i as D}from"./init-C9Lo50Hz.js";import{o as E}from"./ordinal-2upbOM02.js";import{l as R}from"./linear-CAvmmGuA.js";import"./defaultLocale-DK_abR1s.js";function C(){var t,i,s=E().unknown(void 0),e=s.domain,h=s.range,r=0,a=1,n=!1,o=0,c=0,l=.5;function u(){var s=e().length,u=a<r,f=u?a:r,x=u?r:a;t=(x-f)/Math.max(1,s-o+2*c),n&&(t=Math.floor(t)),f+=(x-f-t*(s-o))*l,i=t*(1-o),n&&(f=Math.round(f),i=Math.round(i));var p=function(t,i,s){t=+t,i=+i,s=(h=arguments.length)<2?(i=t,t=0,1):h<3?1:+s;for(var e=-1,h=0|Math.max(0,Math.ceil((i-t)/s)),r=new Array(h);++e<h;)r[e]=t+e*s;return r}(s).map(function(i){return f+t*i});return h(u?p.reverse():p)}return delete s.unknown,s.domain=function(t){return arguments.length?(e(t),u()):e()},s.range=function(t){return arguments.length?([r,a]=t,r=+r,a=+a,u()):[r,a]},s.rangeRound=function(t){return[r,a]=t,r=+r,a=+a,n=!0,u()},s.bandwidth=function(){return i},s.step=function(){return t},s.round=function(t){return arguments.length?(n=!!t,u()):n},s.padding=function(t){return arguments.length?(o=Math.min(1,c=+t),u()):o},s.paddingInner=function(t){return arguments.length?(o=Math.min(1,t),u()):o},s.paddingOuter=function(t){return arguments.length?(c=+t,u()):c},s.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),u()):l},s.copy=function(){return C(e(),[r,a]).round(n).paddingInner(o).paddingOuter(c).align(l)},D.apply(u(),arguments)}var I=function(){var t=g(function(t,i,s,e){for(s=s||{},e=t.length;e--;s[t[e]]=i);return s},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],e=[1,3],h=[1,5],r=[1,6],a=[1,7],n=[1,5,10,12,14,16,18,19,21,23,34,35,36],o=[1,25],c=[1,26],l=[1,28],u=[1,29],f=[1,30],x=[1,31],p=[1,32],d=[1,33],m=[1,34],b=[1,35],_=[1,36],y=[1,37],A=[1,43],k=[1,42],w=[1,47],T=[1,50],v=[1,10,12,14,16,18,19,21,23,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],M=[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],E={trace:g(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:g(function(t,i,s,e,h,r,a){var n=r.length-1;switch(h){case 5:e.setOrientation(r[n]);break;case 9:e.setDiagramTitle(r[n].text.trim());break;case 12:e.setLineData({text:"",type:"text"},r[n]);break;case 13:e.setLineData(r[n-1],r[n]);break;case 14:e.setBarData({text:"",type:"text"},r[n]);break;case 15:e.setBarData(r[n-1],r[n]);break;case 16:this.$=r[n].trim(),e.setAccTitle(this.$);break;case 17:case 18:this.$=r[n].trim(),e.setAccDescription(this.$);break;case 19:case 27:this.$=r[n-1];break;case 20:this.$=[Number(r[n-2]),...r[n]];break;case 21:this.$=[Number(r[n])];break;case 22:e.setXAxisTitle(r[n]);break;case 23:e.setXAxisTitle(r[n-1]);break;case 24:e.setXAxisTitle({type:"text",text:""});break;case 25:e.setXAxisBand(r[n]);break;case 26:e.setXAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 28:this.$=[r[n-2],...r[n]];break;case 29:this.$=[r[n]];break;case 30:e.setYAxisTitle(r[n]);break;case 31:e.setYAxisTitle(r[n-1]);break;case 32:e.setYAxisTitle({type:"text",text:""});break;case 33:e.setYAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 37:case 38:this.$={text:r[n],type:"text"};break;case 39:this.$={text:r[n],type:"markdown"};break;case 40:this.$=r[n];break;case 41:this.$=r[n-1]+""+r[n]}},"anonymous"),table:[t(i,s,{3:1,4:2,7:4,5:e,34:h,35:r,36:a}),{1:[3]},t(i,s,{4:2,7:4,3:8,5:e,34:h,35:r,36:a}),t(i,s,{4:2,7:4,6:9,3:10,5:e,8:[1,11],34:h,35:r,36:a}),{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(n,[2,34]),t(n,[2,35]),t(n,[2,36]),{1:[2,1]},t(i,s,{4:2,7:4,3:21,5:e,34:h,35:r,36:a}),{1:[2,3]},t(n,[2,5]),t(i,[2,7],{4:22,34:h,35:r,36:a}),{11:23,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:39,13:38,24:A,27:k,29:40,30:41,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:45,15:44,27:w,33:46,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:49,17:48,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:52,17:51,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{20:[1,53]},{22:[1,54]},t(v,[2,18]),{1:[2,2]},t(v,[2,8]),t(v,[2,9]),t(S,[2,37],{40:55,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y}),t(S,[2,38]),t(S,[2,39]),t(M,[2,40]),t(M,[2,42]),t(M,[2,43]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(v,[2,10]),t(v,[2,22],{30:41,29:56,24:A,27:k}),t(v,[2,24]),t(v,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,11]),t(v,[2,30],{33:60,27:w}),t(v,[2,32]),{31:[1,61]},t(v,[2,12]),{17:62,24:T},{25:63,27:D},t(v,[2,14]),{17:65,24:T},t(v,[2,16]),t(v,[2,17]),t(M,[2,41]),t(v,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(v,[2,31]),{27:[1,69]},t(v,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(v,[2,15]),t(v,[2,26]),t(v,[2,27]),{11:59,32:72,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,33]),t(v,[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:g(function(t,i){if(!i.recoverable){var s=new Error(t);throw s.hash=i,s}this.trace(t)},"parseError"),parse:g(function(t){var i=this,s=[0],e=[],h=[null],r=[],a=this.table,n="",o=0,c=0,l=r.slice.call(arguments,1),u=Object.create(this.lexer),f={yy:{}};for(var x in this.yy)Object.prototype.hasOwnProperty.call(this.yy,x)&&(f.yy[x]=this.yy[x]);u.setInput(t,f.yy),f.yy.lexer=u,f.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;r.push(p);var d=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=e.pop()||u.lex()||1)&&(t instanceof Array&&(t=(e=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,g(function(t){s.length=s.length-2*t,h.length=h.length-t,r.length=r.length-t},"popStack"),g(m,"lex");for(var b,_,y,A,k,w,T,v,S={};;){if(_=s[s.length-1],this.defaultActions[_]?y=this.defaultActions[_]:(null==b&&(b=m()),y=a[_]&&a[_][b]),void 0===y||!y.length||!y[0]){var M="";for(k in v=[],a[_])this.terminals_[k]&&k>2&&v.push("'"+this.terminals_[k]+"'");M=u.showPosition?"Parse error on line "+(o+1)+":\n"+u.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(M,{text:u.match,token:this.terminals_[b]||b,line:u.yylineno,loc:p,expected:v})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(y[0]){case 1:s.push(b),h.push(u.yytext),r.push(u.yylloc),s.push(y[1]),b=null,c=u.yyleng,n=u.yytext,o=u.yylineno,p=u.yylloc;break;case 2:if(w=this.productions_[y[1]][1],S.$=h[h.length-w],S._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},d&&(S._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(A=this.performAction.apply(S,[n,c,o,f.yy,y[1],h,r].concat(l))))return A;w&&(s=s.slice(0,-1*w*2),h=h.slice(0,-1*w),r=r.slice(0,-1*w)),s.push(this.productions_[y[1]][0]),h.push(S.$),r.push(S._$),T=a[s[s.length-2]][s[s.length-1]],s.push(T);break;case 3:return!0}}return!0},"parse")},R=function(){return{EOF:1,parseError:g(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:g(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:g(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:g(function(t){var i=t.length,s=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 e=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===e.length?this.yylloc.first_column:0)+e[e.length-s.length].length-s[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(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:g(function(t){this.unput(this.match.slice(t))},"less"),pastInput:g(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:g(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:g(function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:g(function(t,i){var s,e,h;if(this.options.backtrack_lexer&&(h={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&&(h.yylloc.range=this.yylloc.range.slice(0))),(e=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in h)this[r]=h[r];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;var t,i,s,e;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),r=0;r<h.length;r++)if((s=this._input.match(this.rules[h[r]]))&&(!i||s[0].length>i[0].length)){if(i=s,e=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,h[r])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,h[e]))&&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:g(function(){var t=this.next();return t||this.lex()},"lex"),begin:g(function(t){this.conditionStack.push(t)},"begin"),popState:g(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(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:g(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:g(function(t){this.begin(t)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(t,i,s,e){switch(s){case 0:case 1:case 5:case 44: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 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 27:this.pushState("string");break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 45:return 35;case 46: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,/^(?:xychart\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,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],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:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}}();function C(){this.yy={}}return E.lexer=R,g(C,"Parser"),C.prototype=E,E.Parser=C,new C}();I.parser=I;var L=I;function P(t){return"bar"===t.type}function $(t){return"band"===t.type}function N(t){return"linear"===t.type}g(P,"isBarPlot"),g($,"isBandAxisData"),g(N,"isLinearAxisData");var z=(g(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 s={width:0,height:0},e=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const h of t){const t=S(e,1,h),r=t?t.width:h.length*i,a=t?t.height:i;s.width=Math.max(s.width,r),s.height=Math.max(s.height,a)}return e.remove(),s}},"TextDimensionCalculatorWithFont"),t),B=(g(i=class{constructor(t,i,s,e){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=e,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 s=this.getLabelDimension(),e=.2*t.width;this.outerPadding=Math.min(s.width/2,e);const h=s.height+2*this.axisConfig.labelPadding;this.labelTextHeight=s.height,h<=i&&(i-=h,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),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,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 s=this.getLabelDimension(),e=.2*t.height;this.outerPadding=Math.min(s.height/2,e);const h=s.width+2*this.axisConfig.labelPadding;h<=i&&(i-=h,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),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,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),O=(g(s=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.categories=s,this.scale=C().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=C().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),m.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},"BandAxis"),s),X=(g(e=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.domain=s,this.scale=R().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=R().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},"LinearAxis"),e);function F(t,i,s,e){const h=new z(e);return $(t)?new O(i,s,t.categories,t.title,h):new X(i,s,[t.min,t.max],t.title,h)}g(F,"getAxis");var U=(g(h=class{constructor(t,i,s,e){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=e,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),s=Math.max(i.width,t.width),e=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=e&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=e,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"),h);function W(t,i,s,e){const h=new z(e);return new U(h,t,i,s)}g(W,"getChartTitleComponent");var Y=(g(r=class{constructor(t,i,s,e,h){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=e,this.plotIndex=h}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?M().y(t=>t[0]).x(t=>t[1])(t):M().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"),r),j=(g(a=class{constructor(t,i,s,e,h,r){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=e,this.orientation=h,this.plotIndex=r}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()),s=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]-s,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]-s,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"),a),H=(g(n=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,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,s]of this.chartData.plots.entries())switch(s.type){case"line":{const e=new Y(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}break;case"bar":{const e=new j(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}}return t}},"BasePlot"),n);function V(t,i,s){return new H(t,i,s)}g(V,"getPlotComponent");var Q,G=(g(o=class{constructor(t,i,s,e){this.chartConfig=t,this.chartData=i,this.componentStore={title:W(t,i,s,e),plot:V(t,i,s),xAxis:F(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},e),yAxis:F(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},e)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),r=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),a=this.componentStore.plot.calculateSpace({width:h,height:r});t-=a.width,i-=a.height,a=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=a.height,i-=a.height,this.componentStore.xAxis.setAxisPosition("bottom"),a=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=a.height,this.componentStore.yAxis.setAxisPosition("left"),a=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=a.width,t-=a.width,t>0&&(h+=t,t=0),i>0&&(r+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:r}),this.componentStore.plot.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:e+r}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:e}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=0,r=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),n=this.componentStore.plot.calculateSpace({width:r,height:a});t-=n.width,i-=n.height,n=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=n.height,i-=n.height,this.componentStore.xAxis.setAxisPosition("left"),n=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=n.width,e=n.width,this.componentStore.yAxis.setAxisPosition("top"),n=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=n.height,h=s+n.height,t>0&&(r+=t,t=0),i>0&&(a+=i,i=0),this.componentStore.plot.calculateSpace({width:r,height:a}),this.componentStore.plot.setBoundingBoxXY({x:e,y:h}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([h,h+a]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(t=>P(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"),o),K=(g(c=class{static build(t,i,s,e){return new G(t,i,s,e).getDrawableElement()}},"XYChartBuilder"),c),q=0,Z=rt(),J=ht(),tt=at(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1;function ht(){const t=v(),i=A();return w(t.xyChart,i.themeVariables.xyChart)}function rt(){const t=A();return w(T.xyChart,t.xyChart)}function at(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function nt(t){const i=A();return k(t.trim(),i)}function ot(t){Q=t}function ct(t){Z.chartOrientation="horizontal"===t?"horizontal":"vertical"}function lt(t){tt.xAxis.title=nt(t.text)}function ut(t,i){tt.xAxis={type:"linear",title:tt.xAxis.title,min:t,max:i},st=!0}function ft(t){tt.xAxis={type:"band",title:tt.xAxis.title,categories:t.map(t=>nt(t.text))},st=!0}function xt(t){tt.yAxis.title=nt(t.text)}function pt(t,i){tt.yAxis={type:"linear",title:tt.yAxis.title,min:t,max:i},et=!0}function dt(t){const i=Math.min(...t),s=Math.max(...t),e=N(tt.yAxis)?tt.yAxis.min:1/0,h=N(tt.yAxis)?tt.yAxis.max:-1/0;tt.yAxis={type:"linear",title:tt.yAxis.title,min:Math.min(e,i),max:Math.max(h,s)}}function gt(t){let i=[];if(0===t.length)return i;if(!st){const i=N(tt.xAxis)?tt.xAxis.min:1/0,s=N(tt.xAxis)?tt.xAxis.max:-1/0;ut(Math.min(i,1),Math.max(s,t.length))}if(et||dt(t),$(tt.xAxis)&&(i=tt.xAxis.categories.map((i,s)=>[i,t[s]])),N(tt.xAxis)){const s=tt.xAxis.min,e=tt.xAxis.max,h=(e-s)/(t.length-1),r=[];for(let t=s;t<=e;t+=h)r.push(`${t}`);i=r.map((i,s)=>[i,t[s]])}return i}function mt(t){return it[0===t?0:t%it.length]}function bt(t,i){const s=gt(i);tt.plots.push({type:"line",strokeFill:mt(q),strokeWidth:2,data:s}),q++}function _t(t,i){const s=gt(i);tt.plots.push({type:"bar",fill:mt(q),data:s}),q++}function yt(){if(0===tt.plots.length)throw Error("No Plot to render, please provide a plot with some data");return tt.title=f(),K.build(Z,tt,J,Q)}function At(){return J}function kt(){return Z}function wt(){return tt}g(ht,"getChartDefaultThemeConfig"),g(rt,"getChartDefaultConfig"),g(at,"getChartDefaultData"),g(nt,"textSanitizer"),g(ot,"setTmpSVGG"),g(ct,"setOrientation"),g(lt,"setXAxisTitle"),g(ut,"setXAxisRangeData"),g(ft,"setXAxisBand"),g(xt,"setYAxisTitle"),g(pt,"setYAxisRangeData"),g(dt,"setYAxisRangeFromPlotData"),g(gt,"transformDataWithoutCategory"),g(mt,"getPlotColorFromPalette"),g(bt,"setLineData"),g(_t,"setBarData"),g(yt,"getDrawableElem"),g(At,"getChartThemeConfig"),g(kt,"getChartConfig"),g(wt,"getXYChartData");var Tt={parser:L,db:{getDrawableElem:yt,clear:g(function(){y(),q=0,Z=rt(),tt={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},J=ht(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1},"clear"),setAccTitle:d,getAccTitle:p,setDiagramTitle:x,getDiagramTitle:f,getAccDescription:u,setAccDescription:l,setOrientation:ct,setXAxisTitle:lt,setXAxisRangeData:ut,setXAxisBand:ft,setYAxisTitle:xt,setYAxisRangeData:pt,setLineData:bt,setBarData:_t,setTmpSVGG:ot,getChartThemeConfig:At,getChartConfig:kt,getXYChartData:wt},renderer:{draw:g((t,i,s,e)=>{const h=e.db,r=h.getChartThemeConfig(),a=h.getChartConfig(),n=h.getXYChartData().plots[0].data.map(t=>t[1]);function o(t){return"top"===t?"text-before-edge":"middle"}function c(t){return"left"===t?"start":"right"===t?"end":"middle"}function l(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}g(o,"getDominantBaseLine"),g(c,"getTextAnchor"),g(l,"getTextTransformation"),m.debug("Rendering xychart chart\n"+t);const u=b(i),f=u.append("g").attr("class","main"),x=f.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");_(u,a.height,a.width,!0),u.attr("viewBox",`0 0 ${a.width} ${a.height}`),x.attr("fill",r.backgroundColor),h.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const p=h.getDrawableElem(),d={};function y(t){let i=f,s="";for(const[e]of t.entries()){let h=f;e>0&&d[s]&&(h=d[s]),s+=t[e],i=d[s],i||(i=d[s]=h.append("g").attr("class",t[e]))}return i}g(y,"getGroup");for(const m of p){if(0===m.data.length)continue;const t=y(m.groupTexts);switch(m.type){case"rect":if(t.selectAll("rect").data(m.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),a.showDataLabel)if("horizontal"===a.chartOrientation){let i=function(t,i){const{data:e,label:h}=t;return i*h.length*s<=e.width-10};g(i,"fitsHorizontally");const s=.7,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:s}=t;let e=.7*s.height;for(;!i(t,e)&&e>0;)e-=1;return e}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width-10).attr("y",t=>t.data.y+t.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}else{let i=function(t,i,s){const{data:e,label:h}=t,r=i*h.length*.7,a=e.x+e.width/2,n=a+r/2,o=a-r/2>=e.x&&n<=e.x+e.width,c=e.y+s+i<=e.y+e.height;return o&&c};g(i,"fitsInBar");const s=10,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:e,label:h}=t;let r=e.width/(.7*h.length);for(;!i(t,r,s)&&r>0;)r-=1;return r}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width/2).attr("y",t=>t.data.y+s).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}break;case"text":t.selectAll("text").data(m.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=>o(t.verticalPos)).attr("text-anchor",t=>c(t.horizontalPos)).attr("transform",t=>l(t)).text(t=>t.text);break;case"path":t.selectAll("path").data(m.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{Tt as diagram};
|
|
1
|
+
var t,i,s,e,h,r,a,n,o,c;import{s as l,g as u,q as f,p as x,a as p,b as d,_ as g,l as m,H as b,e as _,y,F as A,i as k,D as w,E as T,K as v,aA as S,R as M}from"./index-BxRbZ9su.js";import{i as D}from"./init-C9Lo50Hz.js";import{o as E}from"./ordinal-2upbOM02.js";import{l as R}from"./linear-CQh1t4yP.js";import"./defaultLocale-DK_abR1s.js";function C(){var t,i,s=E().unknown(void 0),e=s.domain,h=s.range,r=0,a=1,n=!1,o=0,c=0,l=.5;function u(){var s=e().length,u=a<r,f=u?a:r,x=u?r:a;t=(x-f)/Math.max(1,s-o+2*c),n&&(t=Math.floor(t)),f+=(x-f-t*(s-o))*l,i=t*(1-o),n&&(f=Math.round(f),i=Math.round(i));var p=function(t,i,s){t=+t,i=+i,s=(h=arguments.length)<2?(i=t,t=0,1):h<3?1:+s;for(var e=-1,h=0|Math.max(0,Math.ceil((i-t)/s)),r=new Array(h);++e<h;)r[e]=t+e*s;return r}(s).map(function(i){return f+t*i});return h(u?p.reverse():p)}return delete s.unknown,s.domain=function(t){return arguments.length?(e(t),u()):e()},s.range=function(t){return arguments.length?([r,a]=t,r=+r,a=+a,u()):[r,a]},s.rangeRound=function(t){return[r,a]=t,r=+r,a=+a,n=!0,u()},s.bandwidth=function(){return i},s.step=function(){return t},s.round=function(t){return arguments.length?(n=!!t,u()):n},s.padding=function(t){return arguments.length?(o=Math.min(1,c=+t),u()):o},s.paddingInner=function(t){return arguments.length?(o=Math.min(1,t),u()):o},s.paddingOuter=function(t){return arguments.length?(c=+t,u()):c},s.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),u()):l},s.copy=function(){return C(e(),[r,a]).round(n).paddingInner(o).paddingOuter(c).align(l)},D.apply(u(),arguments)}var I=function(){var t=g(function(t,i,s,e){for(s=s||{},e=t.length;e--;s[t[e]]=i);return s},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],e=[1,3],h=[1,5],r=[1,6],a=[1,7],n=[1,5,10,12,14,16,18,19,21,23,34,35,36],o=[1,25],c=[1,26],l=[1,28],u=[1,29],f=[1,30],x=[1,31],p=[1,32],d=[1,33],m=[1,34],b=[1,35],_=[1,36],y=[1,37],A=[1,43],k=[1,42],w=[1,47],T=[1,50],v=[1,10,12,14,16,18,19,21,23,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],M=[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],E={trace:g(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:g(function(t,i,s,e,h,r,a){var n=r.length-1;switch(h){case 5:e.setOrientation(r[n]);break;case 9:e.setDiagramTitle(r[n].text.trim());break;case 12:e.setLineData({text:"",type:"text"},r[n]);break;case 13:e.setLineData(r[n-1],r[n]);break;case 14:e.setBarData({text:"",type:"text"},r[n]);break;case 15:e.setBarData(r[n-1],r[n]);break;case 16:this.$=r[n].trim(),e.setAccTitle(this.$);break;case 17:case 18:this.$=r[n].trim(),e.setAccDescription(this.$);break;case 19:case 27:this.$=r[n-1];break;case 20:this.$=[Number(r[n-2]),...r[n]];break;case 21:this.$=[Number(r[n])];break;case 22:e.setXAxisTitle(r[n]);break;case 23:e.setXAxisTitle(r[n-1]);break;case 24:e.setXAxisTitle({type:"text",text:""});break;case 25:e.setXAxisBand(r[n]);break;case 26:e.setXAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 28:this.$=[r[n-2],...r[n]];break;case 29:this.$=[r[n]];break;case 30:e.setYAxisTitle(r[n]);break;case 31:e.setYAxisTitle(r[n-1]);break;case 32:e.setYAxisTitle({type:"text",text:""});break;case 33:e.setYAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 37:case 38:this.$={text:r[n],type:"text"};break;case 39:this.$={text:r[n],type:"markdown"};break;case 40:this.$=r[n];break;case 41:this.$=r[n-1]+""+r[n]}},"anonymous"),table:[t(i,s,{3:1,4:2,7:4,5:e,34:h,35:r,36:a}),{1:[3]},t(i,s,{4:2,7:4,3:8,5:e,34:h,35:r,36:a}),t(i,s,{4:2,7:4,6:9,3:10,5:e,8:[1,11],34:h,35:r,36:a}),{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(n,[2,34]),t(n,[2,35]),t(n,[2,36]),{1:[2,1]},t(i,s,{4:2,7:4,3:21,5:e,34:h,35:r,36:a}),{1:[2,3]},t(n,[2,5]),t(i,[2,7],{4:22,34:h,35:r,36:a}),{11:23,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:39,13:38,24:A,27:k,29:40,30:41,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:45,15:44,27:w,33:46,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:49,17:48,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:52,17:51,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{20:[1,53]},{22:[1,54]},t(v,[2,18]),{1:[2,2]},t(v,[2,8]),t(v,[2,9]),t(S,[2,37],{40:55,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y}),t(S,[2,38]),t(S,[2,39]),t(M,[2,40]),t(M,[2,42]),t(M,[2,43]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(v,[2,10]),t(v,[2,22],{30:41,29:56,24:A,27:k}),t(v,[2,24]),t(v,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,11]),t(v,[2,30],{33:60,27:w}),t(v,[2,32]),{31:[1,61]},t(v,[2,12]),{17:62,24:T},{25:63,27:D},t(v,[2,14]),{17:65,24:T},t(v,[2,16]),t(v,[2,17]),t(M,[2,41]),t(v,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(v,[2,31]),{27:[1,69]},t(v,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(v,[2,15]),t(v,[2,26]),t(v,[2,27]),{11:59,32:72,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,33]),t(v,[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:g(function(t,i){if(!i.recoverable){var s=new Error(t);throw s.hash=i,s}this.trace(t)},"parseError"),parse:g(function(t){var i=this,s=[0],e=[],h=[null],r=[],a=this.table,n="",o=0,c=0,l=r.slice.call(arguments,1),u=Object.create(this.lexer),f={yy:{}};for(var x in this.yy)Object.prototype.hasOwnProperty.call(this.yy,x)&&(f.yy[x]=this.yy[x]);u.setInput(t,f.yy),f.yy.lexer=u,f.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;r.push(p);var d=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=e.pop()||u.lex()||1)&&(t instanceof Array&&(t=(e=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,g(function(t){s.length=s.length-2*t,h.length=h.length-t,r.length=r.length-t},"popStack"),g(m,"lex");for(var b,_,y,A,k,w,T,v,S={};;){if(_=s[s.length-1],this.defaultActions[_]?y=this.defaultActions[_]:(null==b&&(b=m()),y=a[_]&&a[_][b]),void 0===y||!y.length||!y[0]){var M="";for(k in v=[],a[_])this.terminals_[k]&&k>2&&v.push("'"+this.terminals_[k]+"'");M=u.showPosition?"Parse error on line "+(o+1)+":\n"+u.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(M,{text:u.match,token:this.terminals_[b]||b,line:u.yylineno,loc:p,expected:v})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(y[0]){case 1:s.push(b),h.push(u.yytext),r.push(u.yylloc),s.push(y[1]),b=null,c=u.yyleng,n=u.yytext,o=u.yylineno,p=u.yylloc;break;case 2:if(w=this.productions_[y[1]][1],S.$=h[h.length-w],S._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},d&&(S._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(A=this.performAction.apply(S,[n,c,o,f.yy,y[1],h,r].concat(l))))return A;w&&(s=s.slice(0,-1*w*2),h=h.slice(0,-1*w),r=r.slice(0,-1*w)),s.push(this.productions_[y[1]][0]),h.push(S.$),r.push(S._$),T=a[s[s.length-2]][s[s.length-1]],s.push(T);break;case 3:return!0}}return!0},"parse")},R=function(){return{EOF:1,parseError:g(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:g(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:g(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:g(function(t){var i=t.length,s=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 e=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===e.length?this.yylloc.first_column:0)+e[e.length-s.length].length-s[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(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:g(function(t){this.unput(this.match.slice(t))},"less"),pastInput:g(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:g(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:g(function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:g(function(t,i){var s,e,h;if(this.options.backtrack_lexer&&(h={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&&(h.yylloc.range=this.yylloc.range.slice(0))),(e=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in h)this[r]=h[r];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;var t,i,s,e;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),r=0;r<h.length;r++)if((s=this._input.match(this.rules[h[r]]))&&(!i||s[0].length>i[0].length)){if(i=s,e=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,h[r])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,h[e]))&&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:g(function(){var t=this.next();return t||this.lex()},"lex"),begin:g(function(t){this.conditionStack.push(t)},"begin"),popState:g(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(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:g(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:g(function(t){this.begin(t)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(t,i,s,e){switch(s){case 0:case 1:case 5:case 44: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 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 27:this.pushState("string");break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 45:return 35;case 46: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,/^(?:xychart\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,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],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:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}}();function C(){this.yy={}}return E.lexer=R,g(C,"Parser"),C.prototype=E,E.Parser=C,new C}();I.parser=I;var L=I;function P(t){return"bar"===t.type}function $(t){return"band"===t.type}function N(t){return"linear"===t.type}g(P,"isBarPlot"),g($,"isBandAxisData"),g(N,"isLinearAxisData");var z=(g(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 s={width:0,height:0},e=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const h of t){const t=S(e,1,h),r=t?t.width:h.length*i,a=t?t.height:i;s.width=Math.max(s.width,r),s.height=Math.max(s.height,a)}return e.remove(),s}},"TextDimensionCalculatorWithFont"),t),B=(g(i=class{constructor(t,i,s,e){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=e,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 s=this.getLabelDimension(),e=.2*t.width;this.outerPadding=Math.min(s.width/2,e);const h=s.height+2*this.axisConfig.labelPadding;this.labelTextHeight=s.height,h<=i&&(i-=h,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),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,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 s=this.getLabelDimension(),e=.2*t.height;this.outerPadding=Math.min(s.height/2,e);const h=s.width+2*this.axisConfig.labelPadding;h<=i&&(i-=h,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),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,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),O=(g(s=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.categories=s,this.scale=C().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=C().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),m.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},"BandAxis"),s),X=(g(e=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.domain=s,this.scale=R().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=R().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},"LinearAxis"),e);function F(t,i,s,e){const h=new z(e);return $(t)?new O(i,s,t.categories,t.title,h):new X(i,s,[t.min,t.max],t.title,h)}g(F,"getAxis");var U=(g(h=class{constructor(t,i,s,e){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=e,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),s=Math.max(i.width,t.width),e=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=e&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=e,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"),h);function W(t,i,s,e){const h=new z(e);return new U(h,t,i,s)}g(W,"getChartTitleComponent");var Y=(g(r=class{constructor(t,i,s,e,h){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=e,this.plotIndex=h}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?M().y(t=>t[0]).x(t=>t[1])(t):M().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"),r),j=(g(a=class{constructor(t,i,s,e,h,r){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=e,this.orientation=h,this.plotIndex=r}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()),s=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]-s,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]-s,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"),a),H=(g(n=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,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,s]of this.chartData.plots.entries())switch(s.type){case"line":{const e=new Y(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}break;case"bar":{const e=new j(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}}return t}},"BasePlot"),n);function V(t,i,s){return new H(t,i,s)}g(V,"getPlotComponent");var Q,G=(g(o=class{constructor(t,i,s,e){this.chartConfig=t,this.chartData=i,this.componentStore={title:W(t,i,s,e),plot:V(t,i,s),xAxis:F(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},e),yAxis:F(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},e)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),r=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),a=this.componentStore.plot.calculateSpace({width:h,height:r});t-=a.width,i-=a.height,a=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=a.height,i-=a.height,this.componentStore.xAxis.setAxisPosition("bottom"),a=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=a.height,this.componentStore.yAxis.setAxisPosition("left"),a=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=a.width,t-=a.width,t>0&&(h+=t,t=0),i>0&&(r+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:r}),this.componentStore.plot.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:e+r}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:e}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=0,r=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),n=this.componentStore.plot.calculateSpace({width:r,height:a});t-=n.width,i-=n.height,n=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=n.height,i-=n.height,this.componentStore.xAxis.setAxisPosition("left"),n=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=n.width,e=n.width,this.componentStore.yAxis.setAxisPosition("top"),n=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=n.height,h=s+n.height,t>0&&(r+=t,t=0),i>0&&(a+=i,i=0),this.componentStore.plot.calculateSpace({width:r,height:a}),this.componentStore.plot.setBoundingBoxXY({x:e,y:h}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([h,h+a]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(t=>P(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"),o),K=(g(c=class{static build(t,i,s,e){return new G(t,i,s,e).getDrawableElement()}},"XYChartBuilder"),c),q=0,Z=rt(),J=ht(),tt=at(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1;function ht(){const t=v(),i=A();return w(t.xyChart,i.themeVariables.xyChart)}function rt(){const t=A();return w(T.xyChart,t.xyChart)}function at(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function nt(t){const i=A();return k(t.trim(),i)}function ot(t){Q=t}function ct(t){Z.chartOrientation="horizontal"===t?"horizontal":"vertical"}function lt(t){tt.xAxis.title=nt(t.text)}function ut(t,i){tt.xAxis={type:"linear",title:tt.xAxis.title,min:t,max:i},st=!0}function ft(t){tt.xAxis={type:"band",title:tt.xAxis.title,categories:t.map(t=>nt(t.text))},st=!0}function xt(t){tt.yAxis.title=nt(t.text)}function pt(t,i){tt.yAxis={type:"linear",title:tt.yAxis.title,min:t,max:i},et=!0}function dt(t){const i=Math.min(...t),s=Math.max(...t),e=N(tt.yAxis)?tt.yAxis.min:1/0,h=N(tt.yAxis)?tt.yAxis.max:-1/0;tt.yAxis={type:"linear",title:tt.yAxis.title,min:Math.min(e,i),max:Math.max(h,s)}}function gt(t){let i=[];if(0===t.length)return i;if(!st){const i=N(tt.xAxis)?tt.xAxis.min:1/0,s=N(tt.xAxis)?tt.xAxis.max:-1/0;ut(Math.min(i,1),Math.max(s,t.length))}if(et||dt(t),$(tt.xAxis)&&(i=tt.xAxis.categories.map((i,s)=>[i,t[s]])),N(tt.xAxis)){const s=tt.xAxis.min,e=tt.xAxis.max,h=(e-s)/(t.length-1),r=[];for(let t=s;t<=e;t+=h)r.push(`${t}`);i=r.map((i,s)=>[i,t[s]])}return i}function mt(t){return it[0===t?0:t%it.length]}function bt(t,i){const s=gt(i);tt.plots.push({type:"line",strokeFill:mt(q),strokeWidth:2,data:s}),q++}function _t(t,i){const s=gt(i);tt.plots.push({type:"bar",fill:mt(q),data:s}),q++}function yt(){if(0===tt.plots.length)throw Error("No Plot to render, please provide a plot with some data");return tt.title=f(),K.build(Z,tt,J,Q)}function At(){return J}function kt(){return Z}function wt(){return tt}g(ht,"getChartDefaultThemeConfig"),g(rt,"getChartDefaultConfig"),g(at,"getChartDefaultData"),g(nt,"textSanitizer"),g(ot,"setTmpSVGG"),g(ct,"setOrientation"),g(lt,"setXAxisTitle"),g(ut,"setXAxisRangeData"),g(ft,"setXAxisBand"),g(xt,"setYAxisTitle"),g(pt,"setYAxisRangeData"),g(dt,"setYAxisRangeFromPlotData"),g(gt,"transformDataWithoutCategory"),g(mt,"getPlotColorFromPalette"),g(bt,"setLineData"),g(_t,"setBarData"),g(yt,"getDrawableElem"),g(At,"getChartThemeConfig"),g(kt,"getChartConfig"),g(wt,"getXYChartData");var Tt={parser:L,db:{getDrawableElem:yt,clear:g(function(){y(),q=0,Z=rt(),tt={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},J=ht(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1},"clear"),setAccTitle:d,getAccTitle:p,setDiagramTitle:x,getDiagramTitle:f,getAccDescription:u,setAccDescription:l,setOrientation:ct,setXAxisTitle:lt,setXAxisRangeData:ut,setXAxisBand:ft,setYAxisTitle:xt,setYAxisRangeData:pt,setLineData:bt,setBarData:_t,setTmpSVGG:ot,getChartThemeConfig:At,getChartConfig:kt,getXYChartData:wt},renderer:{draw:g((t,i,s,e)=>{const h=e.db,r=h.getChartThemeConfig(),a=h.getChartConfig(),n=h.getXYChartData().plots[0].data.map(t=>t[1]);function o(t){return"top"===t?"text-before-edge":"middle"}function c(t){return"left"===t?"start":"right"===t?"end":"middle"}function l(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}g(o,"getDominantBaseLine"),g(c,"getTextAnchor"),g(l,"getTextTransformation"),m.debug("Rendering xychart chart\n"+t);const u=b(i),f=u.append("g").attr("class","main"),x=f.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");_(u,a.height,a.width,!0),u.attr("viewBox",`0 0 ${a.width} ${a.height}`),x.attr("fill",r.backgroundColor),h.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const p=h.getDrawableElem(),d={};function y(t){let i=f,s="";for(const[e]of t.entries()){let h=f;e>0&&d[s]&&(h=d[s]),s+=t[e],i=d[s],i||(i=d[s]=h.append("g").attr("class",t[e]))}return i}g(y,"getGroup");for(const m of p){if(0===m.data.length)continue;const t=y(m.groupTexts);switch(m.type){case"rect":if(t.selectAll("rect").data(m.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),a.showDataLabel)if("horizontal"===a.chartOrientation){let i=function(t,i){const{data:e,label:h}=t;return i*h.length*s<=e.width-10};g(i,"fitsHorizontally");const s=.7,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:s}=t;let e=.7*s.height;for(;!i(t,e)&&e>0;)e-=1;return e}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width-10).attr("y",t=>t.data.y+t.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}else{let i=function(t,i,s){const{data:e,label:h}=t,r=i*h.length*.7,a=e.x+e.width/2,n=a+r/2,o=a-r/2>=e.x&&n<=e.x+e.width,c=e.y+s+i<=e.y+e.height;return o&&c};g(i,"fitsInBar");const s=10,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:e,label:h}=t;let r=e.width/(.7*h.length);for(;!i(t,r,s)&&r>0;)r-=1;return r}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width/2).attr("y",t=>t.data.y+s).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}break;case"text":t.selectAll("text").data(m.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=>o(t.verticalPos)).attr("text-anchor",t=>c(t.horizontalPos)).attr("transform",t=>l(t)).text(t=>t.text);break;case"path":t.selectAll("path").data(m.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{Tt as diagram};
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<meta charset="UTF-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
|
7
7
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
8
|
-
<meta name="apple-mobile-web-app-status-bar-style" content="
|
|
8
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
|
|
9
9
|
<meta name="mobile-web-app-capable" content="yes" />
|
|
10
10
|
<link rel="icon" type="image/png" href="/favicon.png" />
|
|
11
11
|
<title>OmniContext CLI</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-BxRbZ9su.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CUmxgXdk.css">
|
|
14
14
|
</head>
|
|
15
15
|
|
|
16
16
|
<body>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: simplify
|
|
3
|
-
description: Review changed code for reuse, quality, and efficiency, then fix any issues found.
|
|
3
|
+
description: Review changed code for reuse, quality, and efficiency, then fix any issues found.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Simplify: Code Review and Cleanup
|
|
@@ -17,9 +17,9 @@ Run `git diff` (or `git diff HEAD` if there are staged changes) to see what chan
|
|
|
17
17
|
|
|
18
18
|
For each change:
|
|
19
19
|
|
|
20
|
-
1. **Search for existing utilities and helpers** that could replace newly written code. Look for similar patterns elsewhere in the codebase
|
|
20
|
+
1. **Search for existing utilities and helpers** that could replace newly written code. Look for similar patterns elsewhere in the codebase. Common locations are utility directories, shared modules, and files adjacent to the changed ones.
|
|
21
21
|
2. **Flag any new function that duplicates existing functionality.** Suggest the existing function to use instead.
|
|
22
|
-
3. **Flag any inline logic that could use an existing utility
|
|
22
|
+
3. **Flag any inline logic that could use an existing utility**: hand-rolled string manipulation, manual path handling, custom environment checks, ad-hoc type guards, and similar patterns are common candidates.
|
|
23
23
|
|
|
24
24
|
### Code Quality
|
|
25
25
|
|
|
@@ -30,7 +30,7 @@ Review the same changes for hacky patterns:
|
|
|
30
30
|
3. **Copy-paste with slight variation**: near-duplicate code blocks that should be unified with a shared abstraction
|
|
31
31
|
4. **Leaky abstractions**: exposing internal details that should be encapsulated, or breaking existing abstraction boundaries
|
|
32
32
|
5. **Stringly-typed code**: using raw strings where constants, enums (string unions), or branded types already exist in the codebase
|
|
33
|
-
6. **Unnecessary comments**: comments explaining WHAT the code does (well-named identifiers already do that), narrating the change, or referencing the task/caller
|
|
33
|
+
6. **Unnecessary comments**: comments explaining WHAT the code does (well-named identifiers already do that), narrating the change, or referencing the task/caller. Delete them; keep only non-obvious WHY (hidden constraints, subtle invariants, workarounds)
|
|
34
34
|
|
|
35
35
|
### Efficiency
|
|
36
36
|
|
|
@@ -39,8 +39,8 @@ Review the same changes for efficiency:
|
|
|
39
39
|
1. **Unnecessary work**: redundant computations, repeated file reads, duplicate network/API calls, N+1 patterns
|
|
40
40
|
2. **Missed concurrency**: independent operations run sequentially when they could run in parallel
|
|
41
41
|
3. **Hot-path bloat**: new blocking work added to startup or per-request/per-render hot paths
|
|
42
|
-
4. **Recurring no-op updates**: state/store updates inside polling loops, intervals, or event handlers that fire unconditionally
|
|
43
|
-
5. **Unnecessary existence checks**: pre-checking file/resource existence before operating (TOCTOU anti-pattern)
|
|
42
|
+
4. **Recurring no-op updates**: state/store updates inside polling loops, intervals, or event handlers that fire unconditionally. Add a change-detection guard so downstream consumers aren't notified when nothing changed
|
|
43
|
+
5. **Unnecessary existence checks**: pre-checking file/resource existence before operating (TOCTOU anti-pattern). Operate directly and handle the error
|
|
44
44
|
6. **Memory**: unbounded data structures, missing cleanup, event listener leaks
|
|
45
45
|
7. **Overly broad operations**: reading entire files when only a portion is needed, loading all items when filtering for one
|
|
46
46
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Analytics
|
|
3
|
+
icon: "◆"
|
|
4
|
+
allowBaseTools: [WebSearch, AnalyticsQuery]
|
|
5
|
+
allowBuiltinAgents: [Recall]
|
|
6
|
+
starterPrompts:
|
|
7
|
+
- Show me a breakdown of my usage over the past week
|
|
8
|
+
- Which models am I using most and how do they compare on speed?
|
|
9
|
+
- Analyze my token costs and cache hit rates
|
|
10
|
+
---
|
|
11
|
+
Omx is a usage analytics assistant with direct access to a local
|
|
12
|
+
SQLite database that logs every LLM API request. Use the
|
|
13
|
+
AnalyticsQuery tool to run SQL queries and answer questions about
|
|
14
|
+
usage patterns, token consumption, latency, model performance, cache
|
|
15
|
+
efficiency, and trends over time. When presenting data, prefer clear
|
|
16
|
+
markdown tables and concise summaries. Calculate derived metrics when
|
|
17
|
+
useful: cost estimates (based on typical per-token pricing), cache hit
|
|
18
|
+
ratios, p50/p95 latency, tokens per second throughput. If the user
|
|
19
|
+
asks about a time range, convert it to unix milliseconds for
|
|
20
|
+
started_at_ms comparisons. Timestamps in the database are unix
|
|
21
|
+
milliseconds. The current time is {{TODAY}}. Key columns: protocol
|
|
22
|
+
(anthropic, openai, gemini, or responses), model_source (provider like
|
|
23
|
+
deepseek, openrouter, etc., nullable), first_token_latency_ms (time to
|
|
24
|
+
first output chunk), generation_time_ms (total generation wall time),
|
|
25
|
+
input_tokens / output_tokens (token counts per request),
|
|
26
|
+
cache_creation_tokens / cache_read_tokens (prompt caching metrics),
|
|
27
|
+
finish_reason (how the request ended: end_turn, tool_use, stop, etc.).
|
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: General
|
|
3
3
|
icon: "◇"
|
|
4
|
-
allowBaseTools:
|
|
4
|
+
allowBaseTools:
|
|
5
|
+
- Bash
|
|
6
|
+
- BashOutput
|
|
7
|
+
- Edit
|
|
8
|
+
- Glob
|
|
9
|
+
- Grep
|
|
10
|
+
- Read
|
|
11
|
+
- Skill
|
|
12
|
+
- WebFetch
|
|
13
|
+
- WebSearch
|
|
14
|
+
- Write
|
|
15
|
+
allowBuiltinAgents: [Recall]
|
|
5
16
|
allowCustomAgents: true
|
|
6
17
|
allowMcpTools: true
|
|
7
18
|
allowRemoteTools: true
|
|
19
|
+
starterPrompts:
|
|
20
|
+
- Help me think through an idea and turn it into a plan
|
|
21
|
+
- Ask me a few questions, then help me write a clear message
|
|
22
|
+
- Ask me what I want to research, then help me summarize it
|
|
8
23
|
---
|
|
9
|
-
Omx is a versatile personal assistant
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
inspect the document, spreadsheet, or presentation before answering
|
|
13
|
-
questions about it. When the user asks you to make changes, apply
|
|
14
|
-
them directly rather than just describing what to do. Keep your
|
|
15
|
-
responses clear, friendly, and to the point. Match the tone of the
|
|
16
|
-
conversation -- casual when chatting, precise when working on
|
|
24
|
+
Omx is a versatile personal assistant. Keep your responses
|
|
25
|
+
clear, friendly, and to the point. Match the tone of the
|
|
26
|
+
conversation. Be casual when chatting, precise when working on
|
|
17
27
|
something specific. Avoid jargon unless the user uses it first.
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
When you have tools available, use them proactively rather than
|
|
29
|
+
guessing. You're running on {{OS_TYPE}} ({{PLATFORM}}/{{ARCH}}).
|
|
30
|
+
The current working directory is {{CWD}}. Today is {{TODAY}}.
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: Programming
|
|
3
3
|
icon: "○"
|
|
4
|
-
allowBaseTools:
|
|
4
|
+
allowBaseTools:
|
|
5
|
+
- Bash
|
|
6
|
+
- BashOutput
|
|
7
|
+
- Edit
|
|
8
|
+
- Glob
|
|
9
|
+
- Grep
|
|
10
|
+
- Read
|
|
11
|
+
- Skill
|
|
12
|
+
- WebFetch
|
|
13
|
+
- WebSearch
|
|
14
|
+
- Write
|
|
5
15
|
allowBuiltinAgents: true
|
|
6
16
|
allowCustomAgents: true
|
|
7
17
|
allowMcpTools: true
|
|
8
18
|
allowRemoteTools: true
|
|
19
|
+
starterPrompts:
|
|
20
|
+
- Survey this codebase and summarize the architecture
|
|
21
|
+
- Find the main entry points and important files in this project
|
|
22
|
+
- Review this project and point out any obvious issues or risks
|
|
9
23
|
---
|
|
10
24
|
Omx is a small, helpful, zero-telemetry coding assistant. Keep your
|
|
11
25
|
responses short and concise, using markdown for formatting. Avoid
|
|
@@ -31,3 +45,4 @@ Focus on facts and problem-solving. When referencing code, use the
|
|
|
31
45
|
format file_path:line_number. You're running on {{OS_TYPE}}
|
|
32
46
|
({{PLATFORM}}/{{ARCH}}), so keep this in mind for commands, paths, and
|
|
33
47
|
platform-specific guidance. The current working directory is {{CWD}}.
|
|
48
|
+
Today is {{TODAY}}.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Recall
|
|
3
|
+
icon: "◈"
|
|
4
|
+
allowBaseTools: [RecallSearch, RecallRead, WebSearch]
|
|
5
|
+
allowBuiltinAgents: []
|
|
6
|
+
starterPrompts:
|
|
7
|
+
- What did we discuss about the architecture last time?
|
|
8
|
+
- Find conversations where I debugged a tricky issue
|
|
9
|
+
- What decisions did we make about the database design?
|
|
10
|
+
---
|
|
11
|
+
Omx is a chat history search assistant with access to a local
|
|
12
|
+
full-text search index of all past sessions. Use RecallSearch to find
|
|
13
|
+
matching sessions by keyword, then RecallRead to pull surrounding
|
|
14
|
+
conversation context. RecallSearch is keyword-based, not semantic;
|
|
15
|
+
search for words that would literally appear in the conversation. If
|
|
16
|
+
a search returns no results, rethink what words the conversation
|
|
17
|
+
would actually contain and retry with different terms. Try up to
|
|
18
|
+
three rounds of keyword variations before giving up. When presenting
|
|
19
|
+
results, organize by session with clear summaries of what was
|
|
20
|
+
discussed, key decisions made, and any unresolved items. Include
|
|
21
|
+
relevant quotes when they add clarity. The current time is {{TODAY}}.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-context-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.84",
|
|
4
4
|
"description": "Omx is a small, helpful, zero-telemetry coding assistant.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@mixmark-io/domino": "^2.2.0",
|
|
34
|
+
"@node-rs/jieba": "^2.0.1",
|
|
35
|
+
"better-sqlite3": "^12.9.0",
|
|
34
36
|
"figlet": "^1.8.0",
|
|
35
37
|
"node-notifier": "^10.0.1"
|
|
36
38
|
},
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { readdirSync, readFileSync, writeFileSync } from 'fs';
|
|
2
|
+
import { join, dirname, basename, isAbsolute, resolve } from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
const args = process.argv.slice(2);
|
|
6
|
+
const widthArg = args.find(a => /^\d+$/.test(a));
|
|
7
|
+
const fileArg = args.find(a => a.endsWith('.md') || a.endsWith('.txt'));
|
|
8
|
+
const WIDTH = parseInt(widthArg, 10) || 70;
|
|
9
|
+
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const workflowsDir = join(scriptDir, '..', 'workflows');
|
|
11
|
+
const promptsDir = join(scriptDir, '..', 'source', 'prompts');
|
|
12
|
+
|
|
13
|
+
function wrapParagraph(text) {
|
|
14
|
+
const words = text.split(/\s+/);
|
|
15
|
+
const lines = [];
|
|
16
|
+
let line = '';
|
|
17
|
+
for (const word of words) {
|
|
18
|
+
if (!line) {
|
|
19
|
+
line = word;
|
|
20
|
+
} else if (line.length + 1 + word.length <= WIDTH) {
|
|
21
|
+
line += ' ' + word;
|
|
22
|
+
} else {
|
|
23
|
+
lines.push(line);
|
|
24
|
+
line = word;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (line) lines.push(line);
|
|
28
|
+
return lines.join('\n');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function wrapBody(body) {
|
|
32
|
+
return body.split('\n\n').map(block => {
|
|
33
|
+
if (block.startsWith('- ') || block.startsWith(' ') || block.includes('\n- ')) {
|
|
34
|
+
return block.split('\n').map(line => {
|
|
35
|
+
if (line.length <= WIDTH) return line;
|
|
36
|
+
const match = line.match(/^(\s*-\s*)/);
|
|
37
|
+
if (!match) return wrapParagraph(line);
|
|
38
|
+
const prefix = match[1];
|
|
39
|
+
const rest = line.slice(prefix.length);
|
|
40
|
+
const indent = ' '.repeat(prefix.length);
|
|
41
|
+
const words = rest.split(/\s+/);
|
|
42
|
+
const lines = [];
|
|
43
|
+
let cur = '';
|
|
44
|
+
for (const word of words) {
|
|
45
|
+
if (!cur) {
|
|
46
|
+
cur = word;
|
|
47
|
+
} else if (prefix.length + cur.length + 1 + word.length <= WIDTH) {
|
|
48
|
+
cur += ' ' + word;
|
|
49
|
+
} else {
|
|
50
|
+
lines.push(cur);
|
|
51
|
+
cur = word;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (cur) lines.push(cur);
|
|
55
|
+
return lines.map((l, i) => (i === 0 ? prefix : indent) + l).join('\n');
|
|
56
|
+
}).join('\n');
|
|
57
|
+
}
|
|
58
|
+
return wrapParagraph(block);
|
|
59
|
+
}).join('\n\n');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function resolveFileArg(arg) {
|
|
63
|
+
if (isAbsolute(arg)) return resolve(arg);
|
|
64
|
+
if (arg.includes('/')) return resolve(arg);
|
|
65
|
+
if (arg.endsWith('.txt')) return join(promptsDir, arg);
|
|
66
|
+
return join(workflowsDir, arg);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const filePaths = fileArg
|
|
70
|
+
? [resolveFileArg(fileArg)]
|
|
71
|
+
: [
|
|
72
|
+
...readdirSync(workflowsDir).map(f => join(workflowsDir, f)).filter(f => f.endsWith('.md')),
|
|
73
|
+
...readdirSync(promptsDir).map(f => join(promptsDir, f)).filter(f => f.endsWith('.txt')),
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
for (const filePath of filePaths) {
|
|
77
|
+
const name = basename(filePath);
|
|
78
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
79
|
+
const isTxt = filePath.endsWith('.txt');
|
|
80
|
+
|
|
81
|
+
const fmMatch = content.match(/^---\n([\s\S]*?)\n---\n/);
|
|
82
|
+
if (!isTxt && !fmMatch) {
|
|
83
|
+
console.log(`${name}: no frontmatter, skipping`);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const frontmatter = fmMatch ? fmMatch[0] : '';
|
|
88
|
+
const body = content.slice(frontmatter.length);
|
|
89
|
+
const wrapped = wrapBody(body.trimEnd());
|
|
90
|
+
|
|
91
|
+
const result = frontmatter + wrapped + '\n';
|
|
92
|
+
if (result === content) {
|
|
93
|
+
console.log(`${name}: already wrapped`);
|
|
94
|
+
} else {
|
|
95
|
+
writeFileSync(filePath, result);
|
|
96
|
+
console.log(`${name}: rewrapped to ${WIDTH} columns`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ap as a,aq as s}from"./index-whs1emOP.js";const o=(o,p)=>a.lang.round(s.parse(o)[p]);export{o as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as r,c as s,a as t,C as e}from"./chunk-B4BG7PRW-BXEqAVZ9.js";import{_ as i}from"./index-whs1emOP.js";import"./chunk-FMBD7UC4-Bxj9xhWB.js";import"./chunk-55IACEB6-BaobwOT0.js";import"./chunk-QN33PNHL-BXnFDMFI.js";var n={parser:t,get db(){return new e},renderer:s,styles:r,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as r,c as s,a as t,C as e}from"./chunk-B4BG7PRW-BXEqAVZ9.js";import{_ as i}from"./index-whs1emOP.js";import"./chunk-FMBD7UC4-Bxj9xhWB.js";import"./chunk-55IACEB6-BaobwOT0.js";import"./chunk-QN33PNHL-BXnFDMFI.js";var n={parser:t,get db(){return new e},renderer:s,styles:r,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as r}from"./graph-DskrZt2F.js";function o(o){return r(o,4)}export{o as c};
|