aitu-app 0.5.14
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/.DS_Store +0 -0
- package/README.md +47 -0
- package/_headers +84 -0
- package/_redirects +2 -0
- package/assets/ChatMessagesArea-CkUX81uB.js +251 -0
- package/assets/ChatMessagesArea-Di0Z80Zh.css +1 -0
- package/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/assets/Tableau10-B-NsZVaP.js +1 -0
- package/assets/Tableau10-Dnlau_Wv.js +1 -0
- package/assets/ToolboxDrawer-By1XMh8B.js +87 -0
- package/assets/ToolboxDrawer-fPqvDLQE.css +1 -0
- package/assets/__vite-browser-external-BIHI7g3E.js +1 -0
- package/assets/ai-analyze-Db-iXol6.js +1 -0
- package/assets/arc-BZXVqUcI.js +1 -0
- package/assets/arc-ajYHRRnk.js +1 -0
- package/assets/array-B5oSNiGi.js +1 -0
- package/assets/array-BKyUJesY.js +1 -0
- package/assets/batch-image-generation-Baqb01Lm.js +6 -0
- package/assets/batch-image-generation-CbLMWmjk.css +1 -0
- package/assets/blockDiagram-38ab4fdb-BT3H_WVv.js +118 -0
- package/assets/blockDiagram-38ab4fdb-u0xYP3Lt.js +118 -0
- package/assets/c4Diagram-3d4e48cf-CBvM6zjM.js +10 -0
- package/assets/c4Diagram-3d4e48cf-WOIEVidH.js +10 -0
- package/assets/channel-BP25wTsw.js +1 -0
- package/assets/channel-HzrLNFUg.js +1 -0
- package/assets/classDiagram-70f12bd4-BMutcvFi.js +2 -0
- package/assets/classDiagram-70f12bd4-Cl9U1r5F.js +2 -0
- package/assets/classDiagram-v2-f2320105-C0agtbR4.js +2 -0
- package/assets/classDiagram-v2-f2320105-tCBzATK6.js +2 -0
- package/assets/clone-B69pF7Y_.js +1 -0
- package/assets/clone-oX7o-l4R.js +1 -0
- package/assets/createText-2e5e7dd3-CZ9_fscE.js +5 -0
- package/assets/createText-2e5e7dd3-idrqgJjU.js +7 -0
- package/assets/edges-e0da2a9e-C-RyePMV.js +4 -0
- package/assets/edges-e0da2a9e-DJXAjJSL.js +4 -0
- package/assets/erDiagram-9861fffd-DWJR_3zL.js +51 -0
- package/assets/erDiagram-9861fffd-x2Kcy95-.js +51 -0
- package/assets/flowDb-956e92f1-BgKjOIdz.js +10 -0
- package/assets/flowDb-956e92f1-CF6y18Tn.js +10 -0
- package/assets/flowDiagram-66a62f08-BPPw0wPU.js +4 -0
- package/assets/flowDiagram-66a62f08-CSAllSFf.js +4 -0
- package/assets/flowDiagram-v2-96b9c2cf-B-UGyXRi.js +1 -0
- package/assets/flowDiagram-v2-96b9c2cf-Cm596kxZ.js +1 -0
- package/assets/flowchart-elk-definition-4a651766-9XSRJbsr.js +139 -0
- package/assets/flowchart-elk-definition-4a651766-DWFN9DN3.js +139 -0
- package/assets/ganttDiagram-c361ad54-D9tbz9tQ.js +257 -0
- package/assets/ganttDiagram-c361ad54-ot5pUYpT.js +257 -0
- package/assets/gitGraphDiagram-72cf32ee-BFV3Mt8C.js +70 -0
- package/assets/gitGraphDiagram-72cf32ee-C6qFzgGh.js +70 -0
- package/assets/graph-BxwlF7JS.js +1 -0
- package/assets/graph-D-2Ldvxg.js +1 -0
- package/assets/grid-image-cM9AmYC8.js +1 -0
- package/assets/has-CgdIPiQG.js +1 -0
- package/assets/hasIn-4iY02rGN.js +1 -0
- package/assets/index-3862675e-CVZnpwDN.js +1 -0
- package/assets/index-3862675e-DqdI9cab.js +1 -0
- package/assets/index-B2dvADz8.css +1 -0
- package/assets/index-BicRPzXC.js +1 -0
- package/assets/index-Bs7-jmv6.css +1 -0
- package/assets/index-BwSGXyRr.js +99 -0
- package/assets/index-C1XdOOAn.css +1 -0
- package/assets/index-C4AKKbpQ.css +1 -0
- package/assets/index-CkpXFt8n.js +1 -0
- package/assets/index-CrxF9gFe.js +42 -0
- package/assets/index-DBWqXBIQ.js +93 -0
- package/assets/index-DI_5V2-m.js +3 -0
- package/assets/index-DWUAFoZG.js +2064 -0
- package/assets/index-Dn0YtZ2R.js +3 -0
- package/assets/index-e05Rs4M6.js +12 -0
- package/assets/index.dom-C3-224fz.js +1 -0
- package/assets/infoDiagram-f8f76790-CnrpwoOt.js +7 -0
- package/assets/infoDiagram-f8f76790-FKC1Sy9Y.js +7 -0
- package/assets/init-A0kIFD9x.js +1 -0
- package/assets/init-Gi6I4Gst.js +1 -0
- package/assets/inspiration-board-B_-BBBHt.js +1 -0
- package/assets/isEmpty-Dj2GV0v-.js +1 -0
- package/assets/journeyDiagram-49397b02-B7fP21sU.js +139 -0
- package/assets/journeyDiagram-49397b02-Dp3X9XWq.js +139 -0
- package/assets/katex-BbEIqZs1.js +261 -0
- package/assets/katex-Cu_Erd72.js +261 -0
- package/assets/layout-BD3yCK_X.js +1 -0
- package/assets/layout-DHHYqX7p.js +1 -0
- package/assets/line-B3bNrkzn.js +1 -0
- package/assets/line-B86HLuqu.js +1 -0
- package/assets/linear-DU2Ciymb.js +1 -0
- package/assets/linear-wCAlMhOS.js +1 -0
- package/assets/mermaid.core-DfVvnpgz.js +91 -0
- package/assets/mindmap-definition-fc14e90a-D1sxE3xG.js +425 -0
- package/assets/mindmap-definition-fc14e90a-YuSOJC7P.js +425 -0
- package/assets/ordinal-BRr1uYdk.js +1 -0
- package/assets/ordinal-Cboi1Yqb.js +1 -0
- package/assets/path-CY0bYimO.js +1 -0
- package/assets/path-CbwjOpE9.js +1 -0
- package/assets/photo-wall-splitter-BVU2e0aS.js +1 -0
- package/assets/pick-Cvlwra4g.js +1 -0
- package/assets/pieDiagram-8a3498a8-B6mJUqro.js +35 -0
- package/assets/pieDiagram-8a3498a8-B91bWgo_.js +35 -0
- package/assets/quadrantDiagram-120e2f19-BxS8fQEz.js +7 -0
- package/assets/quadrantDiagram-120e2f19-DwudONqx.js +7 -0
- package/assets/requirementDiagram-deff3bca-DygaMIoy.js +52 -0
- package/assets/requirementDiagram-deff3bca-v9xlgfS8.js +52 -0
- package/assets/sankeyDiagram-04a897e0-BV23dp4l.js +8 -0
- package/assets/sankeyDiagram-04a897e0-BXCiXiyw.js +8 -0
- package/assets/sequenceDiagram-704730f1-CObRpNi4.js +122 -0
- package/assets/sequenceDiagram-704730f1-Ck69A6wI.js +122 -0
- package/assets/settings-dialog-BlCO49C4.js +1 -0
- package/assets/settings-dialog-QUxXj54T.css +1 -0
- package/assets/stateDiagram-587899a1-J_G6I0oo.js +1 -0
- package/assets/stateDiagram-587899a1-z-tKclr3.js +1 -0
- package/assets/stateDiagram-v2-d93cdb3a-DsThtOzP.js +1 -0
- package/assets/stateDiagram-v2-d93cdb3a-XIvq5t8a.js +1 -0
- package/assets/styles-6aaf32cf-1fjuNMUk.js +207 -0
- package/assets/styles-6aaf32cf-DT2rVNfQ.js +207 -0
- package/assets/styles-9a916d00-fLeUSina.js +160 -0
- package/assets/styles-9a916d00-q64Umkis.js +160 -0
- package/assets/styles-c10674c1-BWlxVc3Q.js +116 -0
- package/assets/styles-c10674c1-CtYpjMYU.js +116 -0
- package/assets/svgDrawCommon-08f97a94-C_DhKfny.js +1 -0
- package/assets/svgDrawCommon-08f97a94-DSBqmUv2.js +1 -0
- package/assets/timeline-definition-85554ec2-AKpzwLPN.js +61 -0
- package/assets/timeline-definition-85554ec2-dTkYwoLF.js +61 -0
- package/assets/ttd-dialog-CxiaIUuJ.js +47 -0
- package/assets/ttd-dialog-DCapefb6.css +1 -0
- package/assets/upload-4sxUU7q_.js +1 -0
- package/assets/video-recovery-service-BckHbSyK.js +1 -0
- package/assets/web-vitals-DcvjKPr-.js +1 -0
- package/assets/winbox.bundle.min-CoRPjCs5.js +1 -0
- package/assets/xlsx-CkFp8p6R.js +105 -0
- package/assets/xychartDiagram-e933f94c-DCmvL0ag.js +7 -0
- package/assets/xychartDiagram-e933f94c-aqOiXp_u.js +7 -0
- package/batch-image.html +1616 -0
- package/favicon.ico +0 -0
- package/icons/README.md +55 -0
- package/icons/aitu10.png +0 -0
- package/icons/android-chrome-192x192.png +0 -0
- package/icons/android-chrome-512x512.png +0 -0
- package/icons/apple-touch-icon.png +0 -0
- package/icons/favicon-16x16.png +0 -0
- package/icons/favicon-16x16.svg +539 -0
- package/icons/favicon-32x32.png +0 -0
- package/icons/favicon-32x32.svg +539 -0
- package/icons/favicon-new.svg +539 -0
- package/icons/favicon-new.svg.png +0 -0
- package/icons/icon-192x192.svg +539 -0
- package/icons/icon-512x512.svg +539 -0
- package/icons/icon-96x96.png +0 -0
- package/icons/icon-96x96.svg +539 -0
- package/iframe-test.html +340 -0
- package/index.html +105 -0
- package/init.json +6 -0
- package/logo/cardid.jpg +0 -0
- package/logo/group-qr.png +0 -0
- package/logo/logo_drawnix_h.svg +539 -0
- package/logo/logo_drawnix_h_dark.svg +539 -0
- package/logo/logo_drawnix_new.svg +539 -0
- package/manifest.json +52 -0
- package/package.json +31 -0
- package/product_showcase/aitu-01.png +0 -0
- package/product_showcase/aitu-02.png +0 -0
- package/product_showcase/aitu-03.png +0 -0
- package/product_showcase/aitu-04.png +0 -0
- package/product_showcase/aitu-05.png +0 -0
- package/product_showcase/aitu-06.png +0 -0
- package/product_showcase/case-1.png +0 -0
- package/product_showcase/case-2.png +0 -0
- package/robots.txt +13 -0
- package/sitemap.xml +29 -0
- package/sw-debug/app.js +3069 -0
- package/sw-debug/console-entry.js +80 -0
- package/sw-debug/log-entry.js +452 -0
- package/sw-debug/log-panel.js +309 -0
- package/sw-debug/postmessage-entry.js +117 -0
- package/sw-debug/status-panel.js +125 -0
- package/sw-debug/styles.css +2103 -0
- package/sw-debug/sw-communication.js +208 -0
- package/sw-debug/utils.js +112 -0
- package/sw-debug.html +685 -0
- package/sw.js +58 -0
- package/version.json +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=document.createElement("i");function c(t){const n="&"+t+";";r.innerHTML=n;const e=r.textContent;return e.charCodeAt(e.length-1)===59&&t!=="semi"||e===n?!1:e}export{c as d};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{l as U,D as Y,e as M}from"./index-BwSGXyRr.js";import"./index-DWUAFoZG.js";import"./isEmpty-Dj2GV0v-.js";var O=(function(){var a=function(u,t,e,n){for(e=e||{},n=u.length;n--;e[u[n]]=t);return e},f=[6,9,10],m={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]],performAction:function(t,e,n,s,r,i,d){switch(i.length-1,r){case 1:return s;case 4:break;case 6:s.setInfo(!0);break}},table:[{3:1,4:[1,2]},{1:[3]},a(f,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},a(f,[2,3]),a(f,[2,4]),a(f,[2,5]),a(f,[2,6])],defaultActions:{4:[2,1]},parseError:function(t,e){if(e.recoverable)this.trace(t);else{var n=new Error(t);throw n.hash=e,n}},parse:function(t){var e=this,n=[0],s=[],r=[null],i=[],d=this.table,P="",v=0,L=0,N=2,T=1,R=i.slice.call(arguments,1),o=Object.create(this.lexer),p={yy:{}};for(var E in this.yy)Object.prototype.hasOwnProperty.call(this.yy,E)&&(p.yy[E]=this.yy[E]);o.setInput(t,p.yy),p.yy.lexer=o,p.yy.parser=this,typeof o.yylloc>"u"&&(o.yylloc={});var I=o.yylloc;i.push(I);var z=o.options&&o.options.ranges;typeof p.yy.parseError=="function"?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function D(){var y;return y=s.pop()||o.lex()||T,typeof y!="number"&&(y instanceof Array&&(s=y,y=s.pop()),y=e.symbols_[y]||y),y}for(var l,g,h,w,_={},b,c,F,S;;){if(g=n[n.length-1],this.defaultActions[g]?h=this.defaultActions[g]:((l===null||typeof l>"u")&&(l=D()),h=d[g]&&d[g][l]),typeof h>"u"||!h.length||!h[0]){var A="";S=[];for(b in d[g])this.terminals_[b]&&b>N&&S.push("'"+this.terminals_[b]+"'");o.showPosition?A="Parse error on line "+(v+1)+`:
|
|
2
|
+
`+o.showPosition()+`
|
|
3
|
+
Expecting `+S.join(", ")+", got '"+(this.terminals_[l]||l)+"'":A="Parse error on line "+(v+1)+": Unexpected "+(l==T?"end of input":"'"+(this.terminals_[l]||l)+"'"),this.parseError(A,{text:o.match,token:this.terminals_[l]||l,line:o.yylineno,loc:I,expected:S})}if(h[0]instanceof Array&&h.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+l);switch(h[0]){case 1:n.push(l),r.push(o.yytext),i.push(o.yylloc),n.push(h[1]),l=null,L=o.yyleng,P=o.yytext,v=o.yylineno,I=o.yylloc;break;case 2:if(c=this.productions_[h[1]][1],_.$=r[r.length-c],_._$={first_line:i[i.length-(c||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(c||1)].first_column,last_column:i[i.length-1].last_column},z&&(_._$.range=[i[i.length-(c||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(_,[P,L,v,p.yy,h[1],r,i].concat(R)),typeof w<"u")return w;c&&(n=n.slice(0,-1*c*2),r=r.slice(0,-1*c),i=i.slice(0,-1*c)),n.push(this.productions_[h[1]][0]),r.push(_.$),i.push(_._$),F=d[n[n.length-2]][n[n.length-1]],n.push(F);break;case 3:return!0}}return!0}},k=(function(){var u={EOF:1,parseError:function(e,n){if(this.yy.parser)this.yy.parser.parseError(e,n);else throw new Error(e)},setInput: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},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=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 s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|
|
5
|
+
`+e+"^"},test_match:function(t,e){var n,s,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),s=t[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var i in r)this[i]=r[i];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,s;this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),i=0;i<r.length;i++)if(n=this._input.match(this.rules[r[i]]),n&&(!e||n[0].length>e[0].length)){if(e=n,s=i,this.options.backtrack_lexer){if(t=this.test_match(n,r[i]),t!==!1)return t;if(this._backtrack){e=!1;continue}else return!1}else if(!this.options.flex)break}return e?(t=this.test_match(e,r[s]),t!==!1?t:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(e,n,s,r){switch(s){case 0:return 4;case 1:return 9;case 2:return"space";case 3:return 10;case 4:return 6;case 5:return"TXT"}},rules:[/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5],inclusive:!0}}};return u})();m.lexer=k;function x(){this.yy={}}return x.prototype=m,m.Parser=x,new x})();O.parser=O;const B=O,j={info:!1};let $=j.info;const V=a=>{$=a},X=()=>$,q=()=>{$=j.info},C={clear:q,setInfo:V,getInfo:X},G=(a,f,m)=>{U.debug(`rendering info diagram
|
|
7
|
+
`+a);const k=Y(f);M(k,100,400,!0),k.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${m}`)},H={draw:G},W={parser:B,db:C,renderer:H};export{W as diagram};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{l as Y,B,e as D}from"./mermaid.core-DfVvnpgz.js";import"./index-DWUAFoZG.js";var O=(function(){var a=function(u,t,e,n){for(e=e||{},n=u.length;n--;e[u[n]]=t);return e},f=[6,9,10],m={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]],performAction:function(t,e,n,s,r,i,d){switch(i.length-1,r){case 1:return s;case 4:break;case 6:s.setInfo(!0);break}},table:[{3:1,4:[1,2]},{1:[3]},a(f,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},a(f,[2,3]),a(f,[2,4]),a(f,[2,5]),a(f,[2,6])],defaultActions:{4:[2,1]},parseError:function(t,e){if(e.recoverable)this.trace(t);else{var n=new Error(t);throw n.hash=e,n}},parse:function(t){var e=this,n=[0],s=[],r=[null],i=[],d=this.table,P="",v=0,L=0,N=2,T=1,R=i.slice.call(arguments,1),o=Object.create(this.lexer),p={yy:{}};for(var E in this.yy)Object.prototype.hasOwnProperty.call(this.yy,E)&&(p.yy[E]=this.yy[E]);o.setInput(t,p.yy),p.yy.lexer=o,p.yy.parser=this,typeof o.yylloc>"u"&&(o.yylloc={});var I=o.yylloc;i.push(I);var z=o.options&&o.options.ranges;typeof p.yy.parseError=="function"?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function U(){var y;return y=s.pop()||o.lex()||T,typeof y!="number"&&(y instanceof Array&&(s=y,y=s.pop()),y=e.symbols_[y]||y),y}for(var l,g,h,w,_={},b,c,F,S;;){if(g=n[n.length-1],this.defaultActions[g]?h=this.defaultActions[g]:((l===null||typeof l>"u")&&(l=U()),h=d[g]&&d[g][l]),typeof h>"u"||!h.length||!h[0]){var A="";S=[];for(b in d[g])this.terminals_[b]&&b>N&&S.push("'"+this.terminals_[b]+"'");o.showPosition?A="Parse error on line "+(v+1)+`:
|
|
2
|
+
`+o.showPosition()+`
|
|
3
|
+
Expecting `+S.join(", ")+", got '"+(this.terminals_[l]||l)+"'":A="Parse error on line "+(v+1)+": Unexpected "+(l==T?"end of input":"'"+(this.terminals_[l]||l)+"'"),this.parseError(A,{text:o.match,token:this.terminals_[l]||l,line:o.yylineno,loc:I,expected:S})}if(h[0]instanceof Array&&h.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+l);switch(h[0]){case 1:n.push(l),r.push(o.yytext),i.push(o.yylloc),n.push(h[1]),l=null,L=o.yyleng,P=o.yytext,v=o.yylineno,I=o.yylloc;break;case 2:if(c=this.productions_[h[1]][1],_.$=r[r.length-c],_._$={first_line:i[i.length-(c||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(c||1)].first_column,last_column:i[i.length-1].last_column},z&&(_._$.range=[i[i.length-(c||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(_,[P,L,v,p.yy,h[1],r,i].concat(R)),typeof w<"u")return w;c&&(n=n.slice(0,-1*c*2),r=r.slice(0,-1*c),i=i.slice(0,-1*c)),n.push(this.productions_[h[1]][0]),r.push(_.$),i.push(_._$),F=d[n[n.length-2]][n[n.length-1]],n.push(F);break;case 3:return!0}}return!0}},k=(function(){var u={EOF:1,parseError:function(e,n){if(this.yy.parser)this.yy.parser.parseError(e,n);else throw new Error(e)},setInput: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},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=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 s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|
|
5
|
+
`+e+"^"},test_match:function(t,e){var n,s,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),s=t[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var i in r)this[i]=r[i];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,s;this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),i=0;i<r.length;i++)if(n=this._input.match(this.rules[r[i]]),n&&(!e||n[0].length>e[0].length)){if(e=n,s=i,this.options.backtrack_lexer){if(t=this.test_match(n,r[i]),t!==!1)return t;if(this._backtrack){e=!1;continue}else return!1}else if(!this.options.flex)break}return e?(t=this.test_match(e,r[s]),t!==!1?t:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(e,n,s,r){switch(s){case 0:return 4;case 1:return 9;case 2:return"space";case 3:return 10;case 4:return 6;case 5:return"TXT"}},rules:[/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5],inclusive:!0}}};return u})();m.lexer=k;function x(){this.yy={}}return x.prototype=m,m.Parser=x,new x})();O.parser=O;const M=O,j={info:!1};let $=j.info;const V=a=>{$=a},X=()=>$,q=()=>{$=j.info},C={clear:q,setInfo:V,getInfo:X},G=(a,f,m)=>{Y.debug(`rendering info diagram
|
|
7
|
+
`+a);const k=B(f);D(k,100,400,!0),k.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${m}`)},H={draw:G},Q={parser:M,db:C,renderer:H};export{Q as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(e,a){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(a).domain(e);break}return this}export{t as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(e,a){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(a).domain(e);break}return this}export{t as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as l,t as d,m as T,n as k,o as y,s as h}from"./index-DWUAFoZG.js";function f(){var e;return k.get().imageModelName||((e=y[0])==null?void 0:e.id)||"gemini-2.5-flash-image-vip"}function M(t,e){const r=h.zh;return r(t,e)}function A(t,e){const{theme:r,imageCount:u=l.imageCount,imageSize:o="16x9",referenceImages:s,model:I}=t;if(!r||typeof r!="string")return{success:!1,error:"缺少必填参数 theme(主题描述)",type:"error"};const n=Math.min(Math.max(1,u),16),m=M(r,n),c=I||f(),i=s==null?void 0:s.map((a,g)=>({type:"url",url:a,name:`reference-${g+1}`}));try{let a;if(e!=null&&e.retryTaskId){if(d.retryTask(e.retryTaskId),a=d.getTask(e.retryTaskId),!a)throw new Error(`重试任务不存在: ${e.retryTaskId}`)}else a=d.createTask({prompt:m,size:o,model:c,uploadedImages:i&&i.length>0?i:void 0,isInspirationBoard:!0,inspirationBoardImageCount:n,inspirationBoardLayoutStyle:"inspiration-board",originalTheme:r,batchId:e==null?void 0:e.batchId,globalIndex:(e==null?void 0:e.globalIndex)||1,autoInsertToCanvas:!0},T.IMAGE);return{success:!0,data:{taskId:a.id,theme:r,imageCount:n,prompt:m.substring(0,100)+"..."},type:"image",taskId:a.id,task:a}}catch(a){return console.error("[InspirationBoard] Failed to create task:",a),{success:!1,error:a.message||"创建灵感图任务失败",type:"error"}}}export{A as createInspirationBoardTask};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as i,d as e,e as o,f as n,g as f,h as a,j as p,k as y}from"./index-DWUAFoZG.js";var g="[object Map]",c="[object Set]",b=Object.prototype,h=b.hasOwnProperty;function m(r){if(r==null)return!0;if(i(r)&&(e(r)||typeof r=="string"||typeof r.splice=="function"||o(r)||n(r)||f(r)))return!r.length;var t=a(r);if(t==g||t==c)return!r.size;if(p(r))return!y(r).length;for(var s in r)if(h.call(r,s))return!1;return!0}export{m as i};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import{a as yt,s as ft,b as dt,c as pt,o as gt,p as mt,g as I,d as H,e as xt,r as kt}from"./index-BwSGXyRr.js";import{a as _t,g as it,f as bt,d as vt}from"./svgDrawCommon-08f97a94-C_DhKfny.js";import{a as Q}from"./arc-ajYHRRnk.js";import"./index-DWUAFoZG.js";import"./isEmpty-Dj2GV0v-.js";import"./path-CbwjOpE9.js";var X=(function(){var t=function(p,s,r,a){for(r=r||{},a=p.length;a--;r[p[a]]=s);return r},e=[6,8,10,11,12,14,16,17,18],i=[1,9],l=[1,10],n=[1,11],h=[1,12],c=[1,13],f=[1,14],y={trace:function(){},yy:{},symbols_:{error:2,start:3,journey: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,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",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",18:"taskName",19:"taskData"},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,2]],performAction:function(s,r,a,u,d,o,w){var k=o.length-1;switch(d){case 1:return o[k-1];case 2:this.$=[];break;case 3:o[k-1].push(o[k]),this.$=o[k-1];break;case 4:case 5:this.$=o[k];break;case 6:case 7:this.$=[];break;case 8:u.setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),u.setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),u.setAccDescription(this.$);break;case 12:u.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 13:u.addTask(o[k-1],o[k]),this.$="task";break}},table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:i,12:l,14:n,16:h,17:c,18:f},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:i,12:l,14:n,16:h,17:c,18:f},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:function(s,r){if(r.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=r,a}},parse:function(s){var r=this,a=[0],u=[],d=[null],o=[],w=this.table,k="",R=0,Z=0,lt=2,J=1,ct=o.slice.call(arguments,1),x=Object.create(this.lexer),S={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(S.yy[z]=this.yy[z]);x.setInput(s,S.yy),S.yy.lexer=x,S.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var Y=x.yylloc;o.push(Y);var ht=x.options&&x.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ut(){var T;return T=u.pop()||x.lex()||J,typeof T!="number"&&(T instanceof Array&&(u=T,T=u.pop()),T=r.symbols_[T]||T),T}for(var _,E,b,O,A={},N,$,K,B;;){if(E=a[a.length-1],this.defaultActions[E]?b=this.defaultActions[E]:((_===null||typeof _>"u")&&(_=ut()),b=w[E]&&w[E][_]),typeof b>"u"||!b.length||!b[0]){var q="";B=[];for(N in w[E])this.terminals_[N]&&N>lt&&B.push("'"+this.terminals_[N]+"'");x.showPosition?q="Parse error on line "+(R+1)+`:
|
|
2
|
+
`+x.showPosition()+`
|
|
3
|
+
Expecting `+B.join(", ")+", got '"+(this.terminals_[_]||_)+"'":q="Parse error on line "+(R+1)+": Unexpected "+(_==J?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(q,{text:x.match,token:this.terminals_[_]||_,line:x.yylineno,loc:Y,expected:B})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+_);switch(b[0]){case 1:a.push(_),d.push(x.yytext),o.push(x.yylloc),a.push(b[1]),_=null,Z=x.yyleng,k=x.yytext,R=x.yylineno,Y=x.yylloc;break;case 2:if($=this.productions_[b[1]][1],A.$=d[d.length-$],A._$={first_line:o[o.length-($||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-($||1)].first_column,last_column:o[o.length-1].last_column},ht&&(A._$.range=[o[o.length-($||1)].range[0],o[o.length-1].range[1]]),O=this.performAction.apply(A,[k,Z,R,S.yy,b[1],d,o].concat(ct)),typeof O<"u")return O;$&&(a=a.slice(0,-1*$*2),d=d.slice(0,-1*$),o=o.slice(0,-1*$)),a.push(this.productions_[b[1]][0]),d.push(A.$),o.push(A._$),K=w[a[a.length-2]][a[a.length-1]],a.push(K);break;case 3:return!0}}return!0}},m=(function(){var p={EOF:1,parseError:function(r,a){if(this.yy.parser)this.yy.parser.parseError(r,a);else throw new Error(r)},setInput:function(s,r){return this.yy=r||this.yy||{},this._input=s,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},input:function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var r=s.match(/(?:\r\n?|\n).*/g);return r?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},unput:function(s){var r=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var u=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),a.length-1&&(this.yylineno-=a.length-1);var d=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:a?(a.length===u.length?this.yylloc.first_column:0)+u[u.length-a.length].length-a[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-r]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(s){this.unput(this.match.slice(s))},pastInput:function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var s=this.pastInput(),r=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
+
`+r+"^"},test_match:function(s,r){var a,u,d;if(this.options.backtrack_lexer&&(d={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&&(d.yylloc.range=this.yylloc.range.slice(0))),u=s[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],a=this.performAction.call(this,this.yy,this,r,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var o in d)this[o]=d[o];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,r,a,u;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),o=0;o<d.length;o++)if(a=this._input.match(this.rules[d[o]]),a&&(!r||a[0].length>r[0].length)){if(r=a,u=o,this.options.backtrack_lexer){if(s=this.test_match(a,d[o]),s!==!1)return s;if(this._backtrack){r=!1;continue}else return!1}else if(!this.options.flex)break}return r?(s=this.test_match(r,d[u]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return r||this.lex()},begin:function(r){this.conditionStack.push(r)},popState:function(){var r=this.conditionStack.length-1;return r>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(r){return r=this.conditionStack.length-1-Math.abs(r||0),r>=0?this.conditionStack[r]:"INITIAL"},pushState:function(r){this.begin(r)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(r,a,u,d){switch(u){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;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 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\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,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/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,19],inclusive:!0}}};return p})();y.lexer=m;function g(){this.yy={}}return g.prototype=y,y.Parser=g,new g})();X.parser=X;const wt=X;let C="";const G=[],V=[],F=[],$t=function(){G.length=0,V.length=0,C="",F.length=0,kt()},Tt=function(t){C=t,G.push(t)},Mt=function(){return G},St=function(){let t=D();const e=100;let i=0;for(;!t&&i<e;)t=D(),i++;return V.push(...F),V},Et=function(){const t=[];return V.forEach(i=>{i.people&&t.push(...i.people)}),[...new Set(t)].sort()},Pt=function(t,e){const i=e.substr(1).split(":");let l=0,n=[];i.length===1?(l=Number(i[0]),n=[]):(l=Number(i[0]),n=i[1].split(","));const h=n.map(f=>f.trim()),c={section:C,type:C,people:h,task:t,score:l};F.push(c)},It=function(t){const e={section:C,type:C,description:t,task:t,classes:[]};V.push(e)},D=function(){const t=function(i){return F[i].processed};let e=!0;for(const[i,l]of F.entries())t(i),e=e&&l.processed;return e},At=function(){return Et()},tt={getConfig:()=>I().journey,clear:$t,setDiagramTitle:mt,getDiagramTitle:gt,setAccTitle:pt,getAccTitle:dt,setAccDescription:ft,getAccDescription:yt,addSection:Tt,getSections:Mt,getTasks:St,addTask:Pt,addTaskOrg:It,getActors:At},Ct=t=>`.label {
|
|
7
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
8
|
+
font-family: var(--mermaid-font-family);
|
|
9
|
+
color: ${t.textColor};
|
|
10
|
+
}
|
|
11
|
+
.mouth {
|
|
12
|
+
stroke: #666;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
line {
|
|
16
|
+
stroke: ${t.textColor}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.legend {
|
|
20
|
+
fill: ${t.textColor};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.label text {
|
|
24
|
+
fill: #333;
|
|
25
|
+
}
|
|
26
|
+
.label {
|
|
27
|
+
color: ${t.textColor}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.face {
|
|
31
|
+
${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};
|
|
32
|
+
stroke: #999;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.node rect,
|
|
36
|
+
.node circle,
|
|
37
|
+
.node ellipse,
|
|
38
|
+
.node polygon,
|
|
39
|
+
.node path {
|
|
40
|
+
fill: ${t.mainBkg};
|
|
41
|
+
stroke: ${t.nodeBorder};
|
|
42
|
+
stroke-width: 1px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.node .label {
|
|
46
|
+
text-align: center;
|
|
47
|
+
}
|
|
48
|
+
.node.clickable {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.arrowheadPath {
|
|
53
|
+
fill: ${t.arrowheadColor};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.edgePath .path {
|
|
57
|
+
stroke: ${t.lineColor};
|
|
58
|
+
stroke-width: 1.5px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.flowchart-link {
|
|
62
|
+
stroke: ${t.lineColor};
|
|
63
|
+
fill: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.edgeLabel {
|
|
67
|
+
background-color: ${t.edgeLabelBackground};
|
|
68
|
+
rect {
|
|
69
|
+
opacity: 0.5;
|
|
70
|
+
}
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cluster rect {
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.cluster text {
|
|
78
|
+
fill: ${t.titleColor};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
div.mermaidTooltip {
|
|
82
|
+
position: absolute;
|
|
83
|
+
text-align: center;
|
|
84
|
+
max-width: 200px;
|
|
85
|
+
padding: 2px;
|
|
86
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
87
|
+
font-family: var(--mermaid-font-family);
|
|
88
|
+
font-size: 12px;
|
|
89
|
+
background: ${t.tertiaryColor};
|
|
90
|
+
border: 1px solid ${t.border2};
|
|
91
|
+
border-radius: 2px;
|
|
92
|
+
pointer-events: none;
|
|
93
|
+
z-index: 100;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.task-type-0, .section-type-0 {
|
|
97
|
+
${t.fillType0?`fill: ${t.fillType0}`:""};
|
|
98
|
+
}
|
|
99
|
+
.task-type-1, .section-type-1 {
|
|
100
|
+
${t.fillType0?`fill: ${t.fillType1}`:""};
|
|
101
|
+
}
|
|
102
|
+
.task-type-2, .section-type-2 {
|
|
103
|
+
${t.fillType0?`fill: ${t.fillType2}`:""};
|
|
104
|
+
}
|
|
105
|
+
.task-type-3, .section-type-3 {
|
|
106
|
+
${t.fillType0?`fill: ${t.fillType3}`:""};
|
|
107
|
+
}
|
|
108
|
+
.task-type-4, .section-type-4 {
|
|
109
|
+
${t.fillType0?`fill: ${t.fillType4}`:""};
|
|
110
|
+
}
|
|
111
|
+
.task-type-5, .section-type-5 {
|
|
112
|
+
${t.fillType0?`fill: ${t.fillType5}`:""};
|
|
113
|
+
}
|
|
114
|
+
.task-type-6, .section-type-6 {
|
|
115
|
+
${t.fillType0?`fill: ${t.fillType6}`:""};
|
|
116
|
+
}
|
|
117
|
+
.task-type-7, .section-type-7 {
|
|
118
|
+
${t.fillType0?`fill: ${t.fillType7}`:""};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.actor-0 {
|
|
122
|
+
${t.actor0?`fill: ${t.actor0}`:""};
|
|
123
|
+
}
|
|
124
|
+
.actor-1 {
|
|
125
|
+
${t.actor1?`fill: ${t.actor1}`:""};
|
|
126
|
+
}
|
|
127
|
+
.actor-2 {
|
|
128
|
+
${t.actor2?`fill: ${t.actor2}`:""};
|
|
129
|
+
}
|
|
130
|
+
.actor-3 {
|
|
131
|
+
${t.actor3?`fill: ${t.actor3}`:""};
|
|
132
|
+
}
|
|
133
|
+
.actor-4 {
|
|
134
|
+
${t.actor4?`fill: ${t.actor4}`:""};
|
|
135
|
+
}
|
|
136
|
+
.actor-5 {
|
|
137
|
+
${t.actor5?`fill: ${t.actor5}`:""};
|
|
138
|
+
}
|
|
139
|
+
`,Vt=Ct,U=function(t,e){return vt(t,e)},Ft=function(t,e){const l=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),n=t.append("g");n.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),n.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function h(y){const m=Q().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);y.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function c(y){const m=Q().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);y.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function f(y){y.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return e.score>3?h(n):e.score<3?c(n):f(n),l},rt=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),i.class!==void 0&&i.attr("class",i.class),e.title!==void 0&&i.append("title").text(e.title),i},at=function(t,e){return bt(t,e)},Lt=function(t,e){function i(n,h,c,f,y){return n+","+h+" "+(n+c)+","+h+" "+(n+c)+","+(h+f-y)+" "+(n+c-y*1.2)+","+(h+f)+" "+n+","+(h+f)}const l=t.append("polygon");l.attr("points",i(e.x,e.y,50,20,7)),l.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,at(t,e)},Rt=function(t,e,i){const l=t.append("g"),n=it();n.x=e.x,n.y=e.y,n.fill=e.fill,n.width=i.width*e.taskCount+i.diagramMarginX*(e.taskCount-1),n.height=i.height,n.class="journey-section section-type-"+e.num,n.rx=3,n.ry=3,U(l,n),ot(i)(e.text,l,n.x,n.y,n.width,n.height,{class:"journey-section section-type-"+e.num},i,e.colour)};let et=-1;const Nt=function(t,e,i){const l=e.x+i.width/2,n=t.append("g");et++,n.append("line").attr("id","task"+et).attr("x1",l).attr("y1",e.y).attr("x2",l).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Ft(n,{cx:l,cy:300+(5-e.score)*30,score:e.score});const c=it();c.x=e.x,c.y=e.y,c.fill=e.fill,c.width=i.width,c.height=i.height,c.class="task task-type-"+e.num,c.rx=3,c.ry=3,U(n,c);let f=e.x+14;e.people.forEach(y=>{const m=e.actors[y].color,g={cx:f,cy:e.y,r:7,fill:m,stroke:"#000",title:y,pos:e.actors[y].position};rt(n,g),f+=10}),ot(i)(e.task,n,c.x,c.y,c.width,c.height,{class:"task"},i,e.colour)},Bt=function(t,e){_t(t,e)},ot=(function(){function t(n,h,c,f,y,m,g,p){const s=h.append("text").attr("x",c+y/2).attr("y",f+m/2+5).style("font-color",p).style("text-anchor","middle").text(n);l(s,g)}function e(n,h,c,f,y,m,g,p,s){const{taskFontSize:r,taskFontFamily:a}=p,u=n.split(/<br\s*\/?>/gi);for(let d=0;d<u.length;d++){const o=d*r-r*(u.length-1)/2,w=h.append("text").attr("x",c+y/2).attr("y",f).attr("fill",s).style("text-anchor","middle").style("font-size",r).style("font-family",a);w.append("tspan").attr("x",c+y/2).attr("dy",o).text(u[d]),w.attr("y",f+m/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),l(w,g)}}function i(n,h,c,f,y,m,g,p){const s=h.append("switch"),a=s.append("foreignObject").attr("x",c).attr("y",f).attr("width",y).attr("height",m).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");a.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(n),e(n,s,c,f,y,m,g,p),l(a,g)}function l(n,h){for(const c in h)c in h&&n.attr(c,h[c])}return function(n){return n.textPlacement==="fo"?i:n.textPlacement==="old"?t:e}})(),jt=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")},L={drawRect:U,drawCircle:rt,drawSection:Rt,drawText:at,drawLabel:Lt,drawTask:Nt,drawBackgroundRect:Bt,initGraphics:jt},zt=function(t){Object.keys(t).forEach(function(i){j[i]=t[i]})},M={};function Yt(t){const e=I().journey;let i=60;Object.keys(M).forEach(l=>{const n=M[l].color,h={cx:20,cy:i,r:7,fill:n,stroke:"#000",pos:M[l].position};L.drawCircle(t,h);const c={x:40,y:i+7,fill:"#666",text:l,textMargin:e.boxTextMargin|5};L.drawText(t,c),i+=20})}const j=I().journey,P=j.leftMargin,Ot=function(t,e,i,l){const n=I().journey,h=I().securityLevel;let c;h==="sandbox"&&(c=H("#i"+e));const f=h==="sandbox"?H(c.nodes()[0].contentDocument.body):H("body");v.init();const y=f.select("#"+e);L.initGraphics(y);const m=l.db.getTasks(),g=l.db.getDiagramTitle(),p=l.db.getActors();for(const o in M)delete M[o];let s=0;p.forEach(o=>{M[o]={color:n.actorColours[s%n.actorColours.length],position:s},s++}),Yt(y),v.insert(0,0,P,Object.keys(M).length*50),qt(y,m,0);const r=v.getBounds();g&&y.append("text").text(g).attr("x",P).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const a=r.stopy-r.starty+2*n.diagramMarginY,u=P+r.stopx+2*n.diagramMarginX;xt(y,a,u,n.useMaxWidth),y.append("line").attr("x1",P).attr("y1",n.height*4).attr("x2",u-P-4).attr("y2",n.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const d=g?70:0;y.attr("viewBox",`${r.startx} -25 ${u} ${a+d}`),y.attr("preserveAspectRatio","xMinYMin meet"),y.attr("height",a+d+25)},v={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,i,l){t[e]===void 0?t[e]=i:t[e]=l(i,t[e])},updateBounds:function(t,e,i,l){const n=I().journey,h=this;let c=0;function f(y){return function(g){c++;const p=h.sequenceItems.length-c+1;h.updateVal(g,"starty",e-p*n.boxMargin,Math.min),h.updateVal(g,"stopy",l+p*n.boxMargin,Math.max),h.updateVal(v.data,"startx",t-p*n.boxMargin,Math.min),h.updateVal(v.data,"stopx",i+p*n.boxMargin,Math.max),h.updateVal(g,"startx",t-p*n.boxMargin,Math.min),h.updateVal(g,"stopx",i+p*n.boxMargin,Math.max),h.updateVal(v.data,"starty",e-p*n.boxMargin,Math.min),h.updateVal(v.data,"stopy",l+p*n.boxMargin,Math.max)}}this.sequenceItems.forEach(f())},insert:function(t,e,i,l){const n=Math.min(t,i),h=Math.max(t,i),c=Math.min(e,l),f=Math.max(e,l);this.updateVal(v.data,"startx",n,Math.min),this.updateVal(v.data,"starty",c,Math.min),this.updateVal(v.data,"stopx",h,Math.max),this.updateVal(v.data,"stopy",f,Math.max),this.updateBounds(n,c,h,f)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}},W=j.sectionFills,st=j.sectionColours,qt=function(t,e,i){const l=I().journey;let n="";const h=l.height*2+l.diagramMarginY,c=i+h;let f=0,y="#CCC",m="black",g=0;for(const[p,s]of e.entries()){if(n!==s.section){y=W[f%W.length],g=f%W.length,m=st[f%st.length];let a=0;const u=s.section;for(let o=p;o<e.length&&e[o].section==u;o++)a=a+1;const d={x:p*l.taskMargin+p*l.width+P,y:50,text:s.section,fill:y,num:g,colour:m,taskCount:a};L.drawSection(t,d,l),n=s.section,f++}const r=s.people.reduce((a,u)=>(M[u]&&(a[u]=M[u]),a),{});s.x=p*l.taskMargin+p*l.width+P,s.y=c,s.width=l.diagramMarginX,s.height=l.diagramMarginY,s.colour=m,s.fill=y,s.num=g,s.actors=r,L.drawTask(t,s,l),v.insert(s.x,s.y,s.x+s.width+l.taskMargin,450)}},nt={setConf:zt,draw:Ot},Jt={parser:wt,db:tt,renderer:nt,styles:Vt,init:t=>{nt.setConf(t.journey),tt.clear()}};export{Jt as diagram};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import{a as yt,s as ft,b as dt,c as pt,o as gt,p as mt,g as I,d as H,e as xt,r as kt}from"./mermaid.core-DfVvnpgz.js";import{a as _t,g as it,f as bt,d as vt}from"./svgDrawCommon-08f97a94-DSBqmUv2.js";import{a as Q}from"./arc-BZXVqUcI.js";import"./index-DWUAFoZG.js";import"./path-CY0bYimO.js";var X=(function(){var t=function(p,s,r,a){for(r=r||{},a=p.length;a--;r[p[a]]=s);return r},e=[6,8,10,11,12,14,16,17,18],i=[1,9],l=[1,10],n=[1,11],h=[1,12],c=[1,13],f=[1,14],y={trace:function(){},yy:{},symbols_:{error:2,start:3,journey: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,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",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",18:"taskName",19:"taskData"},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,2]],performAction:function(s,r,a,u,d,o,w){var k=o.length-1;switch(d){case 1:return o[k-1];case 2:this.$=[];break;case 3:o[k-1].push(o[k]),this.$=o[k-1];break;case 4:case 5:this.$=o[k];break;case 6:case 7:this.$=[];break;case 8:u.setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),u.setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),u.setAccDescription(this.$);break;case 12:u.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 13:u.addTask(o[k-1],o[k]),this.$="task";break}},table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:i,12:l,14:n,16:h,17:c,18:f},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:i,12:l,14:n,16:h,17:c,18:f},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:function(s,r){if(r.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=r,a}},parse:function(s){var r=this,a=[0],u=[],d=[null],o=[],w=this.table,k="",R=0,Z=0,lt=2,J=1,ct=o.slice.call(arguments,1),x=Object.create(this.lexer),S={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(S.yy[z]=this.yy[z]);x.setInput(s,S.yy),S.yy.lexer=x,S.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var Y=x.yylloc;o.push(Y);var ht=x.options&&x.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ut(){var T;return T=u.pop()||x.lex()||J,typeof T!="number"&&(T instanceof Array&&(u=T,T=u.pop()),T=r.symbols_[T]||T),T}for(var _,E,b,O,A={},N,$,K,B;;){if(E=a[a.length-1],this.defaultActions[E]?b=this.defaultActions[E]:((_===null||typeof _>"u")&&(_=ut()),b=w[E]&&w[E][_]),typeof b>"u"||!b.length||!b[0]){var q="";B=[];for(N in w[E])this.terminals_[N]&&N>lt&&B.push("'"+this.terminals_[N]+"'");x.showPosition?q="Parse error on line "+(R+1)+`:
|
|
2
|
+
`+x.showPosition()+`
|
|
3
|
+
Expecting `+B.join(", ")+", got '"+(this.terminals_[_]||_)+"'":q="Parse error on line "+(R+1)+": Unexpected "+(_==J?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(q,{text:x.match,token:this.terminals_[_]||_,line:x.yylineno,loc:Y,expected:B})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+_);switch(b[0]){case 1:a.push(_),d.push(x.yytext),o.push(x.yylloc),a.push(b[1]),_=null,Z=x.yyleng,k=x.yytext,R=x.yylineno,Y=x.yylloc;break;case 2:if($=this.productions_[b[1]][1],A.$=d[d.length-$],A._$={first_line:o[o.length-($||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-($||1)].first_column,last_column:o[o.length-1].last_column},ht&&(A._$.range=[o[o.length-($||1)].range[0],o[o.length-1].range[1]]),O=this.performAction.apply(A,[k,Z,R,S.yy,b[1],d,o].concat(ct)),typeof O<"u")return O;$&&(a=a.slice(0,-1*$*2),d=d.slice(0,-1*$),o=o.slice(0,-1*$)),a.push(this.productions_[b[1]][0]),d.push(A.$),o.push(A._$),K=w[a[a.length-2]][a[a.length-1]],a.push(K);break;case 3:return!0}}return!0}},m=(function(){var p={EOF:1,parseError:function(r,a){if(this.yy.parser)this.yy.parser.parseError(r,a);else throw new Error(r)},setInput:function(s,r){return this.yy=r||this.yy||{},this._input=s,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},input:function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var r=s.match(/(?:\r\n?|\n).*/g);return r?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},unput:function(s){var r=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var u=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),a.length-1&&(this.yylineno-=a.length-1);var d=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:a?(a.length===u.length?this.yylloc.first_column:0)+u[u.length-a.length].length-a[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-r]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(s){this.unput(this.match.slice(s))},pastInput:function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var s=this.pastInput(),r=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
+
`+r+"^"},test_match:function(s,r){var a,u,d;if(this.options.backtrack_lexer&&(d={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&&(d.yylloc.range=this.yylloc.range.slice(0))),u=s[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],a=this.performAction.call(this,this.yy,this,r,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var o in d)this[o]=d[o];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,r,a,u;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),o=0;o<d.length;o++)if(a=this._input.match(this.rules[d[o]]),a&&(!r||a[0].length>r[0].length)){if(r=a,u=o,this.options.backtrack_lexer){if(s=this.test_match(a,d[o]),s!==!1)return s;if(this._backtrack){r=!1;continue}else return!1}else if(!this.options.flex)break}return r?(s=this.test_match(r,d[u]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return r||this.lex()},begin:function(r){this.conditionStack.push(r)},popState:function(){var r=this.conditionStack.length-1;return r>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(r){return r=this.conditionStack.length-1-Math.abs(r||0),r>=0?this.conditionStack[r]:"INITIAL"},pushState:function(r){this.begin(r)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(r,a,u,d){switch(u){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;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 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\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,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/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,19],inclusive:!0}}};return p})();y.lexer=m;function g(){this.yy={}}return g.prototype=y,y.Parser=g,new g})();X.parser=X;const wt=X;let C="";const G=[],V=[],F=[],$t=function(){G.length=0,V.length=0,C="",F.length=0,kt()},Tt=function(t){C=t,G.push(t)},Mt=function(){return G},St=function(){let t=D();const e=100;let i=0;for(;!t&&i<e;)t=D(),i++;return V.push(...F),V},Et=function(){const t=[];return V.forEach(i=>{i.people&&t.push(...i.people)}),[...new Set(t)].sort()},Pt=function(t,e){const i=e.substr(1).split(":");let l=0,n=[];i.length===1?(l=Number(i[0]),n=[]):(l=Number(i[0]),n=i[1].split(","));const h=n.map(f=>f.trim()),c={section:C,type:C,people:h,task:t,score:l};F.push(c)},It=function(t){const e={section:C,type:C,description:t,task:t,classes:[]};V.push(e)},D=function(){const t=function(i){return F[i].processed};let e=!0;for(const[i,l]of F.entries())t(i),e=e&&l.processed;return e},At=function(){return Et()},tt={getConfig:()=>I().journey,clear:$t,setDiagramTitle:mt,getDiagramTitle:gt,setAccTitle:pt,getAccTitle:dt,setAccDescription:ft,getAccDescription:yt,addSection:Tt,getSections:Mt,getTasks:St,addTask:Pt,addTaskOrg:It,getActors:At},Ct=t=>`.label {
|
|
7
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
8
|
+
font-family: var(--mermaid-font-family);
|
|
9
|
+
color: ${t.textColor};
|
|
10
|
+
}
|
|
11
|
+
.mouth {
|
|
12
|
+
stroke: #666;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
line {
|
|
16
|
+
stroke: ${t.textColor}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.legend {
|
|
20
|
+
fill: ${t.textColor};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.label text {
|
|
24
|
+
fill: #333;
|
|
25
|
+
}
|
|
26
|
+
.label {
|
|
27
|
+
color: ${t.textColor}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.face {
|
|
31
|
+
${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};
|
|
32
|
+
stroke: #999;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.node rect,
|
|
36
|
+
.node circle,
|
|
37
|
+
.node ellipse,
|
|
38
|
+
.node polygon,
|
|
39
|
+
.node path {
|
|
40
|
+
fill: ${t.mainBkg};
|
|
41
|
+
stroke: ${t.nodeBorder};
|
|
42
|
+
stroke-width: 1px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.node .label {
|
|
46
|
+
text-align: center;
|
|
47
|
+
}
|
|
48
|
+
.node.clickable {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.arrowheadPath {
|
|
53
|
+
fill: ${t.arrowheadColor};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.edgePath .path {
|
|
57
|
+
stroke: ${t.lineColor};
|
|
58
|
+
stroke-width: 1.5px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.flowchart-link {
|
|
62
|
+
stroke: ${t.lineColor};
|
|
63
|
+
fill: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.edgeLabel {
|
|
67
|
+
background-color: ${t.edgeLabelBackground};
|
|
68
|
+
rect {
|
|
69
|
+
opacity: 0.5;
|
|
70
|
+
}
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cluster rect {
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.cluster text {
|
|
78
|
+
fill: ${t.titleColor};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
div.mermaidTooltip {
|
|
82
|
+
position: absolute;
|
|
83
|
+
text-align: center;
|
|
84
|
+
max-width: 200px;
|
|
85
|
+
padding: 2px;
|
|
86
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
87
|
+
font-family: var(--mermaid-font-family);
|
|
88
|
+
font-size: 12px;
|
|
89
|
+
background: ${t.tertiaryColor};
|
|
90
|
+
border: 1px solid ${t.border2};
|
|
91
|
+
border-radius: 2px;
|
|
92
|
+
pointer-events: none;
|
|
93
|
+
z-index: 100;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.task-type-0, .section-type-0 {
|
|
97
|
+
${t.fillType0?`fill: ${t.fillType0}`:""};
|
|
98
|
+
}
|
|
99
|
+
.task-type-1, .section-type-1 {
|
|
100
|
+
${t.fillType0?`fill: ${t.fillType1}`:""};
|
|
101
|
+
}
|
|
102
|
+
.task-type-2, .section-type-2 {
|
|
103
|
+
${t.fillType0?`fill: ${t.fillType2}`:""};
|
|
104
|
+
}
|
|
105
|
+
.task-type-3, .section-type-3 {
|
|
106
|
+
${t.fillType0?`fill: ${t.fillType3}`:""};
|
|
107
|
+
}
|
|
108
|
+
.task-type-4, .section-type-4 {
|
|
109
|
+
${t.fillType0?`fill: ${t.fillType4}`:""};
|
|
110
|
+
}
|
|
111
|
+
.task-type-5, .section-type-5 {
|
|
112
|
+
${t.fillType0?`fill: ${t.fillType5}`:""};
|
|
113
|
+
}
|
|
114
|
+
.task-type-6, .section-type-6 {
|
|
115
|
+
${t.fillType0?`fill: ${t.fillType6}`:""};
|
|
116
|
+
}
|
|
117
|
+
.task-type-7, .section-type-7 {
|
|
118
|
+
${t.fillType0?`fill: ${t.fillType7}`:""};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.actor-0 {
|
|
122
|
+
${t.actor0?`fill: ${t.actor0}`:""};
|
|
123
|
+
}
|
|
124
|
+
.actor-1 {
|
|
125
|
+
${t.actor1?`fill: ${t.actor1}`:""};
|
|
126
|
+
}
|
|
127
|
+
.actor-2 {
|
|
128
|
+
${t.actor2?`fill: ${t.actor2}`:""};
|
|
129
|
+
}
|
|
130
|
+
.actor-3 {
|
|
131
|
+
${t.actor3?`fill: ${t.actor3}`:""};
|
|
132
|
+
}
|
|
133
|
+
.actor-4 {
|
|
134
|
+
${t.actor4?`fill: ${t.actor4}`:""};
|
|
135
|
+
}
|
|
136
|
+
.actor-5 {
|
|
137
|
+
${t.actor5?`fill: ${t.actor5}`:""};
|
|
138
|
+
}
|
|
139
|
+
`,Vt=Ct,U=function(t,e){return vt(t,e)},Ft=function(t,e){const l=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),n=t.append("g");n.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),n.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function h(y){const m=Q().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);y.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function c(y){const m=Q().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);y.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function f(y){y.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return e.score>3?h(n):e.score<3?c(n):f(n),l},rt=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),i.class!==void 0&&i.attr("class",i.class),e.title!==void 0&&i.append("title").text(e.title),i},at=function(t,e){return bt(t,e)},Lt=function(t,e){function i(n,h,c,f,y){return n+","+h+" "+(n+c)+","+h+" "+(n+c)+","+(h+f-y)+" "+(n+c-y*1.2)+","+(h+f)+" "+n+","+(h+f)}const l=t.append("polygon");l.attr("points",i(e.x,e.y,50,20,7)),l.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,at(t,e)},Rt=function(t,e,i){const l=t.append("g"),n=it();n.x=e.x,n.y=e.y,n.fill=e.fill,n.width=i.width*e.taskCount+i.diagramMarginX*(e.taskCount-1),n.height=i.height,n.class="journey-section section-type-"+e.num,n.rx=3,n.ry=3,U(l,n),ot(i)(e.text,l,n.x,n.y,n.width,n.height,{class:"journey-section section-type-"+e.num},i,e.colour)};let et=-1;const Nt=function(t,e,i){const l=e.x+i.width/2,n=t.append("g");et++,n.append("line").attr("id","task"+et).attr("x1",l).attr("y1",e.y).attr("x2",l).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Ft(n,{cx:l,cy:300+(5-e.score)*30,score:e.score});const c=it();c.x=e.x,c.y=e.y,c.fill=e.fill,c.width=i.width,c.height=i.height,c.class="task task-type-"+e.num,c.rx=3,c.ry=3,U(n,c);let f=e.x+14;e.people.forEach(y=>{const m=e.actors[y].color,g={cx:f,cy:e.y,r:7,fill:m,stroke:"#000",title:y,pos:e.actors[y].position};rt(n,g),f+=10}),ot(i)(e.task,n,c.x,c.y,c.width,c.height,{class:"task"},i,e.colour)},Bt=function(t,e){_t(t,e)},ot=(function(){function t(n,h,c,f,y,m,g,p){const s=h.append("text").attr("x",c+y/2).attr("y",f+m/2+5).style("font-color",p).style("text-anchor","middle").text(n);l(s,g)}function e(n,h,c,f,y,m,g,p,s){const{taskFontSize:r,taskFontFamily:a}=p,u=n.split(/<br\s*\/?>/gi);for(let d=0;d<u.length;d++){const o=d*r-r*(u.length-1)/2,w=h.append("text").attr("x",c+y/2).attr("y",f).attr("fill",s).style("text-anchor","middle").style("font-size",r).style("font-family",a);w.append("tspan").attr("x",c+y/2).attr("dy",o).text(u[d]),w.attr("y",f+m/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),l(w,g)}}function i(n,h,c,f,y,m,g,p){const s=h.append("switch"),a=s.append("foreignObject").attr("x",c).attr("y",f).attr("width",y).attr("height",m).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");a.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(n),e(n,s,c,f,y,m,g,p),l(a,g)}function l(n,h){for(const c in h)c in h&&n.attr(c,h[c])}return function(n){return n.textPlacement==="fo"?i:n.textPlacement==="old"?t:e}})(),jt=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")},L={drawRect:U,drawCircle:rt,drawSection:Rt,drawText:at,drawLabel:Lt,drawTask:Nt,drawBackgroundRect:Bt,initGraphics:jt},zt=function(t){Object.keys(t).forEach(function(i){j[i]=t[i]})},M={};function Yt(t){const e=I().journey;let i=60;Object.keys(M).forEach(l=>{const n=M[l].color,h={cx:20,cy:i,r:7,fill:n,stroke:"#000",pos:M[l].position};L.drawCircle(t,h);const c={x:40,y:i+7,fill:"#666",text:l,textMargin:e.boxTextMargin|5};L.drawText(t,c),i+=20})}const j=I().journey,P=j.leftMargin,Ot=function(t,e,i,l){const n=I().journey,h=I().securityLevel;let c;h==="sandbox"&&(c=H("#i"+e));const f=h==="sandbox"?H(c.nodes()[0].contentDocument.body):H("body");v.init();const y=f.select("#"+e);L.initGraphics(y);const m=l.db.getTasks(),g=l.db.getDiagramTitle(),p=l.db.getActors();for(const o in M)delete M[o];let s=0;p.forEach(o=>{M[o]={color:n.actorColours[s%n.actorColours.length],position:s},s++}),Yt(y),v.insert(0,0,P,Object.keys(M).length*50),qt(y,m,0);const r=v.getBounds();g&&y.append("text").text(g).attr("x",P).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const a=r.stopy-r.starty+2*n.diagramMarginY,u=P+r.stopx+2*n.diagramMarginX;xt(y,a,u,n.useMaxWidth),y.append("line").attr("x1",P).attr("y1",n.height*4).attr("x2",u-P-4).attr("y2",n.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const d=g?70:0;y.attr("viewBox",`${r.startx} -25 ${u} ${a+d}`),y.attr("preserveAspectRatio","xMinYMin meet"),y.attr("height",a+d+25)},v={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,i,l){t[e]===void 0?t[e]=i:t[e]=l(i,t[e])},updateBounds:function(t,e,i,l){const n=I().journey,h=this;let c=0;function f(y){return function(g){c++;const p=h.sequenceItems.length-c+1;h.updateVal(g,"starty",e-p*n.boxMargin,Math.min),h.updateVal(g,"stopy",l+p*n.boxMargin,Math.max),h.updateVal(v.data,"startx",t-p*n.boxMargin,Math.min),h.updateVal(v.data,"stopx",i+p*n.boxMargin,Math.max),h.updateVal(g,"startx",t-p*n.boxMargin,Math.min),h.updateVal(g,"stopx",i+p*n.boxMargin,Math.max),h.updateVal(v.data,"starty",e-p*n.boxMargin,Math.min),h.updateVal(v.data,"stopy",l+p*n.boxMargin,Math.max)}}this.sequenceItems.forEach(f())},insert:function(t,e,i,l){const n=Math.min(t,i),h=Math.max(t,i),c=Math.min(e,l),f=Math.max(e,l);this.updateVal(v.data,"startx",n,Math.min),this.updateVal(v.data,"starty",c,Math.min),this.updateVal(v.data,"stopx",h,Math.max),this.updateVal(v.data,"stopy",f,Math.max),this.updateBounds(n,c,h,f)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}},W=j.sectionFills,st=j.sectionColours,qt=function(t,e,i){const l=I().journey;let n="";const h=l.height*2+l.diagramMarginY,c=i+h;let f=0,y="#CCC",m="black",g=0;for(const[p,s]of e.entries()){if(n!==s.section){y=W[f%W.length],g=f%W.length,m=st[f%st.length];let a=0;const u=s.section;for(let o=p;o<e.length&&e[o].section==u;o++)a=a+1;const d={x:p*l.taskMargin+p*l.width+P,y:50,text:s.section,fill:y,num:g,colour:m,taskCount:a};L.drawSection(t,d,l),n=s.section,f++}const r=s.people.reduce((a,u)=>(M[u]&&(a[u]=M[u]),a),{});s.x=p*l.taskMargin+p*l.width+P,s.y=c,s.width=l.diagramMarginX,s.height=l.diagramMarginY,s.colour=m,s.fill=y,s.num=g,s.actors=r,L.drawTask(t,s,l),v.insert(s.x,s.y,s.x+s.width+l.taskMargin,450)}},nt={setConf:zt,draw:Ot},Zt={parser:wt,db:tt,renderer:nt,styles:Vt,init:t=>{nt.setConf(t.journey),tt.clear()}};export{Zt as diagram};
|