khoj 2.0.0b12.dev5__py3-none-any.whl → 2.0.0b13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- khoj/app/README.md +1 -1
- khoj/app/urls.py +1 -0
- khoj/configure.py +21 -54
- khoj/database/adapters/__init__.py +6 -15
- khoj/database/management/commands/delete_orphaned_fileobjects.py +0 -1
- khoj/database/migrations/0064_remove_conversation_temp_id_alter_conversation_id.py +1 -1
- khoj/database/migrations/0075_migrate_generated_assets_and_validate.py +1 -1
- khoj/database/migrations/0092_alter_chatmodel_model_type_alter_chatmodel_name_and_more.py +36 -0
- khoj/database/migrations/0093_remove_localorgconfig_user_and_more.py +36 -0
- khoj/database/models/__init__.py +10 -40
- khoj/database/tests.py +0 -2
- khoj/interface/compiled/404/index.html +2 -2
- khoj/interface/compiled/_next/static/chunks/{9245.a04e92d034540234.js → 1225.ecac11e7421504c4.js} +3 -3
- khoj/interface/compiled/_next/static/chunks/1320.ae930ad00affe685.js +5 -0
- khoj/interface/compiled/_next/static/chunks/{1327-1a9107b9a2a04a98.js → 1327-e254819a9172cfa7.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/1626.15a8acc0d6639ec6.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{3489.c523fe96a2eee74f.js → 1940.d082758bd04e08ae.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/{2327-ea623ca2d22f78e9.js → 2327-438aaec1657c5ada.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/2475.57a0d0fd93d07af0.js +93 -0
- khoj/interface/compiled/_next/static/chunks/2481.5ce6524ba0a73f90.js +55 -0
- khoj/interface/compiled/_next/static/chunks/297.4c4c823ff6e3255b.js +174 -0
- khoj/interface/compiled/_next/static/chunks/{5639-09e2009a2adedf8b.js → 3260-82d2521fab032ff1.js} +68 -23
- khoj/interface/compiled/_next/static/chunks/3353.1c6d553216a1acae.js +1 -0
- khoj/interface/compiled/_next/static/chunks/3855.f7b8131f78af046e.js +1 -0
- khoj/interface/compiled/_next/static/chunks/3973.dc54a39586ab48be.js +1 -0
- khoj/interface/compiled/_next/static/chunks/4241.c1cd170f7f37ac59.js +24 -0
- khoj/interface/compiled/_next/static/chunks/{4327.8d2a1b8f1ea78208.js → 4327.f3704dc398c67113.js} +19 -19
- khoj/interface/compiled/_next/static/chunks/4505.f09454a346269c3f.js +117 -0
- khoj/interface/compiled/_next/static/chunks/4801.96a152d49742b644.js +1 -0
- khoj/interface/compiled/_next/static/chunks/5427-a95ec748e52abb75.js +1 -0
- khoj/interface/compiled/_next/static/chunks/549.2bd27f59a91a9668.js +148 -0
- khoj/interface/compiled/_next/static/chunks/5765.71b1e1207b76b03f.js +1 -0
- khoj/interface/compiled/_next/static/chunks/584.d7ce3505f169b706.js +1 -0
- khoj/interface/compiled/_next/static/chunks/6240.34f7c1fa692edd61.js +24 -0
- khoj/interface/compiled/_next/static/chunks/6d3fe5a5-f9f3c16e0bc0cdf9.js +10 -0
- khoj/interface/compiled/_next/static/chunks/{7127-0f4a2a77d97fb5fa.js → 7127-97b83757db125ba6.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/7200-93ab0072359b8028.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{2612.bcf5a623b3da209e.js → 7553.f5ad54b1f6e92c49.js} +2 -2
- khoj/interface/compiled/_next/static/chunks/7626-1b630f1654172341.js +1 -0
- khoj/interface/compiled/_next/static/chunks/764.dadd316e8e16d191.js +63 -0
- khoj/interface/compiled/_next/static/chunks/78.08169ab541abab4f.js +43 -0
- khoj/interface/compiled/_next/static/chunks/784.e03acf460df213d1.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{9537-d9ab442ce15d1e20.js → 8072-e1440cb482a0940e.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/{3265.924139c4146ee344.js → 8086.8d39887215807fcd.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/8168.f074ab8c7c16d82d.js +59 -0
- khoj/interface/compiled/_next/static/chunks/{8694.2bd9c2f65d8c5847.js → 8223.1705878fa7a09292.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/8483.94f6c9e2bee86f50.js +215 -0
- khoj/interface/compiled/_next/static/chunks/{8888.ebe0e552b59e7fed.js → 8810.fc0e479de78c7c61.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/8828.bc74dc4ce94e78f6.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{7303.d0612f812a967a08.js → 8909.14ac3f43d0070cf1.js} +5 -5
- khoj/interface/compiled/_next/static/chunks/90542734.b1a1629065ba199b.js +1 -0
- khoj/interface/compiled/_next/static/chunks/9167.098534184f03fe92.js +56 -0
- khoj/interface/compiled/_next/static/chunks/{4980.63500d68b3bb1222.js → 9537.e934ce37bf314509.js} +5 -5
- khoj/interface/compiled/_next/static/chunks/9574.3fe8e26e95bf1c34.js +1 -0
- khoj/interface/compiled/_next/static/chunks/9599.ec50b5296c27dae9.js +1 -0
- khoj/interface/compiled/_next/static/chunks/9643.b34248df52ffc77c.js +262 -0
- khoj/interface/compiled/_next/static/chunks/9747.2fd9065b1435abb1.js +1 -0
- khoj/interface/compiled/_next/static/chunks/9922.98f2b2a9959b4ebe.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/layout-e49165209d2e406c.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/page-e291b49977f43880.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/automations/page-198b26df6e09bbb0.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/chat/{page-8e1c4f2af3c9429e.js → page-dfcc1e8e2ad62873.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/{page-2b3056cba8aa96ce.js → page-1567cac7b79a7c59.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/{page-8be3b35178abf2ec.js → page-6081362437c82470.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-6fb51c5c80f8ec67.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-4a4b0c0f4749c2b2.js → page-e0dcb1762f8c8f88.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/webpack-5393aad3d824e0cb.js +1 -0
- khoj/interface/compiled/agents/index.html +2 -2
- khoj/interface/compiled/agents/index.txt +3 -3
- khoj/interface/compiled/automations/index.html +2 -2
- khoj/interface/compiled/automations/index.txt +3 -3
- khoj/interface/compiled/chat/index.html +2 -2
- khoj/interface/compiled/chat/index.txt +3 -3
- khoj/interface/compiled/index.html +2 -2
- khoj/interface/compiled/index.txt +3 -3
- khoj/interface/compiled/search/index.html +2 -2
- khoj/interface/compiled/search/index.txt +3 -3
- khoj/interface/compiled/settings/index.html +2 -2
- khoj/interface/compiled/settings/index.txt +3 -3
- khoj/interface/compiled/share/chat/index.html +2 -2
- khoj/interface/compiled/share/chat/index.txt +3 -3
- khoj/main.py +7 -9
- khoj/manage.py +1 -0
- khoj/processor/content/github/github_to_entries.py +6 -7
- khoj/processor/content/images/image_to_entries.py +0 -1
- khoj/processor/content/markdown/markdown_to_entries.py +2 -3
- khoj/processor/content/notion/notion_to_entries.py +5 -6
- khoj/processor/content/org_mode/org_to_entries.py +4 -5
- khoj/processor/content/org_mode/orgnode.py +4 -4
- khoj/processor/content/plaintext/plaintext_to_entries.py +1 -2
- khoj/processor/content/text_to_entries.py +1 -3
- khoj/processor/conversation/google/utils.py +3 -3
- khoj/processor/conversation/openai/gpt.py +65 -28
- khoj/processor/conversation/openai/utils.py +359 -28
- khoj/processor/conversation/prompts.py +16 -41
- khoj/processor/conversation/utils.py +29 -39
- khoj/processor/embeddings.py +0 -2
- khoj/processor/image/generate.py +3 -3
- khoj/processor/operator/__init__.py +2 -3
- khoj/processor/operator/grounding_agent.py +15 -2
- khoj/processor/operator/grounding_agent_uitars.py +34 -23
- khoj/processor/operator/operator_agent_anthropic.py +29 -4
- khoj/processor/operator/operator_agent_base.py +1 -1
- khoj/processor/operator/operator_agent_binary.py +4 -4
- khoj/processor/operator/operator_agent_openai.py +21 -6
- khoj/processor/operator/operator_environment_browser.py +1 -1
- khoj/processor/operator/operator_environment_computer.py +1 -1
- khoj/processor/speech/text_to_speech.py +0 -1
- khoj/processor/tools/online_search.py +1 -1
- khoj/processor/tools/run_code.py +1 -1
- khoj/routers/api.py +2 -15
- khoj/routers/api_agents.py +1 -2
- khoj/routers/api_automation.py +1 -1
- khoj/routers/api_chat.py +10 -16
- khoj/routers/api_content.py +3 -111
- khoj/routers/api_model.py +0 -1
- khoj/routers/api_subscription.py +1 -1
- khoj/routers/email.py +4 -4
- khoj/routers/helpers.py +44 -103
- khoj/routers/research.py +8 -8
- khoj/search_filter/base_filter.py +2 -4
- khoj/search_type/text_search.py +1 -2
- khoj/utils/cli.py +5 -53
- khoj/utils/config.py +0 -65
- khoj/utils/constants.py +6 -7
- khoj/utils/helpers.py +10 -18
- khoj/utils/initialization.py +7 -48
- khoj/utils/models.py +2 -4
- khoj/utils/rawconfig.py +1 -69
- khoj/utils/state.py +2 -8
- khoj/utils/yaml.py +0 -39
- {khoj-2.0.0b12.dev5.dist-info → khoj-2.0.0b13.dist-info}/METADATA +3 -3
- {khoj-2.0.0b12.dev5.dist-info → khoj-2.0.0b13.dist-info}/RECORD +139 -148
- khoj/interface/compiled/_next/static/chunks/1191.b547ec13349b4aed.js +0 -1
- khoj/interface/compiled/_next/static/chunks/1588.f0558a0bdffc4761.js +0 -117
- khoj/interface/compiled/_next/static/chunks/1918.925cb4a35518d258.js +0 -43
- khoj/interface/compiled/_next/static/chunks/2849.dc00ae5ba7219cfc.js +0 -1
- khoj/interface/compiled/_next/static/chunks/303.fe76de943e930fbd.js +0 -1
- khoj/interface/compiled/_next/static/chunks/4533.586e74b45a2bde25.js +0 -55
- khoj/interface/compiled/_next/static/chunks/4551.82ce1476b5516bc2.js +0 -5
- khoj/interface/compiled/_next/static/chunks/4748.0edd37cba3ea2809.js +0 -59
- khoj/interface/compiled/_next/static/chunks/5210.cd35a1c1ec594a20.js +0 -93
- khoj/interface/compiled/_next/static/chunks/5329.f8b3c5b3d16159cd.js +0 -1
- khoj/interface/compiled/_next/static/chunks/5427-13d6ffd380fdfab7.js +0 -1
- khoj/interface/compiled/_next/static/chunks/558-c14e76cff03f6a60.js +0 -1
- khoj/interface/compiled/_next/static/chunks/5830.8876eccb82da9b7d.js +0 -262
- khoj/interface/compiled/_next/static/chunks/6230.88a71d8145347b3f.js +0 -1
- khoj/interface/compiled/_next/static/chunks/7161.77e0530a40ad5ca8.js +0 -1
- khoj/interface/compiled/_next/static/chunks/7200-ac3b2e37ff30e126.js +0 -1
- khoj/interface/compiled/_next/static/chunks/7505.c31027a3695bdebb.js +0 -148
- khoj/interface/compiled/_next/static/chunks/7760.35649cc21d9585bd.js +0 -56
- khoj/interface/compiled/_next/static/chunks/83.48e2db193a940052.js +0 -1
- khoj/interface/compiled/_next/static/chunks/8427.844694e06133fb51.js +0 -1
- khoj/interface/compiled/_next/static/chunks/8665.4db7e6b2e8933497.js +0 -174
- khoj/interface/compiled/_next/static/chunks/872.caf84cc1a39ae59f.js +0 -1
- khoj/interface/compiled/_next/static/chunks/8890.6e8a59e4de6978bc.js +0 -215
- khoj/interface/compiled/_next/static/chunks/8950.5f2272e0ac923f9e.js +0 -1
- khoj/interface/compiled/_next/static/chunks/90542734.2c21f16f18b22411.js +0 -1
- khoj/interface/compiled/_next/static/chunks/9202.c703864fcedc8d1f.js +0 -63
- khoj/interface/compiled/_next/static/chunks/9320.6aca4885d541aa44.js +0 -24
- khoj/interface/compiled/_next/static/chunks/9535.f78cd92d03331e55.js +0 -1
- khoj/interface/compiled/_next/static/chunks/9968.b111fc002796da81.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/agents/layout-e00fb81dca656a10.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/agents/page-9a4610474cd59a71.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/automations/page-f7bb9d777b7745d4.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-e8e5db7830bf3f47.js +0 -1
- khoj/interface/compiled/_next/static/chunks/f3e3247b-1758d4651e4457c2.js +0 -10
- khoj/interface/compiled/_next/static/chunks/webpack-338a5000c912cc94.js +0 -1
- khoj/migrations/__init__.py +0 -0
- khoj/migrations/migrate_offline_chat_default_model.py +0 -69
- khoj/migrations/migrate_offline_chat_default_model_2.py +0 -71
- khoj/migrations/migrate_offline_chat_schema.py +0 -83
- khoj/migrations/migrate_offline_model.py +0 -29
- khoj/migrations/migrate_processor_config_openai.py +0 -67
- khoj/migrations/migrate_server_pg.py +0 -132
- khoj/migrations/migrate_version.py +0 -17
- khoj/processor/conversation/offline/__init__.py +0 -0
- khoj/processor/conversation/offline/chat_model.py +0 -224
- khoj/processor/conversation/offline/utils.py +0 -80
- khoj/processor/conversation/offline/whisper.py +0 -15
- khoj/utils/fs_syncer.py +0 -252
- /khoj/interface/compiled/_next/static/{7GoMcE8WpP9fbfYZXv4Nv → RYbQvo3AvgOR0bEVVfxF4}/_buildManifest.js +0 -0
- /khoj/interface/compiled/_next/static/{7GoMcE8WpP9fbfYZXv4Nv → RYbQvo3AvgOR0bEVVfxF4}/_ssgManifest.js +0 -0
- /khoj/interface/compiled/_next/static/chunks/app/search/{page-4885df3cd175c957.js → page-3639e50ec3e9acfd.js} +0 -0
- {khoj-2.0.0b12.dev5.dist-info → khoj-2.0.0b13.dist-info}/WHEEL +0 -0
- {khoj-2.0.0b12.dev5.dist-info → khoj-2.0.0b13.dist-info}/entry_points.txt +0 -0
- {khoj-2.0.0b12.dev5.dist-info → khoj-2.0.0b13.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,148 @@
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[549],{68048:function(t,e,i){i.d(e,{AD:function(){return u},AE:function(){return o},Mu:function(){return a},O:function(){return s},kc:function(){return h},rB:function(){return c},yU:function(){return l}});var n=i(20755),r=i(59543),a=(0,n.eW)((t,e)=>{let i=t.append("rect");if(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),e.name&&i.attr("name",e.name),e.rx&&i.attr("rx",e.rx),e.ry&&i.attr("ry",e.ry),void 0!==e.attrs)for(let t in e.attrs)i.attr(t,e.attrs[t]);return e.class&&i.attr("class",e.class),i},"drawRect"),s=(0,n.eW)((t,e)=>{a(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"}).lower()},"drawBackgroundRect"),l=(0,n.eW)((t,e)=>{let i=e.text.replace(n.Vw," "),r=t.append("text");r.attr("x",e.x),r.attr("y",e.y),r.attr("class","legend"),r.style("text-anchor",e.anchor),e.class&&r.attr("class",e.class);let a=r.append("tspan");return a.attr("x",e.x+2*e.textMargin),a.text(i),r},"drawText"),o=(0,n.eW)((t,e,i,n)=>{let a=t.append("image");a.attr("x",e),a.attr("y",i);let s=(0,r.N)(n);a.attr("xlink:href",s)},"drawImage"),c=(0,n.eW)((t,e,i,n)=>{let a=t.append("use");a.attr("x",e),a.attr("y",i);let s=(0,r.N)(n);a.attr("xlink:href",`#${s}`)},"drawEmbeddedImage"),h=(0,n.eW)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),u=(0,n.eW)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj")},76084:function(t,e,i){i.d(e,{G:function(){return n}});var n=(0,i(20755).eW)(()=>`
|
2
|
+
/* Font Awesome icon styling - consolidated */
|
3
|
+
.label-icon {
|
4
|
+
display: inline-block;
|
5
|
+
height: 1em;
|
6
|
+
overflow: visible;
|
7
|
+
vertical-align: -0.125em;
|
8
|
+
}
|
9
|
+
|
10
|
+
.node .label-icon path {
|
11
|
+
fill: currentColor;
|
12
|
+
stroke: revert;
|
13
|
+
stroke-width: revert;
|
14
|
+
}
|
15
|
+
`,"getIconStyles")},90549:function(t,e,i){i.d(e,{diagram:function(){return z}});var n=i(68048),r=i(76084),a=i(20755),s=i(84370),l=function(){var t=(0,a.eW)(function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},"o"),e=[6,8,10,11,12,14,16,17,18],i=[1,9],n=[1,10],r=[1,11],s=[1,12],l=[1,13],o=[1,14],c={trace:(0,a.eW)(function(){},"trace"),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:(0,a.eW)(function(t,e,i,n,r,a,s){var l=a.length-1;switch(r){case 1:return a[l-1];case 2:case 6:case 7:this.$=[];break;case 3:a[l-1].push(a[l]),this.$=a[l-1];break;case 4:case 5:this.$=a[l];break;case 8:n.setDiagramTitle(a[l].substr(6)),this.$=a[l].substr(6);break;case 9:this.$=a[l].trim(),n.setAccTitle(this.$);break;case 10:case 11:this.$=a[l].trim(),n.setAccDescription(this.$);break;case 12:n.addSection(a[l].substr(8)),this.$=a[l].substr(8);break;case 13:n.addTask(a[l-1],a[l]),this.$="task"}},"anonymous"),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:n,14:r,16:s,17:l,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:i,12:n,14:r,16:s,17:l,18:o},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:(0,a.eW)(function(t,e){if(e.recoverable)this.trace(t);else{var i=Error(t);throw i.hash=e,i}},"parseError"),parse:(0,a.eW)(function(t){var e=this,i=[0],n=[],r=[null],s=[],l=this.table,o="",c=0,h=0,u=0,y=s.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(d.yy[f]=this.yy[f]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var g=p.yylloc;s.push(g);var x=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=n.pop()||p.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,a.eW)(function(t){i.length=i.length-2*t,r.length=r.length-t,s.length=s.length-t},"popStack"),(0,a.eW)(m,"lex");for(var k,_,b,v,w,W,$,M,T,E={};;){if(b=i[i.length-1],this.defaultActions[b]?v=this.defaultActions[b]:(null==k&&(k=m()),v=l[b]&&l[b][k]),void 0===v||!v.length||!v[0]){var S="";for(W in T=[],l[b])this.terminals_[W]&&W>2&&T.push("'"+this.terminals_[W]+"'");S=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==k?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(S,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:g,expected:T})}if(v[0]instanceof Array&&v.length>1)throw Error("Parse Error: multiple actions possible at state: "+b+", token: "+k);switch(v[0]){case 1:i.push(k),r.push(p.yytext),s.push(p.yylloc),i.push(v[1]),k=null,_?(k=_,_=null):(h=p.yyleng,o=p.yytext,c=p.yylineno,g=p.yylloc,u>0&&u--);break;case 2:if($=this.productions_[v[1]][1],E.$=r[r.length-$],E._$={first_line:s[s.length-($||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-($||1)].first_column,last_column:s[s.length-1].last_column},x&&(E._$.range=[s[s.length-($||1)].range[0],s[s.length-1].range[1]]),void 0!==(w=this.performAction.apply(E,[o,h,c,d.yy,v[1],r,s].concat(y))))return w;$&&(i=i.slice(0,-1*$*2),r=r.slice(0,-1*$),s=s.slice(0,-1*$)),i.push(this.productions_[v[1]][0]),r.push(E.$),s.push(E._$),M=l[i[i.length-2]][i[i.length-1]],i.push(M);break;case 3:return!0}}return!0},"parse")},h={EOF:1,parseError:(0,a.eW)(function(t,e){if(this.yy.parser)this.yy.parser.parseError(t,e);else throw Error(t)},"parseError"),setInput:(0,a.eW)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,a.eW)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,a.eW)(function(t){var e=t.length,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 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: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=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,a.eW)(function(){return this._more=!0,this},"more"),reject:(0,a.eW)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,a.eW)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,a.eW)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,a.eW)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,a.eW)(function(){var t=this.pastInput(),e=Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,a.eW)(function(t,e){var i,n,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))),(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 a in r)this[a]=r[a];return!1},"test_match"),next:(0,a.eW)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,i,n,r=this._currentRules(),a=0;a<r.length;a++)if((i=this._input.match(this.rules[r[a]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[a])))return t;if(!this._backtrack)return!1;e=!1;continue}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[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:(0,a.eW)(function(){return this.next()||this.lex()},"lex"),begin:(0,a.eW)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,a.eW)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,a.eW)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,a.eW)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,a.eW)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,a.eW)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,a.eW)(function(t,e,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 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),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}}};function u(){this.yy={}}return c.lexer=h,(0,a.eW)(u,"Parser"),u.prototype=c,c.Parser=u,new u}();l.parser=l;var o="",c=[],h=[],u=[],y=(0,a.eW)(function(){c.length=0,h.length=0,o="",u.length=0,(0,a.ZH)()},"clear"),p=(0,a.eW)(function(t){o=t,c.push(t)},"addSection"),d=(0,a.eW)(function(){return c},"getSections"),f=(0,a.eW)(function(){let t=k(),e=0;for(;!t&&e<100;)t=k(),e++;return h.push(...u),h},"getTasks"),g=(0,a.eW)(function(){let t=[];return h.forEach(e=>{e.people&&t.push(...e.people)}),[...new Set(t)].sort()},"updateActors"),x=(0,a.eW)(function(t,e){let i=e.substr(1).split(":"),n=0,r=[];1===i.length?(n=Number(i[0]),r=[]):(n=Number(i[0]),r=i[1].split(","));let a=r.map(t=>t.trim()),s={section:o,type:o,people:a,task:t,score:n};u.push(s)},"addTask"),m=(0,a.eW)(function(t){let e={section:o,type:o,description:t,task:t,classes:[]};h.push(e)},"addTaskOrg"),k=(0,a.eW)(function(){let t=(0,a.eW)(function(t){return u[t].processed},"compileTask"),e=!0;for(let[i,n]of u.entries())t(i),e=e&&n.processed;return e},"compileTasks"),_=(0,a.eW)(function(){return g()},"getActors"),b={getConfig:(0,a.eW)(()=>(0,a.nV)().journey,"getConfig"),clear:y,setDiagramTitle:a.g2,getDiagramTitle:a.Kr,setAccTitle:a.GN,getAccTitle:a.eu,setAccDescription:a.U$,getAccDescription:a.Mx,addSection:p,getSections:d,getTasks:f,addTask:x,addTaskOrg:m,getActors:_},v=(0,a.eW)(t=>`.label {
|
16
|
+
font-family: ${t.fontFamily};
|
17
|
+
color: ${t.textColor};
|
18
|
+
}
|
19
|
+
.mouth {
|
20
|
+
stroke: #666;
|
21
|
+
}
|
22
|
+
|
23
|
+
line {
|
24
|
+
stroke: ${t.textColor}
|
25
|
+
}
|
26
|
+
|
27
|
+
.legend {
|
28
|
+
fill: ${t.textColor};
|
29
|
+
font-family: ${t.fontFamily};
|
30
|
+
}
|
31
|
+
|
32
|
+
.label text {
|
33
|
+
fill: #333;
|
34
|
+
}
|
35
|
+
.label {
|
36
|
+
color: ${t.textColor}
|
37
|
+
}
|
38
|
+
|
39
|
+
.face {
|
40
|
+
${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};
|
41
|
+
stroke: #999;
|
42
|
+
}
|
43
|
+
|
44
|
+
.node rect,
|
45
|
+
.node circle,
|
46
|
+
.node ellipse,
|
47
|
+
.node polygon,
|
48
|
+
.node path {
|
49
|
+
fill: ${t.mainBkg};
|
50
|
+
stroke: ${t.nodeBorder};
|
51
|
+
stroke-width: 1px;
|
52
|
+
}
|
53
|
+
|
54
|
+
.node .label {
|
55
|
+
text-align: center;
|
56
|
+
}
|
57
|
+
.node.clickable {
|
58
|
+
cursor: pointer;
|
59
|
+
}
|
60
|
+
|
61
|
+
.arrowheadPath {
|
62
|
+
fill: ${t.arrowheadColor};
|
63
|
+
}
|
64
|
+
|
65
|
+
.edgePath .path {
|
66
|
+
stroke: ${t.lineColor};
|
67
|
+
stroke-width: 1.5px;
|
68
|
+
}
|
69
|
+
|
70
|
+
.flowchart-link {
|
71
|
+
stroke: ${t.lineColor};
|
72
|
+
fill: none;
|
73
|
+
}
|
74
|
+
|
75
|
+
.edgeLabel {
|
76
|
+
background-color: ${t.edgeLabelBackground};
|
77
|
+
rect {
|
78
|
+
opacity: 0.5;
|
79
|
+
}
|
80
|
+
text-align: center;
|
81
|
+
}
|
82
|
+
|
83
|
+
.cluster rect {
|
84
|
+
}
|
85
|
+
|
86
|
+
.cluster text {
|
87
|
+
fill: ${t.titleColor};
|
88
|
+
}
|
89
|
+
|
90
|
+
div.mermaidTooltip {
|
91
|
+
position: absolute;
|
92
|
+
text-align: center;
|
93
|
+
max-width: 200px;
|
94
|
+
padding: 2px;
|
95
|
+
font-family: ${t.fontFamily};
|
96
|
+
font-size: 12px;
|
97
|
+
background: ${t.tertiaryColor};
|
98
|
+
border: 1px solid ${t.border2};
|
99
|
+
border-radius: 2px;
|
100
|
+
pointer-events: none;
|
101
|
+
z-index: 100;
|
102
|
+
}
|
103
|
+
|
104
|
+
.task-type-0, .section-type-0 {
|
105
|
+
${t.fillType0?`fill: ${t.fillType0}`:""};
|
106
|
+
}
|
107
|
+
.task-type-1, .section-type-1 {
|
108
|
+
${t.fillType0?`fill: ${t.fillType1}`:""};
|
109
|
+
}
|
110
|
+
.task-type-2, .section-type-2 {
|
111
|
+
${t.fillType0?`fill: ${t.fillType2}`:""};
|
112
|
+
}
|
113
|
+
.task-type-3, .section-type-3 {
|
114
|
+
${t.fillType0?`fill: ${t.fillType3}`:""};
|
115
|
+
}
|
116
|
+
.task-type-4, .section-type-4 {
|
117
|
+
${t.fillType0?`fill: ${t.fillType4}`:""};
|
118
|
+
}
|
119
|
+
.task-type-5, .section-type-5 {
|
120
|
+
${t.fillType0?`fill: ${t.fillType5}`:""};
|
121
|
+
}
|
122
|
+
.task-type-6, .section-type-6 {
|
123
|
+
${t.fillType0?`fill: ${t.fillType6}`:""};
|
124
|
+
}
|
125
|
+
.task-type-7, .section-type-7 {
|
126
|
+
${t.fillType0?`fill: ${t.fillType7}`:""};
|
127
|
+
}
|
128
|
+
|
129
|
+
.actor-0 {
|
130
|
+
${t.actor0?`fill: ${t.actor0}`:""};
|
131
|
+
}
|
132
|
+
.actor-1 {
|
133
|
+
${t.actor1?`fill: ${t.actor1}`:""};
|
134
|
+
}
|
135
|
+
.actor-2 {
|
136
|
+
${t.actor2?`fill: ${t.actor2}`:""};
|
137
|
+
}
|
138
|
+
.actor-3 {
|
139
|
+
${t.actor3?`fill: ${t.actor3}`:""};
|
140
|
+
}
|
141
|
+
.actor-4 {
|
142
|
+
${t.actor4?`fill: ${t.actor4}`:""};
|
143
|
+
}
|
144
|
+
.actor-5 {
|
145
|
+
${t.actor5?`fill: ${t.actor5}`:""};
|
146
|
+
}
|
147
|
+
${(0,r.G)()}
|
148
|
+
`,"getStyles"),w=(0,a.eW)(function(t,e){return(0,n.Mu)(t,e)},"drawRect"),W=(0,a.eW)(function(t,e){let i=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");function r(t){let i=(0,s.Nb1)().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function l(t){let i=(0,s.Nb1)().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function o(t){t.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 n.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),n.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),(0,a.eW)(r,"smile"),(0,a.eW)(l,"sad"),(0,a.eW)(o,"ambivalent"),e.score>3?r(n):e.score<3?l(n):o(n),i},"drawFace"),$=(0,a.eW)(function(t,e){let 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"),M=(0,a.eW)(function(t,e){return(0,n.yU)(t,e)},"drawText"),T=(0,a.eW)(function(t,e,i){let r=t.append("g"),a=(0,n.kc)();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=i.width*e.taskCount+i.diagramMarginX*(e.taskCount-1),a.height=i.height,a.class="journey-section section-type-"+e.num,a.rx=3,a.ry=3,w(r,a),C(i)(e.text,r,a.x,a.y,a.width,a.height,{class:"journey-section section-type-"+e.num},i,e.colour)},"drawSection"),E=-1,S=(0,a.eW)(function(t,e,i){let r=e.x+i.width/2,a=t.append("g");E++,a.append("line").attr("id","task"+E).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),W(a,{cx:r,cy:300+(5-e.score)*30,score:e.score});let s=(0,n.kc)();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=i.width,s.height=i.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,w(a,s);let l=e.x+14;e.people.forEach(t=>{let i=e.actors[t].color;$(a,{cx:l,cy:e.y,r:7,fill:i,stroke:"#000",title:t,pos:e.actors[t].position}),l+=10}),C(i)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},i,e.colour)},"drawTask"),C=function(){function t(t,e,i,r,a,s,l,o){n(e.append("text").attr("x",i+a/2).attr("y",r+s/2+5).style("font-color",o).style("text-anchor","middle").text(t),l)}function e(t,e,i,r,a,s,l,o,c){let{taskFontSize:h,taskFontFamily:u}=o,y=t.split(/<br\s*\/?>/gi);for(let t=0;t<y.length;t++){let o=t*h-h*(y.length-1)/2,p=e.append("text").attr("x",i+a/2).attr("y",r).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",u);p.append("tspan").attr("x",i+a/2).attr("dy",o).text(y[t]),p.attr("y",r+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(p,l)}}function i(t,i,r,a,s,l,o,c){let h=i.append("switch"),u=h.append("foreignObject").attr("x",r).attr("y",a).attr("width",s).attr("height",l).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),e(t,h,r,a,s,l,o,c),n(u,o)}function n(t,e){for(let i in e)i in e&&t.attr(i,e[i])}return(0,a.eW)(t,"byText"),(0,a.eW)(e,"byTspan"),(0,a.eW)(i,"byFo"),(0,a.eW)(n,"_setTextAttrs"),function(n){return"fo"===n.textPlacement?i:"old"===n.textPlacement?t:e}}(),A={drawCircle:$,drawSection:T,drawText:M,drawTask:S,initGraphics:(0,a.eW)(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")},I=(0,a.eW)(function(t){Object.keys(t).forEach(function(e){N[e]=t[e]})},"setConf"),P={},j=0;function V(t){let e=(0,a.nV)().journey,i=e.maxLabelWidth;j=0;let n=60;Object.keys(P).forEach(r=>{let a=P[r].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:P[r].position};A.drawCircle(t,s);let l=t.append("text").attr("visibility","hidden").text(r),o=l.node().getBoundingClientRect().width;l.remove();let c=[];if(o<=i)c=[r];else{let e=r.split(" "),n="";l=t.append("text").attr("visibility","hidden"),e.forEach(t=>{let e=n?`${n} ${t}`:t;if(l.text(e),l.node().getBoundingClientRect().width>i){if(n&&c.push(n),n=t,l.text(t),l.node().getBoundingClientRect().width>i){let e="";for(let n of t)e+=n,l.text(e+"-"),l.node().getBoundingClientRect().width>i&&(c.push(e.slice(0,-1)+"-"),e=n);n=e}}else n=e}),n&&c.push(n),l.remove()}c.forEach((i,r)=>{let a={x:40,y:n+7+20*r,fill:"#666",text:i,textMargin:e.boxTextMargin??5},s=A.drawText(t,a).node().getBoundingClientRect().width;s>j&&s>e.leftMargin-s&&(j=s)}),n+=Math.max(20,20*c.length)})}(0,a.eW)(V,"drawActorLegend");var N=(0,a.nV)().journey,F=0,B=(0,a.eW)(function(t,e,i,n){let r;let l=(0,a.nV)(),o=l.journey.titleColor,c=l.journey.titleFontSize,h=l.journey.titleFontFamily,u=l.securityLevel;"sandbox"===u&&(r=(0,s.Ys)("#i"+e));let y="sandbox"===u?(0,s.Ys)(r.nodes()[0].contentDocument.body):(0,s.Ys)("body");O.init();let p=y.select("#"+e);A.initGraphics(p);let d=n.db.getTasks(),f=n.db.getDiagramTitle(),g=n.db.getActors();for(let t in P)delete P[t];let x=0;g.forEach(t=>{P[t]={color:N.actorColours[x%N.actorColours.length],position:x},x++}),V(p),F=N.leftMargin+j,O.insert(0,0,F,50*Object.keys(P).length),L(p,d,0);let m=O.getBounds();f&&p.append("text").text(f).attr("x",F).attr("font-size",c).attr("font-weight","bold").attr("y",25).attr("fill",o).attr("font-family",h);let k=m.stopy-m.starty+2*N.diagramMarginY,_=F+m.stopx+2*N.diagramMarginX;(0,a.v2)(p,k,_,N.useMaxWidth),p.append("line").attr("x1",F).attr("y1",4*N.height).attr("x2",_-F-4).attr("y2",4*N.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");let b=f?70:0;p.attr("viewBox",`${m.startx} -25 ${_} ${k+b}`),p.attr("preserveAspectRatio","xMinYMin meet"),p.attr("height",k+b+25)},"draw"),O={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:(0,a.eW)(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:(0,a.eW)(function(t,e,i,n){void 0===t[e]?t[e]=i:t[e]=n(i,t[e])},"updateVal"),updateBounds:(0,a.eW)(function(t,e,i,n){let r=(0,a.nV)().journey,s=this,l=0;function o(o){return(0,a.eW)(function(a){l++;let c=s.sequenceItems.length-l+1;s.updateVal(a,"starty",e-c*r.boxMargin,Math.min),s.updateVal(a,"stopy",n+c*r.boxMargin,Math.max),s.updateVal(O.data,"startx",t-c*r.boxMargin,Math.min),s.updateVal(O.data,"stopx",i+c*r.boxMargin,Math.max),"activation"!==o&&(s.updateVal(a,"startx",t-c*r.boxMargin,Math.min),s.updateVal(a,"stopx",i+c*r.boxMargin,Math.max),s.updateVal(O.data,"starty",e-c*r.boxMargin,Math.min),s.updateVal(O.data,"stopy",n+c*r.boxMargin,Math.max))},"updateItemBounds")}(0,a.eW)(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:(0,a.eW)(function(t,e,i,n){let r=Math.min(t,i),a=Math.max(t,i),s=Math.min(e,n),l=Math.max(e,n);this.updateVal(O.data,"startx",r,Math.min),this.updateVal(O.data,"starty",s,Math.min),this.updateVal(O.data,"stopx",a,Math.max),this.updateVal(O.data,"stopy",l,Math.max),this.updateBounds(r,s,a,l)},"insert"),bumpVerticalPos:(0,a.eW)(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:(0,a.eW)(function(){return this.verticalPos},"getVerticalPos"),getBounds:(0,a.eW)(function(){return this.data},"getBounds")},R=N.sectionFills,D=N.sectionColours,L=(0,a.eW)(function(t,e,i){let n=(0,a.nV)().journey,r="",s=i+(2*n.height+n.diagramMarginY),l=0,o="#CCC",c="black",h=0;for(let[i,a]of e.entries()){if(r!==a.section){o=R[l%R.length],h=l%R.length,c=D[l%D.length];let s=0,u=a.section;for(let t=i;t<e.length;t++)if(e[t].section==u)s+=1;else break;let y={x:i*n.taskMargin+i*n.width+F,y:50,text:a.section,fill:o,num:h,colour:c,taskCount:s};A.drawSection(t,y,n),r=a.section,l++}let u=a.people.reduce((t,e)=>(P[e]&&(t[e]=P[e]),t),{});a.x=i*n.taskMargin+i*n.width+F,a.y=s,a.width=n.diagramMarginX,a.height=n.diagramMarginY,a.colour=c,a.fill=o,a.num=h,a.actors=u,A.drawTask(t,a,n),O.insert(a.x,a.y,a.x+a.width+n.taskMargin,450)}},"drawTasks"),Y={setConf:I,draw:B},z={parser:l,db:b,renderer:Y,styles:v,init:(0,a.eW)(t=>{Y.setConf(t.journey),b.clear()},"init")}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5765],{5765:function(e,c,n){n.d(c,{createPacketServices:function(){return t.g}});var t=n(14119);n(51127)}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[584],{20584:function(r,e,s){s.d(e,{diagram:function(){return t}});var a=s(60297);s(76084),s(16816),s(14201),s(12168),s(36731),s(61797),s(98280),s(59542),s(57537),s(79296),s(56574);var n=s(20755),t={parser:a.P0,get db(){return new a.dR},renderer:a.b0,styles:a.Ee,init:(0,n.eW)(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")}}}]);
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6240],{30298:function(e,t,a){function l(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}a.d(t,{A:function(){return l}}),(0,a(20755).eW)(l,"populateCommonDb")},14201:function(e,t,a){a.d(t,{j:function(){return r}});var l=a(20755),r=(0,l.eW)((e,t,a,r)=>{e.attr("class",a);let{width:n,height:o,x:c,y:d}=s(e,t);(0,l.v2)(e,o,n,r);let p=i(c,d,n,o,t);e.attr("viewBox",p),l.cM.debug(`viewBox configured: ${p} with padding: ${t}`)},"setupViewPortForSVG"),s=(0,l.eW)((e,t)=>{let a=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:a.width+2*t,height:a.height+2*t,x:a.x,y:a.y}},"calculateDimensionsWithPadding"),i=(0,l.eW)((e,t,a,l,r)=>`${e-r} ${t-r} ${a} ${l}`,"createViewBox")},66240:function(e,t,a){a.d(t,{diagram:function(){return x}});var l=a(14201),r=a(57537),s=a(30298),i=a(56574),n=a(38111),o=a(20755),c=a(54327),d=a(84370),p=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=o.GN,this.getAccTitle=o.eu,this.setDiagramTitle=o.g2,this.getDiagramTitle=o.Kr,this.getAccDescription=o.Mx,this.setAccDescription=o.U$}static{(0,o.eW)(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let e=o.vZ,t=(0,o.iE)();return(0,i.Rb)({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),0===t&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,t){let a=this.classes.get(e)??{id:e,styles:[],textStyles:[]},l=t.replace(/\\,/g,"\xa7\xa7\xa7").replace(/,/g,";").replace(/§§§/g,",").split(";");l&&l.forEach(e=>{(0,r.Fh)(e)&&(a?.textStyles?a.textStyles.push(e):a.textStyles=[e]),a?.styles?a.styles.push(e):a.styles=[e]}),this.classes.set(e,a)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){(0,o.ZH)(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function h(e){if(!e.length)return[];let t=[],a=[];return e.forEach(e=>{let l={name:e.name,children:"Leaf"===e.type?void 0:[]};for(l.classSelector=e?.classSelector,e?.cssCompiledStyles&&(l.cssCompiledStyles=[e.cssCompiledStyles]),"Leaf"===e.type&&void 0!==e.value&&(l.value=e.value);a.length>0&&a[a.length-1].level>=e.level;)a.pop();if(0===a.length)t.push(l);else{let e=a[a.length-1].node;e.children?e.children.push(l):e.children=[l]}"Leaf"!==e.type&&a.push({node:l,level:e.level})}),t}(0,o.eW)(h,"buildHierarchy");var m=(0,o.eW)((e,t)=>{(0,s.A)(e,t);let a=[];for(let a of e.TreemapRows??[])"ClassDefStatement"===a.$type&&t.addClass(a.className??"",a.styleText??"");for(let l of e.TreemapRows??[]){let e=l.item;if(!e)continue;let r=l.indent?parseInt(l.indent):0,s=u(e),i=e.classSelector?t.getStylesForClass(e.classSelector):[],n=i.length>0?i.join(";"):void 0,o={level:r,name:s,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:n};a.push(o)}let l=h(a),r=(0,o.eW)((e,a)=>{for(let l of e)t.addNode(l,a),l.children&&l.children.length>0&&r(l.children,a+1)},"addNodesRecursively");r(l,0)},"populate"),u=(0,o.eW)(e=>e.name?String(e.name):"","getItemName"),y={parser:{yy:void 0},parse:(0,o.eW)(async e=>{try{let t=c.Qc,a=await t("treemap",e);o.cM.debug("Treemap AST:",a);let l=y.parser?.yy;if(!(l instanceof p))throw Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m(a,l)}catch(e){throw o.cM.error("Error parsing treemap:",e),e}},"parse")},f=(0,o.eW)((e,t,a,s)=>{let i;let c=s.db,p=c.getConfig(),h=p.padding??10,m=c.getDiagramTitle(),u=c.getRoot(),{themeVariables:y}=(0,o.iE)();if(!u)return;let f=m?30:0,g=(0,n.P)(t),S=p.nodeWidth?10*p.nodeWidth:960,x=p.nodeHeight?10*p.nodeHeight:500,b=x+f;g.attr("viewBox",`0 0 ${S} ${b}`),(0,o.v2)(g,b,S,p.useMaxWidth);try{let e=p.valueFormat||",";if("$0,0"===e)i=(0,o.eW)(e=>"$"+(0,d.WUZ)(",")(e),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){let t=/\.\d+/.exec(e),a=t?t[0]:"";i=(0,o.eW)(e=>"$"+(0,d.WUZ)(","+a)(e),"valueFormat")}else if(e.startsWith("$")){let t=e.substring(1);i=(0,o.eW)(e=>"$"+(0,d.WUZ)(t||"")(e),"valueFormat")}else i=(0,d.WUZ)(e)}catch(e){o.cM.error("Error creating format function:",e),i=(0,d.WUZ)(",")}let $=(0,d.PKp)().range(["transparent",y.cScale0,y.cScale1,y.cScale2,y.cScale3,y.cScale4,y.cScale5,y.cScale6,y.cScale7,y.cScale8,y.cScale9,y.cScale10,y.cScale11]),C=(0,d.PKp)().range(["transparent",y.cScalePeer0,y.cScalePeer1,y.cScalePeer2,y.cScalePeer3,y.cScalePeer4,y.cScalePeer5,y.cScalePeer6,y.cScalePeer7,y.cScalePeer8,y.cScalePeer9,y.cScalePeer10,y.cScalePeer11]),v=(0,d.PKp)().range([y.cScaleLabel0,y.cScaleLabel1,y.cScaleLabel2,y.cScaleLabel3,y.cScaleLabel4,y.cScaleLabel5,y.cScaleLabel6,y.cScaleLabel7,y.cScaleLabel8,y.cScaleLabel9,y.cScaleLabel10,y.cScaleLabel11]);m&&g.append("text").attr("x",S/2).attr("y",f/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(m);let w=g.append("g").attr("transform",`translate(0, ${f})`).attr("class","treemapContainer"),W=(0,d.bT9)(u).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),k=(0,d.pNI)().size([S,x]).paddingTop(e=>e.children&&e.children.length>0?35:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?10:0).paddingRight(e=>e.children&&e.children.length>0?10:0).paddingBottom(e=>e.children&&e.children.length>0?10:0).round(!0)(W),L=k.descendants().filter(e=>e.children&&e.children.length>0),T=w.selectAll(".treemapSection").data(L).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);T.append("rect").attr("width",e=>e.x1-e.x0).attr("height",25).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>0===e.depth?"display: none;":""),T.append("clipPath").attr("id",(e,a)=>`clip-section-${t}-${a}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",25),T.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,t)=>`treemapSection section${t}`).attr("fill",e=>$(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>C(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(0===e.depth)return"display: none;";let t=(0,r.UG)({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),T.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",12.5).attr("dominant-baseline","middle").text(e=>0===e.depth?"":e.data.name).attr("font-weight","bold").attr("style",e=>0===e.depth?"display: none;":"dominant-baseline: middle; font-size: 12px; fill:"+v(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+(0,r.UG)({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).each(function(e){if(0===e.depth)return;let t=(0,d.Ys)(this),a=e.data.name;t.text(a);let l=e.x1-e.x0,r=Math.max(15,!1!==p.showValues&&e.value?l-10-30-10-6:l-6-6),s=t.node();if(s.getComputedTextLength()>r){let e=a;for(;e.length>0;){if(0===(e=a.substring(0,e.length-1)).length){t.text("..."),s.getComputedTextLength()>r&&t.text("");break}if(t.text(e+"..."),s.getComputedTextLength()<=r)break}}}),!1!==p.showValues&&T.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",12.5).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?i(e.value):"").attr("font-style","italic").attr("style",e=>0===e.depth?"display: none;":"text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+v(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+(0,r.UG)({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:"));let M=k.leaves(),P=w.selectAll(".treemapLeafGroup").data(M).enter().append("g").attr("class",(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);P.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?$(e.parent.data.name):$(e.data.name)).attr("style",e=>(0,r.UG)({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?$(e.parent.data.name):$(e.data.name)).attr("stroke-width",3),P.append("clipPath").attr("id",(e,a)=>`clip-${t}-${a}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),P.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>"text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+v(e.data.name)+";"+(0,r.UG)({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(e,a)=>`url(#clip-${t}-${a})`).text(e=>e.data.name).each(function(e){let t=(0,d.Ys)(this),a=e.x1-e.x0,l=e.y1-e.y0,r=t.node(),s=a-8,i=l-8;if(s<10||i<10){t.style("display","none");return}let n=parseInt(t.style("font-size"),10);for(;r.getComputedTextLength()>s&&n>8;)n--,t.style("font-size",`${n}px`);let o=Math.max(6,Math.min(28,Math.round(.6*n))),c=n+2+o;for(;c>i&&n>8&&(!((o=Math.max(6,Math.min(28,Math.round(.6*--n))))<6)||8!==n);)t.style("font-size",`${n}px`),c=n+2+o;t.style("font-size",`${n}px`),(r.getComputedTextLength()>s||n<8||i<n)&&t.style("display","none")}),!1!==p.showValues&&P.append("text").attr("class","treemapValue").attr("x",e=>(e.x1-e.x0)/2).attr("y",function(e){return(e.y1-e.y0)/2}).attr("style",e=>"text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+v(e.data.name)+";"+(0,r.UG)({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(e,a)=>`url(#clip-${t}-${a})`).text(e=>e.value?i(e.value):"").each(function(e){let t=(0,d.Ys)(this),a=this.parentNode;if(!a){t.style("display","none");return}let l=(0,d.Ys)(a).select(".treemapLabel");if(l.empty()||"none"===l.style("display")){t.style("display","none");return}let r=parseFloat(l.style("font-size")),s=Math.max(6,Math.min(28,Math.round(.6*r)));t.style("font-size",`${s}px`);let i=(e.y1-e.y0)/2+r/2+2;t.attr("y",i);let n=e.x1-e.x0,o=e.y1-e.y0;t.node().getComputedTextLength()>n-8||i+s>o-4||s<6?t.style("display","none"):t.style("display",null)});let z=p.diagramPadding??8;(0,l.j)(g,z,"flowchart",p?.useMaxWidth||!1)},"draw"),g=(0,o.eW)(function(e,t){return t.db.getClasses()},"getClasses"),S={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},x={parser:y,get db(){return new p},renderer:{draw:f,getClasses:g},styles:(0,o.eW)(({treemap:e}={})=>{let t=(0,i.Rb)(S,e);return`
|
2
|
+
.treemapNode.section {
|
3
|
+
stroke: ${t.sectionStrokeColor};
|
4
|
+
stroke-width: ${t.sectionStrokeWidth};
|
5
|
+
fill: ${t.sectionFillColor};
|
6
|
+
}
|
7
|
+
.treemapNode.leaf {
|
8
|
+
stroke: ${t.leafStrokeColor};
|
9
|
+
stroke-width: ${t.leafStrokeWidth};
|
10
|
+
fill: ${t.leafFillColor};
|
11
|
+
}
|
12
|
+
.treemapLabel {
|
13
|
+
fill: ${t.labelColor};
|
14
|
+
font-size: ${t.labelFontSize};
|
15
|
+
}
|
16
|
+
.treemapValue {
|
17
|
+
fill: ${t.valueColor};
|
18
|
+
font-size: ${t.valueFontSize};
|
19
|
+
}
|
20
|
+
.treemapTitle {
|
21
|
+
fill: ${t.titleColor};
|
22
|
+
font-size: ${t.titleFontSize};
|
23
|
+
}
|
24
|
+
`},"getStyles")}}}]);
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9183],{98280:function(t,e,a){a.d(e,{C1:function(){return d},Lf:function(){return ei},XO:function(){return b},Yn:function(){return en},ZH:function(){return B},aH:function(){return eh},dW:function(){return el},gU:function(){return es},jr:function(){return g},us:function(){return C}});var l=a(59542),r=a(57537),i=a(79296),n=a(56574),s=a(20755),h=a(84370),o=a(90705),d=(0,s.eW)(async(t,e,a)=>{let l,r;let o=e.useHtmlLabels||(0,s.ku)(s.nV()?.htmlLabels);l=a||"node default";let d=t.insert("g").attr("class",l).attr("id",e.domId||e.id),c=d.insert("g").attr("class","label").attr("style",(0,n.R7)(e.labelStyle));r=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];let g=await (0,i.rw)(c,(0,s.oO)((0,n.SH)(r),(0,s.nV)()),{useHtmlLabels:o,width:e.width||s.nV().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img}),y=g.getBBox(),f=(e?.padding??0)/2;if(o){let t=g.children[0],e=(0,h.Ys)(g),a=t.getElementsByTagName("img");if(a){let t=""===r.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function l(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=(0,s.nV)().fontSize?(0,s.nV)().fontSize:window.getComputedStyle(document.body).fontSize,[a=s.vZ.fontSize]=(0,n.VG)(t),l=5*a+"px";e.style.minWidth=l,e.style.maxWidth=l}else e.style.width="100%";a(e)}(0,s.eW)(l,"setupImage"),setTimeout(()=>{e.complete&&l()}),e.addEventListener("error",l),e.addEventListener("load",l)})))}y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}return o?c.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"):c.attr("transform","translate(0, "+-y.height/2+")"),e.centerLabel&&c.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:d,bbox:y,halfPadding:f,label:c}},"labelHelper"),c=(0,s.eW)(async(t,e,a)=>{let l=a.useHtmlLabels||(0,s.ku)(s.nV()?.flowchart?.htmlLabels),r=t.insert("g").attr("class","label").attr("style",a.labelStyle||""),o=await (0,i.rw)(r,(0,s.oO)((0,n.SH)(e),(0,s.nV)()),{useHtmlLabels:l,width:a.width||s.nV()?.flowchart?.wrappingWidth,style:a.labelStyle,addSvgBackground:!!a.icon||!!a.img}),d=o.getBBox(),c=a.padding/2;if((0,s.ku)(s.nV()?.flowchart?.htmlLabels)){let t=o.children[0],e=(0,h.Ys)(o);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}return l?r.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):r.attr("transform","translate(0, "+-d.height/2+")"),a.centerLabel&&r.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),r.insert("rect",":first-child"),{shapeSvg:t,bbox:d,halfPadding:c,label:r}},"insertLabel"),g=(0,s.eW)((t,e)=>{let a=e.node().getBBox();t.width=a.width,t.height=a.height},"updateNodeBounds"),y=(0,s.eW)((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function f(t){let e=t.map((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`);return e.push("Z"),e.join(" ")}function p(t,e,a,l,r,i){let n=[],s=a-t,h=2*Math.PI/(s/i),o=e+(l-e)/2;for(let e=0;e<=50;e++){let a=t+e/50*s,l=o+r*Math.sin(h*(a-t));n.push({x:a,y:l})}return n}function u(t,e,a,l,r,i){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}(0,s.eW)(f,"createPathFromPoints"),(0,s.eW)(p,"generateFullSineWavePoints"),(0,s.eW)(u,"generateCirclePoints");var m=(0,s.eW)((t,e)=>{var a,l,r=t.x,i=t.y,n=e.x-r,s=e.y-i,h=t.width/2,o=t.height/2;return Math.abs(s)*h>Math.abs(n)*o?(s<0&&(o=-o),a=0===s?0:o*n/s,l=o):(n<0&&(h=-h),a=h,l=0===n?0:h*s/n),{x:r+a,y:i+l}},"intersectRect");function x(t,e){e&&t.attr("style",e)}async function w(t){let e=(0,h.Ys)(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),a=e.append("xhtml:div"),l=t.label;t.label&&(0,s.l0)(t.label)&&(l=await (0,s.uT)(t.label.replace(s.SY.lineBreakRegex,"\n"),(0,s.nV)()));let r=t.isNode?"nodeLabel":"edgeLabel";return a.html('<span class="'+r+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+l+"</span>"),x(a,t.labelStyle),a.style("display","inline-block"),a.style("padding-right","1px"),a.style("white-space","nowrap"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}(0,s.eW)(x,"applyStyle"),(0,s.eW)(w,"addHtmlLabel");var b=(0,s.eW)(async(t,e,a,l)=>{let r=t||"";if("object"==typeof r&&(r=r[0]),(0,s.ku)((0,s.nV)().flowchart.htmlLabels)){r=r.replace(/\\n|\n/g,"<br />"),s.cM.info("vertexText"+r);let t={isNode:l,label:(0,n.SH)(r).replace(/fa[blrs]?:fa-[\w-]+/g,t=>`<i class='${t.replace(":"," ")}'></i>`),labelStyle:e?e.replace("fill:","color:"):e};return await w(t)}{let t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));for(let e of"string"==typeof r?r.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(r)?r:[]){let l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),a?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=e.trim(),t.appendChild(l)}return t}},"createLabel"),$=(0,s.eW)((t,e,a,l,r)=>["M",t+r,e,"H",t+a-r,"A",r,r,0,0,1,t+a,e+r,"V",e+l-r,"A",r,r,0,0,1,t+a-r,e+l,"H",t+r,"A",r,r,0,0,1,t,e+l-r,"V",e+r,"A",r,r,0,0,1,t+r,e,"Z"].join(" "),"createRoundedRectPathD"),k=(0,s.eW)(async(t,e)=>{let a;s.cM.info("Creating subgraph rect for ",e.id,e);let n=(0,s.nV)(),{themeVariables:d,handDrawnSeed:c}=n,{clusterBkg:g,clusterBorder:y}=d,{labelStyles:f,nodeStyles:p,borderStyles:u,backgroundStyles:x}=(0,r.UG)(e),w=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),b=(0,s.ku)(n.flowchart.htmlLabels),k=w.insert("g").attr("class","cluster-label "),M=await (0,i.rw)(k,e.label,{style:e.labelStyle,useHtmlLabels:b,isNode:!0}),S=M.getBBox();if((0,s.ku)(n.flowchart.htmlLabels)){let t=M.children[0],e=(0,h.Ys)(M);S=t.getBoundingClientRect(),e.attr("width",S.width),e.attr("height",S.height)}let D=e.width<=S.width+e.padding?S.width+e.padding:e.width;e.width<=S.width+e.padding?e.diff=(D-e.width)/2-e.padding:e.diff=-e.padding;let W=e.height,v=e.x-D/2,C=e.y-W/2;if(s.cM.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=o.Z.svg(w),l=(0,r._q)(e,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:c}),i=t.path($(v,C,D,W,0),l);(a=w.insert(()=>(s.cM.debug("Rough node insert CXC",i),i),":first-child")).select("path:nth-child(2)").attr("style",u.join(";")),a.select("path").attr("style",x.join(";").replace("fill","stroke"))}else(a=w.insert("rect",":first-child")).attr("style",p).attr("rx",e.rx).attr("ry",e.ry).attr("x",v).attr("y",C).attr("width",D).attr("height",W);let{subGraphTitleTopMargin:B}=(0,l.L)(n);if(k.attr("transform",`translate(${e.x-S.width/2}, ${e.y-e.height/2+B})`),f){let t=k.select("span");t&&t.attr("style",f)}let N=a.node().getBBox();return e.offsetX=0,e.width=N.width,e.height=N.height,e.offsetY=S.height-e.padding/2,e.intersect=function(t){return m(e,t)},{cluster:w,labelBBox:S}},"rect"),M=(0,s.eW)((t,e)=>{let a=t.insert("g").attr("class","note-cluster").attr("id",e.id),l=a.insert("rect",":first-child"),r=0*e.padding,i=r/2;l.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-i).attr("y",e.y-e.height/2-i).attr("width",e.width+r).attr("height",e.height+r).attr("fill","none");let n=l.node().getBBox();return e.width=n.width,e.height=n.height,e.intersect=function(t){return m(e,t)},{cluster:a,labelBBox:{width:0,height:0}}},"noteGroup"),S=(0,s.eW)(async(t,e)=>{let a;let l=(0,s.nV)(),{themeVariables:r,handDrawnSeed:i}=l,{altBackground:n,compositeBackground:d,compositeTitleBackground:c,nodeBorder:g}=r,y=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),f=y.insert("g",":first-child"),p=y.insert("g").attr("class","cluster-label"),u=y.append("rect"),x=p.node().appendChild(await b(e.label,e.labelStyle,void 0,!0)),w=x.getBBox();if((0,s.ku)(l.flowchart.htmlLabels)){let t=x.children[0],e=(0,h.Ys)(x);w=t.getBoundingClientRect(),e.attr("width",w.width),e.attr("height",w.height)}let k=0*e.padding,M=(e.width<=w.width+e.padding?w.width+e.padding:e.width)+k;e.width<=w.width+e.padding?e.diff=(M-e.width)/2-e.padding:e.diff=-e.padding;let S=e.height+k,D=e.height+k-w.height-6,W=e.x-M/2,v=e.y-S/2;e.width=M;let C=e.y-e.height/2-k/2+w.height+2;if("handDrawn"===e.look){let t=e.cssClasses.includes("statediagram-cluster-alt"),l=o.Z.svg(y),r=e.rx||e.ry?l.path($(W,v,M,S,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:g,seed:i}):l.rectangle(W,v,M,S,{seed:i});a=y.insert(()=>r,":first-child");let s=l.rectangle(W,C,M,D,{fill:t?n:d,fillStyle:t?"hachure":"solid",stroke:g,seed:i});a=y.insert(()=>r,":first-child"),u=y.insert(()=>s)}else(a=f.insert("rect",":first-child")).attr("class","outer").attr("x",W).attr("y",v).attr("width",M).attr("height",S).attr("data-look",e.look),u.attr("class","inner").attr("x",W).attr("y",C).attr("width",M).attr("height",D);p.attr("transform",`translate(${e.x-w.width/2}, ${v+1-((0,s.ku)(l.flowchart.htmlLabels)?0:3)})`);let B=a.node().getBBox();return e.height=B.height,e.offsetX=0,e.offsetY=w.height-e.padding/2,e.labelBBox=w,e.intersect=function(t){return m(e,t)},{cluster:y,labelBBox:w}},"roundedWithTitle"),D=(0,s.eW)(async(t,e)=>{let a;s.cM.info("Creating subgraph rect for ",e.id,e);let n=(0,s.nV)(),{themeVariables:d,handDrawnSeed:c}=n,{clusterBkg:g,clusterBorder:y}=d,{labelStyles:f,nodeStyles:p,borderStyles:u,backgroundStyles:x}=(0,r.UG)(e),w=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),b=(0,s.ku)(n.flowchart.htmlLabels),k=w.insert("g").attr("class","cluster-label "),M=await (0,i.rw)(k,e.label,{style:e.labelStyle,useHtmlLabels:b,isNode:!0,width:e.width}),S=M.getBBox();if((0,s.ku)(n.flowchart.htmlLabels)){let t=M.children[0],e=(0,h.Ys)(M);S=t.getBoundingClientRect(),e.attr("width",S.width),e.attr("height",S.height)}let D=e.width<=S.width+e.padding?S.width+e.padding:e.width;e.width<=S.width+e.padding?e.diff=(D-e.width)/2-e.padding:e.diff=-e.padding;let W=e.height,v=e.x-D/2,C=e.y-W/2;if(s.cM.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=o.Z.svg(w),l=(0,r._q)(e,{roughness:.7,fill:g,stroke:y,fillWeight:4,seed:c}),i=t.path($(v,C,D,W,e.rx),l);(a=w.insert(()=>(s.cM.debug("Rough node insert CXC",i),i),":first-child")).select("path:nth-child(2)").attr("style",u.join(";")),a.select("path").attr("style",x.join(";").replace("fill","stroke"))}else(a=w.insert("rect",":first-child")).attr("style",p).attr("rx",e.rx).attr("ry",e.ry).attr("x",v).attr("y",C).attr("width",D).attr("height",W);let{subGraphTitleTopMargin:B}=(0,l.L)(n);if(k.attr("transform",`translate(${e.x-S.width/2}, ${e.y-e.height/2+B})`),f){let t=k.select("span");t&&t.attr("style",f)}let N=a.node().getBBox();return e.offsetX=0,e.width=N.width,e.height=N.height,e.offsetY=S.height-e.padding/2,e.intersect=function(t){return m(e,t)},{cluster:w,labelBBox:S}},"kanbanSection"),W={rect:k,squareRect:k,roundedWithTitle:S,noteGroup:M,divider:(0,s.eW)((t,e)=>{let a;let{themeVariables:l,handDrawnSeed:r}=(0,s.nV)(),{nodeBorder:i}=l,n=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),h=n.insert("g",":first-child"),d=0*e.padding,c=e.width+d;e.diff=-e.padding;let g=e.height+d,y=e.x-c/2,f=e.y-g/2;if(e.width=c,"handDrawn"===e.look){let t=o.Z.svg(n).rectangle(y,f,c,g,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:i,seed:r});a=n.insert(()=>t,":first-child")}else(a=h.insert("rect",":first-child")).attr("class","divider").attr("x",y).attr("y",f).attr("width",c).attr("height",g).attr("data-look",e.look);let p=a.node().getBBox();return e.height=p.height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return m(e,t)},{cluster:n,labelBBox:{}}},"divider"),kanbanSection:D},v=new Map,C=(0,s.eW)(async(t,e)=>{let a=e.shape||"rect",l=await W[a](t,e);return v.set(e.id,l),l},"insertCluster"),B=(0,s.eW)(()=>{v=new Map},"clear");function N(t,e,a,l){var r=t.x,i=t.y,n=r-l.x,s=i-l.y,h=Math.sqrt(e*e*s*s+a*a*n*n),o=Math.abs(e*a*n/h);l.x<r&&(o=-o);var d=Math.abs(e*a*s/h);return l.y<i&&(d=-d),{x:r+o,y:i+d}}function A(t,e,a){return N(t,e,e,a)}function R(t,e,a,l){var r,i,n,s,h,o,d,c,g,y,f,p,u;if(r=e.y-t.y,n=t.x-e.x,h=e.x*t.y-t.x*e.y,g=r*a.x+n*a.y+h,y=r*l.x+n*l.y+h,!(0!==g&&0!==y&&L(g,y))&&(i=l.y-a.y,s=a.x-l.x,o=l.x*a.y-a.x*l.y,d=i*t.x+s*t.y+o,c=i*e.x+s*e.y+o,!(0!==d&&0!==c&&L(d,c))&&0!=(f=r*s-i*n)))return p=Math.abs(f/2),{x:(u=n*o-s*h)<0?(u-p)/f:(u+p)/f,y:(u=i*h-r*o)<0?(u-p)/f:(u+p)/f}}function L(t,e){return t*e>0}function q(t,e,a){let l=t.x,r=t.y,i=[],n=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){n=Math.min(n,t.x),s=Math.min(s,t.y)}):(n=Math.min(n,e.x),s=Math.min(s,e.y));let h=l-t.width/2-n,o=r-t.height/2-s;for(let l=0;l<e.length;l++){let r=e[l],n=e[l<e.length-1?l+1:0],s=R(t,a,{x:h+r.x,y:o+r.y},{x:h+n.x,y:o+n.y});s&&i.push(s)}return i.length?(i.length>1&&i.sort(function(t,e){let l=t.x-a.x,r=t.y-a.y,i=Math.sqrt(l*l+r*r),n=e.x-a.x,s=e.y-a.y,h=Math.sqrt(n*n+s*s);return i<h?-1:i===h?0:1}),i[0]):t}(0,s.eW)(function(t,e){return t.intersect(e)},"intersectNode"),(0,s.eW)(N,"intersectEllipse"),(0,s.eW)(A,"intersectCircle"),(0,s.eW)(R,"intersectLine"),(0,s.eW)(L,"sameSign"),(0,s.eW)(q,"intersectPolygon");var _={circle:A,polygon:q,rect:m};function P(t,e){let{labelStyles:a}=(0,r.UG)(e);e.labelStyle=a;let l=y(e),i=l;l||(i="anchor");let h=t.insert("g").attr("class",i).attr("id",e.domId||e.id),{cssStyles:d}=e,c=o.Z.svg(h),f=(0,r._q)(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(f.roughness=0);let p=c.circle(0,0,2,f),u=h.insert(()=>p,":first-child");return u.attr("class","anchor").attr("style",(0,n.R7)(d)),g(e,u),e.intersect=function(t){return s.cM.info("Circle intersect",e,1,t),_.circle(e,1,t)},h}function Z(t,e,a,l,r,i,n){let s=Math.atan2(l-e,a-t),h=Math.sqrt(((a-t)/2/r)**2+((l-e)/2/i)**2);if(h>1)throw Error("The given radii are too small to create an arc between the points.");let o=Math.sqrt(1-h**2),d=(t+a)/2+o*i*Math.sin(s)*(n?-1:1),c=(e+l)/2-o*r*Math.cos(s)*(n?-1:1),g=Math.atan2((e-c)/i,(t-d)/r),y=Math.atan2((l-c)/i,(a-d)/r)-g;n&&y<0&&(y+=2*Math.PI),!n&&y>0&&(y-=2*Math.PI);let f=[];for(let t=0;t<20;t++){let e=g+t/19*y,a=d+r*Math.cos(e),l=c+i*Math.sin(e);f.push({x:a,y:l})}return f}async function U(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=n.width+e.padding+20,h=n.height+e.padding,c=h/2,p=c/(2.5+h/50),{cssStyles:u}=e,m=[{x:s/2,y:-h/2},{x:-s/2,y:-h/2},...Z(-s/2,-h/2,-s/2,h/2,p,c,!1),{x:s/2,y:h/2},...Z(s/2,h/2,s/2,-h/2,p,c,!0)],x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=f(m),$=x.path(b,w),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),k.attr("transform",`translate(${p/2}, 0)`),g(e,k),e.intersect=function(t){return _.polygon(e,m,t)},i}function G(t,e,a,l){return t.insert("polygon",":first-child").attr("points",l.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+a/2+")")}async function T(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=s.height+e.padding,c=s.width+e.padding+12,p=-h,u=[{x:12,y:p},{x:c,y:p},{x:c,y:0},{x:0,y:0},{x:0,y:p+12},{x:12,y:p}],{cssStyles:m}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(u),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),m&&a.attr("style",m)}else a=G(n,c,h,u);return i&&a.attr("style",i),g(e,a),e.intersect=function(t){return _.polygon(e,u,t)},n}function I(t,e){let{nodeStyles:a}=(0,r.UG)(e);e.label="";let l=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,n=Math.max(28,e.width??0),s=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}],h=o.Z.svg(l),d=(0,r._q)(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");let c=f(s),g=h.path(c,d),p=l.insert(()=>g,":first-child");return i&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",i),a&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",a),e.width=28,e.height=28,e.intersect=function(t){return _.polygon(e,s,t)},l}async function E(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:h,bbox:c,halfPadding:f}=await d(t,e,y(e)),p=c.width/2+f,{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(h),l=(0,r._q)(e,{}),i=t.circle(0,0,2*p,l);(a=h.insert(()=>i,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(u))}else a=h.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",p).attr("cx",0).attr("cy",0);return g(e,a),e.intersect=function(t){return s.cM.info("Circle intersect",e,p,t),_.circle(e,p,t)},h}function H(t){let e=Math.cos(Math.PI/4),a=Math.sin(Math.PI/4),l=2*t,r={x:l/2*e,y:l/2*a},i={x:-(l/2)*e,y:l/2*a},n={x:-(l/2)*e,y:-(l/2)*a},s={x:l/2*e,y:-(l/2)*a};return`M ${i.x},${i.y} L ${s.x},${s.y}
|
2
|
+
M ${r.x},${r.y} L ${n.x},${n.y}`}function V(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a,e.label="";let i=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),n=Math.max(30,e?.width??0),{cssStyles:h}=e,d=o.Z.svg(i),c=(0,r._q)(e,{});"handDrawn"!==e.look&&(c.roughness=0,c.fillStyle="solid");let f=d.circle(0,0,2*n,c),p=H(n),u=d.path(p,c),m=i.insert(()=>f,":first-child");return m.insert(()=>u),h&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",h),l&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",l),g(e,m),e.intersect=function(t){return s.cM.info("crossedCircle intersect",e,{radius:n,point:t}),_.circle(e,n,t)},i}function Y(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}async function j(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+(e.padding??0),c=n.height+(e.padding??0),p=Math.max(5,.1*c),{cssStyles:u}=e,m=[...Y(h/2,-c/2,p,30,-90,0),{x:-h/2-p,y:p},...Y(h/2+2*p,-p,p,20,-180,-270),...Y(h/2+2*p,p,p,20,-90,-180),{x:-h/2-p,y:-c/2},...Y(h/2,c/2,p,20,0,90)],x=[{x:h/2,y:-c/2-p},{x:-h/2,y:-c/2-p},...Y(h/2,-c/2,p,20,-90,0),{x:-h/2-p,y:-p},...Y(h/2+.1*h,-p,p,20,-180,-270),...Y(h/2+.1*h,p,p,20,-90,-180),{x:-h/2-p,y:c/2},...Y(h/2,c/2,p,20,0,90),{x:-h/2,y:c/2+p},{x:h/2,y:c/2+p}],w=o.Z.svg(i),b=(0,r._q)(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=f(m).replace("Z",""),k=w.path($,b),M=f(x),S=w.path(M,{...b}),D=i.insert("g",":first-child");return D.insert(()=>S,":first-child").attr("stroke-opacity",0),D.insert(()=>k,":first-child"),D.attr("class","text"),u&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),D.attr("transform",`translate(${p}, 0)`),s.attr("transform",`translate(${-h/2+p-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,D),e.intersect=function(t){return _.polygon(e,x,t)},i}function O(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:i,y:o})}return n}async function z(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+(e.padding??0),c=n.height+(e.padding??0),p=Math.max(5,.1*c),{cssStyles:u}=e,m=[...O(h/2,-c/2,p,20,-90,0),{x:h/2+p,y:-p},...O(h/2+2*p,-p,p,20,-180,-270),...O(h/2+2*p,p,p,20,-90,-180),{x:h/2+p,y:c/2},...O(h/2,c/2,p,20,0,90)],x=[{x:-h/2,y:-c/2-p},{x:h/2,y:-c/2-p},...O(h/2,-c/2,p,20,-90,0),{x:h/2+p,y:-p},...O(h/2+2*p,-p,p,20,-180,-270),...O(h/2+2*p,p,p,20,-90,-180),{x:h/2+p,y:c/2},...O(h/2,c/2,p,20,0,90),{x:h/2,y:c/2+p},{x:-h/2,y:c/2+p}],w=o.Z.svg(i),b=(0,r._q)(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=f(m).replace("Z",""),k=w.path($,b),M=f(x),S=w.path(M,{...b}),D=i.insert("g",":first-child");return D.insert(()=>S,":first-child").attr("stroke-opacity",0),D.insert(()=>k,":first-child"),D.attr("class","text"),u&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),D.attr("transform",`translate(${-p}, 0)`),s.attr("transform",`translate(${-h/2+(e.padding??0)/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,D),e.intersect=function(t){return _.polygon(e,x,t)},i}function F(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}async function X(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+(e.padding??0),c=n.height+(e.padding??0),p=Math.max(5,.1*c),{cssStyles:u}=e,m=[...F(h/2,-c/2,p,30,-90,0),{x:-h/2-p,y:p},...F(h/2+2*p,-p,p,20,-180,-270),...F(h/2+2*p,p,p,20,-90,-180),{x:-h/2-p,y:-c/2},...F(h/2,c/2,p,20,0,90)],x=[...F(-h/2+p+p/2,-c/2,p,20,-90,-180),{x:h/2-p/2,y:p},...F(-h/2-p/2,-p,p,20,0,90),...F(-h/2-p/2,p,p,20,-90,0),{x:h/2-p/2,y:-p},...F(-h/2+p+p/2,c/2,p,30,-180,-270)],w=[{x:h/2,y:-c/2-p},{x:-h/2,y:-c/2-p},...F(h/2,-c/2,p,20,-90,0),{x:-h/2-p,y:-p},...F(h/2+2*p,-p,p,20,-180,-270),...F(h/2+2*p,p,p,20,-90,-180),{x:-h/2-p,y:c/2},...F(h/2,c/2,p,20,0,90),{x:-h/2,y:c/2+p},{x:h/2-p-p/2,y:c/2+p},...F(-h/2+p+p/2,-c/2,p,20,-90,-180),{x:h/2-p/2,y:p},...F(-h/2-p/2,-p,p,20,0,90),...F(-h/2-p/2,p,p,20,-90,0),{x:h/2-p/2,y:-p},...F(-h/2+p+p/2,c/2,p,30,-180,-270)],b=o.Z.svg(i),$=(0,r._q)(e,{fill:"none"});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=f(m).replace("Z",""),M=b.path(k,$),S=f(x).replace("Z",""),D=b.path(S,$),W=f(w),v=b.path(W,{...$}),C=i.insert("g",":first-child");return C.insert(()=>v,":first-child").attr("stroke-opacity",0),C.insert(()=>M,":first-child"),C.insert(()=>D,":first-child"),C.attr("class","text"),u&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",l),C.attr("transform",`translate(${p-p/4}, 0)`),s.attr("transform",`translate(${-h/2+(e.padding??0)/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,C),e.intersect=function(t){return _.polygon(e,w,t)},i}async function J(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(80,(n.width+(e.padding??0)*2)*1.25,e?.width??0),h=Math.max(20,n.height+(e.padding??0)*2,e?.height??0),c=h/2,{cssStyles:p}=e,m=o.Z.svg(i),x=(0,r._q)(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=s-c,b=h/4,$=[{x:w,y:0},{x:b,y:0},{x:0,y:h/2},{x:b,y:h},{x:w,y:h},...u(-w,-h/2,c,50,270,90)],k=f($),M=m.path(k,x),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",p),l&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",l),S.attr("transform",`translate(${-s/2}, ${-h/2})`),g(e,S),e.intersect=function(t){return _.polygon(e,$,t)},i}(0,s.eW)(P,"anchor"),(0,s.eW)(Z,"generateArcPoints"),(0,s.eW)(U,"bowTieRect"),(0,s.eW)(G,"insertPolygonShape"),(0,s.eW)(T,"card"),(0,s.eW)(I,"choice"),(0,s.eW)(E,"circle"),(0,s.eW)(H,"createLine"),(0,s.eW)(V,"crossedCircle"),(0,s.eW)(Y,"generateCirclePoints"),(0,s.eW)(j,"curlyBraceLeft"),(0,s.eW)(O,"generateCirclePoints"),(0,s.eW)(z,"curlyBraceRight"),(0,s.eW)(F,"generateCirclePoints"),(0,s.eW)(X,"curlyBraces"),(0,s.eW)(J,"curvedTrapezoid");var K=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createCylinderPathD"),Q=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createOuterCylinderPathD"),tt=(0,s.eW)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function te(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:c}=await d(t,e,y(e)),f=Math.max(h.width+e.padding,e.width??0),p=f/2,u=p/(2.5+f/50),m=Math.max(h.height+u+e.padding,e.height??0),{cssStyles:x}=e;if("handDrawn"===e.look){let t=o.Z.svg(s),l=Q(0,0,f,m,p,u),i=tt(0,u,f,m,p,u),n=t.path(l,(0,r._q)(e,{})),h=t.path(i,(0,r._q)(e,{fill:"none"}));a=s.insert(()=>h,":first-child"),(a=s.insert(()=>n,":first-child")).attr("class","basic label-container"),x&&a.attr("style",x)}else{let t=K(0,0,f,m,p,u);a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(x)).attr("style",i)}return a.attr("label-offset-y",u),a.attr("transform",`translate(${-f/2}, ${-(m/2+u)})`),g(e,a),c.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+(e.padding??0)/1.5-(h.y-(h.top??0))})`),e.intersect=function(t){let a=_.rect(e,t),l=a.x-(e.x??0);if(0!=p&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-u)){let r=u*u*(1-l*l/(p*p));r>0&&(r=Math.sqrt(r)),r=u-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},s}async function ta(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+e.padding,c=n.height+e.padding,f=.2*c,p=-h/2,u=-c/2-f/2,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=x.polygon([{x:p,y:u+f},{x:-p,y:u+f},{x:-p,y:-u},{x:p,y:-u},{x:p,y:u},{x:-p,y:u},{x:-p,y:u+f}].map(t=>[t.x,t.y]),w),$=i.insert(()=>b,":first-child");return $.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",l),s.attr("transform",`translate(${p+(e.padding??0)/2-(n.x-(n.left??0))}, ${u+f+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,$),e.intersect=function(t){return _.rect(e,t)},i}async function tl(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:h,bbox:c,halfPadding:f}=await d(t,e,y(e)),p=c.width/2+f+5,u=c.width/2+f,{cssStyles:m}=e;if("handDrawn"===e.look){let t=o.Z.svg(h),l=(0,r._q)(e,{roughness:.2,strokeWidth:2.5}),i=(0,r._q)(e,{roughness:.2,strokeWidth:1.5}),s=t.circle(0,0,2*p,l),d=t.circle(0,0,2*u,i);(a=h.insert("g",":first-child")).attr("class",(0,n.R7)(e.cssClasses)).attr("style",(0,n.R7)(m)),a.node()?.appendChild(s),a.node()?.appendChild(d)}else{let t=(a=h.insert("g",":first-child")).insert("circle",":first-child"),e=a.insert("circle");a.attr("class","basic label-container").attr("style",i),t.attr("class","outer-circle").attr("style",i).attr("r",p).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",i).attr("r",u).attr("cx",0).attr("cy",0)}return g(e,a),e.intersect=function(t){return s.cM.info("DoubleCircle intersect",e,p,t),_.circle(e,p,t)},h}function tr(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.label="",e.labelStyle=l;let n=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:h}=e,d=o.Z.svg(n),{nodeBorder:c}=a,f=(0,r._q)(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(f.roughness=0);let p=d.circle(0,0,14,f),u=n.insert(()=>p,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),h&&h.length>0&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",h),i&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",i),g(e,u),e.intersect=function(t){return s.cM.info("filledCircle intersect",e,{radius:7,point:t}),_.circle(e,7,t)},n}async function ti(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:h}=await d(t,e,y(e)),c=n.width+(e.padding??0),p=c+n.height,u=c+n.height,m=[{x:0,y:-p},{x:u,y:-p},{x:u/2,y:0}],{cssStyles:x}=e,w=o.Z.svg(i),b=(0,r._q)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=f(m),k=w.path($,b),M=i.insert(()=>k,":first-child").attr("transform",`translate(${-p/2}, ${p/2})`);return x&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",x),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),e.width=c,e.height=p,g(e,M),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-p/2+(e.padding??0)/2+(n.y-(n.top??0))})`),e.intersect=function(t){return s.cM.info("Triangle intersect",e,m,t),_.polygon(e,m,t)},i}function tn(t,e,{dir:a,config:{state:l,themeVariables:i}}){let{nodeStyles:n}=(0,r.UG)(e);e.label="";let s=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:h}=e,d=Math.max(70,e?.width??0),c=Math.max(10,e?.height??0);"LR"===a&&(d=Math.max(10,e?.width??0),c=Math.max(70,e?.height??0));let f=-1*d/2,p=-1*c/2,u=o.Z.svg(s),m=(0,r._q)(e,{stroke:i.lineColor,fill:i.lineColor});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let x=u.rectangle(f,p,d,c,m),w=s.insert(()=>x,":first-child");h&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",h),n&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",n),g(e,w);let b=l?.padding??0;return e.width&&e.height&&(e.width+=b/2||0,e.height+=b/2||0),e.intersect=function(t){return _.rect(e,t)},s}async function ts(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),h=Math.max(80,n.width+(e.padding??0)*2,e?.width??0),c=Math.max(50,n.height+(e.padding??0)*2,e?.height??0),p=c/2,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-h/2,y:-c/2},{x:h/2-p,y:-c/2},...u(-h/2+p,0,p,50,90,270),{x:h/2-p,y:c/2},{x:-h/2,y:c/2}],$=f(b),k=x.path($,w),M=i.insert(()=>k,":first-child");return M.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",m),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),g(e,M),e.intersect=function(t){return s.cM.info("Pill intersect",e,{radius:p,point:t}),_.polygon(e,b,t)},i}(0,s.eW)(te,"cylinder"),(0,s.eW)(ta,"dividedRectangle"),(0,s.eW)(tl,"doublecircle"),(0,s.eW)(tr,"filledCircle"),(0,s.eW)(ti,"flippedTriangle"),(0,s.eW)(tn,"forkJoin"),(0,s.eW)(ts,"halfRoundedRectangle");var th=(0,s.eW)((t,e,a,l,r)=>`M${t+r},${e} L${t+a-r},${e} L${t+a},${e-l/2} L${t+a-r},${e-l} L${t+r},${e-l} L${t},${e-l/2} Z`,"createHexagonPathD");async function to(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=s.height+e.padding,c=h/4,f=s.width+2*c+e.padding,p=[{x:c,y:0},{x:f-c,y:0},{x:f,y:-h/2},{x:f-c,y:-h},{x:c,y:-h},{x:0,y:-h/2}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=th(0,0,f,h,c),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-f/2}, ${h/2})`),u&&a.attr("style",u)}else a=G(n,f,h,p);return i&&a.attr("style",i),e.width=f,e.height=h,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}async function td(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.label="",e.labelStyle=a;let{shapeSvg:i}=await d(t,e,y(e)),n=Math.max(30,e?.width??0),h=Math.max(30,e?.height??0),{cssStyles:c}=e,p=o.Z.svg(i),u=(0,r._q)(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=[{x:0,y:0},{x:n,y:0},{x:0,y:h},{x:n,y:h}],x=f(m),w=p.path(x,u),b=i.insert(()=>w,":first-child");return b.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",c),l&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",l),b.attr("transform",`translate(${-n/2}, ${-h/2})`),g(e,b),e.intersect=function(t){return s.cM.info("Pill intersect",e,{points:m}),_.polygon(e,m,t)},i}async function tc(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48),c=l?.wrappingWidth;e.width=Math.max(h,c??0);let{shapeSvg:y,bbox:f,label:p}=await d(t,e,"icon-shape default"),u="t"===e.pos,{nodeBorder:m}=a,{stylesMap:x}=(0,r.dT)(e),w=-h/2,b=-h/2,$=e.label?8:0,k=o.Z.svg(y),M=(0,r._q)(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");let S=k.rectangle(w,b,h,h,M),D=Math.max(h,f.width),W=h+f.height+$,v=k.rectangle(-D/2,-W/2,D,W,{...M,fill:"transparent",stroke:"none"}),C=y.insert(()=>S,":first-child"),B=y.insert(()=>v);if(e.icon){let t=y.append("g");t.html(`<g>${await (0,i.s4)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${u?f.height/2+$/2-r/2-s:-f.height/2-$/2-r/2-s})`),t.attr("style",`color: ${x.get("stroke")??m};`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${u?-W/2:W/2-f.height})`),C.attr("transform",`translate(0,${u?f.height/2+$/2:-f.height/2-$/2})`),g(e,B),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return _.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=u?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+$},{x:a+h/2,y:l-r/2+f.height+$},{x:a+h/2,y:l+r/2},{x:a-h/2,y:l+r/2},{x:a-h/2,y:l-r/2+f.height+$},{x:a-f.width/2,y:l-r/2+f.height+$}]:[{x:a-h/2,y:l-r/2},{x:a+h/2,y:l-r/2},{x:a+h/2,y:l-r/2+h},{x:a+f.width/2,y:l-r/2+h},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+h},{x:a-h/2,y:l-r/2+h}],_.polygon(e,i,t)},y}async function tg(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48),c=l?.wrappingWidth;e.width=Math.max(h,c??0);let{shapeSvg:y,bbox:f,label:p}=await d(t,e,"icon-shape default"),u=e.label?8:0,m="t"===e.pos,{nodeBorder:x,mainBkg:w}=a,{stylesMap:b}=(0,r.dT)(e),$=o.Z.svg(y),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=b.get("fill");k.stroke=M??w;let S=y.append("g");e.icon&&S.html(`<g>${await (0,i.s4)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let D=S.node().getBBox(),W=D.width,v=D.height,C=D.x,B=D.y,N=Math.max(W,v)*Math.SQRT2+40,A=$.circle(0,0,N,k),R=Math.max(N,f.width),L=N+f.height+u,q=$.rectangle(-R/2,-L/2,R,L,{...k,fill:"transparent",stroke:"none"}),P=y.insert(()=>A,":first-child"),Z=y.insert(()=>q);return S.attr("transform",`translate(${-W/2-C},${m?f.height/2+u/2-v/2-B:-f.height/2-u/2-v/2-B})`),S.attr("style",`color: ${b.get("stroke")??x};`),p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-L/2:L/2-f.height})`),P.attr("transform",`translate(0,${m?f.height/2+u/2:-f.height/2-u/2})`),g(e,Z),e.intersect=function(t){return s.cM.info("iconSquare intersect",e,t),_.rect(e,t)},y}async function ty(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48),c=l?.wrappingWidth;e.width=Math.max(h,c??0);let{shapeSvg:y,bbox:f,halfPadding:p,label:u}=await d(t,e,"icon-shape default"),m="t"===e.pos,x=h+2*p,w=h+2*p,{nodeBorder:b,mainBkg:k}=a,{stylesMap:M}=(0,r.dT)(e),S=e.label?8:0,D=o.Z.svg(y),W=(0,r._q)(e,{});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=M.get("fill");W.stroke=v??k;let C=D.path($(-w/2,-x/2,w,x,5),W),B=Math.max(w,f.width),N=x+f.height+S,A=D.rectangle(-B/2,-N/2,B,N,{...W,fill:"transparent",stroke:"none"}),R=y.insert(()=>C,":first-child").attr("class","icon-shape2"),L=y.insert(()=>A);if(e.icon){let t=y.append("g");t.html(`<g>${await (0,i.s4)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${m?f.height/2+S/2-r/2-s:-f.height/2-S/2-r/2-s})`),t.attr("style",`color: ${M.get("stroke")??b};`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-N/2:N/2-f.height})`),R.attr("transform",`translate(0,${m?f.height/2+S/2:-f.height/2-S/2})`),g(e,L),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return _.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=m?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+S},{x:a+w/2,y:l-r/2+f.height+S},{x:a+w/2,y:l+r/2},{x:a-w/2,y:l+r/2},{x:a-w/2,y:l-r/2+f.height+S},{x:a-f.width/2,y:l-r/2+f.height+S}]:[{x:a-w/2,y:l-r/2},{x:a+w/2,y:l-r/2},{x:a+w/2,y:l-r/2+x},{x:a+f.width/2,y:l-r/2+x},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+x},{x:a-w/2,y:l-r/2+x}],_.polygon(e,i,t)},y}async function tf(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48),c=l?.wrappingWidth;e.width=Math.max(h,c??0);let{shapeSvg:y,bbox:f,halfPadding:p,label:u}=await d(t,e,"icon-shape default"),m="t"===e.pos,x=h+2*p,w=h+2*p,{nodeBorder:b,mainBkg:k}=a,{stylesMap:M}=(0,r.dT)(e),S=e.label?8:0,D=o.Z.svg(y),W=(0,r._q)(e,{});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=M.get("fill");W.stroke=v??k;let C=D.path($(-w/2,-x/2,w,x,.1),W),B=Math.max(w,f.width),N=x+f.height+S,A=D.rectangle(-B/2,-N/2,B,N,{...W,fill:"transparent",stroke:"none"}),R=y.insert(()=>C,":first-child"),L=y.insert(()=>A);if(e.icon){let t=y.append("g");t.html(`<g>${await (0,i.s4)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${m?f.height/2+S/2-r/2-s:-f.height/2-S/2-r/2-s})`),t.attr("style",`color: ${M.get("stroke")??b};`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-N/2:N/2-f.height})`),R.attr("transform",`translate(0,${m?f.height/2+S/2:-f.height/2-S/2})`),g(e,L),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return _.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=m?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+S},{x:a+w/2,y:l-r/2+f.height+S},{x:a+w/2,y:l+r/2},{x:a-w/2,y:l+r/2},{x:a-w/2,y:l-r/2+f.height+S},{x:a-f.width/2,y:l-r/2+f.height+S}]:[{x:a-w/2,y:l-r/2},{x:a+w/2,y:l-r/2},{x:a+w/2,y:l-r/2+x},{x:a+f.width/2,y:l-r/2+x},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+x},{x:a-w/2,y:l-r/2+x}],_.polygon(e,i,t)},y}async function tp(t,e,{config:{flowchart:a}}){let l=new Image;l.src=e?.img??"",await l.decode();let i=Number(l.naturalWidth.toString().replace("px","")),n=Number(l.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/n;let{labelStyles:h}=(0,r.UG)(e);e.labelStyle=h;let c=a?.wrappingWidth;e.defaultWidth=a?.wrappingWidth;let y=Math.max(e.label?c??0:0,e?.assetWidth??i),f="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:y,p="on"===e.constraint?f/e.imageAspectRatio:e?.assetHeight??n;e.width=Math.max(f,c??0);let{shapeSvg:u,bbox:m,label:x}=await d(t,e,"image-shape default"),w="t"===e.pos,b=-f/2,$=e.label?8:0,k=o.Z.svg(u),M=(0,r._q)(e,{});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");let S=k.rectangle(b,-p/2,f,p,M),D=Math.max(f,m.width),W=p+m.height+$,v=k.rectangle(-D/2,-W/2,D,W,{...M,fill:"none",stroke:"none"}),C=u.insert(()=>S,":first-child"),B=u.insert(()=>v);if(e.img){let t=u.append("image");t.attr("href",e.img),t.attr("width",f),t.attr("height",p),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-f/2},${w?W/2-p:-W/2})`)}return x.attr("transform",`translate(${-m.width/2-(m.x-(m.left??0))},${w?-p/2-m.height/2-$/2:p/2-m.height/2+$/2})`),C.attr("transform",`translate(0,${w?m.height/2+$/2:-m.height/2-$/2})`),g(e,B),e.intersect=function(t){if(s.cM.info("iconSquare intersect",e,t),!e.label)return _.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=w?[{x:a-m.width/2,y:l-r/2},{x:a+m.width/2,y:l-r/2},{x:a+m.width/2,y:l-r/2+m.height+$},{x:a+f/2,y:l-r/2+m.height+$},{x:a+f/2,y:l+r/2},{x:a-f/2,y:l+r/2},{x:a-f/2,y:l-r/2+m.height+$},{x:a-m.width/2,y:l-r/2+m.height+$}]:[{x:a-f/2,y:l-r/2},{x:a+f/2,y:l-r/2},{x:a+f/2,y:l-r/2+p},{x:a+m.width/2,y:l-r/2+p},{x:a+m.width/2/2,y:l+r/2},{x:a-m.width/2,y:l+r/2},{x:a-m.width/2,y:l-r/2+p},{x:a-f/2,y:l-r/2+p}],_.polygon(e,i,t)},u}async function tu(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=Math.max(s.width+(e.padding??0)*2,e?.width??0),c=Math.max(s.height+(e.padding??0)*2,e?.height??0),p=[{x:0,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:-3*c/6,y:-c}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&a.attr("style",u)}else a=G(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}async function tm(t,e,a){let l;let{labelStyles:i,nodeStyles:s}=(0,r.UG)(e);e.labelStyle=i;let{shapeSvg:h,bbox:c}=await d(t,e,y(e)),f=Math.max(c.width+2*a.labelPaddingX,e?.width||0),p=Math.max(c.height+2*a.labelPaddingY,e?.height||0),u=-f/2,m=-p/2,{rx:x,ry:w}=e,{cssStyles:b}=e;if(a?.rx&&a.ry&&(x=a.rx,w=a.ry),"handDrawn"===e.look){let t=o.Z.svg(h),a=(0,r._q)(e,{}),i=x||w?t.path($(u,m,f,p,x||0),a):t.rectangle(u,m,f,p,a);(l=h.insert(()=>i,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(b))}else(l=h.insert("rect",":first-child")).attr("class","basic label-container").attr("style",s).attr("rx",(0,n.R7)(x)).attr("ry",(0,n.R7)(w)).attr("x",u).attr("y",m).attr("width",f).attr("height",p);return g(e,l),e.intersect=function(t){return _.rect(e,t)},h}async function tx(t,e){let{shapeSvg:a,bbox:l,label:r}=await d(t,e,"label"),i=a.insert("rect",":first-child");return i.attr("width",.1).attr("height",.1),a.attr("class","label edgeLabel"),r.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),g(e,i),e.intersect=function(t){return _.rect(e,t)},a}async function tw(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=Math.max(s.width+(e.padding??0),e?.width??0),c=Math.max(s.height+(e.padding??0),e?.height??0),p=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&a.attr("style",u)}else a=G(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}async function tb(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=Math.max(s.width+(e.padding??0),e?.width??0),c=Math.max(s.height+(e.padding??0),e?.height??0),p=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&a.attr("style",u)}else a=G(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}function t$(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.label="",e.labelStyle=a;let i=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:n}=e,h=Math.max(35,e?.width??0),d=Math.max(35,e?.height??0),c=[{x:h,y:0},{x:0,y:d+3.5},{x:h-14,y:d+3.5},{x:0,y:2*d},{x:h,y:d-3.5},{x:14,y:d-3.5}],p=o.Z.svg(i),u=(0,r._q)(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=f(c),x=p.path(m,u),w=i.insert(()=>x,":first-child");return n&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",n),l&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",l),w.attr("transform",`translate(-${h/2},${-d})`),g(e,w),e.intersect=function(t){return s.cM.info("lightningBolt intersect",e,t),_.polygon(e,c,t)},i}(0,s.eW)(to,"hexagon"),(0,s.eW)(td,"hourglass"),(0,s.eW)(tc,"icon"),(0,s.eW)(tg,"iconCircle"),(0,s.eW)(ty,"iconRounded"),(0,s.eW)(tf,"iconSquare"),(0,s.eW)(tp,"imageSquare"),(0,s.eW)(tu,"inv_trapezoid"),(0,s.eW)(tm,"drawRect"),(0,s.eW)(tx,"labelRect"),(0,s.eW)(tw,"lean_left"),(0,s.eW)(tb,"lean_right"),(0,s.eW)(t$,"lightningBolt");var tk=(0,s.eW)((t,e,a,l,r,i,n)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createCylinderPathD"),tM=(0,s.eW)((t,e,a,l,r,i,n)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createOuterCylinderPathD"),tS=(0,s.eW)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function tD(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:c}=await d(t,e,y(e)),f=Math.max(h.width+(e.padding??0),e.width??0),p=f/2,u=p/(2.5+f/50),m=Math.max(h.height+u+(e.padding??0),e.height??0),x=.1*m,{cssStyles:w}=e;if("handDrawn"===e.look){let t=o.Z.svg(s),l=tM(0,0,f,m,p,u,x),i=tS(0,u,f,m,p,u),n=(0,r._q)(e,{}),h=t.path(l,n),d=t.path(i,n);s.insert(()=>d,":first-child").attr("class","line"),(a=s.insert(()=>h,":first-child")).attr("class","basic label-container"),w&&a.attr("style",w)}else{let t=tk(0,0,f,m,p,u,x);a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(w)).attr("style",i)}return a.attr("label-offset-y",u),a.attr("transform",`translate(${-f/2}, ${-(m/2+u)})`),g(e,a),c.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+u-(h.y-(h.top??0))})`),e.intersect=function(t){let a=_.rect(e,t),l=a.x-(e.x??0);if(0!=p&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-u)){let r=u*u*(1-l*l/(p*p));r>0&&(r=Math.sqrt(r)),r=u-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},s}async function tW(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),f=c/4,u=c+f,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...p(-h/2-h/2*.1,u/2,h/2+h/2*.1,u/2,f,.8),{x:h/2+h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:-u/2},{x:-h/2,y:-u/2},{x:-h/2,y:u/2*1.1},{x:-h/2,y:-u/2}],$=x.polygon(b.map(t=>[t.x,t.y]),w),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),k.attr("transform",`translate(0,${-f/2})`),s.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)-f/2-(n.y-(n.top??0))})`),g(e,k),e.intersect=function(t){return _.polygon(e,b,t)},i}async function tv(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),p=-h/2,u=-c/2,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{}),b=[{x:p-5,y:u+5},{x:p-5,y:u+c+5},{x:p+h-5,y:u+c+5},{x:p+h-5,y:u+c},{x:p+h,y:u+c},{x:p+h,y:u+c-5},{x:p+h+5,y:u+c-5},{x:p+h+5,y:u-5},{x:p+5,y:u-5},{x:p+5,y:u},{x:p,y:u},{x:p,y:u+5}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let $=f(b),k=x.path($,w),M=f([{x:p,y:u+5},{x:p+h-5,y:u+5},{x:p+h-5,y:u+c},{x:p+h,y:u+c},{x:p+h,y:u},{x:p,y:u}]),S=x.path(M,{...w,fill:"none"}),D=i.insert(()=>S,":first-child");return D.insert(()=>k,":first-child"),D.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),s.attr("transform",`translate(${-(n.width/2)-5-(n.x-(n.left??0))}, ${-(n.height/2)+5-(n.y-(n.top??0))})`),g(e,D),e.intersect=function(t){return _.polygon(e,b,t)},i}async function tC(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),u=c/4,m=c+u,x=-h/2,w=-m/2,{cssStyles:b}=e,$=p(x-5,w+m+5,x+h-5,w+m+5,u,.8),k=$?.[$.length-1],M=[{x:x-5,y:w+5},{x:x-5,y:w+m+5},...$,{x:x+h-5,y:k.y-5},{x:x+h,y:k.y-5},{x:x+h,y:k.y-10},{x:x+h+5,y:k.y-10},{x:x+h+5,y:w-5},{x:x+5,y:w-5},{x:x+5,y:w},{x,y:w},{x,y:w+5}],S=[{x,y:w+5},{x:x+h-5,y:w+5},{x:x+h-5,y:k.y-5},{x:x+h,y:k.y-5},{x:x+h,y:w},{x,y:w}],D=o.Z.svg(i),W=(0,r._q)(e,{});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=f(M),C=D.path(v,W),B=f(S),N=D.path(B,W),A=i.insert(()=>C,":first-child");return A.insert(()=>N),A.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",b),l&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",l),A.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-(n.width/2)-5-(n.x-(n.left??0))}, ${-(n.height/2)+5-u/2-(n.y-(n.top??0))})`),g(e,A),e.intersect=function(t){return _.polygon(e,M,t)},i}async function tB(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l,e.useHtmlLabels||s.iE().flowchart?.htmlLabels!==!1||(e.centerLabel=!0);let{shapeSvg:n,bbox:h,label:c}=await d(t,e,y(e)),f=Math.max(h.width+(e.padding??0)*2,e?.width??0),p=Math.max(h.height+(e.padding??0)*2,e?.height??0),{cssStyles:u}=e,m=o.Z.svg(n),x=(0,r._q)(e,{fill:a.noteBkgColor,stroke:a.noteBorderColor});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=m.rectangle(-f/2,-p/2,f,p,x),b=n.insert(()=>w,":first-child");return b.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",u),i&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",i),c.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),g(e,b),e.intersect=function(t){return _.rect(e,t)},n}(0,s.eW)(tD,"linedCylinder"),(0,s.eW)(tW,"linedWaveEdgedRect"),(0,s.eW)(tv,"multiRect"),(0,s.eW)(tC,"multiWaveEdgedRectangle"),(0,s.eW)(tB,"note");var tN=(0,s.eW)((t,e,a)=>`M${t+a/2},${e} L${t+a},${e-a/2} L${t+a/2},${e-a} L${t},${e-a/2} Z`,"createDecisionBoxPathD");async function tA(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:h}=await d(t,e,y(e)),c=h.width+e.padding+(h.height+e.padding),f=[{x:c/2,y:0},{x:c,y:-c/2},{x:c/2,y:-c},{x:0,y:-c/2}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=tN(0,0,c),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`),p&&a.attr("style",p)}else a=G(n,c,c,f);return i&&a.attr("style",i),g(e,a),e.intersect=function(t){return s.cM.debug("APA12 Intersect called SPLIT\npoint:",t,"\nnode:\n",e,"\nres:",_.polygon(e,f,t)),_.polygon(e,f,t)},n}async function tR(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0),e?.width??0),c=Math.max(n.height+(e.padding??0),e?.height??0),p=-h/2,u=-c/2,m=u/2,x=[{x:p+m,y:u},{x:p,y:0},{x:p+m,y:-u},{x:-p,y:-u},{x:-p,y:u}],{cssStyles:w}=e,b=o.Z.svg(i),$=(0,r._q)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=f(x),M=b.path(k,$),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),w&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",w),l&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",l),S.attr("transform",`translate(${-m/2},0)`),s.attr("transform",`translate(${-m/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),g(e,S),e.intersect=function(t){return _.polygon(e,x,t)},i}async function tL(t,e){let a,l,i;let{labelStyles:n,nodeStyles:d}=(0,r.UG)(e);e.labelStyle=n,a=e.cssClasses?"node "+e.cssClasses:"node default";let c=t.insert("g").attr("class",a).attr("id",e.domId||e.id),y=c.insert("g"),f=c.insert("g").attr("class","label").attr("style",d),p=e.description,u=e.label,m=f.node().appendChild(await b(u,e.labelStyle,!0,!0)),x={width:0,height:0};if((0,s.ku)(s.nV()?.flowchart?.htmlLabels)){let t=m.children[0],e=(0,h.Ys)(m);x=t.getBoundingClientRect(),e.attr("width",x.width),e.attr("height",x.height)}s.cM.info("Text 2",p);let w=p||[],k=m.getBBox(),M=f.node().appendChild(await b(w.join?w.join("<br/>"):w,e.labelStyle,!0,!0)),S=M.children[0],D=(0,h.Ys)(M);x=S.getBoundingClientRect(),D.attr("width",x.width),D.attr("height",x.height);let W=(e.padding||0)/2;(0,h.Ys)(M).attr("transform","translate( "+(x.width>k.width?0:(k.width-x.width)/2)+", "+(k.height+W+5)+")"),(0,h.Ys)(m).attr("transform","translate( "+(x.width<k.width?0:-(k.width-x.width)/2)+", 0)"),x=f.node().getBBox(),f.attr("transform","translate("+-x.width/2+", "+(-x.height/2-W+3)+")");let v=x.width+(e.padding||0),C=x.height+(e.padding||0),B=-x.width/2-W,N=-x.height/2-W;if("handDrawn"===e.look){let t=o.Z.svg(c),a=(0,r._q)(e,{}),n=t.path($(B,N,v,C,e.rx||0),a),h=t.line(-x.width/2-W,-x.height/2-W+k.height+W,x.width/2+W,-x.height/2-W+k.height+W,a);i=c.insert(()=>(s.cM.debug("Rough node insert CXC",n),h),":first-child"),l=c.insert(()=>(s.cM.debug("Rough node insert CXC",n),n),":first-child")}else l=y.insert("rect",":first-child"),i=y.insert("line"),l.attr("class","outer title-state").attr("style",d).attr("x",-x.width/2-W).attr("y",-x.height/2-W).attr("width",x.width+(e.padding||0)).attr("height",x.height+(e.padding||0)),i.attr("class","divider").attr("x1",-x.width/2-W).attr("x2",x.width/2+W).attr("y1",-x.height/2-W+k.height+W).attr("y2",-x.height/2-W+k.height+W);return g(e,l),e.intersect=function(t){return _.rect(e,t)},c}async function tq(t,e){let a={rx:5,ry:5,classes:"",labelPaddingX:1*(e?.padding||0),labelPaddingY:1*(e?.padding||0)};return tm(t,e,a)}async function t_(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:s,label:h}=await d(t,e,y(e)),c=e?.padding??0,f=Math.max(s.width+(e.padding??0)*2,e?.width??0),p=Math.max(s.height+(e.padding??0)*2,e?.height??0),u=-s.width/2-c,m=-s.height/2-c,{cssStyles:x}=e,w=o.Z.svg(i),b=(0,r._q)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=w.polygon([{x:u,y:m},{x:u+f+8,y:m},{x:u+f+8,y:m+p},{x:u-8,y:m+p},{x:u-8,y:m},{x:u,y:m},{x:u,y:m+p}].map(t=>[t.x,t.y]),b),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container").attr("style",(0,n.R7)(x)),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),x&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),h.attr("transform",`translate(${-f/2+4+(e.padding??0)-(s.x-(s.left??0))},${-p/2+(e.padding??0)-(s.y-(s.top??0))})`),g(e,k),e.intersect=function(t){return _.rect(e,t)},i}async function tP(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),p=-h/2,u=-c/2,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:p,y:u},{x:p,y:u+c},{x:p+h,y:u+c},{x:p+h,y:u-c/2}],$=f(b),k=x.path($,w),M=i.insert(()=>k,":first-child");return M.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",m),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),M.attr("transform",`translate(0, ${c/4})`),s.attr("transform",`translate(${-h/2+(e.padding??0)-(n.x-(n.left??0))}, ${-c/4+(e.padding??0)-(n.y-(n.top??0))})`),g(e,M),e.intersect=function(t){return _.polygon(e,b,t)},i}async function tZ(t,e){let a={rx:0,ry:0,classes:"",labelPaddingX:2*(e?.padding||0),labelPaddingY:1*(e?.padding||0)};return tm(t,e,a)}async function tU(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h}=await d(t,e,y(e)),c=h.height+e.padding,f=h.width+c/4+e.padding,{cssStyles:p}=e;if("handDrawn"===e.look){let t=o.Z.svg(s),l=(0,r._q)(e,{}),i=$(-f/2,-c/2,f,c,c/2),h=t.path(i,l);(a=s.insert(()=>h,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(p))}else(a=s.insert("rect",":first-child")).attr("class","basic label-container").attr("style",i).attr("rx",c/2).attr("ry",c/2).attr("x",-f/2).attr("y",-c/2).attr("width",f).attr("height",c);return g(e,a),e.intersect=function(t){return _.rect(e,t)},s}async function tG(t,e){return tm(t,e,{rx:5,ry:5,classes:"flowchart-node"})}function tT(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{cssStyles:n}=e,{lineColor:s,stateBorder:h,nodeBorder:d}=a,c=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),y=o.Z.svg(c),f=(0,r._q)(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");let p=y.circle(0,0,14,{...f,stroke:s,strokeWidth:2}),u=h??d,m=y.circle(0,0,5,{...f,fill:u,stroke:u,strokeWidth:2,fillStyle:"solid"}),x=c.insert(()=>p,":first-child");return x.insert(()=>m),n&&x.selectAll("path").attr("style",n),i&&x.selectAll("path").attr("style",i),g(e,x),e.intersect=function(t){return _.circle(e,7,t)},c}function tI(t,e,{config:{themeVariables:a}}){let l;let{lineColor:i}=a,n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);if("handDrawn"===e.look){let t=o.Z.svg(n).circle(0,0,14,(0,r.TA)(i));(l=n.insert(()=>t)).attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else(l=n.insert("circle",":first-child")).attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return g(e,l),e.intersect=function(t){return _.circle(e,7,t)},n}async function tE(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:s}=await d(t,e,y(e)),h=(e?.padding||0)/2,c=s.width+e.padding,f=s.height+e.padding,p=-s.width/2-h,u=-s.height/2-h,m=[{x:0,y:0},{x:c,y:0},{x:c,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:c+8,y:0},{x:c+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if("handDrawn"===e.look){let t=o.Z.svg(i),a=(0,r._q)(e,{}),l=t.rectangle(p-8,u,c+16,f,a),s=t.line(p,u,p,u+f,a),h=t.line(p+c,u,p+c,u+f,a);i.insert(()=>s,":first-child"),i.insert(()=>h,":first-child");let d=i.insert(()=>l,":first-child"),{cssStyles:y}=e;d.attr("class","basic label-container").attr("style",(0,n.R7)(y)),g(e,d)}else{let t=G(i,c,f,m);l&&t.attr("style",l),g(e,t)}return e.intersect=function(t){return _.polygon(e,m,t)},i}async function tH(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(n.width+(e.padding??0)*2,e?.width??0),h=Math.max(n.height+(e.padding??0)*2,e?.height??0),c=-s/2,p=-h/2,u=.2*h,{cssStyles:m}=e,x=o.Z.svg(i),w=(0,r._q)(e,{}),b=[{x:c-u/2,y:p},{x:c+s+u/2,y:p},{x:c+s+u/2,y:p+h},{x:c-u/2,y:p+h}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let $=f(b),k=x.path($,w),M=f([{x:c+s-u/2,y:p+h},{x:c+s+u/2,y:p+h},{x:c+s+u/2,y:p+h-.2*h}]),S=x.path(M,{...w,fillStyle:"solid"}),D=i.insert(()=>S,":first-child");return D.insert(()=>k,":first-child"),D.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),g(e,D),e.intersect=function(t){return _.polygon(e,b,t)},i}async function tV(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),u=c/4,m=.2*h,x=.2*c,w=c+u,{cssStyles:b}=e,$=o.Z.svg(i),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=[{x:-h/2-h/2*.1,y:w/2},...p(-h/2-h/2*.1,w/2,h/2+h/2*.1,w/2,u,.8),{x:h/2+h/2*.1,y:-w/2},{x:-h/2-h/2*.1,y:-w/2}],S=-h/2+h/2*.1,D=-w/2-.4*x,W=[{x:S+h-m,y:(D+c)*1.4},{x:S+h,y:D+c-x},{x:S+h,y:(D+c)*.9},...p(S+h,(D+c)*1.3,S+h-m,(D+c)*1.5,-(.03*c),.5)],v=f(M),C=$.path(v,k),B=f(W),N=$.path(B,{...k,fillStyle:"solid"}),A=i.insert(()=>N,":first-child");return A.insert(()=>C,":first-child"),A.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",b),l&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",l),A.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-h/2+(e.padding??0)-(n.x-(n.left??0))},${-c/2+(e.padding??0)-u/2-(n.y-(n.top??0))})`),g(e,A),e.intersect=function(t){return _.polygon(e,M,t)},i}async function tY(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(n.width+e.padding,e?.width||0),h=Math.max(n.height+e.padding,e?.height||0),o=i.insert("rect",":first-child");return o.attr("class","text").attr("style",l).attr("rx",0).attr("ry",0).attr("x",-s/2).attr("y",-h/2).attr("width",s).attr("height",h),g(e,o),e.intersect=function(t){return _.rect(e,t)},i}(0,s.eW)(tA,"question"),(0,s.eW)(tR,"rect_left_inv_arrow"),(0,s.eW)(tL,"rectWithTitle"),(0,s.eW)(tq,"roundedRect"),(0,s.eW)(t_,"shadedProcess"),(0,s.eW)(tP,"slopedRect"),(0,s.eW)(tZ,"squareRect"),(0,s.eW)(tU,"stadium"),(0,s.eW)(tG,"state"),(0,s.eW)(tT,"stateEnd"),(0,s.eW)(tI,"stateStart"),(0,s.eW)(tE,"subroutine"),(0,s.eW)(tH,"taggedRect"),(0,s.eW)(tV,"taggedWaveEdgedRectangle"),(0,s.eW)(tY,"text");var tj=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e}
|
3
|
+
a${r},${i} 0,0,1 0,${-l}
|
4
|
+
l${a},0
|
5
|
+
a${r},${i} 0,0,1 0,${l}
|
6
|
+
M${a},${-l}
|
7
|
+
a${r},${i} 0,0,0 0,${l}
|
8
|
+
l${-a},0`,"createCylinderPathD"),tO=(0,s.eW)((t,e,a,l,r,i)=>`M${t},${e} M${t+a},${e} a${r},${i} 0,0,0 0,${-l} l${-a},0 a${r},${i} 0,0,0 0,${l} l${a},0`,"createOuterCylinderPathD"),tz=(0,s.eW)((t,e,a,l,r,i)=>`M${t+a/2},${-l/2} a${r},${i} 0,0,0 0,${l}`,"createInnerCylinderPathD");async function tF(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:c,halfPadding:f}=await d(t,e,y(e)),p="neo"===e.look?2*f:f,u=h.height+p,m=u/2,x=m/(2.5+u/50),w=h.width+x+p,{cssStyles:b}=e;if("handDrawn"===e.look){let t=o.Z.svg(s),l=tO(0,0,w,u,x,m),i=tz(0,0,w,u,x,m),n=t.path(l,(0,r._q)(e,{})),h=t.path(i,(0,r._q)(e,{fill:"none"}));a=s.insert(()=>h,":first-child"),(a=s.insert(()=>n,":first-child")).attr("class","basic label-container"),b&&a.attr("style",b)}else{let t=tj(0,0,w,u,x,m);(a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(b)).attr("style",i)).attr("class","basic label-container"),b&&a.selectAll("path").attr("style",b),i&&a.selectAll("path").attr("style",i)}return a.attr("label-offset-x",x),a.attr("transform",`translate(${-w/2}, ${u/2} )`),c.attr("transform",`translate(${-(h.width/2)-x-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),g(e,a),e.intersect=function(t){let a=_.rect(e,t),l=a.y-(e.y??0);if(0!=m&&(Math.abs(l)<(e.height??0)/2||Math.abs(l)==(e.height??0)/2&&Math.abs(a.x-(e.x??0))>(e.width??0)/2-x)){let r=x*x*(1-l*l/(m*m));0!=r&&(r=Math.sqrt(Math.abs(r))),r=x-r,t.x-(e.x??0)>0&&(r=-r),a.x+=r}return a},s}async function tX(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=s.width+e.padding,c=s.height+e.padding,p=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.Z.svg(n),l=(0,r._q)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&a.attr("style",u)}else a=G(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return _.polygon(e,p,t)},n}async function tJ(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(60,n.width+(e.padding??0)*2,e?.width??0),h=Math.max(20,n.height+(e.padding??0)*2,e?.height??0),{cssStyles:c}=e,p=o.Z.svg(i),u=(0,r._q)(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let m=[{x:-s/2*.8,y:-h/2},{x:s/2*.8,y:-h/2},{x:s/2,y:-h/2*.6},{x:s/2,y:h/2},{x:-s/2,y:h/2},{x:-s/2,y:-h/2*.6}],x=f(m),w=p.path(x,u),b=i.insert(()=>w,":first-child");return b.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",c),l&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",l),g(e,b),e.intersect=function(t){return _.polygon(e,m,t)},i}async function tK(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:h}=await d(t,e,y(e)),c=(0,s.ku)(s.nV().flowchart?.htmlLabels),p=n.width+(e.padding??0),u=p+n.height,m=p+n.height,x=[{x:0,y:0},{x:m,y:0},{x:m/2,y:-u}],{cssStyles:w}=e,b=o.Z.svg(i),$=(0,r._q)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=f(x),M=b.path(k,$),S=i.insert(()=>M,":first-child").attr("transform",`translate(${-u/2}, ${u/2})`);return w&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",w),l&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",l),e.width=p,e.height=u,g(e,S),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${u/2-(n.height+(e.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),e.intersect=function(t){return s.cM.info("Triangle intersect",e,x,t),_.polygon(e,x,t)},i}async function tQ(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),u=c/8,m=c+u,{cssStyles:x}=e,w=70-h,b=w>0?w/2:0,$=o.Z.svg(i),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=[{x:-h/2-b,y:m/2},...p(-h/2-b,m/2,h/2+b,m/2,u,.8),{x:h/2+b,y:-m/2},{x:-h/2-b,y:-m/2}],S=f(M),D=$.path(S,k),W=i.insert(()=>D,":first-child");return W.attr("class","basic label-container"),x&&"handDrawn"!==e.look&&W.selectAll("path").attr("style",x),l&&"handDrawn"!==e.look&&W.selectAll("path").attr("style",l),W.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-h/2+(e.padding??0)-(n.x-(n.left??0))},${-c/2+(e.padding??0)-u-(n.y-(n.top??0))})`),g(e,W),e.intersect=function(t){return _.polygon(e,M,t)},i}async function t0(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(n.width+(e.padding??0)*2,e?.width??0),h=Math.max(n.height+(e.padding??0)*2,e?.height??0),c=s/h,u=s,m=h;u>m*c?m=u/c:u=m*c,u=Math.max(u,100);let x=Math.min(.2*(m=Math.max(m,50)),m/4),w=m+2*x,{cssStyles:b}=e,$=o.Z.svg(i),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=[{x:-u/2,y:w/2},...p(-u/2,w/2,u/2,w/2,x,1),{x:u/2,y:-w/2},...p(u/2,-w/2,-u/2,-w/2,x,-1)],S=f(M),D=$.path(S,k),W=i.insert(()=>D,":first-child");return W.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&W.selectAll("path").attr("style",b),l&&"handDrawn"!==e.look&&W.selectAll("path").attr("style",l),g(e,W),e.intersect=function(t){return _.polygon(e,M,t)},i}async function t2(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),f=-h/2,p=-c/2,{cssStyles:u}=e,m=o.Z.svg(i),x=(0,r._q)(e,{}),w=[{x:f-5,y:p-5},{x:f-5,y:p+c},{x:f+h,y:p+c},{x:f+h,y:p-5}],b=`M${f-5},${p-5} L${f+h},${p-5} L${f+h},${p+c} L${f-5},${p+c} L${f-5},${p-5}
|
9
|
+
M${f-5},${p} L${f+h},${p}
|
10
|
+
M${f},${p-5} L${f},${p+c}`;"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let $=m.path(b,x),k=i.insert(()=>$,":first-child");return k.attr("transform","translate(2.5, 2.5)"),k.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),s.attr("transform",`translate(${-(n.width/2)+2.5-(n.x-(n.left??0))}, ${-(n.height/2)+2.5-(n.y-(n.top??0))})`),g(e,k),e.intersect=function(t){return _.polygon(e,w,t)},i}async function t1(t,e){if(e.alias&&(e.label=e.alias),"handDrawn"===e.look){let{themeVariables:a}=(0,s.iE)(),{background:l}=a,r={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${l}`]};await t1(t,r)}let a=(0,s.iE)();e.useHtmlLabels=a.htmlLabels;let l=a.er?.diagramPadding??10,i=a.er?.entityPadding??6,{cssStyles:d}=e,{labelStyles:c,nodeStyles:f}=(0,r.UG)(e);if(0===e.attributes.length&&e.label){let r={rx:0,ry:0,labelPaddingX:l,labelPaddingY:1.5*l,classes:""};(0,n.Cq)(e.label,a)+2*r.labelPaddingX<a.er.minEntityWidth&&(e.width=a.er.minEntityWidth);let i=await tm(t,e,r);if(!(0,s.ku)(a.htmlLabels)){let t=i.select("text"),e=t.node()?.getBBox();t.attr("transform",`translate(${-e.width/2}, 0)`)}return i}a.htmlLabels||(l*=1.25,i*=1.25);let p=y(e);p||(p="node default");let u=t.insert("g").attr("class",p).attr("id",e.domId||e.id),m=await t5(u,e.label??"",a,0,0,["name"],c);m.height+=i;let x=0,w=[],b=[],$=0,k=0,M=0,S=0,D=!0,W=!0;for(let t of e.attributes){let e=await t5(u,t.type,a,0,x,["attribute-type"],c);$=Math.max($,e.width+l);let r=await t5(u,t.name,a,0,x,["attribute-name"],c);k=Math.max(k,r.width+l);let n=await t5(u,t.keys.join(),a,0,x,["attribute-keys"],c);M=Math.max(M,n.width+l);let s=await t5(u,t.comment,a,0,x,["attribute-comment"],c);S=Math.max(S,s.width+l);let h=Math.max(e.height,r.height,n.height,s.height)+i;b.push({yOffset:x,rowHeight:h}),x+=h}let v=4;M<=l&&(D=!1,M=0,v--),S<=l&&(W=!1,S=0,v--);let C=u.node().getBBox();if(m.width+2*l-($+k+M+S)>0){let t=m.width+2*l-($+k+M+S);$+=t/v,k+=t/v,M>0&&(M+=t/v),S>0&&(S+=t/v)}let B=$+k+M+S,N=o.Z.svg(u),A=(0,r._q)(e,{});"handDrawn"!==e.look&&(A.roughness=0,A.fillStyle="solid");let R=0;b.length>0&&(R=b.reduce((t,e)=>t+(e?.rowHeight??0),0));let L=Math.max(C.width+2*l,e?.width||0,B),q=Math.max((R??0)+m.height,e?.height||0),P=-L/2,Z=-q/2;u.selectAll("g:not(:first-child)").each((t,e,a)=>{let r=(0,h.Ys)(a[e]),n=r.attr("transform"),s=0,o=0;if(n){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(n);t&&(s=parseFloat(t[1]),o=parseFloat(t[2]),r.attr("class").includes("attribute-name")?s+=$:r.attr("class").includes("attribute-keys")?s+=$+k:r.attr("class").includes("attribute-comment")&&(s+=$+k+M))}r.attr("transform",`translate(${P+l/2+s}, ${o+Z+m.height+i/2})`)}),u.select(".name").attr("transform","translate("+-m.width/2+", "+(Z+i/2)+")");let U=N.rectangle(P,Z,L,q,A),G=u.insert(()=>U,":first-child").attr("style",d.join("")),{themeVariables:T}=(0,s.iE)(),{rowEven:I,rowOdd:E,nodeBorder:H}=T;for(let[t,e]of(w.push(0),b.entries())){let a=(t+1)%2==0&&0!==e.yOffset,l=N.rectangle(P,m.height+Z+e?.yOffset,L,e?.rowHeight,{...A,fill:a?I:E,stroke:H});u.insert(()=>l,"g.label").attr("style",d.join("")).attr("class",`row-rect-${a?"even":"odd"}`)}let V=N.line(P,m.height+Z,L+P,m.height+Z,A);for(let t of(u.insert(()=>V).attr("class","divider"),V=N.line($+P,m.height+Z,$+P,q+Z,A),u.insert(()=>V).attr("class","divider"),D&&(V=N.line($+k+P,m.height+Z,$+k+P,q+Z,A),u.insert(()=>V).attr("class","divider")),W&&(V=N.line($+k+M+P,m.height+Z,$+k+M+P,q+Z,A),u.insert(()=>V).attr("class","divider")),w))V=N.line(P,m.height+Z+t,L+P,m.height+Z+t,A),u.insert(()=>V).attr("class","divider");if(g(e,G),f&&"handDrawn"!==e.look){let t=f.split(";"),e=t?.filter(t=>t.includes("stroke"))?.map(t=>`${t}`).join("; ");u.selectAll("path").attr("style",e??""),u.selectAll(".row-rect-even path").attr("style",f)}return e.intersect=function(t){return _.rect(e,t)},u}async function t5(t,e,a,l=0,r=0,o=[],d=""){let c=t.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${l}, ${r})`).attr("style",d);e!==(0,s.UO)(e)&&(e=(e=(0,s.UO)(e)).replaceAll("<","<").replaceAll(">",">"));let g=c.node().appendChild(await (0,i.rw)(c,e,{width:(0,n.Cq)(e,a)+100,style:d,useHtmlLabels:a.htmlLabels},a));if(e.includes("<")||e.includes(">")){let t=g.children[0];for(t.textContent=t.textContent.replaceAll("<","<").replaceAll(">",">");t.childNodes[0];)(t=t.childNodes[0]).textContent=t.textContent.replaceAll("<","<").replaceAll(">",">")}let y=g.getBBox();if((0,s.ku)(a.htmlLabels)){let t=g.children[0];t.style.textAlign="start";let e=(0,h.Ys)(g);y=t.getBoundingClientRect(),e.attr("width",y.width),e.attr("height",y.height)}return y}async function t8(t,e,a,l,r=a.class.padding??12){let i=l?0:3,n=t.insert("g").attr("class",y(e)).attr("id",e.domId||e.id),s=null,h=null,o=null,d=null,c=0,g=0,f=0;if(s=n.insert("g").attr("class","annotation-group text"),e.annotations.length>0){let t=e.annotations[0];await t4(s,{text:`\xab${t}\xbb`},0),c=s.node().getBBox().height}h=n.insert("g").attr("class","label-group text"),await t4(h,e,0,["font-weight: bolder"]);let p=h.node().getBBox();g=p.height,o=n.insert("g").attr("class","members-group text");let u=0;for(let t of e.members){let e=await t4(o,t,u,[t.parseClassifier()]);u+=e+i}(f=o.node().getBBox().height)<=0&&(f=r/2),d=n.insert("g").attr("class","methods-group text");let m=0;for(let t of e.methods){let e=await t4(d,t,m,[t.parseClassifier()]);m+=e+i}let x=n.node().getBBox();if(null!==s){let t=s.node().getBBox();s.attr("transform",`translate(${-t.width/2})`)}return h.attr("transform",`translate(${-p.width/2}, ${c})`),x=n.node().getBBox(),o.attr("transform",`translate(0, ${c+g+2*r})`),x=n.node().getBBox(),d.attr("transform",`translate(0, ${c+g+(f?f+4*r:2*r)})`),x=n.node().getBBox(),{shapeSvg:n,bbox:x}}async function t4(t,e,a,l=[]){let r;let o=t.insert("g").attr("class","label").attr("style",l.join("; ")),d=(0,s.iE)(),c="useHtmlLabels"in e?e.useHtmlLabels:(0,s.ku)(d.htmlLabels)??!0,g="";g="text"in e?e.text:e.label,!c&&g.startsWith("\\")&&(g=g.substring(1)),(0,s.l0)(g)&&(c=!0);let y=await (0,i.rw)(o,(0,s.uX)((0,n.SH)(g)),{width:(0,n.Cq)(g,d)+50,classes:"markdown-node-label",useHtmlLabels:c},d),f=1;if(c){let t=y.children[0],e=(0,h.Ys)(y);f=t.innerHTML.split("<br>").length,t.innerHTML.includes("</math>")&&(f+=t.innerHTML.split("<mrow>").length-1);let a=t.getElementsByTagName("img");if(a){let t=""===g.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function l(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=5*parseInt(d.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,10)+"px";e.style.minWidth=t,e.style.maxWidth=t}else e.style.width="100%";a(e)}(0,s.eW)(l,"setupImage"),setTimeout(()=>{e.complete&&l()}),e.addEventListener("error",l),e.addEventListener("load",l)})))}r=t.getBoundingClientRect(),e.attr("width",r.width),e.attr("height",r.height)}else{l.includes("font-weight: bolder")&&(0,h.Ys)(y).selectAll("tspan").attr("font-weight",""),f=y.children.length;let t=y.children[0];(""===y.textContent||y.textContent.includes(">"))&&(t.textContent=g[0]+g.substring(1).replaceAll(">",">").replaceAll("<","<").trim()," "===g[1]&&(t.textContent=t.textContent[0]+" "+t.textContent.substring(1))),"undefined"===t.textContent&&(t.textContent=""),r=y.getBBox()}return o.attr("transform","translate(0,"+(-r.height/(2*f)+a)+")"),r.height}async function t7(t,e){let a=(0,s.nV)(),l=a.class.padding??12,i=e.useHtmlLabels??(0,s.ku)(a.htmlLabels)??!0;e.annotations=e.annotations??[],e.members=e.members??[],e.methods=e.methods??[];let{shapeSvg:n,bbox:d}=await t8(t,e,a,i,l),{labelStyles:c,nodeStyles:y}=(0,r.UG)(e);e.labelStyle=c,e.cssStyles=e.styles||"";let f=e.styles?.join(";")||y||"";e.cssStyles||(e.cssStyles=f.replaceAll("!important","").split(";"));let p=0===e.members.length&&0===e.methods.length&&!a.class?.hideEmptyMembersBox,u=o.Z.svg(n),m=(0,r._q)(e,{});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let x=d.width,w=d.height;0===e.members.length&&0===e.methods.length?w+=l:e.members.length>0&&0===e.methods.length&&(w+=2*l);let b=-x/2,$=-w/2,k=u.rectangle(b-l,$-l-(p?l:0===e.members.length&&0===e.methods.length?-l/2:0),x+2*l,w+2*l+(p?2*l:0===e.members.length&&0===e.methods.length?-l:0),m),M=n.insert(()=>k,":first-child");M.attr("class","basic label-container");let S=M.node().getBBox();n.selectAll(".text").each((t,a,r)=>{let s=(0,h.Ys)(r[a]),o=s.attr("transform"),d=0;if(o){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);t&&(d=parseFloat(t[2]))}let c=d+$+l-(p?l:0===e.members.length&&0===e.methods.length?-l/2:0);i||(c-=4);let g=b;(s.attr("class").includes("label-group")||s.attr("class").includes("annotation-group"))&&(g=-s.node()?.getBBox().width/2||0,n.selectAll("text").each(function(t,e,a){"middle"===window.getComputedStyle(a[e]).textAnchor&&(g=0)})),s.attr("transform",`translate(${g}, ${c})`)});let D=n.select(".annotation-group").node().getBBox().height-(p?l/2:0)||0,W=n.select(".label-group").node().getBBox().height-(p?l/2:0)||0,v=n.select(".members-group").node().getBBox().height-(p?l/2:0)||0;if(e.members.length>0||e.methods.length>0||p){let t=u.line(S.x,D+W+$+l,S.x+S.width,D+W+$+l,m);n.insert(()=>t).attr("class","divider").attr("style",f)}if(p||e.members.length>0||e.methods.length>0){let t=u.line(S.x,D+W+v+$+2*l+l,S.x+S.width,D+W+v+$+l+2*l,m);n.insert(()=>t).attr("class","divider").attr("style",f)}if("handDrawn"!==e.look&&n.selectAll("path").attr("style",f),M.select(":nth-child(2)").attr("style",f),n.selectAll(".divider").select("path").attr("style",f),e.labelStyle?n.selectAll("span").attr("style",e.labelStyle):n.selectAll("span").attr("style",f),!i){let t=RegExp(/color\s*:\s*([^;]*)/),e=t.exec(f);if(e){let t=e[0].replace("color","fill");n.selectAll("tspan").attr("style",t)}else if(c){let e=t.exec(c);if(e){let t=e[0].replace("color","fill");n.selectAll("tspan").attr("style",t)}}}return g(e,M),e.intersect=function(t){return _.rect(e,t)},n}async function t9(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let n="verifyMethod"in e,s=y(e),d=t.insert("g").attr("class",s).attr("id",e.domId??e.id),c=a=n?await t3(d,`<<${e.type}>>`,0,e.labelStyle):await t3(d,"<<Element>>",0,e.labelStyle),f=await t3(d,e.name,c,e.labelStyle+"; font-weight: bold;");if(c+=f+20,n){let t=await t3(d,`${e.requirementId?`id: ${e.requirementId}`:""}`,c,e.labelStyle);c+=t;let a=await t3(d,`${e.text?`Text: ${e.text}`:""}`,c,e.labelStyle);c+=a;let l=await t3(d,`${e.risk?`Risk: ${e.risk}`:""}`,c,e.labelStyle);c+=l,await t3(d,`${e.verifyMethod?`Verification: ${e.verifyMethod}`:""}`,c,e.labelStyle)}else{let t=await t3(d,`${e.type?`Type: ${e.type}`:""}`,c,e.labelStyle);c+=t,await t3(d,`${e.docRef?`Doc Ref: ${e.docRef}`:""}`,c,e.labelStyle)}let p=(d.node()?.getBBox().width??200)+20,u=(d.node()?.getBBox().height??200)+20,m=-p/2,x=-u/2,w=o.Z.svg(d),b=(0,r._q)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=w.rectangle(m,x,p,u,b),k=d.insert(()=>$,":first-child");if(k.attr("class","basic label-container").attr("style",i),d.selectAll(".label").each((t,e,a)=>{let l=(0,h.Ys)(a[e]),r=l.attr("transform"),i=0,n=0;if(r){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(r);t&&(i=parseFloat(t[1]),n=parseFloat(t[2]))}let s=n-u/2,o=m+10;(0===e||1===e)&&(o=i),l.attr("transform",`translate(${o}, ${s+20})`)}),c>a+f+20){let t=w.line(m,x+a+f+20,m+p,x+a+f+20,b);d.insert(()=>t).attr("style",i)}return g(e,k),e.intersect=function(t){return _.rect(e,t)},d}async function t3(t,e,a,l=""){let r;if(""===e)return 0;let o=t.insert("g").attr("class","label").attr("style",l),d=(0,s.nV)(),c=d.htmlLabels??!0,g=await (0,i.rw)(o,(0,s.uX)((0,n.SH)(e)),{width:(0,n.Cq)(e,d)+50,classes:"markdown-node-label",useHtmlLabels:c,style:l},d);if(c){let t=g.children[0],e=(0,h.Ys)(g);r=t.getBoundingClientRect(),e.attr("width",r.width),e.attr("height",r.height)}else{for(let t of g.children[0].children)t.textContent=t.textContent.replaceAll(">",">").replaceAll("<","<"),l&&t.setAttribute("style",l);r=g.getBBox(),r.height+=6}return o.attr("transform",`translate(${-r.width/2},${-r.height/2+a})`),r.height}(0,s.eW)(tF,"tiltedCylinder"),(0,s.eW)(tX,"trapezoid"),(0,s.eW)(tJ,"trapezoidalPentagon"),(0,s.eW)(tK,"triangle"),(0,s.eW)(tQ,"waveEdgedRectangle"),(0,s.eW)(t0,"waveRectangle"),(0,s.eW)(t2,"windowPane"),(0,s.eW)(t1,"erBox"),(0,s.eW)(t5,"addText"),(0,s.eW)(t8,"textHelper"),(0,s.eW)(t4,"addText"),(0,s.eW)(t7,"classBox"),(0,s.eW)(t9,"requirementBox"),(0,s.eW)(t3,"addText");var t6=(0,s.eW)(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function et(t,e,{config:a}){let l,i,n,s;let{labelStyles:h,nodeStyles:f}=(0,r.UG)(e);e.labelStyle=h||"";let p=e.width;e.width=(e.width??200)-10;let{shapeSvg:u,bbox:m,label:x}=await d(t,e,y(e)),w=e.padding||10,b="";"ticket"in e&&e.ticket&&a?.kanban?.ticketBaseUrl&&(b=a?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),l=u.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",b).attr("target","_blank"));let k={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};l?{label:i,bbox:n}=await c(l,"ticket"in e&&e.ticket||"",k):{label:i,bbox:n}=await c(u,"ticket"in e&&e.ticket||"",k);let{label:M,bbox:S}=await c(u,"assigned"in e&&e.assigned||"",k);e.width=p;let D=e?.width||0,W=Math.max(n.height,S.height)/2,v=Math.max(m.height+20,e?.height||0)+W,C=-D/2,B=-v/2;x.attr("transform","translate("+(w-D/2)+", "+(-W-m.height/2)+")"),i.attr("transform","translate("+(w-D/2)+", "+(-W+m.height/2)+")"),M.attr("transform","translate("+(w+D/2-S.width-20)+", "+(-W+m.height/2)+")");let{rx:N,ry:A}=e,{cssStyles:R}=e;if("handDrawn"===e.look){let t=o.Z.svg(u),a=(0,r._q)(e,{}),l=N||A?t.path($(C,B,D,v,N||0),a):t.rectangle(C,B,D,v,a);(s=u.insert(()=>l,":first-child")).attr("class","basic label-container").attr("style",R||null)}else{(s=u.insert("rect",":first-child")).attr("class","basic label-container __APA__").attr("style",f).attr("rx",N??5).attr("ry",A??5).attr("x",C).attr("y",B).attr("width",D).attr("height",v);let t="priority"in e&&e.priority;if(t){let e=u.append("line"),a=C+2,l=B+Math.floor((N??0)/2),r=B+v-Math.floor((N??0)/2);e.attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",r).attr("stroke-width","4").attr("stroke",t6(t))}}return g(e,s),e.height=v,e.intersect=function(t){return _.rect(e,t)},u}(0,s.eW)(et,"kanbanItem");var ee=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:tZ},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:tq},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:tU},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:tE},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:te},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:E},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:tA},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:to},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:tb},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:tw},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:tX},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:tu},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:tl},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:tY},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:T},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:t_},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:tI},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:tT},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:tn},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:td},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:j},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:z},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:X},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:t$},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:tQ},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ts},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:tF},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:tD},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:J},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:ta},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:tK},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:t2},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:tr},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:tJ},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:ti},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:tP},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:tC},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:tv},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:U},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:V},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:tV},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:tH},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:t0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:tR},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:tW}],ea=(0,s.eW)(()=>Object.fromEntries([...Object.entries({state:tG,choice:I,note:tB,rectWithTitle:tL,labelRect:tx,iconSquare:tf,iconCircle:tg,icon:tc,iconRounded:ty,imageSquare:tp,anchor:P,kanbanItem:et,classBox:t7,erBox:t1,requirementBox:t9}),...ee.flatMap(t=>[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]].map(e=>[e,t.handler]))]),"generateShapeMap")();function el(t){return t in ea}(0,s.eW)(el,"isValidShape");var er=new Map;async function ei(t,e,a){let l,r;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");let i=e.shape?ea[e.shape]:void 0;if(!i)throw Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let n;"sandbox"===a.config.securityLevel?n="_top":e.linkTarget&&(n=e.linkTarget||"_blank"),l=t.insert("svg:a").attr("xlink:href",e.link).attr("target",n??null),r=await i(l,e,a)}else l=r=await i(t,e,a);return e.tooltip&&r.attr("title",e.tooltip),er.set(e.id,l),e.haveCallback&&l.attr("class",l.attr("class")+" clickable"),l}(0,s.eW)(ei,"insertNode");var en=(0,s.eW)((t,e)=>{er.set(e.id,t)},"setNodeElem"),es=(0,s.eW)(()=>{er.clear()},"clear"),eh=(0,s.eW)(t=>{let e=er.get(t.id);s.cM.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let a=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+a-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),a},"positionNode")}}]);
|