omni-context-cli 0.0.74 → 0.0.77
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 +68 -112
- package/README.zh-CN.md +68 -112
- package/dist/agents/explore.md +26 -19
- package/dist/agents/glance.md +7 -22
- package/dist/agents/{slice.md → search.md} +4 -4
- package/dist/assets/cone-bw-white.svg +24 -7
- package/dist/assets/cone-bw.svg +24 -7
- package/dist/assets/cone-mac@256.png +0 -0
- package/dist/assets/cone-mac@512.png +0 -0
- package/dist/assets/cone.svg +24 -2
- package/dist/assets/cone@128.png +0 -0
- package/dist/assets/cone@16.png +0 -0
- package/dist/assets/cone@24.png +0 -0
- package/dist/assets/cone@256.png +0 -0
- package/dist/assets/cone@32.png +0 -0
- package/dist/assets/cone@512.png +0 -0
- package/dist/assets/cone@64.png +0 -0
- package/dist/assets/icon.ico +0 -0
- package/dist/assets/omnicontext-cli-logo-white.svg +24 -7
- package/dist/assets/omnicontext-cli-logo.svg +24 -7
- package/dist/cli.js +7 -7
- package/dist/clients/extension.vsix +0 -0
- package/dist/clients/web/assets/{_baseUniq-CH4b0N5_.js → _baseUniq-BbAI5D6T.js} +1 -1
- package/dist/clients/web/assets/{arc-BQVP7-Bp.js → arc-C01cHi_J.js} +1 -1
- package/dist/clients/web/assets/{architectureDiagram-VXUJARFQ-CZtE2OyB.js → architectureDiagram-VXUJARFQ-C4SW9geU.js} +1 -1
- package/dist/clients/web/assets/{blockDiagram-VD42YOAC-CtSz7Vx1.js → blockDiagram-VD42YOAC-BJBjUKKm.js} +1 -1
- package/dist/clients/web/assets/{c4Diagram-YG6GDRKO-CeUU0lHA.js → c4Diagram-YG6GDRKO-DRMS2exe.js} +1 -1
- package/dist/clients/web/assets/channel-BFxt5Aug.js +1 -0
- package/dist/clients/web/assets/{chunk-4BX2VUAB-Df-kQvTf.js → chunk-4BX2VUAB-DdM_Xgvz.js} +1 -1
- package/dist/clients/web/assets/{chunk-55IACEB6-DR-uhhX0.js → chunk-55IACEB6-sCGtW4jw.js} +1 -1
- package/dist/clients/web/assets/{chunk-B4BG7PRW-DOrSo5dD.js → chunk-B4BG7PRW-CrTfpFlk.js} +1 -1
- package/dist/clients/web/assets/{chunk-DI55MBZ5-BbUWe3KA.js → chunk-DI55MBZ5-BJxcEBin.js} +1 -1
- package/dist/clients/web/assets/{chunk-FMBD7UC4-BnLGK1jf.js → chunk-FMBD7UC4-ZCzWQMnr.js} +1 -1
- package/dist/clients/web/assets/{chunk-QN33PNHL-VCJVvyMp.js → chunk-QN33PNHL-7lsjOUTT.js} +1 -1
- package/dist/clients/web/assets/{chunk-QZHKN3VN-CPfXJo_T.js → chunk-QZHKN3VN-DM6taDix.js} +1 -1
- package/dist/clients/web/assets/{chunk-TZMSLE5B-BkHNVsyH.js → chunk-TZMSLE5B-Dc2DN3ii.js} +1 -1
- package/dist/clients/web/assets/classDiagram-2ON5EDUG-CMfvUA3j.js +1 -0
- package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-CMfvUA3j.js +1 -0
- package/dist/clients/web/assets/clone-BWI7Baa7.js +1 -0
- package/dist/clients/web/assets/{cose-bilkent-S5V4N54A-C9Wxnne5.js → cose-bilkent-S5V4N54A-r8T3f5yK.js} +1 -1
- package/dist/clients/web/assets/{dagre-6UL2VRFP-B6-ozXSh.js → dagre-6UL2VRFP-UnxnSeQH.js} +1 -1
- package/dist/clients/web/assets/{diagram-PSM6KHXK-D2TK1Mkk.js → diagram-PSM6KHXK-D2ENZ6qS.js} +1 -1
- package/dist/clients/web/assets/{diagram-QEK2KX5R-C5OGEwzB.js → diagram-QEK2KX5R-Eye3JgZm.js} +1 -1
- package/dist/clients/web/assets/{diagram-S2PKOQOG-CjdFw3eQ.js → diagram-S2PKOQOG-Blf5P9RJ.js} +1 -1
- package/dist/clients/web/assets/{erDiagram-Q2GNP2WA-hQIEDub-.js → erDiagram-Q2GNP2WA-wyIeLoVZ.js} +1 -1
- package/dist/clients/web/assets/{flowDiagram-NV44I4VS-WDuMquGw.js → flowDiagram-NV44I4VS-D99ef0t0.js} +1 -1
- package/dist/clients/web/assets/{ganttDiagram-JELNMOA3-BT_k8mao.js → ganttDiagram-JELNMOA3-CvsjeBuE.js} +1 -1
- package/dist/clients/web/assets/{gitGraphDiagram-NY62KEGX-Dq5JUR6E.js → gitGraphDiagram-NY62KEGX-B2ylogok.js} +1 -1
- package/dist/clients/web/assets/{graph-EhiCIhKK.js → graph-BEwCLq4h.js} +1 -1
- package/dist/clients/web/assets/index-30onxp6I.js +2 -0
- package/dist/clients/web/assets/index-pGSHhaP9.css +1 -0
- package/dist/clients/web/assets/{infoDiagram-WHAUD3N6-BrkLiOdx.js → infoDiagram-WHAUD3N6-C9HLlPj3.js} +1 -1
- package/dist/clients/web/assets/{journeyDiagram-XKPGCS4Q-2iAEjN27.js → journeyDiagram-XKPGCS4Q-BGMoCoGu.js} +1 -1
- package/dist/clients/web/assets/{kanban-definition-3W4ZIXB7-C222cIK8.js → kanban-definition-3W4ZIXB7-Z1B1b4dY.js} +1 -1
- package/dist/clients/web/assets/{layout-DDV6LJLJ.js → layout-KBr90mM8.js} +1 -1
- package/dist/clients/web/assets/{linear-Cj0itOnY.js → linear-VOTetRqU.js} +1 -1
- package/dist/clients/web/assets/{min-DB8NGWI2.js → min-BcFr1Xgw.js} +1 -1
- package/dist/clients/web/assets/{mindmap-definition-VGOIOE7T-CCAhA60J.js → mindmap-definition-VGOIOE7T-Bf9fJD2v.js} +1 -1
- package/dist/clients/web/assets/{pieDiagram-ADFJNKIX-D-XXo3zP.js → pieDiagram-ADFJNKIX-DITjn_1i.js} +1 -1
- package/dist/clients/web/assets/{quadrantDiagram-AYHSOK5B-5IBnb1WQ.js → quadrantDiagram-AYHSOK5B-CG8qEQsc.js} +1 -1
- package/dist/clients/web/assets/{requirementDiagram-UZGBJVZJ-4woYoyhj.js → requirementDiagram-UZGBJVZJ-_fiifEP6.js} +1 -1
- package/dist/clients/web/assets/{sankeyDiagram-TZEHDZUN-CQITNuFm.js → sankeyDiagram-TZEHDZUN-dGOtogtu.js} +1 -1
- package/dist/clients/web/assets/{sequenceDiagram-WL72ISMW-BIUgU_on.js → sequenceDiagram-WL72ISMW-BPWg-aZ3.js} +1 -1
- package/dist/clients/web/assets/{stateDiagram-FKZM4ZOC-C3Wi-EZk.js → stateDiagram-FKZM4ZOC-XlU9RkKz.js} +1 -1
- package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-Rsaa7fF9.js +1 -0
- package/dist/clients/web/assets/{timeline-definition-IT6M3QCI-CwRxrax-.js → timeline-definition-IT6M3QCI-CQGxtqhi.js} +1 -1
- package/dist/clients/web/assets/{treemap-KMMF4GRG-i_IDwp2d.js → treemap-KMMF4GRG-Do7kW41s.js} +1 -1
- package/dist/clients/web/assets/{xychartDiagram-PRI3JC2R-BIS0b9I9.js → xychartDiagram-PRI3JC2R-C_QymW0P.js} +1 -1
- package/dist/clients/web/favicon.png +0 -0
- package/dist/clients/web/index.html +2 -2
- package/dist/skills/simplify/SKILL.md +53 -0
- package/dist/workflows/general.md +19 -0
- package/dist/workflows/programming.md +33 -0
- package/package.json +2 -3
- package/scripts/bump-version.mjs +0 -3
- package/scripts/clean.mjs +17 -0
- package/scripts/release-build.mjs +8 -129
- package/dist/agents/pluck.md +0 -49
- package/dist/agents/quest.md +0 -47
- package/dist/agents/ripple.md +0 -58
- package/dist/agents/sculpt.md +0 -63
- package/dist/agents/spark.md +0 -53
- package/dist/agents/sweep.md +0 -44
- package/dist/agents/weave.md +0 -54
- package/dist/clients/web/assets/channel-D-ssYovj.js +0 -1
- package/dist/clients/web/assets/classDiagram-2ON5EDUG-W6DMTXK_.js +0 -1
- package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-W6DMTXK_.js +0 -1
- package/dist/clients/web/assets/clone-Dn7sFHUy.js +0 -1
- package/dist/clients/web/assets/index-B5OdXvjH.js +0 -27
- package/dist/clients/web/assets/index-BP79FsyI.css +0 -1
- package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-BudH3yEK.js +0 -1
- package/dist/slash/ping.md +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e,l as i,d as n,V as s,W as r,X as a,Y as o,B as c,$ as l,y as h}from"./index-B5OdXvjH.js";import{d as u}from"./arc-BQVP7-Bp.js";var d=function(){var e=t(function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},"o"),i=[6,8,10,11,12,14,16,17,20,21],n=[1,9],s=[1,10],r=[1,11],a=[1,12],o=[1,13],c=[1,16],l=[1,17],h={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:t(function(t,e,i,n,s,r,a){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:n.getCommonDb().setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),n.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),n.getCommonDb().setAccDescription(this.$);break;case 12:n.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 15:n.addTask(r[o],0,""),this.$=r[o];break;case 16:n.addEvent(r[o].substr(2)),this.$=r[o]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:s,14:r,16:a,17:o,18:14,19:15,20:c,21:l},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:18,11:n,12:s,14:r,16:a,17:o,18:14,19:15,20:c,21:l},e(i,[2,5]),e(i,[2,6]),e(i,[2,8]),{13:[1,19]},{15:[1,20]},e(i,[2,11]),e(i,[2,12]),e(i,[2,13]),e(i,[2,14]),e(i,[2,15]),e(i,[2,16]),e(i,[2,4]),e(i,[2,9]),e(i,[2,10])],defaultActions:{},parseError:t(function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},"parseError"),parse:t(function(e){var i=this,n=[0],s=[],r=[null],a=[],o=this.table,c="",l=0,h=0,u=a.slice.call(arguments,1),d=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);d.setInput(e,f.yy),f.yy.lexer=d,f.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var p=d.yylloc;a.push(p);var g=d.options&&d.options.ranges;function x(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){n.length=n.length-2*t,r.length=r.length-t,a.length=a.length-t},"popStack"),t(x,"lex");for(var k,y,v,b,w,_,S,$,T={};;){if(y=n[n.length-1],this.defaultActions[y]?v=this.defaultActions[y]:(null==k&&(k=x()),v=o[y]&&o[y][k]),void 0===v||!v.length||!v[0]){var E="";for(w in $=[],o[y])this.terminals_[w]&&w>2&&$.push("'"+this.terminals_[w]+"'");E=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+$.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==k?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(E,{text:d.match,token:this.terminals_[k]||k,line:d.yylineno,loc:p,expected:$})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+k);switch(v[0]){case 1:n.push(k),r.push(d.yytext),a.push(d.yylloc),n.push(v[1]),k=null,h=d.yyleng,c=d.yytext,l=d.yylineno,p=d.yylloc;break;case 2:if(_=this.productions_[v[1]][1],T.$=r[r.length-_],T._$={first_line:a[a.length-(_||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(_||1)].first_column,last_column:a[a.length-1].last_column},g&&(T._$.range=[a[a.length-(_||1)].range[0],a[a.length-1].range[1]]),void 0!==(b=this.performAction.apply(T,[c,h,l,f.yy,v[1],r,a].concat(u))))return b;_&&(n=n.slice(0,-1*_*2),r=r.slice(0,-1*_),a=a.slice(0,-1*_)),n.push(this.productions_[v[1]][0]),r.push(T.$),a.push(T._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0},"parse")},u=function(){return{EOF:1,parseError:t(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:t(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:t(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:t(function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:t(function(t){this.unput(this.match.slice(t))},"less"),pastInput:t(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:t(function(t,e){var i,n,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((i=this._input.match(this.rules[s[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var t=this.next();return t||this.lex()},"lex"),begin:t(function(t){this.conditionStack.push(t)},"begin"),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:t(function(t){this.begin(t)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(t,e,i,n){switch(i){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}}}();function d(){this.yy={}}return h.lexer=u,t(d,"Parser"),d.prototype=h,h.Parser=d,new d}();d.parser=d;var f=d,m={};c(m,{addEvent:()=>T,addSection:()=>w,addTask:()=>$,addTaskOrg:()=>E,clear:()=>b,default:()=>N,getCommonDb:()=>v,getSections:()=>_,getTasks:()=>S});var p="",g=0,x=[],k=[],y=[],v=t(()=>l,"getCommonDb"),b=t(function(){x.length=0,k.length=0,p="",y.length=0,h()},"clear"),w=t(function(t){p=t,x.push(t)},"addSection"),_=t(function(){return x},"getSections"),S=t(function(){let t=I();let e=0;for(;!t&&e<100;)t=I(),e++;return k.push(...y),k},"getTasks"),$=t(function(t,e,i){const n={id:g++,section:p,type:p,task:t,score:e||0,events:i?[i]:[]};y.push(n)},"addTask"),T=t(function(t){y.find(t=>t.id===g-1).events.push(t)},"addEvent"),E=t(function(t){const e={section:p,type:p,description:t,task:t,classes:[]};k.push(e)},"addTaskOrg"),I=t(function(){const e=t(function(t){return y[t].processed},"compileTask");let i=!0;for(const[t,n]of y.entries())e(t),i=i&&n.processed;return i},"compileTasks"),N={clear:b,getCommonDb:v,addSection:w,getSections:_,getTasks:S,addTask:$,addTaskOrg:E,addEvent:T},C=t(function(t,e){const i=t.append("rect");return i.attr("x",e.x),i.attr("y",e.y),i.attr("fill",e.fill),i.attr("stroke",e.stroke),i.attr("width",e.width),i.attr("height",e.height),i.attr("rx",e.rx),i.attr("ry",e.ry),void 0!==e.class&&i.attr("class",e.class),i},"drawRect"),M=t(function(e,i){const n=15,s=e.append("circle").attr("cx",i.cx).attr("cy",i.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");function a(t){const e=u().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+i.cx+","+(i.cy+2)+")")}function o(t){const e=u().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+i.cx+","+(i.cy+7)+")")}function c(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",i.cx-5).attr("y1",i.cy+7).attr("x2",i.cx+5).attr("y2",i.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return r.append("circle").attr("cx",i.cx-5).attr("cy",i.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",i.cx+5).attr("cy",i.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),t(a,"smile"),t(o,"sad"),t(c,"ambivalent"),i.score>3?a(r):i.score<3?o(r):c(r),s},"drawFace"),H=t(function(t,e){const i=t.append("circle");return i.attr("cx",e.cx),i.attr("cy",e.cy),i.attr("class","actor-"+e.pos),i.attr("fill",e.fill),i.attr("stroke",e.stroke),i.attr("r",e.r),void 0!==i.class&&i.attr("class",i.class),void 0!==e.title&&i.append("title").text(e.title),i},"drawCircle"),j=t(function(t,e){const i=e.text.replace(/<br\s*\/?>/gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),void 0!==e.class&&n.attr("class",e.class);const s=n.append("tspan");return s.attr("x",e.x+2*e.textMargin),s.text(i),n},"drawText"),L=t(function(e,i){function n(t,e,i,n,s){return t+","+e+" "+(t+i)+","+e+" "+(t+i)+","+(e+n-s)+" "+(t+i-1.2*s)+","+(e+n)+" "+t+","+(e+n)}t(n,"genPoints");const s=e.append("polygon");s.attr("points",n(i.x,i.y,50,20,7)),s.attr("class","labelBox"),i.y=i.y+i.labelMargin,i.x=i.x+.5*i.labelMargin,j(e,i)},"drawLabel"),A=t(function(t,e,i){const n=t.append("g"),s=R();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=i.width,s.height=i.height,s.class="journey-section section-type-"+e.num,s.rx=3,s.ry=3,C(n,s),z(i)(e.text,n,s.x,s.y,s.width,s.height,{class:"journey-section section-type-"+e.num},i,e.colour)},"drawSection"),O=-1,W=t(function(t,e,i){const n=e.x+i.width/2,s=t.append("g");O++;s.append("line").attr("id","task"+O).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),M(s,{cx:n,cy:300+30*(5-e.score),score:e.score});const r=R();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=i.width,r.height=i.height,r.class="task task-type-"+e.num,r.rx=3,r.ry=3,C(s,r),z(i)(e.task,s,r.x,r.y,r.width,r.height,{class:"task"},i,e.colour)},"drawTask"),F=t(function(t,e){C(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),P=t(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),R=t(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),z=function(){function e(t,e,i,n,r,a,o,c){s(e.append("text").attr("x",i+r/2).attr("y",n+a/2+5).style("font-color",c).style("text-anchor","middle").text(t),o)}function i(t,e,i,n,r,a,o,c,l){const{taskFontSize:h,taskFontFamily:u}=c,d=t.split(/<br\s*\/?>/gi);for(let f=0;f<d.length;f++){const t=f*h-h*(d.length-1)/2,c=e.append("text").attr("x",i+r/2).attr("y",n).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",u);c.append("tspan").attr("x",i+r/2).attr("dy",t).text(d[f]),c.attr("y",n+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(c,o)}}function n(t,e,n,r,a,o,c,l){const h=e.append("switch"),u=h.append("foreignObject").attr("x",n).attr("y",r).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),i(t,h,n,r,a,o,c,l),s(u,c)}function s(t,e){for(const i in e)i in e&&t.attr(i,e[i])}return t(e,"byText"),t(i,"byTspan"),t(n,"byFo"),t(s,"_setTextAttrs"),function(t){return"fo"===t.textPlacement?n:"old"===t.textPlacement?e:i}}(),D=t(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function B(t,e){t.each(function(){var t,i=n(this),s=i.text().split(/(\s+|<br>)/).reverse(),r=[],a=i.attr("y"),o=parseFloat(i.attr("dy")),c=i.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",o+"em");for(let n=0;n<s.length;n++)t=s[s.length-1-n],r.push(t),c.text(r.join(" ").trim()),(c.node().getComputedTextLength()>e||"<br>"===t)&&(r.pop(),c.text(r.join(" ").trim()),r="<br>"===t?[""]:[t],c=i.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))})}t(B,"wrap");var V=t(function(t,e,i,n){var s;const r=i%12-1,a=t.append("g");e.section=r,a.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+r);const o=a.append("g"),c=a.append("g"),l=c.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(B,e.width).node().getBBox(),h=(null==(s=n.fontSize)?void 0:s.replace)?n.fontSize.replace("px",""):n.fontSize;return e.height=l.height+1.1*h*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,c.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),q(o,e,r,n),e},"drawNode"),Y=t(function(t,e,i){var n;const s=t.append("g"),r=s.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(B,e.width).node().getBBox(),a=(null==(n=i.fontSize)?void 0:n.replace)?i.fontSize.replace("px",""):i.fontSize;return s.remove(),r.height+1.1*a*.5+e.padding},"getVirtualNodeHeight"),q=t(function(t,e,i){t.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("d",`M0 ${e.height-5} v${10-e.height} q0,-5 5,-5 h${e.width-10} q5,0 5,5 v${e.height-5} H0 Z`),t.append("line").attr("class","node-line-"+i).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),G={drawRect:C,drawCircle:H,drawSection:A,drawText:j,drawLabel:L,drawTask:W,drawBackgroundRect:F,getTextObj:P,getNoteRect:R,initGraphics:D,drawNode:V,getVirtualNodeHeight:Y},U=t(function(t,r,a,o){var c,l,h;const u=e(),d=(null==(c=u.timeline)?void 0:c.leftMargin)??50;i.debug("timeline",o.db);const f=u.securityLevel;let m;"sandbox"===f&&(m=n("#i"+r));const p=n("sandbox"===f?m.nodes()[0].contentDocument.body:"body").select("#"+r);p.append("g");const g=o.db.getTasks(),x=o.db.getCommonDb().getDiagramTitle();i.debug("task",g),G.initGraphics(p);const k=o.db.getSections();i.debug("sections",k);let y=0,v=0,b=0,w=0,_=50+d,S=50;w=50;let $=0,T=!0;k.forEach(function(t){const e={number:$,descr:t,section:$,width:150,padding:20,maxHeight:y},n=G.getVirtualNodeHeight(p,e,u);i.debug("sectionHeight before draw",n),y=Math.max(y,n+20)});let E=0,I=0;i.debug("tasks.length",g.length);for(const[e,n]of g.entries()){const t={number:e,descr:n,section:n.section,width:150,padding:20,maxHeight:v},s=G.getVirtualNodeHeight(p,t,u);i.debug("taskHeight before draw",s),v=Math.max(v,s+20),E=Math.max(E,n.events.length);let r=0;for(const e of n.events){const t={descr:e,section:n.section,number:n.section,width:150,padding:20,maxHeight:50};r+=G.getVirtualNodeHeight(p,t,u)}n.events.length>0&&(r+=10*(n.events.length-1)),I=Math.max(I,r)}i.debug("maxSectionHeight before draw",y),i.debug("maxTaskHeight before draw",v),k&&k.length>0?k.forEach(t=>{const e=g.filter(e=>e.section===t),n={number:$,descr:t,section:$,width:200*Math.max(e.length,1)-50,padding:20,maxHeight:y};i.debug("sectionNode",n);const s=p.append("g"),r=G.drawNode(s,n,$,u);i.debug("sectionNode output",r),s.attr("transform",`translate(${_}, 50)`),S+=y+50,e.length>0&&X(p,e,$,_,S,v,u,E,I,y,!1),_+=200*Math.max(e.length,1),S=50,$++}):(T=!1,X(p,g,$,_,S,v,u,E,I,y,!0));const N=p.node().getBBox();i.debug("bounds",N),x&&p.append("text").text(x).attr("x",N.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),b=T?y+v+150:v+100;p.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",b).attr("x2",N.width+3*d).attr("y2",b).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),s(void 0,p,(null==(l=u.timeline)?void 0:l.padding)??50,(null==(h=u.timeline)?void 0:h.useMaxWidth)??!1)},"draw"),X=t(function(t,e,n,s,r,a,o,c,l,h,u){var d;for(const f of e){const e={descr:f.task,section:n,number:n,width:150,padding:20,maxHeight:a};i.debug("taskNode",e);const c=t.append("g").attr("class","taskWrapper"),h=G.drawNode(c,e,n,o).height;if(i.debug("taskHeight after draw",h),c.attr("transform",`translate(${s}, ${r})`),a=Math.max(a,h),f.events){const e=t.append("g").attr("class","lineWrapper");let i=a;r+=100,i+=Z(t,f.events,n,s,r,o),r-=100,e.append("line").attr("x1",s+95).attr("y1",r+a).attr("x2",s+95).attr("y2",r+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}s+=200,u&&!(null==(d=o.timeline)?void 0:d.disableMulticolor)&&n++}r-=10},"drawTasks"),Z=t(function(t,e,n,s,r,a){let o=0;const c=r;r+=100;for(const l of e){const e={descr:l,section:n,number:n,width:150,padding:20,maxHeight:50};i.debug("eventNode",e);const c=t.append("g").attr("class","eventWrapper"),h=G.drawNode(c,e,n,a).height;o+=h,c.attr("transform",`translate(${s}, ${r})`),r=r+10+h}return r=c,o},"drawEvents"),J={setConf:t(()=>{},"setConf"),draw:U},K=t(t=>{let e="";for(let i=0;i<t.THEME_COLOR_LIMIT;i++)t["lineColor"+i]=t["lineColor"+i]||t["cScaleInv"+i],r(t["lineColor"+i])?t["lineColor"+i]=a(t["lineColor"+i],20):t["lineColor"+i]=o(t["lineColor"+i],20);for(let i=0;i<t.THEME_COLOR_LIMIT;i++){const n=""+(17-3*i);e+=`\n .section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} path {\n fill: ${t["cScale"+i]};\n }\n .section-${i-1} text {\n fill: ${t["cScaleLabel"+i]};\n }\n .node-icon-${i-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+i]};\n }\n .section-edge-${i-1}{\n stroke: ${t["cScale"+i]};\n }\n .edge-depth-${i-1}{\n stroke-width: ${n};\n }\n .section-${i-1} line {\n stroke: ${t["cScaleInv"+i]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${t["cScaleLabel"+i]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n `}return e},"genSections"),Q={db:m,renderer:J,parser:f,styles:t(t=>`\n .edge {\n stroke-width: 3;\n }\n ${K(t)}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`,"getStyles")};export{Q as diagram};
|
|
1
|
+
import{_ as t,c as e,l as i,d as n,V as s,W as r,X as a,Y as o,B as c,$ as l,y as h}from"./index-30onxp6I.js";import{d as u}from"./arc-C01cHi_J.js";var d=function(){var e=t(function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},"o"),i=[6,8,10,11,12,14,16,17,20,21],n=[1,9],s=[1,10],r=[1,11],a=[1,12],o=[1,13],c=[1,16],l=[1,17],h={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:t(function(t,e,i,n,s,r,a){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:n.getCommonDb().setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),n.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),n.getCommonDb().setAccDescription(this.$);break;case 12:n.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 15:n.addTask(r[o],0,""),this.$=r[o];break;case 16:n.addEvent(r[o].substr(2)),this.$=r[o]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:s,14:r,16:a,17:o,18:14,19:15,20:c,21:l},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:18,11:n,12:s,14:r,16:a,17:o,18:14,19:15,20:c,21:l},e(i,[2,5]),e(i,[2,6]),e(i,[2,8]),{13:[1,19]},{15:[1,20]},e(i,[2,11]),e(i,[2,12]),e(i,[2,13]),e(i,[2,14]),e(i,[2,15]),e(i,[2,16]),e(i,[2,4]),e(i,[2,9]),e(i,[2,10])],defaultActions:{},parseError:t(function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},"parseError"),parse:t(function(e){var i=this,n=[0],s=[],r=[null],a=[],o=this.table,c="",l=0,h=0,u=a.slice.call(arguments,1),d=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);d.setInput(e,f.yy),f.yy.lexer=d,f.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var p=d.yylloc;a.push(p);var g=d.options&&d.options.ranges;function x(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){n.length=n.length-2*t,r.length=r.length-t,a.length=a.length-t},"popStack"),t(x,"lex");for(var k,y,v,b,w,_,S,$,T={};;){if(y=n[n.length-1],this.defaultActions[y]?v=this.defaultActions[y]:(null==k&&(k=x()),v=o[y]&&o[y][k]),void 0===v||!v.length||!v[0]){var E="";for(w in $=[],o[y])this.terminals_[w]&&w>2&&$.push("'"+this.terminals_[w]+"'");E=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+$.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==k?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(E,{text:d.match,token:this.terminals_[k]||k,line:d.yylineno,loc:p,expected:$})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+k);switch(v[0]){case 1:n.push(k),r.push(d.yytext),a.push(d.yylloc),n.push(v[1]),k=null,h=d.yyleng,c=d.yytext,l=d.yylineno,p=d.yylloc;break;case 2:if(_=this.productions_[v[1]][1],T.$=r[r.length-_],T._$={first_line:a[a.length-(_||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(_||1)].first_column,last_column:a[a.length-1].last_column},g&&(T._$.range=[a[a.length-(_||1)].range[0],a[a.length-1].range[1]]),void 0!==(b=this.performAction.apply(T,[c,h,l,f.yy,v[1],r,a].concat(u))))return b;_&&(n=n.slice(0,-1*_*2),r=r.slice(0,-1*_),a=a.slice(0,-1*_)),n.push(this.productions_[v[1]][0]),r.push(T.$),a.push(T._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0},"parse")},u=function(){return{EOF:1,parseError:t(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:t(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:t(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:t(function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:t(function(t){this.unput(this.match.slice(t))},"less"),pastInput:t(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:t(function(t,e){var i,n,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((i=this._input.match(this.rules[s[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var t=this.next();return t||this.lex()},"lex"),begin:t(function(t){this.conditionStack.push(t)},"begin"),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:t(function(t){this.begin(t)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(t,e,i,n){switch(i){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}}}();function d(){this.yy={}}return h.lexer=u,t(d,"Parser"),d.prototype=h,h.Parser=d,new d}();d.parser=d;var f=d,m={};c(m,{addEvent:()=>T,addSection:()=>w,addTask:()=>$,addTaskOrg:()=>E,clear:()=>b,default:()=>N,getCommonDb:()=>v,getSections:()=>_,getTasks:()=>S});var p="",g=0,x=[],k=[],y=[],v=t(()=>l,"getCommonDb"),b=t(function(){x.length=0,k.length=0,p="",y.length=0,h()},"clear"),w=t(function(t){p=t,x.push(t)},"addSection"),_=t(function(){return x},"getSections"),S=t(function(){let t=I();let e=0;for(;!t&&e<100;)t=I(),e++;return k.push(...y),k},"getTasks"),$=t(function(t,e,i){const n={id:g++,section:p,type:p,task:t,score:e||0,events:i?[i]:[]};y.push(n)},"addTask"),T=t(function(t){y.find(t=>t.id===g-1).events.push(t)},"addEvent"),E=t(function(t){const e={section:p,type:p,description:t,task:t,classes:[]};k.push(e)},"addTaskOrg"),I=t(function(){const e=t(function(t){return y[t].processed},"compileTask");let i=!0;for(const[t,n]of y.entries())e(t),i=i&&n.processed;return i},"compileTasks"),N={clear:b,getCommonDb:v,addSection:w,getSections:_,getTasks:S,addTask:$,addTaskOrg:E,addEvent:T},C=t(function(t,e){const i=t.append("rect");return i.attr("x",e.x),i.attr("y",e.y),i.attr("fill",e.fill),i.attr("stroke",e.stroke),i.attr("width",e.width),i.attr("height",e.height),i.attr("rx",e.rx),i.attr("ry",e.ry),void 0!==e.class&&i.attr("class",e.class),i},"drawRect"),M=t(function(e,i){const n=15,s=e.append("circle").attr("cx",i.cx).attr("cy",i.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");function a(t){const e=u().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+i.cx+","+(i.cy+2)+")")}function o(t){const e=u().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+i.cx+","+(i.cy+7)+")")}function c(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",i.cx-5).attr("y1",i.cy+7).attr("x2",i.cx+5).attr("y2",i.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return r.append("circle").attr("cx",i.cx-5).attr("cy",i.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",i.cx+5).attr("cy",i.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),t(a,"smile"),t(o,"sad"),t(c,"ambivalent"),i.score>3?a(r):i.score<3?o(r):c(r),s},"drawFace"),H=t(function(t,e){const i=t.append("circle");return i.attr("cx",e.cx),i.attr("cy",e.cy),i.attr("class","actor-"+e.pos),i.attr("fill",e.fill),i.attr("stroke",e.stroke),i.attr("r",e.r),void 0!==i.class&&i.attr("class",i.class),void 0!==e.title&&i.append("title").text(e.title),i},"drawCircle"),j=t(function(t,e){const i=e.text.replace(/<br\s*\/?>/gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),void 0!==e.class&&n.attr("class",e.class);const s=n.append("tspan");return s.attr("x",e.x+2*e.textMargin),s.text(i),n},"drawText"),L=t(function(e,i){function n(t,e,i,n,s){return t+","+e+" "+(t+i)+","+e+" "+(t+i)+","+(e+n-s)+" "+(t+i-1.2*s)+","+(e+n)+" "+t+","+(e+n)}t(n,"genPoints");const s=e.append("polygon");s.attr("points",n(i.x,i.y,50,20,7)),s.attr("class","labelBox"),i.y=i.y+i.labelMargin,i.x=i.x+.5*i.labelMargin,j(e,i)},"drawLabel"),A=t(function(t,e,i){const n=t.append("g"),s=R();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=i.width,s.height=i.height,s.class="journey-section section-type-"+e.num,s.rx=3,s.ry=3,C(n,s),z(i)(e.text,n,s.x,s.y,s.width,s.height,{class:"journey-section section-type-"+e.num},i,e.colour)},"drawSection"),O=-1,W=t(function(t,e,i){const n=e.x+i.width/2,s=t.append("g");O++;s.append("line").attr("id","task"+O).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),M(s,{cx:n,cy:300+30*(5-e.score),score:e.score});const r=R();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=i.width,r.height=i.height,r.class="task task-type-"+e.num,r.rx=3,r.ry=3,C(s,r),z(i)(e.task,s,r.x,r.y,r.width,r.height,{class:"task"},i,e.colour)},"drawTask"),F=t(function(t,e){C(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),P=t(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),R=t(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),z=function(){function e(t,e,i,n,r,a,o,c){s(e.append("text").attr("x",i+r/2).attr("y",n+a/2+5).style("font-color",c).style("text-anchor","middle").text(t),o)}function i(t,e,i,n,r,a,o,c,l){const{taskFontSize:h,taskFontFamily:u}=c,d=t.split(/<br\s*\/?>/gi);for(let f=0;f<d.length;f++){const t=f*h-h*(d.length-1)/2,c=e.append("text").attr("x",i+r/2).attr("y",n).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",u);c.append("tspan").attr("x",i+r/2).attr("dy",t).text(d[f]),c.attr("y",n+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(c,o)}}function n(t,e,n,r,a,o,c,l){const h=e.append("switch"),u=h.append("foreignObject").attr("x",n).attr("y",r).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),i(t,h,n,r,a,o,c,l),s(u,c)}function s(t,e){for(const i in e)i in e&&t.attr(i,e[i])}return t(e,"byText"),t(i,"byTspan"),t(n,"byFo"),t(s,"_setTextAttrs"),function(t){return"fo"===t.textPlacement?n:"old"===t.textPlacement?e:i}}(),D=t(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function B(t,e){t.each(function(){var t,i=n(this),s=i.text().split(/(\s+|<br>)/).reverse(),r=[],a=i.attr("y"),o=parseFloat(i.attr("dy")),c=i.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",o+"em");for(let n=0;n<s.length;n++)t=s[s.length-1-n],r.push(t),c.text(r.join(" ").trim()),(c.node().getComputedTextLength()>e||"<br>"===t)&&(r.pop(),c.text(r.join(" ").trim()),r="<br>"===t?[""]:[t],c=i.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))})}t(B,"wrap");var V=t(function(t,e,i,n){var s;const r=i%12-1,a=t.append("g");e.section=r,a.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+r);const o=a.append("g"),c=a.append("g"),l=c.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(B,e.width).node().getBBox(),h=(null==(s=n.fontSize)?void 0:s.replace)?n.fontSize.replace("px",""):n.fontSize;return e.height=l.height+1.1*h*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,c.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),q(o,e,r,n),e},"drawNode"),Y=t(function(t,e,i){var n;const s=t.append("g"),r=s.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(B,e.width).node().getBBox(),a=(null==(n=i.fontSize)?void 0:n.replace)?i.fontSize.replace("px",""):i.fontSize;return s.remove(),r.height+1.1*a*.5+e.padding},"getVirtualNodeHeight"),q=t(function(t,e,i){t.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("d",`M0 ${e.height-5} v${10-e.height} q0,-5 5,-5 h${e.width-10} q5,0 5,5 v${e.height-5} H0 Z`),t.append("line").attr("class","node-line-"+i).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),G={drawRect:C,drawCircle:H,drawSection:A,drawText:j,drawLabel:L,drawTask:W,drawBackgroundRect:F,getTextObj:P,getNoteRect:R,initGraphics:D,drawNode:V,getVirtualNodeHeight:Y},U=t(function(t,r,a,o){var c,l,h;const u=e(),d=(null==(c=u.timeline)?void 0:c.leftMargin)??50;i.debug("timeline",o.db);const f=u.securityLevel;let m;"sandbox"===f&&(m=n("#i"+r));const p=n("sandbox"===f?m.nodes()[0].contentDocument.body:"body").select("#"+r);p.append("g");const g=o.db.getTasks(),x=o.db.getCommonDb().getDiagramTitle();i.debug("task",g),G.initGraphics(p);const k=o.db.getSections();i.debug("sections",k);let y=0,v=0,b=0,w=0,_=50+d,S=50;w=50;let $=0,T=!0;k.forEach(function(t){const e={number:$,descr:t,section:$,width:150,padding:20,maxHeight:y},n=G.getVirtualNodeHeight(p,e,u);i.debug("sectionHeight before draw",n),y=Math.max(y,n+20)});let E=0,I=0;i.debug("tasks.length",g.length);for(const[e,n]of g.entries()){const t={number:e,descr:n,section:n.section,width:150,padding:20,maxHeight:v},s=G.getVirtualNodeHeight(p,t,u);i.debug("taskHeight before draw",s),v=Math.max(v,s+20),E=Math.max(E,n.events.length);let r=0;for(const e of n.events){const t={descr:e,section:n.section,number:n.section,width:150,padding:20,maxHeight:50};r+=G.getVirtualNodeHeight(p,t,u)}n.events.length>0&&(r+=10*(n.events.length-1)),I=Math.max(I,r)}i.debug("maxSectionHeight before draw",y),i.debug("maxTaskHeight before draw",v),k&&k.length>0?k.forEach(t=>{const e=g.filter(e=>e.section===t),n={number:$,descr:t,section:$,width:200*Math.max(e.length,1)-50,padding:20,maxHeight:y};i.debug("sectionNode",n);const s=p.append("g"),r=G.drawNode(s,n,$,u);i.debug("sectionNode output",r),s.attr("transform",`translate(${_}, 50)`),S+=y+50,e.length>0&&X(p,e,$,_,S,v,u,E,I,y,!1),_+=200*Math.max(e.length,1),S=50,$++}):(T=!1,X(p,g,$,_,S,v,u,E,I,y,!0));const N=p.node().getBBox();i.debug("bounds",N),x&&p.append("text").text(x).attr("x",N.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),b=T?y+v+150:v+100;p.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",b).attr("x2",N.width+3*d).attr("y2",b).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),s(void 0,p,(null==(l=u.timeline)?void 0:l.padding)??50,(null==(h=u.timeline)?void 0:h.useMaxWidth)??!1)},"draw"),X=t(function(t,e,n,s,r,a,o,c,l,h,u){var d;for(const f of e){const e={descr:f.task,section:n,number:n,width:150,padding:20,maxHeight:a};i.debug("taskNode",e);const c=t.append("g").attr("class","taskWrapper"),h=G.drawNode(c,e,n,o).height;if(i.debug("taskHeight after draw",h),c.attr("transform",`translate(${s}, ${r})`),a=Math.max(a,h),f.events){const e=t.append("g").attr("class","lineWrapper");let i=a;r+=100,i+=Z(t,f.events,n,s,r,o),r-=100,e.append("line").attr("x1",s+95).attr("y1",r+a).attr("x2",s+95).attr("y2",r+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}s+=200,u&&!(null==(d=o.timeline)?void 0:d.disableMulticolor)&&n++}r-=10},"drawTasks"),Z=t(function(t,e,n,s,r,a){let o=0;const c=r;r+=100;for(const l of e){const e={descr:l,section:n,number:n,width:150,padding:20,maxHeight:50};i.debug("eventNode",e);const c=t.append("g").attr("class","eventWrapper"),h=G.drawNode(c,e,n,a).height;o+=h,c.attr("transform",`translate(${s}, ${r})`),r=r+10+h}return r=c,o},"drawEvents"),J={setConf:t(()=>{},"setConf"),draw:U},K=t(t=>{let e="";for(let i=0;i<t.THEME_COLOR_LIMIT;i++)t["lineColor"+i]=t["lineColor"+i]||t["cScaleInv"+i],r(t["lineColor"+i])?t["lineColor"+i]=a(t["lineColor"+i],20):t["lineColor"+i]=o(t["lineColor"+i],20);for(let i=0;i<t.THEME_COLOR_LIMIT;i++){const n=""+(17-3*i);e+=`\n .section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} path {\n fill: ${t["cScale"+i]};\n }\n .section-${i-1} text {\n fill: ${t["cScaleLabel"+i]};\n }\n .node-icon-${i-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+i]};\n }\n .section-edge-${i-1}{\n stroke: ${t["cScale"+i]};\n }\n .edge-depth-${i-1}{\n stroke-width: ${n};\n }\n .section-${i-1} line {\n stroke: ${t["cScaleInv"+i]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${t["cScaleLabel"+i]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n `}return e},"genSections"),Q={db:m,renderer:J,parser:f,styles:t(t=>`\n .edge {\n stroke-width: 3;\n }\n ${K(t)}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`,"getStyles")};export{Q as diagram};
|