filecat 7.7.4 → 7.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/1045.0e4bdc838c37771a7f50.js +1 -0
- package/build/dist/1075.493acb74297c1e753de2.js +1 -0
- package/build/dist/1128.b80776fbdbdda36034c3.js +1 -0
- package/build/dist/1388.1dcf844b452e3aae3dc0.js +1 -0
- package/build/dist/1671.fb137d27b5763953487e.js +1 -0
- package/build/dist/{6887.93191dae462af3692775.js → 1738.b8ab2bd79df131e60051.js} +1 -1
- package/build/dist/1802.e43e833638f6ba8e22d7.js +1 -0
- package/build/dist/1964.bd3d684b50aa5191b413.js +1 -0
- package/build/dist/200.bb7f6ce5543bd7ff6d97.js +1 -0
- package/build/dist/2105.e4ba1c1d506b3fe14e8e.js +1 -0
- package/build/dist/2122.bc10dcdbbfc38e0ef883.js +1 -0
- package/build/dist/{3457.18b45379d8bcf7f5f3b5.js → 2180.df641ebaead77c4ada71.js} +1 -1
- package/build/dist/2300.9e1baa1c0368abe53d96.js +2 -0
- package/build/dist/2479.15722ac55b05c521f4f7.js +1 -0
- package/build/dist/2572.8fdddfebb4da2f29dbd8.js +1 -0
- package/build/dist/2674.0c822a9c458f923a4eff.js +1 -0
- package/build/dist/{1001.44a1a25c7d6d3f294bf3.js → 2822.9417e764a14f8f5f57dc.js} +1 -1
- package/build/dist/2994.c492be0d907fa468a9be.js +1 -0
- package/build/dist/{3140.b078ec311f99170b7f4c.js → 3140.794a212da633caf38b3a.js} +2 -2
- package/build/dist/3230.7798ab546facfa058b34.js +1 -0
- package/build/dist/3283.9386fc7f67aef46604fb.js +1 -0
- package/build/dist/{3299.9bd4cf5d1679479639a8.js → 3299.d01f5a742d80f4e6e25b.js} +1 -1
- package/build/dist/3300.b8a3bc571293a6280ed8.js +1 -0
- package/build/dist/{3402.d412940350051a52d7ac.js → 3402.b6dc28d2f9bace7cde85.js} +1 -1
- package/build/dist/3509.cbcb309fbf49db53229f.js +1 -0
- package/build/dist/{3727.b8d9cbae9de47bf8d49b.js → 3510.b975b8bfdee5e8518215.js} +1 -1
- package/build/dist/{587.c75ed69a8373139346f9.js → 3566.ba323afadcf41fad2fa7.js} +1 -1
- package/build/dist/3608.aff9429024b740ac5cd0.js +1 -0
- package/build/dist/3990.5e16453f57b90b01d539.js +1 -0
- package/build/dist/4004.de90f1192487a24a0a9a.js +1 -0
- package/build/dist/4061.c0eb5824eeb6a59fa827.js +1 -0
- package/build/dist/4220.b65b40382726a69ba0bc.js +1 -0
- package/build/dist/{3883.70d42c3a335d6833f07e.js → 4376.b022a792fb34fbe50398.js} +1 -1
- package/build/dist/4437.4d5a0965043471411a00.js +1 -0
- package/build/dist/4469.536491f90535e831ce3e.js +1 -0
- package/build/dist/453.8877eb10f13258c290bc.js +1 -0
- package/build/dist/4560.8ef2e4b60cc86d019dd6.js +1 -0
- package/build/dist/4735.838cd0f656bbf7d99ff6.js +1 -0
- package/build/dist/4772.9b95c402a4def0f576e3.js +1 -0
- package/build/dist/4985.44cb7d829ca477e368b8.js +1 -0
- package/build/dist/5516.645e4a900df9bdc1806c.js +1 -0
- package/build/dist/5526.6b4867751becda056ed8.js +1 -0
- package/build/dist/5617.8efc3b1d218f80df9b39.js +1 -0
- package/build/dist/5744.e9f1efb88a617b05b709.js +1 -0
- package/build/dist/583.cef46d6b21c6fa6454cf.js +1 -0
- package/build/dist/6089.6d5d19a327284ff3b11c.js +1 -0
- package/build/dist/6164.7dae9989dd129479f952.js +1 -0
- package/build/dist/6284.10deb80685728f50aa45.js +1 -0
- package/build/dist/629.b75b024aacc43e0d69cf.js +1 -0
- package/build/dist/6344.291e5dadc74e62739774.js +1 -0
- package/build/dist/6492.3ee4060598de873d8e8f.js +1 -0
- package/build/dist/6571.b381c44055704e3ba649.js +1 -0
- package/build/dist/6731.6763296ce5ae210bc0fe.js +1 -0
- package/build/dist/6759.f88b50c41207cb8345d1.js +1 -0
- package/build/dist/{4951.88718d978aea2dd40006.js → 6789.34921a30c8a81f0a6407.js} +1 -1
- package/build/dist/6800.ee99fd0a88b6acbaaf2c.js +1 -0
- package/build/dist/6803.fe4297b1e51c3bfc7f50.js +1 -0
- package/build/dist/{313.d51fc773856f078487ad.js → 6806.9ebf089eba60f3b8e946.js} +1 -1
- package/build/dist/7038.4e4fc8e405c56d3080e2.js +1 -0
- package/build/dist/7310.bf944d03f24fcf109680.js +1 -0
- package/build/dist/{359.1b95bd6368196ccaa731.js → 7430.25bf8437ad8f7c1fd36f.js} +1 -1
- package/build/dist/7483.5e26ada69b33418c31a8.js +1 -0
- package/build/dist/{4087.4796ff56340985c35542.js → 7486.fe0b5f867c08b40a3360.js} +1 -1
- package/build/dist/7567.09e1b34ad9bd3e463eb4.js +1 -0
- package/build/dist/7834.7a593dcb80ca09f58586.js +1 -0
- package/build/dist/784.48a3b71205680f427109.js +1 -0
- package/build/dist/7943.54c702542d55f576a576.js +1 -0
- package/build/dist/7954.6ce241a8ed27cb26efc6.js +1 -0
- package/build/dist/8079.f6f2be43e5d933ae1f6f.js +1 -0
- package/build/dist/8677.860320b7f36947e57d11.js +1 -0
- package/build/dist/8727.3628c746061aed7a4077.js +1 -0
- package/build/dist/9299.ed4de6cd4f4bfa0a966a.js +1 -0
- package/build/dist/9324.ef229da9b943484298ba.js +1 -0
- package/build/dist/9364.d2570d78afc50fe1b23e.js +1 -0
- package/build/dist/9463.2629a7daf4c2865b9b96.js +1 -0
- package/build/dist/index.html +1 -1
- package/build/dist/main.98bb29605335d9b2219f.js +2 -0
- package/build/main.js +1 -1
- package/package.json +4 -5
- package/build/dist/1075.3ef2e1902e9f7e9e37b1.js +0 -1
- package/build/dist/1312.199a506fb836a2412255.js +0 -1
- package/build/dist/136.e3bb3c50051edb17454d.js +0 -1
- package/build/dist/1478.c58a43bb24820a13eaed.js +0 -1
- package/build/dist/1491.901cce0168c42ad319fa.js +0 -1
- package/build/dist/1566.4f405afd26063b55129c.js +0 -1
- package/build/dist/161.98f6c2a50bf3824a6efb.js +0 -1
- package/build/dist/1654.a21a099e2749ef167ea9.js +0 -1
- package/build/dist/1875.46dd3a6cc071d45a32f1.js +0 -1
- package/build/dist/1883.14c90bbe93fe206906f0.js +0 -1
- package/build/dist/1924.c7bd2a2aa0e9bc78c9ba.js +0 -1
- package/build/dist/2000.f55ddba9e6313243f028.js +0 -1
- package/build/dist/2101.d4efa6a2c1e9169d9225.js +0 -1
- package/build/dist/2180.60fe32ab12c2fa1570a4.js +0 -1
- package/build/dist/2191.4c4f2fd5127168a81877.js +0 -1
- package/build/dist/2213.ceffb8fd7be66b35d079.js +0 -1
- package/build/dist/2463.6e530d1e9b5c58dba166.js +0 -1
- package/build/dist/2623.8b1e5e391dd4e05fc119.js +0 -1
- package/build/dist/2674.3713c09449bdd57b1066.js +0 -1
- package/build/dist/2894.8395ec5e280cc6b6c4dc.js +0 -1
- package/build/dist/3042.f490cfa4208208262398.js +0 -1
- package/build/dist/3096.d0b2c77a23418c545c01.js +0 -1
- package/build/dist/311.da79ace98b69a635c41c.js +0 -1
- package/build/dist/3166.088cf4a0356c3a6e30a0.js +0 -1
- package/build/dist/3357.4f1bf81ecc3c11a3f813.js +0 -1
- package/build/dist/3475.d10d21b637761d7d886d.js +0 -1
- package/build/dist/3708.04401b24d95214d641e5.js +0 -1
- package/build/dist/3752.01fc1f14b29f340e41fd.js +0 -1
- package/build/dist/3871.7a387a9dc21883d08423.js +0 -1
- package/build/dist/3994.19fb81947d65fc81b0a2.js +0 -1
- package/build/dist/4012.b516fdc981e55be2ebb2.js +0 -1
- package/build/dist/4122.9ea6b5dd8dc9d2265825.js +0 -1
- package/build/dist/4141.06960673a6a484e7b88d.js +0 -1
- package/build/dist/4190.ff72264b4f07f6542d33.js +0 -1
- package/build/dist/4239.1b49d7c26192fb637d57.js +0 -1
- package/build/dist/4288.8dc8f5d962720e084952.js +0 -1
- package/build/dist/434.04cdc2a05316f92d1d38.js +0 -1
- package/build/dist/4376.f3c60897f70dd4e33d2f.js +0 -1
- package/build/dist/4472.9e708dd3e1c9db7d7396.js +0 -1
- package/build/dist/4473.b42b37616f13be64199b.js +0 -1
- package/build/dist/449.3fd75e05da22fe1c5ecc.js +0 -1
- package/build/dist/452.4974390f4f4d991216e5.js +0 -1
- package/build/dist/4547.36b5848220c04c47bc80.js +0 -1
- package/build/dist/4605.ef0f4204b3bf3a18efa6.js +0 -1
- package/build/dist/4804.fbd0ffcf57d9dffc15b7.js +0 -1
- package/build/dist/482.0c7512372a1fbf61d704.js +0 -1
- package/build/dist/4963.22d7db9b376a42d3f00b.js +0 -1
- package/build/dist/5097.a0de16bf7b90a8b1157d.js +0 -1
- package/build/dist/5123.d9ed79af478b5cc4f1b2.js +0 -1
- package/build/dist/5332.8b6e85d8764e907a01d5.js +0 -1
- package/build/dist/536.660d866952b46ba53180.js +0 -1
- package/build/dist/548.d3d912d0c0c7e835e1dc.js +0 -1
- package/build/dist/5516.cc92dfbf06ddcd133dbc.js +0 -1
- package/build/dist/5590.585778da623ec71f7722.js +0 -1
- package/build/dist/5616.14df0fe505c4dadf4042.js +0 -1
- package/build/dist/5695.95dc69f3b02812eb9e93.js +0 -1
- package/build/dist/5697.6ac62f99ca19a979f1eb.js +0 -1
- package/build/dist/5741.237d817efc942de875e5.js +0 -1
- package/build/dist/5849.d26365d4b19533db6fd6.js +0 -1
- package/build/dist/5902.3969a79465383ff4bbb4.js +0 -1
- package/build/dist/5942.981e03467a3b2c653ab8.js +0 -1
- package/build/dist/6029.63e4beb66df7afc65a90.js +0 -1
- package/build/dist/6054.f91307b52046172fc5f8.js +0 -1
- package/build/dist/6089.0863a6a09be2b97e84e1.js +0 -1
- package/build/dist/6095.d845e356a4db8a241cdb.js +0 -1
- package/build/dist/6114.ca67e88c701691b3bb1e.js +0 -1
- package/build/dist/612.74d77e32957a5c6eb197.js +0 -1
- package/build/dist/625.d9e531476b3306e0b837.js +0 -1
- package/build/dist/6318.66541f9cef18d14ea3ea.js +0 -1
- package/build/dist/6455.5c950f6eb61015409eb6.js +0 -1
- package/build/dist/6527.436d2d5d81376e6a54ae.js +0 -1
- package/build/dist/6530.2f1b283a902603262048.js +0 -1
- package/build/dist/6610.b92f337fcc1b347350fb.js +0 -1
- package/build/dist/6926.2786af754adcdabfbede.js +0 -1
- package/build/dist/697.62f8b1ec6d2cd40ed316.js +0 -1
- package/build/dist/70.be2f9130c93c4175d12f.js +0 -1
- package/build/dist/7081.9e1e196fecfcccb4bfb9.js +0 -1
- package/build/dist/7128.3573ab2a5f28b79ba89e.js +0 -1
- package/build/dist/7163.ad09accaa87e565b8dc0.js +0 -1
- package/build/dist/72.a1d87dabb7f0615b3a21.js +0 -1
- package/build/dist/7229.50a1700104d1e4732735.js +0 -1
- package/build/dist/7332.d024ae75a3da2f7674a1.js +0 -1
- package/build/dist/7509.370c49d7ff43e289190c.js +0 -1
- package/build/dist/7514.dbf525bade6ffbd70af6.js +0 -2
- package/build/dist/7557.7d62939c56391a647067.js +0 -1
- package/build/dist/7588.2d840229f62de92b22e5.js +0 -1
- package/build/dist/7632.5660653552f755580adc.js +0 -1
- package/build/dist/7639.b3c6382de2fde652a40b.js +0 -1
- package/build/dist/779.91614fabf5c9eb3aafa0.js +0 -1
- package/build/dist/7810.979796e8a3aad6d4d72f.js +0 -1
- package/build/dist/7897.8b8070d6abe5c2327168.js +0 -1
- package/build/dist/7941.dbef0b0f412899800b13.js +0 -1
- package/build/dist/7953.5cd280effe2e967ea490.js +0 -1
- package/build/dist/7954.efecc100b407af204add.js +0 -1
- package/build/dist/7959.e31a21f28ff463d9d5e9.js +0 -1
- package/build/dist/8034.301f1099c4a7ce6c2829.js +0 -1
- package/build/dist/8080.e1c9af30bdd818b08c6e.js +0 -1
- package/build/dist/8087.6452b67614a0855535a4.js +0 -1
- package/build/dist/8140.bbccc589b007f9d410d1.js +0 -1
- package/build/dist/8162.e47cccbe327b26a2ea6f.js +0 -1
- package/build/dist/8322.56c8f4b4ad93b1a866c8.js +0 -1
- package/build/dist/8376.01a9f23ba06a78922364.js +0 -1
- package/build/dist/8433.e54d57e2cc9408e5e411.js +0 -1
- package/build/dist/8460.25f0859cb2266f764113.js +0 -1
- package/build/dist/8524.7945bff0063dc5c5903d.js +0 -1
- package/build/dist/8782.a5498372f1eb6bab41b7.js +0 -1
- package/build/dist/8953.23fe6fe13b28168428d3.js +0 -1
- package/build/dist/8964.bdf168262ab40956654a.js +0 -1
- package/build/dist/9003.69a0d15e722e1ed455b0.js +0 -1
- package/build/dist/9299.c2699815e5339e4045f8.js +0 -1
- package/build/dist/9385.2b1afe7b55d4c16f97ad.js +0 -1
- package/build/dist/9428.3176bab8f5780f060d51.js +0 -1
- package/build/dist/9456.506d55e351dec4f45566.js +0 -1
- package/build/dist/9465.8ff5871fb708cf7c1021.js +0 -1
- package/build/dist/9500.95d19d78b580734ec35e.js +0 -1
- package/build/dist/9512.03215278f26dc63c056d.js +0 -1
- package/build/dist/9614.cfdbe03d8e2960b0a53a.js +0 -1
- package/build/dist/9651.6bf3e34362f10c1aa35d.js +0 -1
- package/build/dist/9788.4a1c2f3626e532d3b44c.js +0 -1
- package/build/dist/9943.b62436bd9d0730c715a9.js +0 -1
- package/build/dist/9967.216bc8d26440bcbaf785.js +0 -1
- package/build/dist/9970.aa60aa700a790ba226f0.js +0 -1
- package/build/dist/main.7a6fed9f5f814a194409.js +0 -2
- /package/build/dist/{7514.dbf525bade6ffbd70af6.js.LICENSE.txt → 2300.9e1baa1c0368abe53d96.js.LICENSE.txt} +0 -0
- /package/build/dist/{3140.b078ec311f99170b7f4c.js.LICENSE.txt → 3140.794a212da633caf38b3a.js.LICENSE.txt} +0 -0
- /package/build/dist/{main.7a6fed9f5f814a194409.js.LICENSE.txt → main.98bb29605335d9b2219f.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6492],{11356(t,e){e.k=void 0;e.k=function(t,e){void 0===e&&(e={listUnicodeChar:""}),(e=e||{}).listUnicodeChar=!!e.hasOwnProperty("listUnicodeChar")&&e.listUnicodeChar,e.stripListLeaders=!e.hasOwnProperty("stripListLeaders")||e.stripListLeaders,e.gfm=!e.hasOwnProperty("gfm")||e.gfm,e.useImgAltText=!e.hasOwnProperty("useImgAltText")||e.useImgAltText,e.preserveLinks=!!e.hasOwnProperty("preserveLinks")&&e.preserveLinks;var r=t||"";r=r.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm,"");try{e.stripListLeaders&&(r=e.listUnicodeChar?r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,e.listUnicodeChar+" $1"):r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,"$1")),e.gfm&&(r=r.replace(/\n={2,}/g,"\n").replace(/~{3}.*\n/g,"").replace(/~~/g,"").replace(/`{3}.*\n/g,"")),e.preserveLinks&&(r=r.replace(/\[(.*?)\][\[\(](.*?)[\]\)]/g,"$1 ($2)")),r=r.replace(/<[^>]*>/g,"").replace(/^[=\-]{2,}\s*$/g,"").replace(/\[\^.+?\](\: .*?$)?/g,"").replace(/\s{0,2}\[.*?\]: .*?$/g,"").replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g,e.useImgAltText?"$1":"").replace(/\[(.*?)\][\[\(].*?[\]\)]/g,"$1").replace(/^\s{0,3}>\s?/g,"").replace(/(^|\n)\s{0,3}>\s?/g,"\n\n").replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g,"").replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} {0,}(\n)?\s{0,}$/gm,"$1$2$3").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/(`{3,})(.*?)\1/gm,"$2").replace(/`(.+?)`/g,"$1").replace(/\n{2,}/g,"\n\n")}catch(e){return console.error(e),t}return r}},6492(t,e,r){r.r(e),r.d(e,{parseMermaidToExcalidraw:()=>Ie});const o={rect:"rectangle",circle:"ellipse"},n={startOnLoad:!1,flowchart:{curve:"linear"},themeVariables:{fontSize:"20px"},maxEdges:500,maxTextSize:5e4};class s{constructor({converter:t}){this.convert=(t,e)=>this.converter(t,{...e,fontSize:e.fontSize||20}),this.converter=t}}var i,a,l;!function(t){t.ROUND="round",t.STADIUM="stadium",t.DOUBLECIRCLE="doublecircle",t.CIRCLE="circle",t.DIAMOND="diamond",t.CYLINDER="cylinder"}(i||(i={})),function(t){t.COLOR="color"}(a||(a={})),function(t){t.FILL="fill",t.STROKE="stroke",t.STROKE_WIDTH="stroke-width",t.STROKE_DASHARRAY="stroke-dasharray"}(l||(l={}));var c=r(11356);const d={arrow_circle:{endArrowhead:"circle"},arrow_cross:{endArrowhead:"bar"},arrow_open:{endArrowhead:null,startArrowhead:null},double_arrow_circle:{endArrowhead:"circle",startArrowhead:"circle"},double_arrow_cross:{endArrowhead:"bar",startArrowhead:"bar"},double_arrow_point:{endArrowhead:"arrow",startArrowhead:"arrow"}},u=t=>{let e=t.text;return"markdown"===t.labelType&&(e=(0,c.k)(t.text)),h(e)},h=t=>t.replace(/\s?(fa|fab):[a-zA-Z0-9-]+/g,""),p=t=>{const e={};return Object.keys(t).forEach(r=>{switch(r){case l.FILL:e.backgroundColor=t[r],e.fillStyle="solid";break;case l.STROKE:e.strokeColor=t[r];break;case l.STROKE_WIDTH:e.strokeWidth=Number(t[r]?.split("px")[0]);break;case l.STROKE_DASHARRAY:e.strokeStyle="dashed"}}),e},g=t=>{const e={};return Object.keys(t).forEach(r=>{if(r===a.COLOR)e.strokeColor=t[r]}),e},y=(t,e)=>Math.max(20,Math.ceil(t.length*e*.62)),f=new s({converter:(t,e)=>{const r=[],o=e.fontSize,{getGroupIds:n,getParentId:s}=(t=>{const e={};t.subGraphs.map(r=>{r.nodeIds.forEach(o=>{e[r.id]={id:r.id,parent:null,isLeaf:!1},e[o]={id:o,parent:r.id,isLeaf:void 0!==t.vertices[o]}})});const r={};return[...Object.keys(t.vertices),...t.subGraphs.map(t=>t.id)].forEach(t=>{if(!e[t])return;let o=e[t];const n=[];for(o.isLeaf||n.push(`subgraph_group_${o.id}`);o.parent;)n.push(`subgraph_group_${o.parent}`),o=e[o.parent];r[t]=n}),{getGroupIds:t=>r[t]||[],getParentId:t=>e[t]?e[t].parent:null}})(t);return t.subGraphs.reverse().forEach(t=>{const e=n(t.id),s=u(t),i=y(s,o||16)+64,a=Math.max(t.width,i),l=t.x-(a-t.width)/2,c=p(t.containerStyle),d=g(t.labelStyle),h={id:t.id,type:"rectangle",groupIds:e,x:l,y:t.y,width:a,height:t.height,label:{groupIds:e,text:s,fontSize:o,verticalAlign:"top",...d},...c};r.push(h)}),Object.values(t.vertices).forEach(t=>{if(!t)return;const e=n(t.id),s=u(t),a=((t,e,r,o)=>{const n=o||20;if(t!==i.CYLINDER||!e||e.includes("\n"))return n;const s=Math.max(20,r-12);return y(e,n)<=s?n:Math.max(12,Math.floor(s/(.62*e.length)))})(t.type,s,t.width,o),l=p(t.containerStyle),c=g(t.labelStyle);let d={id:t.id,type:"rectangle",groupIds:e,x:t.x,y:t.y,width:t.width,height:t.height,strokeWidth:2,label:{groupIds:e,text:s,fontSize:a,...c},link:t.link||null,...l};switch(t.type){case i.STADIUM:case i.ROUND:d={...d,roundness:{type:3}};break;case i.DOUBLECIRCLE:{const o=5;e.push(`doublecircle_${t.id}}`);const n={type:"ellipse",groupIds:e,x:t.x+o,y:t.y+o,width:t.width-2*o,height:t.height-2*o,strokeWidth:2,roundness:{type:3},label:{groupIds:e,text:s,fontSize:a,...c}};d={...d,groupIds:e,type:"ellipse"},r.push(n);break}case i.CIRCLE:d.type="ellipse";break;case i.DIAMOND:d.type="diamond"}r.push(d)}),t.edges.forEach(t=>{let e=[];const i=s(t.start),a=s(t.end);i&&i===a&&(e=n(i));const{startX:l,startY:c,reflectionPoints:h}=t,p=h.map(t=>{return e=t.x-h[0].x,r=t.y-h[0].y,[e,r];var e,r}),g=(y=t.type||"arrow_point",d[y]);var y;const f=r.find(e=>e.id===t.start),b=r.find(e=>e.id===t.end);if(!f||!b)return;const m={id:`${t.start}_${t.end}`,type:"arrow",groupIds:e,x:l,y:c,strokeWidth:"thick"===t.stroke?4:2,strokeStyle:"dotted"===t.stroke?"dashed":void 0,points:p,...t.text?{label:{text:u(t),fontSize:o,groupIds:e}}:{},roundness:{type:2},...g,start:{id:f.id||""},end:{id:b.id||""}};r.push(m)}),{elements:r}}});let b=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_","");const m=new s({converter:t=>{const e=b(),{width:r,height:o}=t,n={type:"image",x:0,y:0,width:r,height:o,status:"saved",fileId:e};return{files:{[e]:{id:e,mimeType:t.mimeType,dataURL:t.dataURL}},elements:[n]}}}),x=(t,e)=>[t,e],w=t=>t.replace(/\\n/g,"\n"),S=t=>{const e={type:"line",x:t.startX,y:t.startY,points:[x(0,0),x(t.endX-t.startX,t.endY-t.startY)],width:t.endX-t.startX,height:t.endY-t.startY,strokeStyle:t.strokeStyle||"solid",strokeColor:t.strokeColor||"#000",strokeWidth:t.strokeWidth||1};return t.groupId&&Object.assign(e,{groupIds:[t.groupId]}),t.id&&Object.assign(e,{id:t.id}),e},A=t=>{const e={type:"text",x:t.x,y:t.y,width:t.width,height:t.height,text:w(t.text)||"",fontSize:t.fontSize,verticalAlign:"top",strokeColor:t.color};return t.groupId&&Object.assign(e,{groupIds:[t.groupId]}),t.id&&Object.assign(e,{id:t.id}),e},k=t=>{const e={text:w(t?.label?.text||""),fontSize:t?.label?.fontSize,textAlign:t.label?.textAlign,verticalAlign:t.label?.verticalAlign||"middle",strokeColor:t.label?.color||"#000",...t.groupId?{groupIds:[t.groupId]}:{}};let r={};"rectangle"===t.type&&"activation"===t.subtype&&(r={backgroundColor:"#e9ecef",fillStyle:"solid"});const o={id:t.id,type:t.type,x:t.x,y:t.y,width:t.width,height:t.height,label:e,strokeStyle:t?.strokeStyle,strokeWidth:t?.strokeWidth,strokeColor:t?.strokeColor,backgroundColor:t?.bgColor,fillStyle:"solid",...r};return t.groupId&&Object.assign(o,{groupIds:[t.groupId]}),o},E=t=>{const e={type:"arrow",x:t.startX,y:t.startY,points:t.points?.map(([t,e])=>x(t,e))||[x(0,0),x(t.endX-t.startX,t.endY-t.startY)],width:t.endX-t.startX,height:t.endY-t.startY,strokeStyle:t?.strokeStyle||"solid",endArrowhead:t?.endArrowhead||null,startArrowhead:t?.startArrowhead||null,label:{text:w(t?.label?.text||""),fontSize:16,textAlign:t?.label?.textAlign,verticalAlign:t?.label?.verticalAlign},roundness:{type:2},start:t.start,end:t.end};return t.groupId&&Object.assign(e,{groupIds:[t.groupId]}),e},v=t=>{if(!t)return!0;const e=t.trim().toLowerCase();return"transparent"===e||"none"===e||"rgba(0,0,0,0)"===e||"rgba(0, 0, 0, 0)"===e},C=(t,e,r=!0)=>{const o=t,n=o.groupIds??[];if(n.includes(e)||(o.groupIds=[...n,e]),!r||!o.label)return;const s=o.label.groupIds??[];s.includes(e)||(o.label.groupIds=[...s,e])},I=new s({converter:t=>{const e=[],r=[];if(Object.values(t.nodes).forEach(t=>{t&&t.length&&t.forEach(t=>{let o;switch(t.type){case"line":o=S(t);break;case"rectangle":case"ellipse":o=k(t);break;case"text":o=A(t);break;default:throw`unknown type ${t.type}`}"rectangle"===t.type&&"activation"===t?.subtype?r.push(o):e.push(o)})}),Object.values(t.lines).forEach(t=>{t&&e.push(S(t))}),Object.values(t.arrows).forEach(t=>{t&&(e.push(E(t)),t.sequenceNumber&&e.push(k(t.sequenceNumber)))}),e.push(...r),t.loops){const{lines:r,texts:o,nodes:n}=t.loops;r.forEach(t=>{e.push(S(t))}),o.forEach(t=>{e.push(A(t))}),n.forEach(t=>{e.push(k(t))})}return t.groups&&t.groups.forEach(t=>{const{actorKeys:r,name:o}=t;let n=1/0,s=1/0,i=0,a=0;if(!r.length)return;const l=e.filter(t=>{if(t.id){const e=t.id.indexOf("-"),o=t.id.substring(0,e);return r.includes(o)}return!1});if(!l.length)return;if(l.forEach(t=>{void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height&&(n=Math.min(n,t.x),s=Math.min(s,t.y),i=Math.max(i,t.x+t.width),a=Math.max(a,t.y+t.height))}),!(Number.isFinite(n)&&Number.isFinite(s)&&Number.isFinite(i)&&Number.isFinite(a)))return;const c=n-10,d=s-10,u=i-n+20,h=a-s+20,p=b(),g=b(),y=k({type:"rectangle",x:c,y:d,width:u,height:h,bgColor:v(t.fill)?void 0:t.fill,strokeColor:"#1f1f1f",strokeWidth:1,id:p,groupId:g});if(e.unshift(y),e.forEach(t=>{t.id!==p&&void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height&&t.x>=n&&t.x+t.width<=i&&t.y>=s&&t.y+t.height<=a&&C(t,g)}),o){const t=A({type:"text",id:b(),text:o,x:c+4,y:d-24,width:(f=o,m=16,Math.max(20,Math.round(f.length*m*.6))),height:24,fontSize:16,color:"#1f1f1f",groupId:g});C(t,g,!1),e.push(t)}var f,m}),{elements:e}}}),O=new s({converter:t=>{const e=[];return t.nodes.forEach(t=>{t&&t.length&&t.forEach(t=>{let r;switch(t.type){case"line":r=S(t);break;case"rectangle":case"ellipse":r=k(t);break;case"text":r=A(t);break;default:throw`unknown type ${t.type}`}e.push(r)})}),Object.values(t.lines).forEach(t=>{t&&e.push(S(t))}),Object.values(t.arrows).forEach(t=>{if(!t)return;const r=E(t);e.push(r)}),Object.values(t.text).forEach(t=>{const r=A(t);e.push(r)}),Object.values(t.namespaces).forEach(r=>{const o=Object.keys(r.classes),n=[...o],s=[...t.lines,...t.arrows,...t.text];o.forEach(t=>{const e=s.filter(e=>e.metadata&&e.metadata.classId===t).map(t=>t.id);e.length&&n.push(...e)});const i={type:"frame",id:b(),name:r.id,children:n};e.push(i)}),{elements:e}}}),L=new s({converter:t=>{const e=[];return t.nodes.forEach(t=>{t&&t.length&&t.forEach(t=>{let r;switch(t.type){case"line":r=S(t);break;case"rectangle":case"ellipse":r=k(t);break;case"text":r=A(t);break;default:throw`unknown type ${t.type}`}e.push(r)})}),t.lines.forEach(t=>{e.push(S(t))}),t.arrows.forEach(t=>{e.push(E(t))}),t.text.forEach(t=>{e.push(A(t))}),{elements:e}}}),N=(t,e)=>[t,e],$="#000000",T=new Set(["choice","fork","join","stateStart","stateEnd","divider"]),Y=t=>"stateEnd"===t.shape?[`state_end_group_${t.id}`]:void 0,R=t=>"rectWithTitle"===t.shape&&t.description.length?[t.text,...t.description].join("\n"):t.text;let X;const _=(t,e)=>{const r=(()=>{if(void 0!==X)return X;if("undefined"==typeof document)return X=null,X;try{X=document.createElement("canvas").getContext("2d")}catch{X=null}return X})();return r?(r.font=`${e}px Excalifont, sans-serif`,r.measureText(t).width):t.length*e*.6},q=(t,e,r)=>{if(_(t,e)<=r)return[t];const o=[];let n="";for(const s of t){const t=`${n}${s}`;n&&_(t,e)>r?(o.push(n),n=s):n=t}return n&&o.push(n),o},M=(t,e,r)=>{const o=t.map(t=>((t,e,r)=>{if(!t.trim())return t;if(_(t,e)<=r)return t;const o=t.split(/\s+/).filter(Boolean),n=[];let s="";for(const t of o){const o=q(t,e,r);for(const[t,i]of o.entries()){const o=s?`${s}${s&&0===t?" ":""}${i}`:i;_(o,e)<=r?s=o:(s&&n.push(s),s=i)}o.length}return n.push(s),n.join("\n")})(t,e,r)).join("\n"),n=o.split("\n");return{width:Math.max(...n.map(t=>_(t,e))),height:n.length*e*1.25}},z=t=>{const e=R(t);if(!e||T.has(t.shape))return 16;const r=Math.max(1,t.width-10),o=Math.max(1,t.height-10),n=e.split("\n");if(n.length>1){if(Math.max(...n.map(t=>_(t,16)))<=r)return 16}return((t,e,r,o)=>{const n=t.split("\n");for(let t=16;t>=14;t-=1){const{height:o}=M(n,t,e);if(o<=r)return t}return o})(e,r,o,1===n.length?16:14)},D=t=>{const e=p(t.containerStyle),r=(t=>{if(T.has(t.shape))return;const e=R(t);return e?{text:e,fontSize:z(t),verticalAlign:"rectWithTitle"===t.shape||"roundedWithTitle"===t.shape?"top":"middle",...g(t.labelStyle)}:void 0})(t),o="choice"===t.shape?"diamond":"stateStart"===t.shape||"stateEnd"===t.shape?"ellipse":"rectangle",n="rect"===t.shape||"rectWithTitle"===t.shape||"roundedWithTitle"===t.shape,s="stateStart"===t.shape||"fork"===t.shape||"join"===t.shape,i=e.backgroundColor||e.strokeColor||$,a=e.strokeColor||e.backgroundColor||$;return{id:t.id,type:o,...Y(t)?{groupIds:Y(t)}:{},x:t.x,y:t.y,width:t.width,height:t.height,...r?{label:r}:{},...e,...n?{roundness:{type:3}}:{},...s?{backgroundColor:i,strokeColor:a,fillStyle:"solid"}:{}}},W=new s({converter:t=>{const e=[];return t.nodes.forEach(t=>{if(!t.isRenderable)return;const r=D(t);e.push(r);const o=(t=>{if(!t.dividerLine)return null;const e=p(t.containerStyle);return{id:`${t.id}__divider`,type:"line",x:t.dividerLine.startX,y:t.dividerLine.startY,width:t.dividerLine.endX-t.dividerLine.startX,height:t.dividerLine.endY-t.dividerLine.startY,points:[N(0,0),N(t.dividerLine.endX-t.dividerLine.startX,t.dividerLine.endY-t.dividerLine.startY)],strokeColor:e.strokeColor||"#000",strokeWidth:e.strokeWidth||1}})(t);o&&e.push(o),"stateEnd"===t.shape&&e.push((t=>{const e=p(t.containerStyle),r=Math.max(2,.32*Math.min(t.width,t.height)),o=t.endInnerColor||e.strokeColor||e.backgroundColor||$;return{id:`${t.id}__inner`,type:"ellipse",groupIds:Y(t),x:t.x+r,y:t.y+r,width:Math.max(1,t.width-2*r),height:Math.max(1,t.height-2*r),backgroundColor:o,strokeColor:o,fillStyle:"solid",strokeWidth:1}})(t))}),t.edges.forEach(t=>{e.push((t=>{const e=t.reflectionPoints.map((t,e,r)=>{const o=r[0];return 0===e?N(0,0):N(t.x-o.x,t.y-o.y)});return{id:t.id,type:"arrow",x:t.startX,y:t.startY,width:t.endX-t.startX,height:t.endY-t.startY,points:e,strokeColor:t.strokeColor||"#000",strokeWidth:t.strokeWidth||2,strokeStyle:t.strokeStyle||"solid",endArrowhead:t.isNoteEdge?null:"triangle",roundness:{type:2},start:{id:t.start},end:{id:t.end},...t.text?{label:{text:t.text,fontSize:16}}:{}}})(t))}),{elements:e}}}),F=t=>{const e=(t=j(t)).replace(/#(\d+);/g,"&#$1;").replace(/#([a-z]+);/g,"&$1;"),r=document.createElement("textarea");return r.innerHTML=e,r.value},B=t=>{const e=t.getAttribute("transform"),r=e?.match(/translate\(([ \d.-]+),\s*([\d.-]+)\)/);let o=0,n=0;return r&&(o=Number(r[1]),n=Number(r[2])),{transformX:o,transformY:n}},j=function(t){return t.replace(/fl°°/g,"#").replace(/fl°/g,"&").replace(/¶ß/g,";")},K=(t,e=.5)=>{const r=[];return t.forEach(t=>{const o=r[r.length-1];if(!o)return void r.push(t);Math.hypot(t[0]-o[0],t[1]-o[1])<=e||r.push(t)}),r},P=t=>{const e=t.getAttribute("d");if(!e)return null;const r=Array.from(e.matchAll(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi),t=>Number(t[0]));return r.length<4?null:{startX:r[0],startY:r[1],endX:r[r.length-2],endY:r[r.length-1]}},U=t=>{const e=t.getAttribute("data-points");if(!e){const e=P(t);return e?[{x:e.startX,y:e.startY},{x:e.endX,y:e.endY}]:[]}try{const t=atob(e),r=JSON.parse(t);return Array.isArray(r)?r.filter(t=>t&&"number"==typeof t.x&&"number"==typeof t.y&&Number.isFinite(t.x)&&Number.isFinite(t.y)):[]}catch{return[]}},H=(t,e={x:0,y:0},r="LM")=>{if("path"!==t.tagName.toLowerCase())throw new Error(`Invalid input: Expected an HTMLElement of tag "path", got ${t.tagName}`);const o=t.getAttribute("d");if(!o)throw new Error('Path element does not contain a "d" attribute');const n=o.split(new RegExp(`(?=[${r}])`)),s=n[0].substring(1).split(",").map(t=>parseFloat(t)),i=n[n.length-1].substring(1).split(",").map(t=>parseFloat(t)),a=n.map(t=>{const e=t[0],r=t.substring(1).split(",").map(t=>parseFloat(t));return"C"===e?{x:r[4],y:r[5],command:e}:{x:r[0],y:r[1],command:e}}).filter((t,e,r)=>{if(0===e||e===r.length-1)return!0;if(t.x===r[e-1].x&&t.y===r[e-1].y)return!1;if(e===r.length-2&&"C"===t.command)return!1;if(e===r.length-2&&(r[e-1].x===t.x||r[e-1].y===t.y)){const e=r[r.length-1];return Math.hypot(e.x-t.x,e.y-t.y)>20}return t.x!==r[e-1].x||t.y!==r[e-1].y}).map(t=>({x:t.x+e.x,y:t.y+e.y}));return{startX:s[0]+e.x,startY:s[1]+e.y,endX:i[0]+e.x,endY:i[1]+e.y,reflectionPoints:a}},V=(t,e={})=>(t=>({...t,elements:t.elements.map(t=>{if(!("points"in t)||!Array.isArray(t.points))return t;const e=t.points;if(e.length<2)return t;const r=K(e);return r.length===e.length?t:{...t,points:r}})}))((()=>{switch(t.type){case"graphImage":return m.convert(t,e);case"flowchart":return f.convert(t,e);case"sequence":return I.convert(t,e);case"class":return O.convert(t,e);case"erd":return L.convert(t,e);case"state":return W.convert(t,e);default:throw new Error(`graphToExcalidraw: unknown graph type "${t.type}, only flowcharts are supported!"`)}})());var G=r(62300);const J=t=>t.replace(/\s*!important\s*$/i,"").trim(),Z=(t,e)=>{let r=e;for(;r<t.length&&/\s/.test(t[r]);)r+=1;const o=r;for(;r<t.length&&/[a-z-]/i.test(t[r]);)r+=1;if(r===o)return!1;for(;r<t.length&&/\s/.test(t[r]);)r+=1;return":"===t[r]},Q=t=>{const e=[];let r=0;for(;r<t.length;){for(;r<t.length&&/[\s;,]/.test(t[r]);)r+=1;if(r>=t.length)break;const o=r;for(;r<t.length&&":"!==t[r]&&";"!==t[r]&&","!==t[r];)r+=1;if(r>=t.length||":"!==t[r])break;const n=t.substring(o,r).trim().toLowerCase();r+=1;const s=r;let i=0,a=null;for(;r<t.length;){const e=t[r];if(a)e===a&&"\\"!==t[r-1]&&(a=null),r+=1;else if('"'!==e&&"'"!==e)if("("!==e)if(")"!==e){if(0===i){if(";"===e||","===e)break;if(/\s/.test(e)&&Z(t,r))break}r+=1}else i=Math.max(0,i-1),r+=1;else i+=1,r+=1;else a=e,r+=1}const l=J(t.substring(s,r));n&&l&&e.push({property:n,value:l}),r<t.length&&(";"===t[r]||","===t[r])&&(r+=1)}return e},tt=t=>{const e=J(t);if(!e)return!1;if("undefined"!=typeof CSS&&"function"==typeof CSS.supports)return CSS.supports("color",e);if("undefined"!=typeof document){const t=document.createElement("div");return t.style.color="",t.style.color=e,""!==t.style.color}return!1},et=(t,e)=>{const r=t.getAttribute("style");return r&&Q(r).find(t=>t.property===e)?.value||""},rt=(...t)=>{for(const e of t){const t=J(e||"");if(tt(t))return t}},ot=(t,e)=>{const r=t.querySelector("text, foreignObject, div, span, p")||t,o=rt(r.getAttribute?.("fill"),et(r,"fill"),r.style?.fill);if(o)return o;const n=rt(r.getAttribute?.("color"),et(r,"color"),r.style?.color);if(n)return n;const s=rt(e);return s||void 0},nt=(t,e,r)=>{switch(e){case l.FILL:case l.STROKE:tt(r)&&(t[e]=r);break;case l.STROKE_WIDTH:case l.STROKE_DASHARRAY:t[e]=r}},st=(t,e,r)=>{e===a.COLOR&&tt(r)&&(t[a.COLOR]=r)},it=(t,e,r)=>{t&&Q(t).forEach(({property:t,value:o})=>{nt(e,t,o),st(r,t,o)})},at=(t,e)=>{t&&Q(t).forEach(({property:t,value:r})=>{"fill"===t&&tt(r)?e[a.COLOR]=r:st(e,t,r)})},lt=(t,e)=>{if(!t)return;[[l.FILL,t.getAttribute("fill")],[l.STROKE,t.getAttribute("stroke")],[l.STROKE_WIDTH,t.getAttribute("stroke-width")],[l.STROKE_DASHARRAY,t.getAttribute("stroke-dasharray")]].forEach(([t,r])=>{const o=J(r||"");o&&nt(e,t,o)})},ct=(t,e)=>{if(!t)return;const r=t.getAttribute("fill")||t.getAttribute("color"),o=J(r||"");tt(o)&&(e[a.COLOR]=o)},dt=(t,e,r,o)=>{if(!(e instanceof Map))return;const n=e.get(t);n&&(n.styles?.forEach(t=>{Q(t).forEach(({property:t,value:e})=>{nt(r,t,e),st(o,t,e)})}),n.textStyles?.forEach(t=>{Q(t).forEach(({property:t,value:e})=>{st(o,t,e)})}))},ut=(t,e,r)=>{const o=e.querySelector(`[id*="${t.domId}"]`);if(!o)return;let n;"a"===o.parentElement?.tagName.toLowerCase()&&(n=o.parentElement.getAttribute("xlink:href"));const s=ht(n?o.parentElement:o,e),i=o.getBBox(),a={width:i.width,height:i.height},l={},c={};t.classes&&r instanceof Map&&(Array.isArray(t.classes)?t.classes:[t.classes]).forEach(t=>{dt(t,r,l,c)}),t.styles?.forEach(t=>{it(t,l,c)});const d=o.querySelector(".label-container");it(d?.getAttribute("style"),l,c),lt(d,l);return Array.from(o.querySelectorAll(".label, .nodeLabel, .label text, .label tspan, .label span, .label div")).forEach(t=>{at(t.getAttribute("style"),c),ct(t,c)}),{id:t.id,labelType:t.labelType,text:F(t.text||""),type:t.type,link:n||void 0,...s,...a,containerStyle:l,labelStyle:c}},ht=(t,e)=>{if(!t)throw new Error("Element not found");let r=t.parentElement?.parentElement;const o=t.childNodes[0];let n={x:0,y:0};if(o){const{transformX:t,transformY:e}=B(o),r=o.getBBox();n={x:Number(o.getAttribute("x"))||t+r.x||0,y:Number(o.getAttribute("y"))||e+r.y||0}}const{transformX:s,transformY:i}=B(t),a={x:s+n.x,y:i+n.y};for(;r&&r.id!==e.id;){if("root"===r.classList.value&&r.hasAttribute("transform")){const{transformX:t,transformY:e}=B(r);a.x+=t,a.y+=e}r=r.parentElement}return a},pt=(t,e)=>{const r=t.getVertices(),o=t.getEdges(),n=t.getSubGraphs(),s=t.getClasses(),i={},a=s instanceof Map?s:{};r instanceof Map?r.forEach((t,r)=>{i[r]=ut(t,e,a)}):"object"==typeof r&&null!==r&&Object.entries(r).forEach(([t,r])=>{i[t]=ut(r,e,a)});const l=new Map,c=(Array.isArray(o)?o:[]).map(t=>{if(!e.querySelector(`[id*="${t.id}"]`))return null;const r=`${t.start}-${t.end}`,o=l.get(r)||0;return l.set(r,o+1),((t,e,r)=>{const o=r.querySelector(`[id*="${t.id}"]`);if(!o)throw new Error("Edge element not found");const n=ht(o,r),s=H(o,n);return t.length=void 0,{...t,...s,text:F(t.text)}})(t,0,e)}).filter(t=>null!==t&&t.reflectionPoints.length>1),d=(Array.isArray(n)?n:[]).map(t=>((t,e,r)=>{const o=t.nodes.map(t=>t.startsWith("flowchart-")?t.split("-")[1]:t),n=e.querySelector(`[id='${t.id}']`);if(!n)throw new Error("SubGraph element not found");const s=ht(n,e),i=n.getBBox(),a={width:i.width,height:i.height},l={},c={},d=n.querySelector(":scope > rect, :scope > path, :scope > polygon, :scope > ellipse")||n.querySelector(".cluster > rect, .cluster > path, .cluster > polygon, .cluster > ellipse")||n.querySelector("rect, path, polygon, ellipse");it(n.getAttribute("style"),l,c),it(d?.getAttribute("style"),l,c),lt(d,l);const u=n.querySelector(".cluster-label text, .cluster-label tspan")||n.querySelector("text");return at(u?.getAttribute("style"),c),ct(u,c),dt(t.id,r,l,c),t.classes?.forEach(t=>{dt(t,r,l,c)}),{id:t.id,nodeIds:o,text:F(t.title),labelType:"text",...s,...a,containerStyle:l,labelStyle:c}})(t,e,a));return{type:"flowchart",subGraphs:d,vertices:i,edges:c}},gt=(t,e,r,o,n)=>{const s={type:"arrow"};return s.startX=t,s.startY=e,s.endX=r,s.endY=o,Object.assign(s,{...n}),s},yt=(t,e,r,o)=>({type:"text",x:t,y:e,text:r,width:o?.width||20,height:o?.height||20,fontSize:o?.fontSize||20,id:o?.id,color:o?.color,groupId:o?.groupId,metadata:o?.metadata}),ft=(t,e,r)=>{const o={},n=Number(t.getAttribute("x")),s=Number(t.getAttribute("y"));o.type="text",o.text=F(e),r?.id&&(o.id=r.id),r?.groupId&&(o.groupId=r.groupId);const i=t.getBBox();o.width=i.width,o.height=i.height,o.x=n-i.width/2,o.y=s;const a=parseInt(getComputedStyle(t).fontSize);return o.fontSize=a,o.color=ot(t),o},bt=(t,e,r={})=>{const o={};o.type=e;const{label:n,subtype:s,id:i,groupId:a}=r;o.id=i,a&&(o.groupId=a),n&&(o.label={text:F(n.text),fontSize:16,textAlign:n?.textAlign,verticalAlign:n?.verticalAlign});const l=t.getBBox();switch(o.x=l.x,o.y=l.y,o.width=l.width,o.height=l.height,o.subtype=s,s){case"highlight":const e=t.getAttribute("fill");e&&(o.bgColor=J(e));break;case"note":o.strokeStyle="dashed"}return o},mt=(t,e,r,o,n,s)=>{const i={};i.startX=e,i.startY=r,i.endX=o,s?.groupId&&(i.groupId=s.groupId),s?.id&&(i.id=s.id),i.endY=n;const a=t.getAttribute("stroke");return i.strokeColor=a?J(a):null,i.strokeWidth=Number(t.getAttribute("stroke-width")),i.type="line",i},xt={0:"SOLID",1:"DOTTED",3:"SOLID_CROSS",4:"DOTTED_CROSS",5:"SOLID_OPEN",6:"DOTTED_OPEN",24:"SOLID_POINT",25:"DOTTED_POINT"},wt=0,St=1,At=2,kt=3,Et=4,vt=5,Ct=6,It=24,Ot=25,Lt=27,Nt=t=>{let e;switch(t){case wt:case kt:case vt:case It:e="solid";break;case St:case Et:case Ct:case Ot:e="dotted";break;default:e="solid"}return e},$t=(t,e,r)=>{if(!t)throw"root node not found";const n=b(),s=Array.from(t.children),i=[];return s.forEach((t,s)=>{const a=`${r?.id}-${s}`;let l;switch(t.tagName){case"line":const r=Number(t.getAttribute("x1")),s=Number(t.getAttribute("y1")),i=Number(t.getAttribute("x2")),c=Number(t.getAttribute("y2"));l=mt(t,r,s,i,c,{groupId:n,id:a});break;case"text":l=ft(t,e,{groupId:n,id:a});break;case"circle":l=bt(t,"ellipse",{label:t.textContent?{text:t.textContent}:void 0,groupId:n,id:a});default:l=bt(t,o[t.tagName],{label:t.textContent?{text:t.textContent}:void 0,groupId:n,id:a})}i.push(l)}),i},Tt=(t,e)=>{const r=e.getAttribute("fill"),o=e.getAttribute("stroke"),n=e.getAttribute("stroke-width"),s=e.getAttribute("stroke-dasharray");r&&"none"!==r&&(t.bgColor=J(r)),o&&"none"!==o&&(t.strokeColor=J(o)),n&&(t.strokeWidth=Number(n)),s&&s.trim()&&(t.strokeStyle="dashed")},Yt=(t,e,r)=>{const o=[],n=Array.from(e.querySelectorAll('[class*="messageLine"]')),s=Object.keys(xt),i=t.filter(t=>s.includes(t.type.toString()));return n.forEach((t,e)=>{const n=i[e],s=xt[n.type],a=((t,e)=>{const r={};e?.label&&(r.label={text:F(e.label),fontSize:16});const o=t.tagName;if("line"===o)r.startX=Number(t.getAttribute("x1")),r.startY=Number(t.getAttribute("y1")),r.endX=Number(t.getAttribute("x2")),r.endY=Number(t.getAttribute("y2"));else if("path"===o){const e=t.getAttribute("d");if(!e)throw new Error('Path element does not contain a "d" attribute');const o=e.split(/(?=[LC])/),n=o[0].substring(1).split(",").map(t=>parseFloat(t)),s=[];o.forEach(t=>{const e=t.substring(1).trim().split(" ").map(t=>{const[e,r]=t.split(",");return[parseFloat(e)-n[0],parseFloat(r)-n[1]]});s.push(...e)});const i=s[s.length-1];r.startX=n[0],r.startY=n[1],r.endX=i[0],r.endY=i[1],r.points=s}if(e?.label){const t=10;r.startY=r.startY-t,r.endY=r.endY-t}const n=t.getAttribute("stroke"),s=(n&&"none"!==n?n:"")||getComputedStyle(t).stroke||"";return r.strokeColor=s?J(s):null,r.strokeWidth=Number(t.getAttribute("stroke-width")),r.type="arrow",r.strokeStyle=e?.strokeStyle||"solid",r.startArrowhead=e?.startArrowhead||null,r.endArrowhead=e?.endArrowhead||null,r})(t,{label:n?.message,strokeStyle:Nt(n.type),endArrowhead:"SOLID_OPEN"===s||"DOTTED_OPEN"===s?null:"arrow"}),l=r[n.from],c=r[n.to];l?.topId&&c?.topId&&(a.start={type:l.bindType||"rectangle",id:l.topId},a.end={type:c.bindType||"rectangle",id:c.topId}),((t,e)=>{if(t.nextElementSibling?.classList.contains("sequenceNumber")){const r=t.nextElementSibling?.textContent;if(!r)throw new Error("sequence number not present");const o=30,n=o/2,s=10,i={type:"rectangle",x:e.startX-s,y:e.startY-n,label:{text:r,fontSize:14},bgColor:"#e9ecef",height:o,subtype:"sequence"};Object.assign(e,{sequenceNumber:i})}})(t,a),o.push(a)}),o},Rt=(t,e)=>{const r=t.db,o=[],n=r.getBoxes().map(t=>({...t,fill:J(t.fill||"")})),s=(t=>{const e=Array.from(t.querySelectorAll(".rect")).filter(t=>"g"!==t.parentElement?.tagName),r=[];return e.forEach(t=>{const e=bt(t,"rectangle",{label:{text:""},subtype:"highlight"});r.push(e)}),r})(e),i=r.getActors(),{nodes:a,lines:l,actorMap:c}=((t,e)=>{const r=Array.from(e.querySelectorAll(".actor-top")),o=Array.from(e.querySelectorAll(".actor-bottom")),n=[],s=[],i={},a=t instanceof Map?Array.from(t.values()):Object.values(t),l=Array.from(e.querySelectorAll(".actor-line")),c=(t,e)=>{const r=t.name,o=l.find(t=>t.getAttribute("name")===r);if(o)return o;const n="participant"===t.type?e.parentElement?.previousElementSibling:e.previousElementSibling;return n?"line"===n.tagName?n:n.querySelector("line"):null};return a.forEach(t=>{const e=r.find(e=>e.getAttribute("name")===t.name),a=o.find(e=>e.getAttribute("name")===t.name);if(!e||!a)throw"root not found";const l=t.description;if("participant"===t.type){const r=bt(e,"rectangle",{id:`${t.name}-top`,label:{text:l},subtype:"actor"});if(Tt(r,e),!r)throw"Top Node element not found!";n.push([r]);const o=bt(a,"rectangle",{id:`${t.name}-bottom`,label:{text:l},subtype:"actor"});i[t.name]={topId:`${t.name}-top`,bottomId:`${t.name}-bottom`,bindType:"rectangle"},Tt(o,a),n.push([o]);const d=c(t,e);if("line"!==d?.tagName)throw"Line not found";const u=Number(d.getAttribute("x1"));if(!r.height)throw"Top node element height is null";const h=r.y+r.height,p=o.y,g=Number(d.getAttribute("x2")),y=mt(d,u,h,g,p);s.push(y)}else if("actor"===t.type){const r=$t(e,l,{id:`${t.name}-top`});n.push(r);const o=$t(a,l,{id:`${t.name}-bottom`});n.push(o);const d=c(t,e);if("line"!==d?.tagName)throw"Line not found";const u=Number(d.getAttribute("x1")),h=Number(d.getAttribute("y1")),p=Number(d.getAttribute("x2")),g=o.find(t=>"ellipse"===t.type);if(g){const t=g.y,e=mt(d,u,h,p,t);s.push(e)}const y=r.find(t=>"ellipse"===t.type),f=o.find(t=>"ellipse"===t.type);y?.id&&f?.id&&(i[t.name]={topId:y.id,bottomId:f.id,bindType:"ellipse"})}}),{nodes:n,lines:s,actorMap:i}})(i,e),d=r.getMessages(),u=Yt(d,e,c),h=((t,e)=>{const r=Array.from(e.querySelectorAll(".note")).map(t=>t.parentElement),o=t.filter(t=>t.type===At),n=[];return r.forEach((t,e)=>{if(!t)return;const r=t.firstChild,s=o[e].message,i=bt(r,"rectangle",{label:{text:s},subtype:"note"}),a=r.getAttribute("fill"),l=r.getAttribute("stroke"),c=r.getAttribute("stroke-width"),d=r.getAttribute("stroke-dasharray");a&&"none"!==a&&(i.bgColor=J(a)),l&&"none"!==l&&(i.strokeColor=J(l)),c&&(i.strokeWidth=Number(c)),d&&d.trim()&&(i.strokeStyle="dashed"),n.push(i)}),n})(d,e),p=(t=>{const e=Array.from(t.querySelectorAll("[class*=activation]")),r=[];return e.forEach(t=>{const e=bt(t,"rectangle",{label:{text:""},subtype:"activation"});(()=>{const r=t.getAttribute("fill"),o=t.getAttribute("stroke"),n=t.getAttribute("stroke-width"),s=t.getAttribute("stroke-dasharray");r&&"none"!==r&&(e.bgColor=J(r)),o&&"none"!==o&&(e.strokeColor=J(o)),n&&(e.strokeWidth=Number(n)),s&&s.trim()&&(e.strokeStyle="dashed")})(),r.push(e)}),r})(e),g=((t,e)=>{const r=Array.from(e.querySelectorAll(".loopLine")),o=[],n=[],s=[];r.forEach(t=>{const e=Number(t.getAttribute("x1")),r=Number(t.getAttribute("y1")),n=Number(t.getAttribute("x2")),s=Number(t.getAttribute("y2")),i=mt(t,e,r,n,s);i.strokeStyle="dotted",i.strokeColor="#adb5bd",i.strokeWidth=2,o.push(i)});const i=Array.from(e.querySelectorAll(".loopText")),a=t.filter(t=>t.type===Lt).map(t=>t.message);i.forEach(t=>{const e=t.textContent||"",r=ft(t,e),o=e.match(/\[(.*?)\]/)?.[1]||"";a.includes(o)&&(r.x+=16),n.push(r)});const l=Array.from(e?.querySelectorAll(".labelBox")),c=Array.from(e?.querySelectorAll(".labelText"));return l.forEach((t,e)=>{const r=c[e]?.textContent||"",o=bt(t,"rectangle",{label:{text:r}});o.strokeColor="#adb5bd",o.bgColor="#e9ecef",o.width=void 0,s.push(o)}),{lines:o,texts:n,nodes:s}})(d,e);return o.push(s),o.push(...a),o.push(h),o.push(p),{type:"sequence",lines:l,arrows:u,nodes:o,loops:g,groups:n}},Xt=0,_t=1,qt=2,Mt=0,zt=1,Dt=t=>{let e;switch(t){case Xt:e="diamond_outline";break;case qt:e="diamond";break;case _t:e="triangle_outline";break;case"none":e=null;break;default:e="arrow"}return e},Wt=(t,e)=>{let r=0,o=0,n=t;for(;n&&n!==e;){const{transformX:t,transformY:e}=B(n);r+=t,o+=e,n=n.parentElement}return{tx:r,ty:o}},Ft=new Set(["triangle_outline","diamond","diamond_outline"]),Bt=(t,e=.5)=>{if(t.length<=2)return[...t];const r=[t[0]];for(let o=1;o<t.length-1;o++){const n=r[r.length-1],s=t[o],i=t[o+1],a=i.x-n.x,l=i.y-n.y,c=Math.hypot(a,l);if(!c)continue;const d=Math.abs(a*(s.y-n.y)-l*(s.x-n.x))/c,u=((s.x-n.x)*a+(s.y-n.y)*l)/(c*c);d<=e&&u>=-e&&u<=1+e||r.push(s)}return r.push(t[t.length-1]),r},jt=t=>{const e=K(U(t).map(t=>[t.x,t.y])).map(([t,e])=>({x:t,y:e})),r=P(t);return r&&e.length>=2&&(e[0]={x:r.startX,y:r.startY},e[e.length-1]={x:r.endX,y:r.endY}),Bt(e)},Kt=(t,e,r)=>{const o=t.x-e.x,n=t.y-e.y,s=Math.hypot(o,n);return s?{x:t.x+o/s*r,y:t.y+n/s*r}:t},Pt=t=>{const e=t.points?.map(([e,r])=>({x:t.startX+e,y:t.startY+r})).filter(t=>Number.isFinite(t.x)&&Number.isFinite(t.y));if(!e||e.length<2)return t;const r=[...e],o=!!t.startArrowhead&&Ft.has(t.startArrowhead),n=!!t.endArrowhead&&Ft.has(t.endArrowhead);if(!o&&!n)return t;if(o&&(r[0]=Kt(r[0],r[1],16)),n){const t=r.length-1;r[t]=Kt(r[t],r[t-1],16)}return((t,e)=>{const r=K(e.map(t=>[t.x,t.y])).map(([t,e])=>({x:t,y:e}));if(r.length<2)throw new Error("Arrow route must contain at least two points");const o=r[0],n=r[r.length-1];t.startX=o.x,t.startY=o.y,t.endX=n.x,t.endY=n.y,t.points=r.map(t=>[t.x-o.x,t.y-o.y])})(t,r),t},Ut=(t,e,r)=>{if(t.length<2)throw new Error(`Class diagram edge ${e?.id||"<unknown>"} is missing usable path points`);const o=t[0],n=t[t.length-1],s=gt(o.x,o.y,n.x,n.y,{id:e?.getAttribute("data-id")||e?.id||void 0,...r,points:t.map(t=>[t.x-o.x,t.y-o.y])});return e&&((t,e)=>{const r=J(t.getAttribute("stroke")||getComputedStyle(t).stroke||""),o=parseFloat(t.getAttribute("stroke-width")||getComputedStyle(t).strokeWidth||"1");tt(r)&&"none"!==r&&(e.strokeColor=r),Number.isFinite(o)&&o>0&&(e.strokeWidth=o)})(e,s),Pt(s)},Ht=(t,e)=>Ut((t=>{const e=[];return t.forEach(t=>{jt(t).forEach(t=>{const r=e[e.length-1];r&&r.x===t.x&&r.y===t.y||e.push(t)})}),Bt(e)})(t),t[0],e),Vt=(t,e)=>{const r=(t=>t.points?.map(([e,r])=>({x:t.startX+e,y:t.startY+r})).filter(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))||[])(t);if(r.length<2)return null;const o="start"===e,n=o?r[0]:r[r.length-1],s=o?r[1]:r[r.length-2],i=s.x===n.x?o?-1:1:Math.sign(s.x-n.x),a=s.y===n.y?1:Math.sign(s.y-n.y);return{x:n.x+20*i,y:n.y+(a>=0?12:-28)}},Gt=(t,e)=>{let r=t;for(;r&&r!==e;){if(r.classList.contains("annotation-group"))return"header";if(r.classList.contains("label-group"))return"header";if(r.classList.contains("members-group"))return"members";if(r.classList.contains("methods-group"))return"methods";r=r.parentElement}return"other"},Jt=(t,e,r)=>{const o=[],n=[],s=[];return Object.values(t).forEach(t=>{const{domId:i,id:a}=t,l=b(),c=(t=>{const e={};return t?(t.forEach(t=>{Q(t).forEach(({property:t,value:r})=>{t&&r&&(e[t]=J(r))})}),e):e})(t.styles||t.cssStyles);let d;try{d=r?r(a):void 0}catch{d=void 0}const u=d&&e.querySelector(`#${d}`)||e.querySelector(`#${i}`)||e.querySelector(`[data-id='${a}']`)||(t=>{const r=new RegExp(`^classId-${t}(?:-|$)`);return Array.from(e.querySelectorAll("[id]")).filter(t=>r.test(t.id))[0]})(a);if(!u)throw Error(`DOM Node with id ${i} not found`);const h=u.querySelector("rect")||u,p=h.getBBox(),{tx:g,ty:y}=Wt(h,e),f={type:"rectangle",id:a,groupId:l,x:p.x+g,y:p.y+y,width:p.width,height:p.height,metadata:{classId:a}},m=h.getAttribute("fill"),x=h.getAttribute("stroke"),w=h.getAttribute("stroke-width"),S=h.getAttribute("stroke-dasharray"),A=getComputedStyle(h),k=J(m||c.fill||(m?A.fill:"")),E=J(x||c.stroke||(x?A.stroke:"")),v=w||c["stroke-width"]||(w?A.strokeWidth:""),C=S||c["stroke-dasharray"]||(S?"none"===A.strokeDasharray?"":A.strokeDasharray:""),I=t=>{if(!t)return!1;if(!tt(t))return!1;const e=t.toLowerCase();return!("none"===e||"transparent"===e||"rgba(0, 0, 0, 0)"===e||"black"===e||"#000"===e||"#000000"===e||"rgb(0, 0, 0)"===e||"rgba(0, 0, 0, 1)"===e)};I(k)?f.bgColor=k:f.bgColor=void 0,I(E)?f.strokeColor=E:f.strokeColor=void 0,f.strokeWidth=v?Number(v):void 0,C&&C.trim().length>0?f.strokeStyle="dashed":f.strokeStyle=void 0,o.push(f);[...Array.from(u.querySelectorAll("line")),...Array.from(u.querySelectorAll("g.divider path"))].forEach(t=>{const{tx:r,ty:o}=Wt(t,e);let s,i,c,d;if("line"===t.tagName.toLowerCase())s=Number(t.getAttribute("x1"))+r,i=Number(t.getAttribute("y1"))+o,c=Number(t.getAttribute("x2"))+r,d=Number(t.getAttribute("y2"))+o;else{const e=t.getBBox();s=e.x+r,c=e.x+e.width+r;const n=e.y+e.height/2+o;i=n,d=n}if(s===c&&i===d)return;const u=mt(t,s,i,c,d,{groupId:l,id:b()});f.strokeColor?u.strokeColor=f.strokeColor:u.strokeColor=void 0,void 0!==f.strokeWidth?u.strokeWidth=f.strokeWidth:u.strokeWidth=void 0,f.strokeStyle?u.strokeStyle=f.strokeStyle:u.strokeStyle=void 0,u.metadata={classId:a},n.push(u)});const O=Array.from(u.querySelectorAll("text, foreignObject")),L=[];O.forEach(t=>{const r="foreignobject"===t.tagName.toLowerCase(),o=r?[]:Array.from(t.querySelectorAll("tspan")),n=o.length?o.map(t=>t.textContent?.trim()).filter(Boolean).join("\n"):t.textContent?.trim()||"";if(!n)return;const s=t.getBBox(),{ty:i}=Wt(t,e);let a=parseFloat(getComputedStyle(t).fontSize||"");if(r&&(!Number.isFinite(a)||!a)){const e=t.querySelector("div, span, p");e&&(a=parseFloat(getComputedStyle(e).fontSize||""))}(!Number.isFinite(a)||a<=0)&&(a=Math.max(12,.6*s.height)),a*=.9;const l=ot(t,c.color);L.push({section:Gt(t,u),text:F(n),x:s.x,y:s.y+i,width:f&&f.width?Math.max(f.width-8,s.width):s.width,height:s.height,fontSize:a,color:l})});const N=L.filter(t=>"header"===t.section).sort((t,e)=>t.y-e.y||t.x-e.x);if(!f.label){const t=0===N.length&&1===L.length?L:N;t.length>0&&(f.label={text:t.map(t=>t.text).join("\n"),fontSize:Math.max(...t.map(t=>t.fontSize)),color:t.find(t=>t.color)?.color,verticalAlign:"top"})}L.filter(t=>N.length>0?"header"!==t.section:!(f.label&&1===L.length)).forEach(t=>{const e=yt((f?.x||0)+4,t.y,t.text,{width:t.width,height:t.height,fontSize:t.fontSize,color:t.color,id:b(),groupId:l,metadata:{classId:a}});s.push(e)})}),{nodes:o,lines:n,text:s}},Zt=(t,e,r,o)=>{const n=Array.from(r.querySelectorAll('.edgePaths path[data-edge="true"]:not([id^="edgeNote"]):not([id*="-cyclic-special-"])'));if(0===t.length)return{arrows:[],text:[]};const s=[],i=[];let a=0;return t.forEach(t=>{const{id1:l,id2:c,relation:d}=t,u=e.find(t=>t.id===l),h=e.find(t=>t.id===c);if(!u)throw new Error(`parseRelations: Cannot find node with id ${l}`);if(!h)throw new Error(`parseRelations: Cannot find node with id ${c}`);const p=(t=>{let e;switch(t){case Mt:e="solid";break;case zt:e="dotted";break;default:e="solid"}return e})(d.lineType),g=Dt(d.type1),y=Dt(d.type2);let f;if(l===c){const e=((t,e)=>[`${t}-cyclic-special-1`,`${t}-cyclic-special-mid`,`${t}-cyclic-special-2`].map(t=>e.querySelector(`path[id="${t}"][data-edge="true"]`)).filter(t=>null!==t))(l,r);if(!e.length)throw new Error(`parseRelations: Cannot find rendered SVG edge for relation ${l} -> ${c}`);f=Ht(e,{strokeStyle:p,startArrowhead:g,endArrowhead:y,label:t.title?{text:t.title}:void 0,start:{type:"rectangle",id:u.id},end:{type:"rectangle",id:h.id}})}else{const e=n[a];if(!e)throw new Error(`parseRelations: Cannot find rendered SVG edge for relation ${l} -> ${c}`);a+=1,f=((t,e)=>{const r=jt(t);return Ut([r[0],r[r.length-1]],t,e)})(e,{strokeStyle:p,startArrowhead:g,endArrowhead:y,label:t.title?{text:t.title}:void 0,start:{type:"rectangle",id:u.id},end:{type:"rectangle",id:h.id}})}s.push(f);const{relationTitle1:b,relationTitle2:m}=t,x=l===c,w=20,S=15,A=15;let k,E;if(b&&"none"!==b){if(x){const t=Vt(f,"start");t&&(k=t.x,E=t.y)}else switch(o){case"TB":k=f.startX-w,f.endX<f.startX&&(k-=A),E=f.startY+S;break;case"BT":k=f.startX+w,f.endX>f.startX&&(k+=A),E=f.startY-S;break;case"LR":k=f.startX+w,E=f.startY+S,f.endY>f.startY&&(E+=A);break;case"RL":k=f.startX-w,E=f.startY-S,f.startY>f.endY&&(E-=A);break;default:k=f.startX-w,E=f.startY+S}k??=f.startX-w,E??=f.startY+S;const t=yt(k,E,b,{fontSize:16});i.push(t)}if(m&&"none"!==m){if(x){const t=Vt(f,"end");t&&(k=t.x,E=t.y)}else switch(o){case"TB":k=f.endX+w,f.endX<f.startX&&(k+=A),E=f.endY-S;break;case"BT":k=f.endX-w,f.endX>f.startX&&(k-=A),E=f.endY+S;break;case"LR":k=f.endX-w,E=f.endY-S,f.endY>f.startY&&(E-=A);break;case"RL":k=f.endX+w,E=f.endY+S,f.startY>f.endY&&(E+=A);break;default:k=f.endX+w,E=f.endY-S}k??=f.endX+w,E??=f.endY+S;const t=yt(k,E,m,{fontSize:16});i.push(t)}}),{arrows:s,text:i}},Qt=(t,e,r)=>{const o=[],n=[];return t.forEach((t,s)=>{const{id:i,text:a,class:l}=t,c=e.querySelector(`#${i}`);if(!c)throw new Error(`Node with id ${i} not found!`);const{transformX:d,transformY:u}=B(c),h=c.firstChild,p=bt(h,"rectangle",{id:i,subtype:"note",label:{text:a}});if(Object.assign(p,{x:p.x+d,y:p.y+u}),o.push(p),l){const t=r.find(t=>t.id===l);if(!t)throw new Error(`class node with id ${l} not found!`);const o=e.querySelector(`path[id="edgeNote${s+1}"][data-edge="true"]`);if(o)return void n.push(((t,e)=>Ht([t],e))(o,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:p.id,type:"rectangle"},end:{id:t.id,type:"rectangle"}}));const i=p.x+(p.width||0)/2,a=p.y+(p.height||0),c=i,d=t.y,u=gt(i,a,c,d,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:p.id,type:"rectangle"},end:{id:t.id,type:"rectangle"}});n.push(u)}}),{notes:o,connectors:n}},te=(t,e)=>{let r=0,o=0,n=t;for(;n&&n!==e;){const{transformX:t,transformY:e}=B(n);r+=t,o+=e,n=n.parentElement}return{tx:r,ty:o}},ee=t=>{const e=t.querySelector("text, foreignObject, div, span, p")||t;let r=parseFloat(getComputedStyle(e).fontSize||"");return(!Number.isFinite(r)||r<=0)&&(r=Math.max(12,.75*t.getBBox().height)),r},re=(t,e,r)=>{const o=(t=>{const e=Array.from(t.querySelectorAll("tspan")),r=e.length?e.map(t=>t.textContent?.trim()).filter(Boolean).join("\n"):t.textContent?.trim()||"";return F(r)})(t);if(!o)return null;const n=t.getBBox(),{tx:s,ty:i}=te(t,e);return{className:t.getAttribute("class")||"",text:o,x:n.x+s,y:n.y+i,width:n.width,height:n.height,fontSize:ee(t),color:ot(t,r)}},oe=t=>{switch(t?.toLowerCase()){case"one":return"cardinality_one";case"many":return"cardinality_many";case"only_one":return"cardinality_exactly_one";case"one_or_more":return"cardinality_one_or_many";case"zero_or_one":return"cardinality_zero_or_one";case"zero_or_more":return"cardinality_zero_or_many";default:return null}},ne=t=>{switch(t){case"dotted":return"dotted";case"dashed":return"dashed";default:return"solid"}},se=(t,e)=>{const r=e.querySelector(`[id="${t.id}"]`);if(!r)throw new Error(`ER entity ${t.id} not found in rendered SVG`);const o=t.attributes.length?b():void 0,n=r.getBBox(),{tx:s,ty:i}=te(r,e),a=(t=>{const e={};return t?(t.forEach(t=>{Q(t).forEach(({property:t,value:r})=>{t&&r&&(e[t]=J(r))})}),e):e})([...t.cssStyles||[],...t.cssCompiledStyles||[]]),l=J(a.fill||""),c=J(a.stroke||""),d=(t=>{if(null==t||""===t)return;const e="number"==typeof t?t:parseFloat(J(t));return!Number.isFinite(e)||e<=0?void 0:e})(a["stroke-width"]),u=J(a["stroke-dasharray"]||""),h=Array.from(r.querySelectorAll("g.label")).map(t=>re(t,e,a.color)).filter(t=>null!==t),p=h.find(t=>t.className.includes("name"))||h[0],g=h.filter(t=>t!==p),y=p?.text||F(t.alias||t.label||""),f={type:"rectangle",id:t.id,groupId:o,x:n.x+s,y:n.y+i,width:n.width,height:n.height,label:{text:y,fontSize:t.attributes.length?18:p?.fontSize||16,color:p?.color,textAlign:"center",verticalAlign:t.attributes.length?"top":"middle"},metadata:{entityId:t.id,entityLabel:t.label,entityAlias:t.alias}};tt(l)&&"none"!==l&&(f.bgColor=l),tt(c)&&"none"!==c&&(f.strokeColor=c),d&&Number.isFinite(d)&&d>0&&(f.strokeWidth=d),u&&"none"!==u&&(f.strokeStyle="dashed");const m=Array.from(r.querySelectorAll(".divider path, path.divider, line.divider")).map(r=>((t,e,r,o,n,s,i)=>{const{tx:a,ty:l}=te(t,e);let c=0,d=0,u=0,h=0;if("line"===t.tagName.toLowerCase())c=Number(t.getAttribute("x1"))+a,d=Number(t.getAttribute("y1"))+l,u=Number(t.getAttribute("x2"))+a,h=Number(t.getAttribute("y2"))+l;else{const e=P(t);if(!e)return null;c=e.startX+a,d=e.startY+l,u=e.endX+a,h=e.endY+l}const p={type:"line",id:b(),groupId:r,startX:c,startY:d,endX:u,endY:h,metadata:{entityId:o}};return n&&tt(n)&&"none"!==n&&(p.strokeColor=n),void 0!==s&&(p.strokeWidth=s),i&&(p.strokeStyle=i),p})(r,e,o,t.id,f.strokeColor,f.strokeWidth,f.strokeStyle)).filter(t=>null!==t),x=g.map(e=>yt(e.x,e.y,e.text,{id:b(),groupId:o,width:e.width,height:e.height,fontSize:18,color:e.color,metadata:{entityId:t.id}}));return{container:f,lines:m,text:x}},ie=(t,e)=>{const r=((t,e)=>{const r=e.querySelector(`path[id="${t.id}"][data-edge="true"]`);return r?[r]:t.start!==t.end?[]:[`${t.start}-cyclic-special-1`,`${t.start}-cyclic-special-mid`,`${t.start}-cyclic-special-2`].map(t=>e.querySelector(`path[id="${t}"][data-edge="true"]`)).filter(t=>null!==t)})(t,e);if(!r.length)throw new Error(`ER relationship ${t.id} not found in rendered SVG`);const o=(t=>{const e=[];return t.forEach(t=>{U(t).forEach(t=>{const r=e[e.length-1];r&&r.x===t.x&&r.y===t.y||e.push(t)})}),e})(r);if(o.length<2)throw new Error(`ER relationship ${t.id} is missing usable path points`);const n=o[0],s=o[o.length-1],i=r[0],a=J(i.getAttribute("stroke")||getComputedStyle(i).stroke||""),l=Number(i.getAttribute("stroke-width")||getComputedStyle(i).strokeWidth||1),c=gt(n.x,n.y,s.x,s.y,{id:t.id,label:t.label?{text:F(t.label),fontSize:16,textAlign:"center"}:void 0,strokeStyle:ne(t.pattern),startArrowhead:oe(t.arrowTypeStart),endArrowhead:oe(t.arrowTypeEnd),start:{type:"rectangle",id:t.start},end:{type:"rectangle",id:t.end},points:o.map(t=>[t.x-n.x,t.y-n.y])});return tt(a)&&"none"!==a&&(c.strokeColor=a),Number.isFinite(l)&&l>0&&(c.strokeWidth=l),c},ae=t=>{const e=J(t||"");return!!e&&("none"!==e&&"transparent"!==e&&"rgba(0, 0, 0, 0)"!==e&&"rgba(0,0,0,0)"!==e&&tt(e))},le=(t,e,r)=>{switch(e){case l.FILL:case l.STROKE:ae(r)&&(t[e]=J(r));break;case l.STROKE_WIDTH:case l.STROKE_DASHARRAY:J(r)&&(t[e]=J(r))}},ce=(t,e,r)=>{e===a.COLOR&&ae(r)&&(t[a.COLOR]=J(r))},de=(t,e)=>{t&&Q(t).forEach(({property:t,value:r})=>{t===l.FILL&&ae(r)?e[a.COLOR]=J(r):ce(e,t,r)})},ue=(t,e)=>{let r=0,o=0,n=t;for(;n&&n!==e;){const{transformX:t,transformY:e}=B(n);r+=t,o+=e,n=n.parentElement}return{tx:r,ty:o}},he=(t,e)=>{const r=t.querySelector("line.divider");if(!r)return;const{tx:o,ty:n}=ue(r,e);return{startX:Number(r.getAttribute("x1"))+o,startY:Number(r.getAttribute("y1"))+n,endX:Number(r.getAttribute("x2"))+o,endY:Number(r.getAttribute("y2"))+n}},pe=t=>{const e=t.getBBox();return Math.abs(e.width*e.height)},ge=(t,e)=>{const r=t.getAttribute("style");if(!r)return;const o=Q(r).find(t=>t.property===e);return o?J(o.value):void 0},ye=(t,e)=>{const r=t.map(t=>({element:t,area:pe(t)})).filter(({area:t})=>Number.isFinite(t)&&t>0);if(0===r.length)return null;return r.sort((t,r)=>"largest"===e?r.area-t.area:t.area-r.area)[0].element},fe=(t,e)=>{const r=Array.from(t.querySelectorAll("circle, ellipse, path"));return((t,e)=>{if(!t)return;if(!e.has(l.FILL)&&!e.has(l.STROKE))return;const r=J(t.getAttribute("fill")||ge(t,l.FILL)||""),o=J(t.getAttribute("stroke")||ge(t,l.STROKE)||"");return ae(r)?r:ae(o)?o:void 0})(ye(r,"smallest"),e)},be=t=>(t=>{if(t.length<2)return t;const e=t.slice(1),r=e.filter(t=>t.trim().length>0).reduce((t,e)=>{const r=e.match(/^\s*/)?.[0].length??0;return Math.min(t,r)},Number.POSITIVE_INFINITY);return!Number.isFinite(r)||r<=0?t.map(t=>t.trimEnd()):[t[0].trimEnd(),...e.map(t=>t.replace(new RegExp(`^\\s{0,${r}}`),"").trimEnd())]})(Array.isArray(t.label)?t.label.map(t=>F(t)):F(t.label||"").split("\n")).join("\n"),me=t=>{if(!t.description)return[];return(Array.isArray(t.description)?t.description:[t.description]).map(t=>F(t)).filter(t=>t.length>0)},xe=(t,e,r)=>{const o=r(t);if(!o)throw new Error(`State node element not found for "${t.id}"`);const n=((t,e)=>{switch(e){case"roundedWithTitle":case"rectWithTitle":return t.querySelector("rect.outer")||t.querySelector("rect")||t;case"divider":return t.querySelector("rect.divider")||t.querySelector("rect")||t;case"stateStart":case"stateEnd":return ye(Array.from(t.querySelectorAll("circle, ellipse, path")),"largest")||t;default:return t.querySelector("rect, path, circle, ellipse, polygon")||t}})(o,t.shape),s={},i={},c=[t.labelStyle,...t.cssCompiledStyles||[],...t.cssStyles||[]],d=(t=>{const e=new Set;return t.filter(Boolean).forEach(t=>{Q(t||"").forEach(({property:t})=>{e.add(t)})}),e})(c);c.filter(Boolean).forEach(t=>{((t,e,r)=>{t&&Q(t).forEach(({property:t,value:o})=>{le(e,t,o),ce(r,t,o)})})(t,s,i)}),((t,e,r)=>{if(!t)return;[[l.FILL,t.getAttribute("fill")],[l.STROKE,t.getAttribute("stroke")],[l.STROKE_WIDTH,t.getAttribute("stroke-width")],[l.STROKE_DASHARRAY,t.getAttribute("stroke-dasharray")]].forEach(([t,o])=>{if(!r.has(t))return;if(e[t])return;const n=J(o||"");n&&le(e,t,n)})})(n,s,d),((t,e,r)=>{if(!t)return;const o=[t,...Array.from(t.querySelectorAll("text, foreignObject, div, span, p"))];for(const t of o){if(e[a.COLOR])break;if((r.has(a.COLOR)||r.has(l.FILL))&&(de(t.getAttribute("style"),e),e[a.COLOR]))break;const o=J(t.getAttribute("fill")||t.getAttribute("color")||"");(r.has(a.COLOR)||r.has(l.FILL))&&ae(o)&&(e[a.COLOR]=o)}})(o,i,d);const u=((t,e)=>{const r=t.getBBox(),{tx:o,ty:n}=ue(t,e);return{x:r.x+o,y:r.y+n,width:r.width,height:r.height}})(n,e);return{id:t.id,shape:t.shape,text:be(t),description:me(t),x:u.x,y:u.y,width:u.width,height:u.height,parentId:t.parentId,position:t.position,containerStyle:s,labelStyle:i,dividerLine:"rectWithTitle"===t.shape?he(o,e):void 0,endInnerColor:"stateEnd"===t.shape?fe(o,d):void 0,isRenderable:"noteGroup"!==t.shape}},we=(t,e)=>{const r=e.querySelector(`[id='${t.id}']`);if(!r)return null;const{tx:o,ty:n}=ue(r,e),s=H(r,{x:o,y:n},"MCL");if(s.reflectionPoints.length<2)return null;const i={};[t.style].filter(Boolean).forEach(t=>{Q(t||"").forEach(({property:t,value:e})=>{((t,e)=>{switch(t){case l.STROKE:ae(e)&&(i.strokeColor=J(e));break;case l.STROKE_WIDTH:{const t=parseFloat(J(e));Number.isFinite(t)&&t>0&&(i.strokeWidth=t);break}case l.STROKE_DASHARRAY:J(e)&&(i.strokeStyle="dashed")}})(t,e)})});const a="none"===t.arrowhead||t.classes?.includes("note-edge");return{id:t.id,start:t.start,end:t.end,text:F(t.label||""),...s,strokeColor:i.strokeColor,strokeWidth:i.strokeWidth,strokeStyle:a?"dashed":i.strokeStyle,isNoteEdge:a}},Se=(t,e)=>{const{nodes:r,edges:o}=t.getData(),n=(t=>{const e=new Set,r=t=>(t&&e.add(t),t),o=t=>{const o=t.find(t=>!e.has(t));return r(o||null)};return e=>{const n=[`[id='${e.domId}']`,`[id='${e.id}']`,`[data-id='${e.id}']`];for(const e of n){const o=t.querySelector(e);if(o)return r(o)}switch(e.shape){case"divider":return o(Array.from(t.querySelectorAll("g.statediagram-cluster-alt")));case"stateStart":return o(Array.from(t.querySelectorAll("g.node.default")).filter(t=>t.querySelector("circle.state-start")));case"stateEnd":return o(Array.from(t.querySelectorAll("g.node.default")).filter(t=>!t.querySelector("circle.state-start")));default:return null}}})(e);return{type:"state",nodes:r.map(t=>xe(t,e,n)),edges:o.map(t=>we(t,e)).filter(t=>null!==t)}};let Ae=Promise.resolve();let ke=null,Ee=0;const ve=t=>{const e=t.querySelector("svg");if(!e)throw new Error("SVG element not found");const r=e.getBoundingClientRect(),o=r.width,n=r.height;e.setAttribute("width",`${o}`),e.setAttribute("height",`${n}`);const s=unescape(encodeURIComponent(e.outerHTML));return{type:"graphImage",mimeType:"image/svg+xml",dataURL:`data:image/svg+xml;base64,${btoa(s)}`,width:o,height:n}},Ce=async(t,e=n)=>(t=>{const e=Ae.then(t,t);return Ae=e.then(()=>{},()=>{}),e})(async()=>{const r=e.themeVariables?.fontSize??n.themeVariables.fontSize,o={...n,...e,fontSize:r,themeVariables:{...n.themeVariables,...e.themeVariables,fontSize:r}},s=(t=>JSON.stringify(t))(o);s!==ke&&(G.default.initialize(o),ke=s);const i=await G.default.mermaidAPI.getDiagramFromText((t=>{let e=t;return e=e.replace(/style.*:\S*#.*;/g,t=>t.substring(0,t.length-1)),e=e.replace(/classDef.*:\S*#.*;/g,t=>t.substring(0,t.length-1)),e=e.replace(/#\w+;/g,t=>{const e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?`fl°°${e}¶ß`:`fl°${e}¶ß`}),e})(t)),a="mermaid-to-excalidraw-"+Ee++,l=document.createElement("div");l.setAttribute("style","opacity: 0; position: fixed; z-index: -1; left: -99999px; top: -99999px;");const c=`${a}-container`;l.id=c,document.getElementById(c)?.remove(),document.body.appendChild(l);try{const{svg:e}=await G.default.render(a,t,l);let r;l.innerHTML=e;try{switch(i.type){case"flowchart-v2":case"graph":r=pt(i.db,l);break;case"sequence":r=Rt(i,l);break;case"class":case"classDiagram":r=((t,e)=>{const r=t.db,o=r.getDirection?.()||"TB",n=[],s=[],i=[],a=[],l=r.getNamespaces?.()||[],c=r.getClasses?.()||{},d=c instanceof Map?Object.fromEntries(c):c;if(d&&Object.keys(d).length){const t="function"==typeof r.lookUpDomId?r.lookUpDomId.bind(r):void 0,o=Jt(d,e,t);n.push(o.nodes),s.push(...o.lines),i.push(...o.text),a.push(...o.nodes)}const u=r.getRelations?.()||[],{arrows:h,text:p}=Zt(u,a,e,o),g=r.getNotes?.()||[],{notes:y,connectors:f}=Qt(g,e,a);return n.push(y),h.push(...f),i.push(...p),{type:"class",nodes:n,lines:s,arrows:h,text:i,namespaces:l}})(i,l);break;case"er":r=((t,e)=>{const r=t.getData(),o=r.nodes,n=r.edges,s=[],i=[],a=[];o.forEach(t=>{const r=se(t,e);s.push(r.container),i.push(...r.lines),a.push(...r.text)});const l=n.map(t=>ie(t,e));return{type:"erd",nodes:[s],lines:i,arrows:l,text:a}})(i.db,l);break;case"state":case"stateDiagram":r=Se(i.db,l);break;default:r=ve(l)}}catch(t){console.error("Error processing Mermaid diagram:",t),r=ve(l)}return r}finally{l.remove()}}),Ie=async(t,e)=>{const r=e||{},o=parseInt(r.themeVariables?.fontSize??"")||20,n=await Ce(t,{...r,themeVariables:{...r.themeVariables}});return V(n,{fontSize:o})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6571],{77454(t,e,a){function r(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}a.d(e,{S:()=>r}),(0,a(86827).K)(r,"populateCommonDb")},76571(t,e,a){a.d(e,{diagram:()=>z});var r=a(77454),n=a(5637),i=a(12505),s=a(86535),o=a(31293),l=a(86827),c=a(34376),d={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},g={axes:[],curves:[],options:d},u=structuredClone(g),p=s.UI.radar,h=(0,l.K)(()=>(0,i.$t)({...p,...(0,s.zj)().radar}),"getConfig"),x=(0,l.K)(()=>u.axes,"getAxes"),m=(0,l.K)(()=>u.curves,"getCurves"),$=(0,l.K)(()=>u.options,"getOptions"),f=(0,l.K)(t=>{u.axes=t.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),v=(0,l.K)(t=>{u.curves=t.map(t=>({name:t.name,label:t.label??t.name,entries:y(t.entries)}))},"setCurves"),y=(0,l.K)(t=>{if(null==t[0].axis)return t.map(t=>t.value);const e=x();if(0===e.length)throw new Error("Axes must be populated before curves for reference entries");return e.map(e=>{const a=t.find(t=>t.axis?.$refText===e.name);if(void 0===a)throw new Error("Missing entry for axis "+e.label);return a.value})},"computeCurveEntries"),w={getAxes:x,getCurves:m,getOptions:$,setAxes:f,setCurves:v,setOptions:(0,l.K)(t=>{const e=t.reduce((t,e)=>(t[e.name]=e,t),{});u.options={showLegend:e.showLegend?.value??d.showLegend,ticks:e.ticks?.value??d.ticks,max:e.max?.value??d.max,min:e.min?.value??d.min,graticule:e.graticule?.value??d.graticule},u.options.ticks>32&&(o.R.warn(`Radar diagram ticks (${u.options.ticks}) exceeds maximum allowed (32). Using 32 instead.`),u.options.ticks=32)},"setOptions"),getConfig:h,clear:(0,l.K)(()=>{(0,s.IU)(),u=structuredClone(g)},"clear"),setAccTitle:s.SV,getAccTitle:s.iN,setDiagramTitle:s.ke,getDiagramTitle:s.ab,getAccDescription:s.m7,setAccDescription:s.EI},b=(0,l.K)(t=>{(0,r.S)(t,w);const{axes:e,curves:a,options:n}=t;w.setAxes(e),w.setCurves(a),w.setOptions(n)},"populate"),C={parse:(0,l.K)(async t=>{const e=await(0,c.qg)("radar",t);o.R.debug(e),b(e)},"parse")},k=(0,l.K)((t,e,a,r)=>{const i=r.db,s=i.getAxes(),o=i.getCurves(),l=i.getOptions(),c=i.getConfig(),d=i.getDiagramTitle(),g=(0,n.D)(e),u=K(g,c),p=l.max??Math.max(...o.map(t=>Math.max(...t.entries))),h=l.min,x=Math.min(c.width,c.height)/2;M(u,s,x,l.ticks,l.graticule),L(u,s,x,c),T(u,s,o,h,p,l.graticule,c),S(u,o,l.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),K=(0,l.K)((t,e)=>{const a=e.width+e.marginLeft+e.marginRight,r=e.height+e.marginTop+e.marginBottom,n=e.marginLeft+e.width/2,i=e.marginTop+e.height/2;return(0,s.a$)(t,r,a,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${a} ${r}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${n}, ${i})`)},"drawFrame"),M=(0,l.K)((t,e,a,r,n)=>{if("circle"===n)for(let e=0;e<r;e++){const n=a*(e+1)/r;t.append("circle").attr("r",n).attr("class","radarGraticule")}else if("polygon"===n){const n=e.length;for(let i=0;i<r;i++){const s=a*(i+1)/r,o=e.map((t,e)=>{const a=2*e*Math.PI/n-Math.PI/2;return`${s*Math.cos(a)},${s*Math.sin(a)}`}).join(" ");t.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),L=(0,l.K)((t,e,a,r)=>{const n=e.length;for(let i=0;i<n;i++){const s=e[i].label,o=2*i*Math.PI/n-Math.PI/2,l=Math.cos(o),c=Math.sin(o);t.append("line").attr("x1",0).attr("y1",0).attr("x2",a*r.axisScaleFactor*l).attr("y2",a*r.axisScaleFactor*c).attr("class","radarAxisLine");const d=l>.01?"start":l<-.01?"end":"middle",g=c>.01?"hanging":c<-.01?"auto":"central",u=4;t.append("text").text(s).attr("x",a*r.axisLabelFactor*l+u*l).attr("y",a*r.axisLabelFactor*c+u*c).attr("text-anchor",d).attr("dominant-baseline",g).attr("class","radarAxisLabel")}},"drawAxes");function T(t,e,a,r,n,i,s){const o=e.length,l=Math.min(s.width,s.height)/2;a.forEach((e,a)=>{if(e.entries.length!==o)return;const c=e.entries.map((t,e)=>{const a=2*Math.PI*e/o-Math.PI/2,i=A(t,r,n,l);return{x:i*Math.cos(a),y:i*Math.sin(a)}});"circle"===i?t.append("path").attr("d",O(c,s.curveTension)).attr("class",`radarCurve-${a}`):"polygon"===i&&t.append("polygon").attr("points",c.map(t=>`${t.x},${t.y}`).join(" ")).attr("class",`radarCurve-${a}`)})}function A(t,e,a,r){return r*(Math.min(Math.max(t,e),a)-e)/(a-e)}function O(t,e){const a=t.length;let r=`M${t[0].x},${t[0].y}`;for(let n=0;n<a;n++){const i=t[(n-1+a)%a],s=t[n],o=t[(n+1)%a],l=t[(n+2)%a],c={x:s.x+(o.x-i.x)*e,y:s.y+(o.y-i.y)*e},d={x:o.x-(l.x-s.x)*e,y:o.y-(l.y-s.y)*e};r+=` C${c.x},${c.y} ${d.x},${d.y} ${o.x},${o.y}`}return`${r} Z`}function S(t,e,a,r){if(!a)return;const n=3*(r.width/2+r.marginRight)/4,i=3*-(r.height/2+r.marginTop)/4;e.forEach((e,a)=>{const r=t.append("g").attr("transform",`translate(${n}, ${i+20*a})`);r.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${a}`),r.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(e.label)})}(0,l.K)(T,"drawCurves"),(0,l.K)(A,"relativeRadius"),(0,l.K)(O,"closedRoundCurve"),(0,l.K)(S,"drawLegend");var I={draw:k},D=(0,l.K)((t,e)=>{let a="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const n=t[`cScale${r}`];a+=`\n\t\t.radarCurve-${r} {\n\t\t\tcolor: ${n};\n\t\t\tfill: ${n};\n\t\t\tfill-opacity: ${e.curveOpacity};\n\t\t\tstroke: ${n};\n\t\t\tstroke-width: ${e.curveStrokeWidth};\n\t\t}\n\t\t.radarLegendBox-${r} {\n\t\t\tfill: ${n};\n\t\t\tfill-opacity: ${e.curveOpacity};\n\t\t\tstroke: ${n};\n\t\t}\n\t\t`}return a},"genIndexStyles"),R=(0,l.K)(t=>{const e=(0,s.P$)(),a=(0,s.zj)(),r=(0,i.$t)(e,a.themeVariables);return{themeVariables:r,radarOptions:(0,i.$t)(r.radar,t)}},"buildRadarStyleOptions"),z={parser:C,db:w,renderer:I,styles:(0,l.K)(({radar:t}={})=>{const{themeVariables:e,radarOptions:a}=R(t);return`\n\t.radarTitle {\n\t\tfont-size: ${e.fontSize};\n\t\tcolor: ${e.titleColor};\n\t\tdominant-baseline: hanging;\n\t\ttext-anchor: middle;\n\t}\n\t.radarAxisLine {\n\t\tstroke: ${a.axisColor};\n\t\tstroke-width: ${a.axisStrokeWidth};\n\t}\n\t.radarAxisLabel {\n\t\tfont-size: ${a.axisLabelFontSize}px;\n\t\tcolor: ${a.axisColor};\n\t}\n\t.radarGraticule {\n\t\tfill: ${a.graticuleColor};\n\t\tfill-opacity: ${a.graticuleOpacity};\n\t\tstroke: ${a.graticuleColor};\n\t\tstroke-width: ${a.graticuleStrokeWidth};\n\t}\n\t.radarLegendText {\n\t\ttext-anchor: start;\n\t\tfont-size: ${a.legendFontSize}px;\n\t\tdominant-baseline: hanging;\n\t}\n\t${D(e,a)}\n\t`},"styles")}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6731],{96731(e,c,a){a.d(c,{createCynefinServices:()=>s.t});var s=a(41700);a(80369)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6759],{46759(e,a,c){c.d(a,{createWardleyServices:()=>s.J});var s=c(70656);c(80369)}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4951],{15350(t,r,e){e.d(r,{m:()=>n});var o=e(86827),n=class{constructor(t){this.init=t,this.records=this.init()}static{(0,o.K)(this,"ImperativeState")}reset(){this.records=this.init()}}},77454(t,r,e){function o(t,r){t.accDescr&&r.setAccDescription?.(t.accDescr),t.accTitle&&r.setAccTitle?.(t.accTitle),t.title&&r.setDiagramTitle?.(t.title)}e.d(r,{S:()=>o}),(0,e(86827).K)(o,"populateCommonDb")},44951(t,r,e){e.d(r,{diagram:()=>vt});var o=e(15350),n=e(77454),a=e(51255),i=e(89983),s=e(31293),c=e(86827),d=e(34376),h=e(51444),$={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},m=i.UI.gitGraph,l=(0,c.K)(()=>(0,a.$t)({...m,...(0,i.zj)().gitGraph}),"getConfig"),g=new o.m(()=>{const t=l(),r=t.mainBranchName,e=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:e}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function p(){return(0,a.yT)({length:7})}function y(t,r){const e=Object.create(null);return t.reduce((t,o)=>{const n=r(o);return e[n]||(e[n]=!0,t.push(o)),t},[])}(0,c.K)(p,"getID"),(0,c.K)(y,"uniqBy");var f=(0,c.K)(function(t){g.records.direction=t},"setDirection"),x=(0,c.K)(function(t){s.R.debug("options str",t),t=t?.trim(),t=t||"{}";try{g.records.options=JSON.parse(t)}catch(t){s.R.error("error while parsing gitGraph options",t.message)}},"setOptions"),u=(0,c.K)(function(){return g.records.options},"getOptions"),b=(0,c.K)(function(t){let r=t.msg,e=t.id;const o=t.type;let n=t.tags;s.R.info("commit",r,e,o,n),s.R.debug("Entering commit:",r,e,o,n);const a=l();e=i.Y2.sanitizeText(e,a),r=i.Y2.sanitizeText(r,a),n=n?.map(t=>i.Y2.sanitizeText(t,a));const c={id:e||g.records.seq+"-"+p(),message:r,seq:g.records.seq++,type:o??$.NORMAL,tags:n??[],parents:null==g.records.head?[]:[g.records.head.id],branch:g.records.currBranch};g.records.head=c,s.R.info("main branch",a.mainBranchName),g.records.commits.has(c.id)&&s.R.warn(`Commit ID ${c.id} already exists`),g.records.commits.set(c.id,c),g.records.branches.set(g.records.currBranch,c.id),s.R.debug("in pushCommit "+c.id)},"commit"),w=(0,c.K)(function(t){let r=t.name;const e=t.order;if(r=i.Y2.sanitizeText(r,l()),g.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);g.records.branches.set(r,null!=g.records.head?g.records.head.id:null),g.records.branchConfig.set(r,{name:r,order:e}),E(r),s.R.debug("in createBranch")},"branch"),k=(0,c.K)(t=>{let r=t.branch,e=t.id;const o=t.type,n=t.tags,a=l();r=i.Y2.sanitizeText(r,a),e&&(e=i.Y2.sanitizeText(e,a));const c=g.records.branches.get(g.records.currBranch),d=g.records.branches.get(r),h=c?g.records.commits.get(c):void 0,m=d?g.records.commits.get(d):void 0;if(h&&m&&h.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(g.records.currBranch===r){const t=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},t}if(void 0===h||!h){const t=new Error(`Incorrect usage of "merge". Current branch (${g.records.currBranch})has no commits`);throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},t}if(!g.records.branches.has(r)){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},t}if(void 0===m||!m){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},t}if(h===m){const t=new Error('Incorrect usage of "merge". Both branches have same head');throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},t}if(e&&g.records.commits.has(e)){const t=new Error('Incorrect usage of "merge". Commit with id:'+e+" already exists, use different custom id");throw t.hash={text:`merge ${r} ${e} ${o} ${n?.join(" ")}`,token:`merge ${r} ${e} ${o} ${n?.join(" ")}`,expected:[`merge ${r} ${e}_UNIQUE ${o} ${n?.join(" ")}`]},t}const y=d||"",f={id:e||`${g.records.seq}-${p()}`,message:`merged branch ${r} into ${g.records.currBranch}`,seq:g.records.seq++,parents:null==g.records.head?[]:[g.records.head.id,y],branch:g.records.currBranch,type:$.MERGE,customType:o,customId:!!e,tags:n??[]};g.records.head=f,g.records.commits.set(f.id,f),g.records.branches.set(g.records.currBranch,f.id),s.R.debug(g.records.branches),s.R.debug("in mergeBranch")},"merge"),B=(0,c.K)(function(t){let r=t.id,e=t.targetId,o=t.tags,n=t.parent;s.R.debug("Entering cherryPick:",r,e,o);const a=l();if(r=i.Y2.sanitizeText(r,a),e=i.Y2.sanitizeText(e,a),o=o?.map(t=>i.Y2.sanitizeText(t,a)),n=i.Y2.sanitizeText(n,a),!r||!g.records.commits.has(r)){const t=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const c=g.records.commits.get(r);if(void 0===c||!c)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(n&&(!Array.isArray(c.parents)||!c.parents.includes(n))){throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.")}const d=c.branch;if(c.type===$.MERGE&&!n){throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.")}if(!e||!g.records.commits.has(e)){if(d===g.records.currBranch){const t=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const t=g.records.branches.get(g.records.currBranch);if(void 0===t||!t){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${g.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const a=g.records.commits.get(t);if(void 0===a||!a){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${g.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const i={id:g.records.seq+"-"+p(),message:`cherry-picked ${c?.message} into ${g.records.currBranch}`,seq:g.records.seq++,parents:null==g.records.head?[]:[g.records.head.id,c.id],branch:g.records.currBranch,type:$.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${c.id}${c.type===$.MERGE?`|parent:${n}`:""}`]};g.records.head=i,g.records.commits.set(i.id,i),g.records.branches.set(g.records.currBranch,i.id),s.R.debug(g.records.branches),s.R.debug("in cherryPick")}},"cherryPick"),E=(0,c.K)(function(t){if(t=i.Y2.sanitizeText(t,l()),!g.records.branches.has(t)){const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}{g.records.currBranch=t;const r=g.records.branches.get(g.records.currBranch);g.records.head=void 0!==r&&r?g.records.commits.get(r)??null:null}},"checkout");function C(t,r,e){const o=t.indexOf(r);-1===o?t.push(e):t.splice(o,1,e)}function T(t){const r=t.reduce((t,r)=>t.seq>r.seq?t:r,t[0]);let e="";t.forEach(function(t){e+=t===r?"\t*":"\t|"});const o=[e,r.id,r.seq];for(const t in g.records.branches)g.records.branches.get(t)===r.id&&o.push(t);if(s.R.debug(o.join(" ")),r.parents&&2==r.parents.length&&r.parents[0]&&r.parents[1]){const e=g.records.commits.get(r.parents[0]);C(t,r,e),r.parents[1]&&t.push(g.records.commits.get(r.parents[1]))}else{if(0==r.parents.length)return;if(r.parents[0]){const e=g.records.commits.get(r.parents[0]);C(t,r,e)}}T(t=y(t,t=>t.id))}(0,c.K)(C,"upsert"),(0,c.K)(T,"prettyPrintCommitHistory");var L=(0,c.K)(function(){s.R.debug(g.records.commits);T([I()[0]])},"prettyPrint"),K=(0,c.K)(function(){g.reset(),(0,i.IU)()},"clear"),M=(0,c.K)(function(){return[...g.records.branchConfig.values()].map((t,r)=>null!==t.order&&void 0!==t.order?t:{...t,order:parseFloat(`0.${r}`)}).sort((t,r)=>(t.order??0)-(r.order??0)).map(({name:t})=>({name:t}))},"getBranchesAsObjArray"),R=(0,c.K)(function(){return g.records.branches},"getBranches"),v=(0,c.K)(function(){return g.records.commits},"getCommits"),I=(0,c.K)(function(){const t=[...g.records.commits.values()];return t.forEach(function(t){s.R.debug(t.id)}),t.sort((t,r)=>t.seq-r.seq),t},"getCommitsArray"),P={commitType:$,getConfig:l,setDirection:f,setOptions:x,getOptions:u,commit:b,branch:w,merge:k,cherryPick:B,checkout:E,prettyPrint:L,clear:K,getBranchesAsObjArray:M,getBranches:R,getCommits:v,getCommitsArray:I,getCurrentBranch:(0,c.K)(function(){return g.records.currBranch},"getCurrentBranch"),getDirection:(0,c.K)(function(){return g.records.direction},"getDirection"),getHead:(0,c.K)(function(){return g.records.head},"getHead"),setAccTitle:i.SV,getAccTitle:i.iN,getAccDescription:i.m7,setAccDescription:i.EI,setDiagramTitle:i.ke,getDiagramTitle:i.ab},O=(0,c.K)((t,r)=>{(0,n.S)(t,r),t.dir&&r.setDirection(t.dir);for(const e of t.statements)A(e,r)},"populate"),A=(0,c.K)((t,r)=>{const e={Commit:(0,c.K)(t=>r.commit(G(t)),"Commit"),Branch:(0,c.K)(t=>r.branch(S(t)),"Branch"),Merge:(0,c.K)(t=>r.merge(D(t)),"Merge"),Checkout:(0,c.K)(t=>r.checkout(H(t)),"Checkout"),CherryPicking:(0,c.K)(t=>r.cherryPick(W(t)),"CherryPicking")}[t.$type];e?e(t):s.R.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),G=(0,c.K)(t=>({id:t.id,msg:t.message??"",type:void 0!==t.type?$[t.type]:$.NORMAL,tags:t.tags??void 0}),"parseCommit"),S=(0,c.K)(t=>({name:t.name,order:t.order??0}),"parseBranch"),D=(0,c.K)(t=>({branch:t.branch,id:t.id??"",type:void 0!==t.type?$[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),H=(0,c.K)(t=>t.branch,"parseCheckout"),W=(0,c.K)(t=>({id:t.id,targetId:"",tags:0===t.tags?.length?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),q={parse:(0,c.K)(async t=>{const r=await(0,d.qg)("gitGraph",t);s.R.debug(r),O(r,P)},"parse")};var z=10,_=40,Y=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),j=new Set(["redux-color","redux-dark-color"]),N=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),F=(0,c.K)((t,r,e=!1)=>e&&t>0?(t-1)%(r-1)+1:t%r,"calcColorIndex"),V=new Map,U=new Map,J=new Map,Q=[],X=0,Z="LR",tt=(0,c.K)(()=>{V.clear(),U.clear(),J.clear(),X=0,Q=[],Z="LR"},"clear"),rt=(0,c.K)(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof t?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=t.trim(),r.appendChild(e)}),r},"drawText"),et=(0,c.K)(t=>{let r,e,o;return"BT"===Z?(e=(0,c.K)((t,r)=>t<=r,"comparisonFunc"),o=1/0):(e=(0,c.K)((t,r)=>t>=r,"comparisonFunc"),o=0),t.forEach(t=>{const n="TB"===Z||"BT"==Z?U.get(t)?.y:U.get(t)?.x;void 0!==n&&e(n,o)&&(r=t,o=n)}),r},"findClosestParent"),ot=(0,c.K)(t=>{let r="",e=1/0;return t.forEach(t=>{const o=U.get(t).y;o<=e&&(r=t,e=o)}),r||void 0},"findClosestParentBT"),nt=(0,c.K)((t,r,e)=>{let o=e,n=e;const a=[];t.forEach(t=>{const e=r.get(t);if(!e)throw new Error(`Commit not found for key ${t}`);e.parents.length?(o=it(e),n=Math.max(o,n)):a.push(e),st(e,o)}),o=n,a.forEach(t=>{ct(t,o,e)}),t.forEach(t=>{const e=r.get(t);if(e?.parents.length){const t=ot(e.parents);o=U.get(t).y-_,o<=n&&(n=o);const r=V.get(e.branch).pos,a=o-z;U.set(e.id,{x:r,y:a})}})},"setParallelBTPos"),at=(0,c.K)(t=>{const r=et(t.parents.filter(t=>null!==t));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const e=U.get(r)?.y;if(void 0===e)throw new Error(`Closest parent position not found for commit ${t.id}`);return e},"findClosestParentPos"),it=(0,c.K)(t=>at(t)+_,"calculateCommitPosition"),st=(0,c.K)((t,r)=>{const e=V.get(t.branch);if(!e)throw new Error(`Branch not found for commit ${t.id}`);const o=e.pos,n=r+z;return U.set(t.id,{x:o,y:n}),{x:o,y:n}},"setCommitPosition"),ct=(0,c.K)((t,r,e)=>{const o=V.get(t.branch);if(!o)throw new Error(`Branch not found for commit ${t.id}`);const n=r+e,a=o.pos;U.set(t.id,{x:a,y:n})},"setRootPosition"),dt=(0,c.K)((t,r,e,o,n,a)=>{const{theme:s}=(0,i.D7)(),c=Y.has(s??""),d=j.has(s??""),h=N.has(s??"");if(a===$.HIGHLIGHT)t.append("rect").attr("x",e.x-10+(c?3:0)).attr("y",e.y-10+(c?3:0)).attr("width",c?14:20).attr("height",c?14:20).attr("class",`commit ${r.id} commit-highlight${F(n,8,d)} ${o}-outer`),t.append("rect").attr("x",e.x-6+(c?2:0)).attr("y",e.y-6+(c?2:0)).attr("width",c?8:12).attr("height",c?8:12).attr("class",`commit ${r.id} commit${F(n,8,d)} ${o}-inner`);else if(a===$.CHERRY_PICK)t.append("circle").attr("cx",e.x).attr("cy",e.y).attr("r",c?7:10).attr("class",`commit ${r.id} ${o}`),t.append("circle").attr("cx",e.x-3).attr("cy",e.y+2).attr("r",c?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),t.append("circle").attr("cx",e.x+3).attr("cy",e.y+2).attr("r",c?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),t.append("line").attr("x1",e.x+3).attr("y1",e.y+1).attr("x2",e.x).attr("y2",e.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),t.append("line").attr("x1",e.x-3).attr("y1",e.y+1).attr("x2",e.x).attr("y2",e.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`);else{const i=t.append("circle");if(i.attr("cx",e.x),i.attr("cy",e.y),i.attr("r",c?7:10),i.attr("class",`commit ${r.id} commit${F(n,8,d)}`),a===$.MERGE){const a=t.append("circle");a.attr("cx",e.x),a.attr("cy",e.y),a.attr("r",c?5:6),a.attr("class",`commit ${o} ${r.id} commit${F(n,8,d)}`)}if(a===$.REVERSE){const a=c?4:5;t.append("path").attr("d",`M ${e.x-a},${e.y-a}L${e.x+a},${e.y+a}M${e.x-a},${e.y+a}L${e.x+a},${e.y-a}`).attr("class",`commit ${o} ${r.id} commit${F(n,8,d)}`)}}},"drawCommitBullet"),ht=(0,c.K)((t,r,e,o,n)=>{if(r.type!==$.CHERRY_PICK&&(r.customId&&r.type===$.MERGE||r.type!==$.MERGE)&&n.showCommitLabel){const a=t.append("g"),i=a.insert("rect").attr("class","commit-label-bkg"),s=a.append("text").attr("x",o).attr("y",e.y+25).attr("class","commit-label").text(r.id),c=s.node()?.getBBox();if(c&&(i.attr("x",e.posWithOffset-c.width/2-2).attr("y",e.y+13.5).attr("width",c.width+4).attr("height",c.height+4),"TB"===Z||"BT"===Z?(i.attr("x",e.x-(c.width+16+5)).attr("y",e.y-12),s.attr("x",e.x-(c.width+16)).attr("y",e.y+c.height-12)):s.attr("x",e.posWithOffset-c.width/2),n.rotateCommitLabel))if("TB"===Z||"BT"===Z)s.attr("transform","rotate(-45, "+e.x+", "+e.y+")"),i.attr("transform","rotate(-45, "+e.x+", "+e.y+")");else{const t=-7.5-(c.width+10)/25*9.5,r=10+c.width/25*8.5;a.attr("transform","translate("+t+", "+r+") rotate(-45, "+o+", "+e.y+")")}}},"drawCommitLabel"),$t=(0,c.K)((t,r,e,o)=>{if(r.tags.length>0){let n=0,a=0,i=0;const s=[];for(const o of r.tags.reverse()){const r=t.insert("polygon"),c=t.append("circle"),d=t.append("text").attr("y",e.y-16-n).attr("class","tag-label").text(o),h=d.node()?.getBBox();if(!h)throw new Error("Tag bbox not found");a=Math.max(a,h.width),i=Math.max(i,h.height),d.attr("x",e.posWithOffset-h.width/2),s.push({tag:d,hole:c,rect:r,yOffset:n}),n+=20}for(const{tag:t,hole:r,rect:n,yOffset:c}of s){const s=i/2,d=e.y-19.2-c;if(n.attr("class","tag-label-bkg").attr("points",`\n ${o-a/2-2},${d+2} \n ${o-a/2-2},${d-2}\n ${e.posWithOffset-a/2-4},${d-s-2}\n ${e.posWithOffset+a/2+4},${d-s-2}\n ${e.posWithOffset+a/2+4},${d+s+2}\n ${e.posWithOffset-a/2-4},${d+s+2}`),r.attr("cy",d).attr("cx",o-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===Z||"BT"===Z){const i=o+c;n.attr("class","tag-label-bkg").attr("points",`\n ${e.x},${i+2}\n ${e.x},${i-2}\n ${e.x+z},${i-s-2}\n ${e.x+z+a+4},${i-s-2}\n ${e.x+z+a+4},${i+s+2}\n ${e.x+z},${i+s+2}`).attr("transform","translate(12,12) rotate(45, "+e.x+","+o+")"),r.attr("cx",e.x+2).attr("cy",i).attr("transform","translate(12,12) rotate(45, "+e.x+","+o+")"),t.attr("x",e.x+5).attr("y",i+3).attr("transform","translate(14,14) rotate(45, "+e.x+","+o+")")}}}},"drawCommitTags"),mt=(0,c.K)(t=>{switch(t.customType??t.type){case $.NORMAL:return"commit-normal";case $.REVERSE:return"commit-reverse";case $.HIGHLIGHT:return"commit-highlight";case $.MERGE:return"commit-merge";case $.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),lt=(0,c.K)((t,r,e,o)=>{const n={x:0,y:0};if(!(t.parents.length>0)){if("TB"===r)return 30;if("BT"===r){return(o.get(t.id)??n).y-_}return 0}{const e=et(t.parents);if(e){const a=o.get(e)??n;if("TB"===r)return a.y+_;if("BT"===r){return(o.get(t.id)??n).y-_}return a.x+_}}return 0},"calculatePosition"),gt=(0,c.K)((t,r,e)=>{const o="BT"===Z&&e?r:r+z,n=V.get(t.branch)?.pos,a="TB"===Z||"BT"===Z?V.get(t.branch)?.pos:o;if(void 0===a||void 0===n)throw new Error(`Position were undefined for commit ${t.id}`);const s=Y.has((0,i.D7)().theme??"");return{x:a,y:"TB"===Z||"BT"===Z?o:n+(s?7:-2),posWithOffset:o}},"getCommitPosition"),pt=(0,c.K)((t,r,e,o)=>{const n=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let i="TB"===Z||"BT"===Z?30:0;const s=[...r.keys()],d=o.parallelCommits??!1,h=(0,c.K)((t,e)=>{const o=r.get(t)?.seq,n=r.get(e)?.seq;return void 0!==o&&void 0!==n?o-n:0},"sortKeys");let $=s.sort(h);"BT"===Z&&(d&&nt($,r,i),$=$.reverse()),$.forEach(t=>{const s=r.get(t);if(!s)throw new Error(`Commit not found for key ${t}`);d&&(i=lt(s,Z,i,U));const c=gt(s,i,d);if(e){const t=mt(s),r=s.customType??s.type,e=V.get(s.branch)?.index??0;dt(n,s,c,t,e,r),ht(a,s,c,i,o),$t(a,s,c,i)}"TB"===Z||"BT"===Z?U.set(s.id,{x:c.x,y:c.posWithOffset}):U.set(s.id,{x:c.posWithOffset,y:c.y}),i="BT"===Z&&d?i+_:i+_+z,i>X&&(X=i)})},"drawCommits"),yt=(0,c.K)((t,r,e,o,n)=>{const a=("TB"===Z||"BT"===Z?e.x<o.x:e.y<o.y)?r.branch:t.branch,i=(0,c.K)(t=>t.branch===a,"isOnBranchToGetCurve"),s=(0,c.K)(e=>e.seq>t.seq&&e.seq<r.seq,"isBetweenCommits");return[...n.values()].some(t=>s(t)&&i(t))},"shouldRerouteArrow"),ft=(0,c.K)((t,r,e=0)=>{const o=t+Math.abs(t-r)/2;if(e>5)return o;if(Q.every(t=>Math.abs(t-o)>=10))return Q.push(o),o;const n=Math.abs(t-r);return ft(t,r-n/5,e+1)},"findLane"),xt=(0,c.K)((t,r,e,o)=>{const{theme:n}=(0,i.D7)(),a=j.has(n??""),s=U.get(r.id),c=U.get(e.id);if(void 0===s||void 0===c)throw new Error(`Commit positions not found for commits ${r.id} and ${e.id}`);const d=yt(r,e,s,c,o);let h,m="",l="",g=0,p=0,y=V.get(e.branch)?.index;if(e.type===$.MERGE&&r.id!==e.parents[0]&&(y=V.get(r.branch)?.index),d){m="A 10 10, 0, 0, 0,",l="A 10 10, 0, 0, 1,",g=10,p=10;const t=s.y<c.y?ft(s.y,c.y):ft(c.y,s.y),e=s.x<c.x?ft(s.x,c.x):ft(c.x,s.x);"TB"===Z?s.x<c.x?h=`M ${s.x} ${s.y} L ${e-g} ${s.y} ${l} ${e} ${s.y+p} L ${e} ${c.y-g} ${m} ${e+p} ${c.y} L ${c.x} ${c.y}`:(y=V.get(r.branch)?.index,h=`M ${s.x} ${s.y} L ${e+g} ${s.y} ${m} ${e} ${s.y+p} L ${e} ${c.y-g} ${l} ${e-p} ${c.y} L ${c.x} ${c.y}`):"BT"===Z?s.x<c.x?h=`M ${s.x} ${s.y} L ${e-g} ${s.y} ${m} ${e} ${s.y-p} L ${e} ${c.y+g} ${l} ${e+p} ${c.y} L ${c.x} ${c.y}`:(y=V.get(r.branch)?.index,h=`M ${s.x} ${s.y} L ${e+g} ${s.y} ${l} ${e} ${s.y-p} L ${e} ${c.y+g} ${m} ${e-p} ${c.y} L ${c.x} ${c.y}`):s.y<c.y?h=`M ${s.x} ${s.y} L ${s.x} ${t-g} ${m} ${s.x+p} ${t} L ${c.x-g} ${t} ${l} ${c.x} ${t+p} L ${c.x} ${c.y}`:(y=V.get(r.branch)?.index,h=`M ${s.x} ${s.y} L ${s.x} ${t+g} ${l} ${s.x+p} ${t} L ${c.x-g} ${t} ${m} ${c.x} ${t-p} L ${c.x} ${c.y}`)}else m="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",g=20,p=20,"TB"===Z?(s.x<c.x&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y-g} ${m} ${s.x+p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${l} ${c.x} ${s.y+p} L ${c.x} ${c.y}`),s.x>c.x&&(m="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",g=20,p=20,h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y-g} ${l} ${s.x-p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x+g} ${s.y} ${m} ${c.x} ${s.y+p} L ${c.x} ${c.y}`),s.x===c.x&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`)):"BT"===Z?(s.x<c.x&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y+g} ${l} ${s.x+p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${m} ${c.x} ${s.y-p} L ${c.x} ${c.y}`),s.x>c.x&&(m="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",g=20,p=20,h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y+g} ${m} ${s.x-p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x+g} ${s.y} ${l} ${c.x} ${s.y-p} L ${c.x} ${c.y}`),s.x===c.x&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`)):(s.y<c.y&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${l} ${c.x} ${s.y+p} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${s.x} ${c.y-g} ${m} ${s.x+p} ${c.y} L ${c.x} ${c.y}`),s.y>c.y&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${m} ${c.x} ${s.y-p} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${s.x} ${c.y+g} ${l} ${s.x+p} ${c.y} L ${c.x} ${c.y}`),s.y===c.y&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`));if(void 0===h)throw new Error("Line definition not found");t.append("path").attr("d",h).attr("class","arrow arrow"+F(y,8,a))},"drawArrow"),ut=(0,c.K)((t,r)=>{const e=t.append("g").attr("class","commit-arrows");[...r.keys()].forEach(t=>{const o=r.get(t);o.parents&&o.parents.length>0&&o.parents.forEach(t=>{xt(e,r.get(t),o,r)})})},"drawArrows"),bt=(0,c.K)((t,r,e,o)=>{const{look:n,theme:a,themeVariables:s}=(0,i.D7)(),{dropShadow:c,THEME_COLOR_LIMIT:d}=s,h=Y.has(a??""),$=j.has(a??""),m=t.append("g");r.forEach((t,r)=>{const a=F(r,h?d:8,$),i=V.get(t.name)?.pos;if(void 0===i)throw new Error(`Position not found for branch ${t.name}`);const s="TB"===Z||"BT"===Z?i:h?i+6+1:i-2,l=m.append("line");l.attr("x1",0),l.attr("y1",s),l.attr("x2",X),l.attr("y2",s),l.attr("class","branch branch"+a),"TB"===Z?(l.attr("y1",30),l.attr("x1",i),l.attr("y2",X),l.attr("x2",i)):"BT"===Z&&(l.attr("y1",X),l.attr("x1",i),l.attr("y2",30),l.attr("x2",i)),Q.push(s);const g=t.name,p=rt(g),y=m.insert("rect"),f=m.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+a);f.node().appendChild(p);const x=p.getBBox(),u=h?0:4,b=h?16:0,w=h?12:0;"neo"===n&&y.attr("data-look","neo"),y.attr("class","branchLabelBkg label"+a).attr("style","neo"===n?`filter:${h?`url(#${o}-drop-shadow)`:c}`:"").attr("rx",u).attr("ry",u).attr("x",-x.width-4-(!0===e.rotateCommitLabel?30:0)).attr("y",-x.height/2+10).attr("width",x.width+18+b).attr("height",x.height+4+w),f.attr("transform","translate("+(-x.width-14-(!0===e.rotateCommitLabel?30:0)+b/2)+", "+(s-x.height/2-2)+")"),"TB"===Z?(y.attr("x",i-x.width/2-10).attr("y",0),f.attr("transform","translate("+(i-x.width/2-5)+", 0)"),h&&(y.attr("transform",`translate(${-b/2-3}, ${-w-10})`),f.attr("transform","translate("+(i-x.width/2-5)+", "+(2*-w+7)+")"))):"BT"===Z?(y.attr("x",i-x.width/2-10).attr("y",X),f.attr("transform","translate("+(i-x.width/2-5)+", "+X+")"),h&&(y.attr("transform",`translate(${-b/2-3}, ${w+10})`),f.attr("transform","translate("+(i-x.width/2-5)+", "+(X+2*w+4)+")"))):y.attr("transform","translate(-19, "+(s-12-w/2)+")")})},"drawBranches"),wt=(0,c.K)(function(t,r,e,o,n){return V.set(t,{pos:r,index:e}),r+=50+(n?40:0)+("TB"===Z||"BT"===Z?o.width/2:0)},"setBranchPosition"),kt={draw:(0,c.K)(function(t,r,e,o){tt(),s.R.debug("in gitgraph renderer",t+"\n","id:",r,e);const n=o.db;if(!n.getConfig)return void s.R.error("getConfig method is not available on db");const c=n.getConfig(),d=c.rotateCommitLabel??!1;J=n.getCommits();const $=n.getBranchesAsObjArray();Z=n.getDirection();const m=(0,h.Ltv)(`[id="${r}"]`),{look:l,theme:g,themeVariables:p}=(0,i.D7)(),{useGradient:y,gradientStart:f,gradientStop:x,filterColor:u}=p;if(y){const t=m.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");t.append("stop").attr("offset","0%").attr("stop-color",f).attr("stop-opacity",1),t.append("stop").attr("offset","100%").attr("stop-color",x).attr("stop-opacity",1)}"neo"===l&&Y.has(g??"")&&m.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",u);let b=0;$.forEach((t,r)=>{const e=rt(t.name),o=m.append("g"),n=o.insert("g").attr("class","branchLabel"),a=n.insert("g").attr("class","label branch-label");a.node()?.appendChild(e);const i=e.getBBox();b=wt(t.name,b,r,i,d),a.remove(),n.remove(),o.remove()}),pt(m,J,!1,c),c.showBranches&&bt(m,$,c,r),ut(m,J),pt(m,J,!0,c),a._K.insertTitle(m,"gitTitleText",c.titleTopMargin??0,n.getDiagramTitle()),(0,i.mj)(void 0,m,c.diagramPadding,c.useMaxWidth)},"draw")};var Bt=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Et=new Set(["redux-color","redux-dark-color"]),Ct=new Set(["neo","neo-dark"]),Tt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Lt=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),Kt=(0,c.K)(t=>{const{svgId:r}=t;let e="";if(t.useGradient&&r)for(let o=0;o<t.THEME_COLOR_LIMIT;o++)e+=`\n .label${o} { fill: ${t.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${t.strokeWidth};}\n `;return e},"genGitGraphGradient"),Mt=(0,c.K)(t=>{const r=(0,i.zj)(),{theme:e,themeVariables:o}=r,{borderColorArray:n}=o,a=Bt.has(e);if(Ct.has(e)){let r="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)if(0===e)r+=`\n .branch-label${e} { fill: ${t.nodeBorder};}\n .commit${e} { stroke: ${t.nodeBorder}; }\n .commit-highlight${e} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }\n .arrow${e} { stroke: ${t.nodeBorder}; }\n .commit-bullets { fill: ${t.nodeBorder}; }\n .commit-cherry-pick${e} { stroke: ${t.nodeBorder}; }\n ${Kt(t)}`;else{const o=e%8;r+=`\n .branch-label${e} { fill: ${t["gitBranchLabel"+o]}; }\n .commit${e} { stroke: ${t["git"+o]}; fill: ${t["git"+o]}; }\n .commit-highlight${e} { stroke: ${t["gitInv"+o]}; fill: ${t["gitInv"+o]}; }\n .arrow${e} { stroke: ${t["git"+o]}; }\n `}return r}if(Et.has(e)){let r="";for(let o=0;o<t.THEME_COLOR_LIMIT;o++)if(0===o)r+=`\n .branch-label${o} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .commit${o} { stroke: ${t.nodeBorder}; }\n .commit-highlight${o} { stroke: ${t.nodeBorder}; fill: ${t.mainBkg}; }\n .label${o} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .arrow${o} { stroke: ${t.nodeBorder}; }\n .commit-bullets { fill: ${t.nodeBorder}; }\n `;else{const i=o%n.length;r+=`\n .branch-label${o} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .commit${o} { stroke: ${n[i]}; fill: ${n[i]}; }\n .commit-highlight${o} { stroke: ${n[i]}; fill: ${n[i]}; }\n .label${o} { fill: ${Tt.has(e)?t.mainBkg:n[i]}; stroke: ${n[i]}; stroke-width: ${t.strokeWidth}; }\n .arrow${o} { stroke: ${n[i]}; }\n `}return r}{let r="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)r+=`\n .branch-label${e} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .commit${e} { stroke: ${t.nodeBorder}; }\n .commit-highlight${e} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }\n .label${e} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${a?`font-weight:${t.noteFontWeight}`:""}}\n .arrow${e} { stroke: ${t.nodeBorder}; }\n .commit-bullets { fill: ${t.nodeBorder}; }\n .commit-cherry-pick${e} { stroke: ${t.nodeBorder}; }\n `;return r}},"genColor"),Rt=(0,c.K)(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(t,r)=>r).map(r=>{const e=r%8;return`\n .branch-label${r} { fill: ${t["gitBranchLabel"+e]}; }\n .commit${r} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }\n .commit-highlight${r} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }\n .label${r} { fill: ${t["git"+e]}; }\n .arrow${r} { stroke: ${t["git"+e]}; }\n `}).join("\n")}`,"normalTheme"),vt={parser:q,db:P,renderer:kt,styles:(0,c.K)(t=>{const r=(0,i.zj)(),{theme:e}=r,o=Lt.has(e);return`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n \n ${o?Mt(t):Rt(t)}\n\n .branch {\n stroke-width: ${t.strokeWidth};\n stroke: ${t.commitLineColor??t.lineColor};\n stroke-dasharray: ${o?"4 2":"2"};\n }\n .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${o?t.nodeBorder:t.commitLabelColor}; ${o?`font-weight:${t.noteFontWeight};`:""}}\n .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${o?"transparent":t.commitLabelBackground}; opacity: ${o?"":.5}; }\n .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n .tag-label-bkg { fill: ${o?t.mainBkg:t.tagLabelBackground}; stroke: ${o?t.nodeBorder:t.tagLabelBorder}; ${o?`filter:${t.dropShadow}`:""} }\n .tag-hole { fill: ${t.textColor}; }\n\n .commit-merge {\n stroke: ${o?t.mainBkg:t.primaryColor};\n fill: ${o?t.mainBkg:t.primaryColor};\n }\n .commit-reverse {\n stroke: ${o?t.mainBkg:t.primaryColor};\n fill: ${o?t.mainBkg:t.primaryColor};\n stroke-width: ${o?t.strokeWidth:3};\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${o?t.mainBkg:t.primaryColor};\n fill: ${o?t.mainBkg:t.primaryColor};\n }\n\n .arrow {\n /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */\n stroke-width: ${Bt.has(e)?t.strokeWidth:8};\n stroke-linecap: round;\n fill: none\n }\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`},"getStyles")}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6789],{15350(t,r,e){e.d(r,{m:()=>n});var o=e(86827),n=class{constructor(t){this.init=t,this.records=this.init()}static{(0,o.K)(this,"ImperativeState")}reset(){this.records=this.init()}}},77454(t,r,e){function o(t,r){t.accDescr&&r.setAccDescription?.(t.accDescr),t.accTitle&&r.setAccTitle?.(t.accTitle),t.title&&r.setDiagramTitle?.(t.title)}e.d(r,{S:()=>o}),(0,e(86827).K)(o,"populateCommonDb")},46789(t,r,e){e.d(r,{diagram:()=>vt});var o=e(15350),n=e(77454),a=e(12505),i=e(86535),s=e(31293),c=e(86827),d=e(34376),h=e(51444),$={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},m=i.UI.gitGraph,l=(0,c.K)(()=>(0,a.$t)({...m,...(0,i.zj)().gitGraph}),"getConfig"),g=new o.m(()=>{const t=l(),r=t.mainBranchName,e=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:e}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function p(){return(0,a.yT)({length:7})}function y(t,r){const e=Object.create(null);return t.reduce((t,o)=>{const n=r(o);return e[n]||(e[n]=!0,t.push(o)),t},[])}(0,c.K)(p,"getID"),(0,c.K)(y,"uniqBy");var f=(0,c.K)(function(t){g.records.direction=t},"setDirection"),x=(0,c.K)(function(t){s.R.debug("options str",t),t=t?.trim(),t=t||"{}";try{g.records.options=JSON.parse(t)}catch(t){s.R.error("error while parsing gitGraph options",t.message)}},"setOptions"),u=(0,c.K)(function(){return g.records.options},"getOptions"),b=(0,c.K)(function(t){let r=t.msg,e=t.id;const o=t.type;let n=t.tags;s.R.info("commit",r,e,o,n),s.R.debug("Entering commit:",r,e,o,n);const a=l();e=i.Y2.sanitizeText(e,a),r=i.Y2.sanitizeText(r,a),n=n?.map(t=>i.Y2.sanitizeText(t,a));const c={id:e||g.records.seq+"-"+p(),message:r,seq:g.records.seq++,type:o??$.NORMAL,tags:n??[],parents:null==g.records.head?[]:[g.records.head.id],branch:g.records.currBranch};g.records.head=c,s.R.info("main branch",a.mainBranchName),g.records.commits.has(c.id)&&s.R.warn(`Commit ID ${c.id} already exists`),g.records.commits.set(c.id,c),g.records.branches.set(g.records.currBranch,c.id),s.R.debug("in pushCommit "+c.id)},"commit"),w=(0,c.K)(function(t){let r=t.name;const e=t.order;if(r=i.Y2.sanitizeText(r,l()),g.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);g.records.branches.set(r,null!=g.records.head?g.records.head.id:null),g.records.branchConfig.set(r,{name:r,order:e}),E(r),s.R.debug("in createBranch")},"branch"),k=(0,c.K)(t=>{let r=t.branch,e=t.id;const o=t.type,n=t.tags,a=l();r=i.Y2.sanitizeText(r,a),e&&(e=i.Y2.sanitizeText(e,a));const c=g.records.branches.get(g.records.currBranch),d=g.records.branches.get(r),h=c?g.records.commits.get(c):void 0,m=d?g.records.commits.get(d):void 0;if(h&&m&&h.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(g.records.currBranch===r){const t=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},t}if(void 0===h||!h){const t=new Error(`Incorrect usage of "merge". Current branch (${g.records.currBranch})has no commits`);throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},t}if(!g.records.branches.has(r)){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},t}if(void 0===m||!m){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},t}if(h===m){const t=new Error('Incorrect usage of "merge". Both branches have same head');throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},t}if(e&&g.records.commits.has(e)){const t=new Error('Incorrect usage of "merge". Commit with id:'+e+" already exists, use different custom id");throw t.hash={text:`merge ${r} ${e} ${o} ${n?.join(" ")}`,token:`merge ${r} ${e} ${o} ${n?.join(" ")}`,expected:[`merge ${r} ${e}_UNIQUE ${o} ${n?.join(" ")}`]},t}const y=d||"",f={id:e||`${g.records.seq}-${p()}`,message:`merged branch ${r} into ${g.records.currBranch}`,seq:g.records.seq++,parents:null==g.records.head?[]:[g.records.head.id,y],branch:g.records.currBranch,type:$.MERGE,customType:o,customId:!!e,tags:n??[]};g.records.head=f,g.records.commits.set(f.id,f),g.records.branches.set(g.records.currBranch,f.id),s.R.debug(g.records.branches),s.R.debug("in mergeBranch")},"merge"),B=(0,c.K)(function(t){let r=t.id,e=t.targetId,o=t.tags,n=t.parent;s.R.debug("Entering cherryPick:",r,e,o);const a=l();if(r=i.Y2.sanitizeText(r,a),e=i.Y2.sanitizeText(e,a),o=o?.map(t=>i.Y2.sanitizeText(t,a)),n=i.Y2.sanitizeText(n,a),!r||!g.records.commits.has(r)){const t=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const c=g.records.commits.get(r);if(void 0===c||!c)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(n&&(!Array.isArray(c.parents)||!c.parents.includes(n))){throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.")}const d=c.branch;if(c.type===$.MERGE&&!n){throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.")}if(!e||!g.records.commits.has(e)){if(d===g.records.currBranch){const t=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const t=g.records.branches.get(g.records.currBranch);if(void 0===t||!t){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${g.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const a=g.records.commits.get(t);if(void 0===a||!a){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${g.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const i={id:g.records.seq+"-"+p(),message:`cherry-picked ${c?.message} into ${g.records.currBranch}`,seq:g.records.seq++,parents:null==g.records.head?[]:[g.records.head.id,c.id],branch:g.records.currBranch,type:$.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${c.id}${c.type===$.MERGE?`|parent:${n}`:""}`]};g.records.head=i,g.records.commits.set(i.id,i),g.records.branches.set(g.records.currBranch,i.id),s.R.debug(g.records.branches),s.R.debug("in cherryPick")}},"cherryPick"),E=(0,c.K)(function(t){if(t=i.Y2.sanitizeText(t,l()),!g.records.branches.has(t)){const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}{g.records.currBranch=t;const r=g.records.branches.get(g.records.currBranch);g.records.head=void 0!==r&&r?g.records.commits.get(r)??null:null}},"checkout");function C(t,r,e){const o=t.indexOf(r);-1===o?t.push(e):t.splice(o,1,e)}function T(t){const r=t.reduce((t,r)=>t.seq>r.seq?t:r,t[0]);let e="";t.forEach(function(t){e+=t===r?"\t*":"\t|"});const o=[e,r.id,r.seq];for(const t in g.records.branches)g.records.branches.get(t)===r.id&&o.push(t);if(s.R.debug(o.join(" ")),r.parents&&2==r.parents.length&&r.parents[0]&&r.parents[1]){const e=g.records.commits.get(r.parents[0]);C(t,r,e),r.parents[1]&&t.push(g.records.commits.get(r.parents[1]))}else{if(0==r.parents.length)return;if(r.parents[0]){const e=g.records.commits.get(r.parents[0]);C(t,r,e)}}T(t=y(t,t=>t.id))}(0,c.K)(C,"upsert"),(0,c.K)(T,"prettyPrintCommitHistory");var L=(0,c.K)(function(){s.R.debug(g.records.commits);T([I()[0]])},"prettyPrint"),K=(0,c.K)(function(){g.reset(),(0,i.IU)()},"clear"),M=(0,c.K)(function(){return[...g.records.branchConfig.values()].map((t,r)=>null!==t.order&&void 0!==t.order?t:{...t,order:parseFloat(`0.${r}`)}).sort((t,r)=>(t.order??0)-(r.order??0)).map(({name:t})=>({name:t}))},"getBranchesAsObjArray"),R=(0,c.K)(function(){return g.records.branches},"getBranches"),v=(0,c.K)(function(){return g.records.commits},"getCommits"),I=(0,c.K)(function(){const t=[...g.records.commits.values()];return t.forEach(function(t){s.R.debug(t.id)}),t.sort((t,r)=>t.seq-r.seq),t},"getCommitsArray"),P={commitType:$,getConfig:l,setDirection:f,setOptions:x,getOptions:u,commit:b,branch:w,merge:k,cherryPick:B,checkout:E,prettyPrint:L,clear:K,getBranchesAsObjArray:M,getBranches:R,getCommits:v,getCommitsArray:I,getCurrentBranch:(0,c.K)(function(){return g.records.currBranch},"getCurrentBranch"),getDirection:(0,c.K)(function(){return g.records.direction},"getDirection"),getHead:(0,c.K)(function(){return g.records.head},"getHead"),setAccTitle:i.SV,getAccTitle:i.iN,getAccDescription:i.m7,setAccDescription:i.EI,setDiagramTitle:i.ke,getDiagramTitle:i.ab},O=(0,c.K)((t,r)=>{(0,n.S)(t,r),t.dir&&r.setDirection(t.dir);for(const e of t.statements)A(e,r)},"populate"),A=(0,c.K)((t,r)=>{const e={Commit:(0,c.K)(t=>r.commit(G(t)),"Commit"),Branch:(0,c.K)(t=>r.branch(S(t)),"Branch"),Merge:(0,c.K)(t=>r.merge(D(t)),"Merge"),Checkout:(0,c.K)(t=>r.checkout(H(t)),"Checkout"),CherryPicking:(0,c.K)(t=>r.cherryPick(W(t)),"CherryPicking")}[t.$type];e?e(t):s.R.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),G=(0,c.K)(t=>({id:t.id,msg:t.message??"",type:void 0!==t.type?$[t.type]:$.NORMAL,tags:t.tags??void 0}),"parseCommit"),S=(0,c.K)(t=>({name:t.name,order:t.order??0}),"parseBranch"),D=(0,c.K)(t=>({branch:t.branch,id:t.id??"",type:void 0!==t.type?$[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),H=(0,c.K)(t=>t.branch,"parseCheckout"),W=(0,c.K)(t=>({id:t.id,targetId:"",tags:0===t.tags?.length?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),q={parse:(0,c.K)(async t=>{const r=await(0,d.qg)("gitGraph",t);s.R.debug(r),O(r,P)},"parse")};var z=10,_=40,Y=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),j=new Set(["redux-color","redux-dark-color"]),N=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),F=(0,c.K)((t,r,e=!1)=>e&&t>0?(t-1)%(r-1)+1:t%r,"calcColorIndex"),V=new Map,U=new Map,J=new Map,Q=[],X=0,Z="LR",tt=(0,c.K)(()=>{V.clear(),U.clear(),J.clear(),X=0,Q=[],Z="LR"},"clear"),rt=(0,c.K)(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof t?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=t.trim(),r.appendChild(e)}),r},"drawText"),et=(0,c.K)(t=>{let r,e,o;return"BT"===Z?(e=(0,c.K)((t,r)=>t<=r,"comparisonFunc"),o=1/0):(e=(0,c.K)((t,r)=>t>=r,"comparisonFunc"),o=0),t.forEach(t=>{const n="TB"===Z||"BT"==Z?U.get(t)?.y:U.get(t)?.x;void 0!==n&&e(n,o)&&(r=t,o=n)}),r},"findClosestParent"),ot=(0,c.K)(t=>{let r="",e=1/0;return t.forEach(t=>{const o=U.get(t).y;o<=e&&(r=t,e=o)}),r||void 0},"findClosestParentBT"),nt=(0,c.K)((t,r,e)=>{let o=e,n=e;const a=[];t.forEach(t=>{const e=r.get(t);if(!e)throw new Error(`Commit not found for key ${t}`);e.parents.length?(o=it(e),n=Math.max(o,n)):a.push(e),st(e,o)}),o=n,a.forEach(t=>{ct(t,o,e)}),t.forEach(t=>{const e=r.get(t);if(e?.parents.length){const t=ot(e.parents);o=U.get(t).y-_,o<=n&&(n=o);const r=V.get(e.branch).pos,a=o-z;U.set(e.id,{x:r,y:a})}})},"setParallelBTPos"),at=(0,c.K)(t=>{const r=et(t.parents.filter(t=>null!==t));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const e=U.get(r)?.y;if(void 0===e)throw new Error(`Closest parent position not found for commit ${t.id}`);return e},"findClosestParentPos"),it=(0,c.K)(t=>at(t)+_,"calculateCommitPosition"),st=(0,c.K)((t,r)=>{const e=V.get(t.branch);if(!e)throw new Error(`Branch not found for commit ${t.id}`);const o=e.pos,n=r+z;return U.set(t.id,{x:o,y:n}),{x:o,y:n}},"setCommitPosition"),ct=(0,c.K)((t,r,e)=>{const o=V.get(t.branch);if(!o)throw new Error(`Branch not found for commit ${t.id}`);const n=r+e,a=o.pos;U.set(t.id,{x:a,y:n})},"setRootPosition"),dt=(0,c.K)((t,r,e,o,n,a)=>{const{theme:s}=(0,i.D7)(),c=Y.has(s??""),d=j.has(s??""),h=N.has(s??"");if(a===$.HIGHLIGHT)t.append("rect").attr("x",e.x-10+(c?3:0)).attr("y",e.y-10+(c?3:0)).attr("width",c?14:20).attr("height",c?14:20).attr("class",`commit ${r.id} commit-highlight${F(n,8,d)} ${o}-outer`),t.append("rect").attr("x",e.x-6+(c?2:0)).attr("y",e.y-6+(c?2:0)).attr("width",c?8:12).attr("height",c?8:12).attr("class",`commit ${r.id} commit${F(n,8,d)} ${o}-inner`);else if(a===$.CHERRY_PICK)t.append("circle").attr("cx",e.x).attr("cy",e.y).attr("r",c?7:10).attr("class",`commit ${r.id} ${o}`),t.append("circle").attr("cx",e.x-3).attr("cy",e.y+2).attr("r",c?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),t.append("circle").attr("cx",e.x+3).attr("cy",e.y+2).attr("r",c?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),t.append("line").attr("x1",e.x+3).attr("y1",e.y+1).attr("x2",e.x).attr("y2",e.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),t.append("line").attr("x1",e.x-3).attr("y1",e.y+1).attr("x2",e.x).attr("y2",e.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`);else{const i=t.append("circle");if(i.attr("cx",e.x),i.attr("cy",e.y),i.attr("r",c?7:10),i.attr("class",`commit ${r.id} commit${F(n,8,d)}`),a===$.MERGE){const a=t.append("circle");a.attr("cx",e.x),a.attr("cy",e.y),a.attr("r",c?5:6),a.attr("class",`commit ${o} ${r.id} commit${F(n,8,d)}`)}if(a===$.REVERSE){const a=c?4:5;t.append("path").attr("d",`M ${e.x-a},${e.y-a}L${e.x+a},${e.y+a}M${e.x-a},${e.y+a}L${e.x+a},${e.y-a}`).attr("class",`commit ${o} ${r.id} commit${F(n,8,d)}`)}}},"drawCommitBullet"),ht=(0,c.K)((t,r,e,o,n)=>{if(r.type!==$.CHERRY_PICK&&(r.customId&&r.type===$.MERGE||r.type!==$.MERGE)&&n.showCommitLabel){const a=t.append("g"),i=a.insert("rect").attr("class","commit-label-bkg"),s=a.append("text").attr("x",o).attr("y",e.y+25).attr("class","commit-label").text(r.id),c=s.node()?.getBBox();if(c&&(i.attr("x",e.posWithOffset-c.width/2-2).attr("y",e.y+13.5).attr("width",c.width+4).attr("height",c.height+4),"TB"===Z||"BT"===Z?(i.attr("x",e.x-(c.width+16+5)).attr("y",e.y-12),s.attr("x",e.x-(c.width+16)).attr("y",e.y+c.height-12)):s.attr("x",e.posWithOffset-c.width/2),n.rotateCommitLabel))if("TB"===Z||"BT"===Z)s.attr("transform","rotate(-45, "+e.x+", "+e.y+")"),i.attr("transform","rotate(-45, "+e.x+", "+e.y+")");else{const t=-7.5-(c.width+10)/25*9.5,r=10+c.width/25*8.5;a.attr("transform","translate("+t+", "+r+") rotate(-45, "+o+", "+e.y+")")}}},"drawCommitLabel"),$t=(0,c.K)((t,r,e,o)=>{if(r.tags.length>0){let n=0,a=0,i=0;const s=[];for(const o of r.tags.reverse()){const r=t.insert("polygon"),c=t.append("circle"),d=t.append("text").attr("y",e.y-16-n).attr("class","tag-label").text(o),h=d.node()?.getBBox();if(!h)throw new Error("Tag bbox not found");a=Math.max(a,h.width),i=Math.max(i,h.height),d.attr("x",e.posWithOffset-h.width/2),s.push({tag:d,hole:c,rect:r,yOffset:n}),n+=20}for(const{tag:t,hole:r,rect:n,yOffset:c}of s){const s=i/2,d=e.y-19.2-c;if(n.attr("class","tag-label-bkg").attr("points",`\n ${o-a/2-2},${d+2} \n ${o-a/2-2},${d-2}\n ${e.posWithOffset-a/2-4},${d-s-2}\n ${e.posWithOffset+a/2+4},${d-s-2}\n ${e.posWithOffset+a/2+4},${d+s+2}\n ${e.posWithOffset-a/2-4},${d+s+2}`),r.attr("cy",d).attr("cx",o-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===Z||"BT"===Z){const i=o+c;n.attr("class","tag-label-bkg").attr("points",`\n ${e.x},${i+2}\n ${e.x},${i-2}\n ${e.x+z},${i-s-2}\n ${e.x+z+a+4},${i-s-2}\n ${e.x+z+a+4},${i+s+2}\n ${e.x+z},${i+s+2}`).attr("transform","translate(12,12) rotate(45, "+e.x+","+o+")"),r.attr("cx",e.x+2).attr("cy",i).attr("transform","translate(12,12) rotate(45, "+e.x+","+o+")"),t.attr("x",e.x+5).attr("y",i+3).attr("transform","translate(14,14) rotate(45, "+e.x+","+o+")")}}}},"drawCommitTags"),mt=(0,c.K)(t=>{switch(t.customType??t.type){case $.NORMAL:return"commit-normal";case $.REVERSE:return"commit-reverse";case $.HIGHLIGHT:return"commit-highlight";case $.MERGE:return"commit-merge";case $.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),lt=(0,c.K)((t,r,e,o)=>{const n={x:0,y:0};if(!(t.parents.length>0)){if("TB"===r)return 30;if("BT"===r){return(o.get(t.id)??n).y-_}return 0}{const e=et(t.parents);if(e){const a=o.get(e)??n;if("TB"===r)return a.y+_;if("BT"===r){return(o.get(t.id)??n).y-_}return a.x+_}}return 0},"calculatePosition"),gt=(0,c.K)((t,r,e)=>{const o="BT"===Z&&e?r:r+z,n=V.get(t.branch)?.pos,a="TB"===Z||"BT"===Z?V.get(t.branch)?.pos:o;if(void 0===a||void 0===n)throw new Error(`Position were undefined for commit ${t.id}`);const s=Y.has((0,i.D7)().theme??"");return{x:a,y:"TB"===Z||"BT"===Z?o:n+(s?7:-2),posWithOffset:o}},"getCommitPosition"),pt=(0,c.K)((t,r,e,o)=>{const n=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let i="TB"===Z||"BT"===Z?30:0;const s=[...r.keys()],d=o.parallelCommits??!1,h=(0,c.K)((t,e)=>{const o=r.get(t)?.seq,n=r.get(e)?.seq;return void 0!==o&&void 0!==n?o-n:0},"sortKeys");let $=s.sort(h);"BT"===Z&&(d&&nt($,r,i),$=$.reverse()),$.forEach(t=>{const s=r.get(t);if(!s)throw new Error(`Commit not found for key ${t}`);d&&(i=lt(s,Z,i,U));const c=gt(s,i,d);if(e){const t=mt(s),r=s.customType??s.type,e=V.get(s.branch)?.index??0;dt(n,s,c,t,e,r),ht(a,s,c,i,o),$t(a,s,c,i)}"TB"===Z||"BT"===Z?U.set(s.id,{x:c.x,y:c.posWithOffset}):U.set(s.id,{x:c.posWithOffset,y:c.y}),i="BT"===Z&&d?i+_:i+_+z,i>X&&(X=i)})},"drawCommits"),yt=(0,c.K)((t,r,e,o,n)=>{const a=("TB"===Z||"BT"===Z?e.x<o.x:e.y<o.y)?r.branch:t.branch,i=(0,c.K)(t=>t.branch===a,"isOnBranchToGetCurve"),s=(0,c.K)(e=>e.seq>t.seq&&e.seq<r.seq,"isBetweenCommits");return[...n.values()].some(t=>s(t)&&i(t))},"shouldRerouteArrow"),ft=(0,c.K)((t,r,e=0)=>{const o=t+Math.abs(t-r)/2;if(e>5)return o;if(Q.every(t=>Math.abs(t-o)>=10))return Q.push(o),o;const n=Math.abs(t-r);return ft(t,r-n/5,e+1)},"findLane"),xt=(0,c.K)((t,r,e,o)=>{const{theme:n}=(0,i.D7)(),a=j.has(n??""),s=U.get(r.id),c=U.get(e.id);if(void 0===s||void 0===c)throw new Error(`Commit positions not found for commits ${r.id} and ${e.id}`);const d=yt(r,e,s,c,o);let h,m="",l="",g=0,p=0,y=V.get(e.branch)?.index;if(e.type===$.MERGE&&r.id!==e.parents[0]&&(y=V.get(r.branch)?.index),d){m="A 10 10, 0, 0, 0,",l="A 10 10, 0, 0, 1,",g=10,p=10;const t=s.y<c.y?ft(s.y,c.y):ft(c.y,s.y),e=s.x<c.x?ft(s.x,c.x):ft(c.x,s.x);"TB"===Z?s.x<c.x?h=`M ${s.x} ${s.y} L ${e-g} ${s.y} ${l} ${e} ${s.y+p} L ${e} ${c.y-g} ${m} ${e+p} ${c.y} L ${c.x} ${c.y}`:(y=V.get(r.branch)?.index,h=`M ${s.x} ${s.y} L ${e+g} ${s.y} ${m} ${e} ${s.y+p} L ${e} ${c.y-g} ${l} ${e-p} ${c.y} L ${c.x} ${c.y}`):"BT"===Z?s.x<c.x?h=`M ${s.x} ${s.y} L ${e-g} ${s.y} ${m} ${e} ${s.y-p} L ${e} ${c.y+g} ${l} ${e+p} ${c.y} L ${c.x} ${c.y}`:(y=V.get(r.branch)?.index,h=`M ${s.x} ${s.y} L ${e+g} ${s.y} ${l} ${e} ${s.y-p} L ${e} ${c.y+g} ${m} ${e-p} ${c.y} L ${c.x} ${c.y}`):s.y<c.y?h=`M ${s.x} ${s.y} L ${s.x} ${t-g} ${m} ${s.x+p} ${t} L ${c.x-g} ${t} ${l} ${c.x} ${t+p} L ${c.x} ${c.y}`:(y=V.get(r.branch)?.index,h=`M ${s.x} ${s.y} L ${s.x} ${t+g} ${l} ${s.x+p} ${t} L ${c.x-g} ${t} ${m} ${c.x} ${t-p} L ${c.x} ${c.y}`)}else m="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",g=20,p=20,"TB"===Z?(s.x<c.x&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y-g} ${m} ${s.x+p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${l} ${c.x} ${s.y+p} L ${c.x} ${c.y}`),s.x>c.x&&(m="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",g=20,p=20,h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y-g} ${l} ${s.x-p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x+g} ${s.y} ${m} ${c.x} ${s.y+p} L ${c.x} ${c.y}`),s.x===c.x&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`)):"BT"===Z?(s.x<c.x&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y+g} ${l} ${s.x+p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${m} ${c.x} ${s.y-p} L ${c.x} ${c.y}`),s.x>c.x&&(m="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",g=20,p=20,h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y+g} ${m} ${s.x-p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x+g} ${s.y} ${l} ${c.x} ${s.y-p} L ${c.x} ${c.y}`),s.x===c.x&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`)):(s.y<c.y&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${l} ${c.x} ${s.y+p} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${s.x} ${c.y-g} ${m} ${s.x+p} ${c.y} L ${c.x} ${c.y}`),s.y>c.y&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${m} ${c.x} ${s.y-p} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${s.x} ${c.y+g} ${l} ${s.x+p} ${c.y} L ${c.x} ${c.y}`),s.y===c.y&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`));if(void 0===h)throw new Error("Line definition not found");t.append("path").attr("d",h).attr("class","arrow arrow"+F(y,8,a))},"drawArrow"),ut=(0,c.K)((t,r)=>{const e=t.append("g").attr("class","commit-arrows");[...r.keys()].forEach(t=>{const o=r.get(t);o.parents&&o.parents.length>0&&o.parents.forEach(t=>{xt(e,r.get(t),o,r)})})},"drawArrows"),bt=(0,c.K)((t,r,e,o)=>{const{look:n,theme:a,themeVariables:s}=(0,i.D7)(),{dropShadow:c,THEME_COLOR_LIMIT:d}=s,h=Y.has(a??""),$=j.has(a??""),m=t.append("g");r.forEach((t,r)=>{const a=F(r,h?d:8,$),i=V.get(t.name)?.pos;if(void 0===i)throw new Error(`Position not found for branch ${t.name}`);const s="TB"===Z||"BT"===Z?i:h?i+6+1:i-2,l=m.append("line");l.attr("x1",0),l.attr("y1",s),l.attr("x2",X),l.attr("y2",s),l.attr("class","branch branch"+a),"TB"===Z?(l.attr("y1",30),l.attr("x1",i),l.attr("y2",X),l.attr("x2",i)):"BT"===Z&&(l.attr("y1",X),l.attr("x1",i),l.attr("y2",30),l.attr("x2",i)),Q.push(s);const g=t.name,p=rt(g),y=m.insert("rect"),f=m.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+a);f.node().appendChild(p);const x=p.getBBox(),u=h?0:4,b=h?16:0,w=h?12:0;"neo"===n&&y.attr("data-look","neo"),y.attr("class","branchLabelBkg label"+a).attr("style","neo"===n?`filter:${h?`url(#${o}-drop-shadow)`:c}`:"").attr("rx",u).attr("ry",u).attr("x",-x.width-4-(!0===e.rotateCommitLabel?30:0)).attr("y",-x.height/2+10).attr("width",x.width+18+b).attr("height",x.height+4+w),f.attr("transform","translate("+(-x.width-14-(!0===e.rotateCommitLabel?30:0)+b/2)+", "+(s-x.height/2-2)+")"),"TB"===Z?(y.attr("x",i-x.width/2-10).attr("y",0),f.attr("transform","translate("+(i-x.width/2-5)+", 0)"),h&&(y.attr("transform",`translate(${-b/2-3}, ${-w-10})`),f.attr("transform","translate("+(i-x.width/2-5)+", "+(2*-w+7)+")"))):"BT"===Z?(y.attr("x",i-x.width/2-10).attr("y",X),f.attr("transform","translate("+(i-x.width/2-5)+", "+X+")"),h&&(y.attr("transform",`translate(${-b/2-3}, ${w+10})`),f.attr("transform","translate("+(i-x.width/2-5)+", "+(X+2*w+4)+")"))):y.attr("transform","translate(-19, "+(s-12-w/2)+")")})},"drawBranches"),wt=(0,c.K)(function(t,r,e,o,n){return V.set(t,{pos:r,index:e}),r+=50+(n?40:0)+("TB"===Z||"BT"===Z?o.width/2:0)},"setBranchPosition"),kt={draw:(0,c.K)(function(t,r,e,o){tt(),s.R.debug("in gitgraph renderer",t+"\n","id:",r,e);const n=o.db;if(!n.getConfig)return void s.R.error("getConfig method is not available on db");const c=n.getConfig(),d=c.rotateCommitLabel??!1;J=n.getCommits();const $=n.getBranchesAsObjArray();Z=n.getDirection();const m=(0,h.Ltv)(`[id="${r}"]`),{look:l,theme:g,themeVariables:p}=(0,i.D7)(),{useGradient:y,gradientStart:f,gradientStop:x,filterColor:u}=p;if(y){const t=m.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");t.append("stop").attr("offset","0%").attr("stop-color",f).attr("stop-opacity",1),t.append("stop").attr("offset","100%").attr("stop-color",x).attr("stop-opacity",1)}"neo"===l&&Y.has(g??"")&&m.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",u);let b=0;$.forEach((t,r)=>{const e=rt(t.name),o=m.append("g"),n=o.insert("g").attr("class","branchLabel"),a=n.insert("g").attr("class","label branch-label");a.node()?.appendChild(e);const i=e.getBBox();b=wt(t.name,b,r,i,d),a.remove(),n.remove(),o.remove()}),pt(m,J,!1,c),c.showBranches&&bt(m,$,c,r),ut(m,J),pt(m,J,!0,c),a._K.insertTitle(m,"gitTitleText",c.titleTopMargin??0,n.getDiagramTitle()),(0,i.mj)(void 0,m,c.diagramPadding,c.useMaxWidth)},"draw")};var Bt=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Et=new Set(["redux-color","redux-dark-color"]),Ct=new Set(["neo","neo-dark"]),Tt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Lt=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),Kt=(0,c.K)(t=>{const{svgId:r}=t;let e="";if(t.useGradient&&r)for(let o=0;o<t.THEME_COLOR_LIMIT;o++)e+=`\n .label${o} { fill: ${t.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${t.strokeWidth};}\n `;return e},"genGitGraphGradient"),Mt=(0,c.K)(t=>{const r=(0,i.zj)(),{theme:e,themeVariables:o}=r,{borderColorArray:n}=o,a=Bt.has(e);if(Ct.has(e)){let r="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)if(0===e)r+=`\n .branch-label${e} { fill: ${t.nodeBorder};}\n .commit${e} { stroke: ${t.nodeBorder}; }\n .commit-highlight${e} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }\n .arrow${e} { stroke: ${t.nodeBorder}; }\n .commit-bullets { fill: ${t.nodeBorder}; }\n .commit-cherry-pick${e} { stroke: ${t.nodeBorder}; }\n ${Kt(t)}`;else{const o=e%8;r+=`\n .branch-label${e} { fill: ${t["gitBranchLabel"+o]}; }\n .commit${e} { stroke: ${t["git"+o]}; fill: ${t["git"+o]}; }\n .commit-highlight${e} { stroke: ${t["gitInv"+o]}; fill: ${t["gitInv"+o]}; }\n .arrow${e} { stroke: ${t["git"+o]}; }\n `}return r}if(Et.has(e)){let r="";for(let o=0;o<t.THEME_COLOR_LIMIT;o++)if(0===o)r+=`\n .branch-label${o} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .commit${o} { stroke: ${t.nodeBorder}; }\n .commit-highlight${o} { stroke: ${t.nodeBorder}; fill: ${t.mainBkg}; }\n .label${o} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .arrow${o} { stroke: ${t.nodeBorder}; }\n .commit-bullets { fill: ${t.nodeBorder}; }\n `;else{const i=o%n.length;r+=`\n .branch-label${o} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .commit${o} { stroke: ${n[i]}; fill: ${n[i]}; }\n .commit-highlight${o} { stroke: ${n[i]}; fill: ${n[i]}; }\n .label${o} { fill: ${Tt.has(e)?t.mainBkg:n[i]}; stroke: ${n[i]}; stroke-width: ${t.strokeWidth}; }\n .arrow${o} { stroke: ${n[i]}; }\n `}return r}{let r="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)r+=`\n .branch-label${e} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .commit${e} { stroke: ${t.nodeBorder}; }\n .commit-highlight${e} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }\n .label${e} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${a?`font-weight:${t.noteFontWeight}`:""}}\n .arrow${e} { stroke: ${t.nodeBorder}; }\n .commit-bullets { fill: ${t.nodeBorder}; }\n .commit-cherry-pick${e} { stroke: ${t.nodeBorder}; }\n `;return r}},"genColor"),Rt=(0,c.K)(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(t,r)=>r).map(r=>{const e=r%8;return`\n .branch-label${r} { fill: ${t["gitBranchLabel"+e]}; }\n .commit${r} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }\n .commit-highlight${r} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }\n .label${r} { fill: ${t["git"+e]}; }\n .arrow${r} { stroke: ${t["git"+e]}; }\n `}).join("\n")}`,"normalTheme"),vt={parser:q,db:P,renderer:kt,styles:(0,c.K)(t=>{const r=(0,i.zj)(),{theme:e}=r,o=Lt.has(e);return`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n \n ${o?Mt(t):Rt(t)}\n\n .branch {\n stroke-width: ${t.strokeWidth};\n stroke: ${t.commitLineColor??t.lineColor};\n stroke-dasharray: ${o?"4 2":"2"};\n }\n .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${o?t.nodeBorder:t.commitLabelColor}; ${o?`font-weight:${t.noteFontWeight};`:""}}\n .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${o?"transparent":t.commitLabelBackground}; opacity: ${o?"":.5}; }\n .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n .tag-label-bkg { fill: ${o?t.mainBkg:t.tagLabelBackground}; stroke: ${o?t.nodeBorder:t.tagLabelBorder}; ${o?`filter:${t.dropShadow}`:""} }\n .tag-hole { fill: ${t.textColor}; }\n\n .commit-merge {\n stroke: ${o?t.mainBkg:t.primaryColor};\n fill: ${o?t.mainBkg:t.primaryColor};\n }\n .commit-reverse {\n stroke: ${o?t.mainBkg:t.primaryColor};\n fill: ${o?t.mainBkg:t.primaryColor};\n stroke-width: ${o?t.strokeWidth:3};\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${o?t.mainBkg:t.primaryColor};\n fill: ${o?t.mainBkg:t.primaryColor};\n }\n\n .arrow {\n /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */\n stroke-width: ${Bt.has(e)?t.strokeWidth:8};\n stroke-linecap: round;\n fill: none\n }\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`},"getStyles")}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6800],{36800(t,n,e){e.d(n,{diagram:()=>at});var i=e(86535),r=(e(31293),e(86827)),s=e(51444);function o(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let r of t)null!=(r=n(r,++i,t))&&(e>r||void 0===e&&r>=r)&&(e=r)}return e}function l(t){return t.target.depth}function a(t,n){return t.sourceLinks.length?t.depth:n-1}function c(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let i=-1;for(let r of t)(r=+n(r,++i,t))&&(e+=r)}return e}function h(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let r of t)null!=(r=n(r,++i,t))&&(e<r||void 0===e&&r>=r)&&(e=r)}return e}function u(t){return function(){return t}}function f(t,n){return d(t.source,n.source)||t.index-n.index}function y(t,n){return d(t.target,n.target)||t.index-n.index}function d(t,n){return t.y0-n.y0}function g(t){return t.value}function p(t){return t.index}function _(t){return t.nodes}function k(t){return t.links}function x(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function m({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const e of n.sourceLinks)e.y0=t+e.width/2,t+=e.width;for(const t of n.targetLinks)t.y1=e+t.width/2,e+=t.width}}function b(){let t,n,e,i=0,r=0,s=1,l=1,b=24,v=8,w=p,L=a,S=_,E=k,K=6;function A(){const a={nodes:S.apply(null,arguments),links:E.apply(null,arguments)};return function({nodes:t,links:n}){for(const[n,e]of t.entries())e.index=n,e.sourceLinks=[],e.targetLinks=[];const i=new Map(t.map((n,e)=>[w(n,e,t),n]));for(const[t,e]of n.entries()){e.index=t;let{source:n,target:r}=e;"object"!=typeof n&&(n=e.source=x(i,n)),"object"!=typeof r&&(r=e.target=x(i,r)),n.sourceLinks.push(e),r.targetLinks.push(e)}if(null!=e)for(const{sourceLinks:n,targetLinks:i}of t)n.sort(e),i.sort(e)}(a),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(c(n.sourceLinks,g),c(n.targetLinks,g)):n.fixedValue}(a),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.depth=r;for(const{target:n}of t.sourceLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(a),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.height=r;for(const{source:n}of t.targetLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(a),function(e){const a=function({nodes:t}){const e=h(t,t=>t.depth)+1,r=(s-i-b)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(L.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+b,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(v,(l-r)/(h(a,t=>t.length)-1)),function(n){const e=o(n,n=>(l-r-(n.length-1)*t)/c(n,g));for(const i of n){let n=r;for(const r of i){r.y0=n,r.y1=n+r.value*e,n=r.y1+t;for(const t of r.sourceLinks)t.width=t.value*e}n=(l-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}$(i)}}(a);for(let t=0;t<K;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/K);I(a,n,e),M(a,n,e)}}(a),m(a),a}function M(t,e,i){for(let r=1,s=t.length;r<s;++r){const s=t[r];for(const t of s){let n=0,i=0;for(const{source:e,value:r}of t.targetLinks){let s=r*(t.layer-e.layer);n+=D(e,t)*s,i+=s}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,P(t)}void 0===n&&s.sort(d),T(s,i)}}function I(t,e,i){for(let r=t.length-2;r>=0;--r){const s=t[r];for(const t of s){let n=0,i=0;for(const{target:e,value:r}of t.sourceLinks){let s=r*(e.layer-t.layer);n+=O(t,e)*s,i+=s}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,P(t)}void 0===n&&s.sort(d),T(s,i)}}function T(n,e){const i=n.length>>1,s=n[i];N(n,s.y0-t,i-1,e),C(n,s.y1+t,i+1,e),N(n,l,n.length-1,e),C(n,r,0,e)}function C(n,e,i,r){for(;i<n.length;++i){const s=n[i],o=(e-s.y0)*r;o>1e-6&&(s.y0+=o,s.y1+=o),e=s.y1+t}}function N(n,e,i,r){for(;i>=0;--i){const s=n[i],o=(s.y1-e)*r;o>1e-6&&(s.y0-=o,s.y1-=o),e=s.y0-t}}function P({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(y);for(const{target:{targetLinks:n}}of t)n.sort(f)}}function $(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(y),e.sort(f)}function D(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:r,width:s}of n.sourceLinks){if(r===e)break;i+=s+t}for(const{source:t,width:r}of e.targetLinks){if(t===n)break;i-=r}return i}function O(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:r,width:s}of e.targetLinks){if(r===n)break;i+=s+t}for(const{target:t,width:r}of n.sourceLinks){if(t===e)break;i-=r}return i}return A.update=function(t){return m(t),t},A.nodeId=function(t){return arguments.length?(w="function"==typeof t?t:u(t),A):w},A.nodeAlign=function(t){return arguments.length?(L="function"==typeof t?t:u(t),A):L},A.nodeSort=function(t){return arguments.length?(n=t,A):n},A.nodeWidth=function(t){return arguments.length?(b=+t,A):b},A.nodePadding=function(n){return arguments.length?(v=t=+n,A):v},A.nodes=function(t){return arguments.length?(S="function"==typeof t?t:u(t),A):S},A.links=function(t){return arguments.length?(E="function"==typeof t?t:u(t),A):E},A.linkSort=function(t){return arguments.length?(e=t,A):e},A.size=function(t){return arguments.length?(i=r=0,s=+t[0],l=+t[1],A):[s-i,l-r]},A.extent=function(t){return arguments.length?(i=+t[0][0],s=+t[1][0],r=+t[0][1],l=+t[1][1],A):[[i,r],[s,l]]},A.iterations=function(t){return arguments.length?(K=+t,A):K},A}var v=Math.PI,w=2*v,L=1e-6,S=w-L;function E(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function K(){return new E}E.prototype=K.prototype={constructor:E,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,r,s){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,n,e,i,r){t=+t,n=+n,e=+e,i=+i,r=+r;var s=this._x1,o=this._y1,l=e-t,a=i-n,c=s-t,h=o-n,u=c*c+h*h;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>L)if(Math.abs(h*l-a*c)>L&&r){var f=e-s,y=i-o,d=l*l+a*a,g=f*f+y*y,p=Math.sqrt(d),_=Math.sqrt(u),k=r*Math.tan((v-Math.acos((d+u-g)/(2*p*_)))/2),x=k/_,m=k/p;Math.abs(x-1)>L&&(this._+="L"+(t+x*c)+","+(n+x*h)),this._+="A"+r+","+r+",0,0,"+ +(h*f>c*y)+","+(this._x1=t+m*l)+","+(this._y1=n+m*a)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,i,r,s){t=+t,n=+n,s=!!s;var o=(e=+e)*Math.cos(i),l=e*Math.sin(i),a=t+o,c=n+l,h=1^s,u=s?i-r:r-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+a+","+c:(Math.abs(this._x1-a)>L||Math.abs(this._y1-c)>L)&&(this._+="L"+a+","+c),e&&(u<0&&(u=u%w+w),u>S?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-l)+"A"+e+","+e+",0,1,"+h+","+(this._x1=a)+","+(this._y1=c):u>L&&(this._+="A"+e+","+e+",0,"+ +(u>=v)+","+h+","+(this._x1=t+e*Math.cos(r))+","+(this._y1=n+e*Math.sin(r))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};const A=K;var M=Array.prototype.slice;function I(t){return function(){return t}}function T(t){return t[0]}function C(t){return t[1]}function N(t){return t.source}function P(t){return t.target}function $(t){var n=N,e=P,i=T,r=C,s=null;function o(){var o,l=M.call(arguments),a=n.apply(this,l),c=e.apply(this,l);if(s||(s=o=A()),t(s,+i.apply(this,(l[0]=a,l)),+r.apply(this,l),+i.apply(this,(l[0]=c,l)),+r.apply(this,l)),o)return s=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:I(+t),o):i},o.y=function(t){return arguments.length?(r="function"==typeof t?t:I(+t),o):r},o.context=function(t){return arguments.length?(s=t??null,o):s},o}function D(t,n,e,i,r){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,r,i,r)}function O(t){return[t.source.x1,t.y0]}function j(t){return[t.target.x0,t.y1]}function z(){return $(D).source(O).target(j)}e.dn(I),e.dn(z);var F=function(){var t=(0,r.K)(function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e},"o"),n=[1,9],e=[1,10],i=[1,5,10,12],s={trace:(0,r.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:(0,r.K)(function(t,n,e,i,r,s,o){var l=s.length-1;switch(r){case 7:const t=i.findOrCreateNode(s[l-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(s[l-2].trim().replaceAll('""','"')),e=parseFloat(s[l].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=s[l];break;case 10:this.$=s[l-1]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:(0,r.K)(function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)},"parseError"),parse:(0,r.K)(function(t){var n=this,e=[0],i=[],s=[null],o=[],l=this.table,a="",c=0,h=0,u=0,f=o.slice.call(arguments,1),y=Object.create(this.lexer),d={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(d.yy[g]=this.yy[g]);y.setInput(t,d.yy),d.yy.lexer=y,d.yy.parser=this,void 0===y.yylloc&&(y.yylloc={});var p=y.yylloc;o.push(p);var _=y.options&&y.options.ranges;function k(){var t;return"number"!=typeof(t=i.pop()||y.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,r.K)(function(t){e.length=e.length-2*t,s.length=s.length-t,o.length=o.length-t},"popStack"),(0,r.K)(k,"lex");for(var x,m,b,v,w,L,S,E,K,A={};;){if(b=e[e.length-1],this.defaultActions[b]?v=this.defaultActions[b]:(null==x&&(x=k()),v=l[b]&&l[b][x]),void 0===v||!v.length||!v[0]){var M="";for(L in K=[],l[b])this.terminals_[L]&&L>2&&K.push("'"+this.terminals_[L]+"'");M=y.showPosition?"Parse error on line "+(c+1)+":\n"+y.showPosition()+"\nExpecting "+K.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(M,{text:y.match,token:this.terminals_[x]||x,line:y.yylineno,loc:p,expected:K})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+x);switch(v[0]){case 1:e.push(x),s.push(y.yytext),o.push(y.yylloc),e.push(v[1]),x=null,m?(x=m,m=null):(h=y.yyleng,a=y.yytext,c=y.yylineno,p=y.yylloc,u>0&&u--);break;case 2:if(S=this.productions_[v[1]][1],A.$=s[s.length-S],A._$={first_line:o[o.length-(S||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(S||1)].first_column,last_column:o[o.length-1].last_column},_&&(A._$.range=[o[o.length-(S||1)].range[0],o[o.length-1].range[1]]),void 0!==(w=this.performAction.apply(A,[a,h,c,d.yy,v[1],s,o].concat(f))))return w;S&&(e=e.slice(0,-1*S*2),s=s.slice(0,-1*S),o=o.slice(0,-1*S)),e.push(this.productions_[v[1]][0]),s.push(A.$),o.push(A._$),E=l[e[e.length-2]][e[e.length-1]],e.push(E);break;case 3:return!0}}return!0},"parse")},o=function(){return{EOF:1,parseError:(0,r.K)(function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},"parseError"),setInput:(0,r.K)(function(t,n){return this.yy=n||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,r.K)(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,r.K)(function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var 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:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:(0,r.K)(function(){return this._more=!0,this},"more"),reject:(0,r.K)(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,r.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,r.K)(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,r.K)(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,r.K)(function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},"showPosition"),test_match:(0,r.K)(function(t,n){var e,i,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))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},"test_match"),next:(0,r.K)(function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((e=this._input.match(this.rules[r[s]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,r[s])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,r[i]))&&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,r.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,r.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,r.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,r.K)(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,r.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,r.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,r.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,r.K)(function(t,n,e,i){switch(e){case 0:case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}}}();function l(){this.yy={}}return s.lexer=o,(0,r.K)(l,"Parser"),l.prototype=s,s.Parser=l,new l}();F.parser=F;var U=F,W=[],G=[],V=new Map,X=(0,r.K)(()=>{W=[],G=[],V=new Map,(0,i.IU)()},"clear"),Y=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}static{(0,r.K)(this,"SankeyLink")}},q=(0,r.K)((t,n,e)=>{W.push(new Y(t,n,e))},"addLink"),B=class{constructor(t){this.ID=t}static{(0,r.K)(this,"SankeyNode")}},Q=(0,r.K)(t=>{t=i.Y2.sanitizeText(t,(0,i.D7)());let n=V.get(t);return void 0===n&&(n=new B(t),V.set(t,n),G.push(n)),n},"findOrCreateNode"),R=(0,r.K)(()=>G,"getNodes"),Z=(0,r.K)(()=>W,"getLinks"),H=(0,r.K)(()=>({nodes:G.map(t=>({id:t.ID})),links:W.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),J={nodesMap:V,getConfig:(0,r.K)(()=>(0,i.D7)().sankey,"getConfig"),getNodes:R,getLinks:Z,getGraph:H,addLink:q,findOrCreateNode:Q,getAccTitle:i.iN,setAccTitle:i.SV,getAccDescription:i.m7,setAccDescription:i.EI,getDiagramTitle:i.ab,setDiagramTitle:i.ke,clear:X},tt=class t{static{(0,r.K)(this,"Uid")}static{this.count=0}static next(n){return new t(n+ ++t.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},nt={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?o(t.sourceLinks,l)-1:0},justify:a},et=(0,r.K)(t=>{let n=0,e=0;for(const i of t){const t=i.value??0;t>n&&(n=t,e=i.layer??0)}return e},"findCentralNodeLayer"),it=(0,r.K)(function(t,n,e,o){const{securityLevel:l,sankey:a}=(0,i.D7)(),c=i.ME.sankey;let h;"sandbox"===l&&(h=(0,s.Ltv)("#i"+n));const u="sandbox"===l?(0,s.Ltv)(h.nodes()[0].contentDocument.body):(0,s.Ltv)("body"),f="sandbox"===l?u.select(`[id="${n}"]`):(0,s.Ltv)(`[id="${n}"]`),y=a?.width??c.width,d=a?.height??c.width,g=a?.useMaxWidth??c.useMaxWidth,p=a?.nodeAlignment??c.nodeAlignment,_=a?.prefix??c.prefix,k=a?.suffix??c.suffix,x=a?.showValues??c.showValues,m=a?.nodeWidth??c.nodeWidth??10,v=a?.nodePadding??c.nodePadding??12,w=a?.labelStyle??c.labelStyle??"legacy",L=a?.nodeColors??{},S=o.db.getGraph(),E=nt[p];b().nodeId(t=>t.id).nodeWidth(m).nodePadding(v+(x?15:0)).nodeAlign(E).extent([[0,0],[y,d]])(S);const K=et(S.nodes),A=(0,s.UMr)(s.zt),M=(0,r.K)(t=>L[t]??A(t),"getNodeColor");f.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",t=>(t.uid=tt.next("node-")).id).attr("transform",function(t){return"translate("+t.x0+","+t.y0+")"}).attr("x",t=>t.x0).attr("y",t=>t.y0).append("rect").attr("height",t=>t.y1-t.y0).attr("width",t=>t.x1-t.x0).attr("fill",t=>M(t.id));const I=(0,r.K)(({id:t,value:n})=>x?`${t}\n${_}${Math.round(100*n)/100}${k}`:t,"getText"),T=(0,r.K)(t=>{if("outlined"===w){return(t.layer??0)<K?{x:t.x0-6,anchor:"end"}:{x:t.x1+6,anchor:"start"}}return t.x0<y/2?{x:t.x1+6,anchor:"start"}:{x:t.x0-6,anchor:"end"}},"getLabelPosition"),C=f.append("g").attr("class","node-labels").attr("font-size",14),N=(0,r.K)(t=>C.selectAll(t?`.${t}`:"text").data(S.nodes).join("text").attr("class",t??null).attr("x",t=>T(t).x).attr("y",t=>(t.y1+t.y0)/2).attr("dy",(x?"0":"0.35")+"em").attr("text-anchor",t=>T(t).anchor).text(I),"appendLabel");"outlined"===w?(N("sankey-label-bg"),N("sankey-label-fg")):N();const P=f.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),$=a?.linkColor??"gradient";if("gradient"===$){const t=P.append("linearGradient").attr("id",t=>(t.uid=tt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",t=>t.source.x1).attr("x2",t=>t.target.x0);t.append("stop").attr("offset","0%").attr("stop-color",t=>M(t.source.id)),t.append("stop").attr("offset","100%").attr("stop-color",t=>M(t.target.id))}let D;switch($){case"gradient":D=(0,r.K)(t=>t.uid,"coloring");break;case"source":D=(0,r.K)(t=>M(t.source.id),"coloring");break;case"target":D=(0,r.K)(t=>M(t.target.id),"coloring");break;default:D=$}P.append("path").attr("d",z()).attr("stroke",D).attr("stroke-width",t=>Math.max(1,t.width)),(0,i.ot)(void 0,f,0,g)},"draw"),rt={draw:it},st=(0,r.K)(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim(),"prepareTextForParsing"),ot=(0,r.K)(t=>`.label {\n font-family: ${t.fontFamily};\n }\n\n .node-labels {\n font-family: ${t.fontFamily};\n }\n\n /* Outlined label style - background stroke for better readability */\n .sankey-label-bg {\n stroke: ${t.mainBkg||t.background||"#fff"};\n stroke-width: 4px;\n stroke-linejoin: round;\n paint-order: stroke;\n }\n\n /* Foreground label text */\n .sankey-label-fg {\n fill: ${t.textColor};\n }\n\n /* Node styling */\n .node rect {\n shape-rendering: crispEdges;\n }\n\n /* Link styling */\n .link {\n fill: none;\n stroke-opacity: 0.5;\n mix-blend-mode: multiply;\n }\n`,"getStyles"),lt=U.parse.bind(U);U.parse=t=>lt(st(t));var at={styles:ot,parser:U,db:J,renderer:rt}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6803],{66803(t,e,i){i.d(e,{diagram:()=>C});var n=i(5637),s=i(12505),a=i(86535),r=(i(31293),i(86827)),h=i(61057),o=function(){var t=(0,r.K)(function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},"o"),e=[1,4],i=[1,14],n=[1,12],s=[1,13],a=[6,7,8],h=[1,20],o=[1,18],l=[1,19],c=[6,7,11],u=[1,6,13,14],d=[1,23],y=[1,24],p=[1,6,7,11,13,14],g={trace:(0,r.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:(0,r.K)(function(t,e,i,n,s,a,r){var h=a.length-1;switch(s){case 6:case 7:return n;case 15:n.addNode(a[h-1].length,a[h].trim());break;case 16:n.addNode(0,a[h].trim())}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:i,7:[1,10],9:9,12:11,13:n,14:s},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:i,12:15,13:n,14:s},{6:i,9:16,12:11,13:n,14:s},{6:h,7:o,10:17,11:l},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:h,7:o,10:22,11:l},{1:[2,7],6:i,12:15,13:n,14:s},t(u,[2,14],{7:d,11:y}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(c,[2,15]),t(u,[2,13],{7:d,11:y}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:(0,r.K)(function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},"parseError"),parse:(0,r.K)(function(t){var e=this,i=[0],n=[],s=[null],a=[],h=this.table,o="",l=0,c=0,u=0,d=a.slice.call(arguments,1),y=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);y.setInput(t,p.yy),p.yy.lexer=y,p.yy.parser=this,void 0===y.yylloc&&(y.yylloc={});var f=y.yylloc;a.push(f);var k=y.options&&y.options.ranges;function m(){var t;return"number"!=typeof(t=n.pop()||y.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,r.K)(function(t){i.length=i.length-2*t,s.length=s.length-t,a.length=a.length-t},"popStack"),(0,r.K)(m,"lex");for(var w,x,b,_,v,S,K,$,I,E={};;){if(b=i[i.length-1],this.defaultActions[b]?_=this.defaultActions[b]:(null==w&&(w=m()),_=h[b]&&h[b][w]),void 0===_||!_.length||!_[0]){var A="";for(S in I=[],h[b])this.terminals_[S]&&S>2&&I.push("'"+this.terminals_[S]+"'");A=y.showPosition?"Parse error on line "+(l+1)+":\n"+y.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==w?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(A,{text:y.match,token:this.terminals_[w]||w,line:y.yylineno,loc:f,expected:I})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+w);switch(_[0]){case 1:i.push(w),s.push(y.yytext),a.push(y.yylloc),i.push(_[1]),w=null,x?(w=x,x=null):(c=y.yyleng,o=y.yytext,l=y.yylineno,f=y.yylloc,u>0&&u--);break;case 2:if(K=this.productions_[_[1]][1],E.$=s[s.length-K],E._$={first_line:a[a.length-(K||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(K||1)].first_column,last_column:a[a.length-1].last_column},k&&(E._$.range=[a[a.length-(K||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,_[1],s,a].concat(d))))return v;K&&(i=i.slice(0,-1*K*2),s=s.slice(0,-1*K),a=a.slice(0,-1*K)),i.push(this.productions_[_[1]][0]),s.push(E.$),a.push(E._$),$=h[i[i.length-2]][i[i.length-1]],i.push($);break;case 3:return!0}}return!0},"parse")},f=function(){return{EOF:1,parseError:(0,r.K)(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:(0,r.K)(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,r.K)(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,r.K)(function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,r.K)(function(){return this._more=!0,this},"more"),reject:(0,r.K)(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,r.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,r.K)(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,r.K)(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,r.K)(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,r.K)(function(t,e){var i,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var a in s)this[a]=s[a];return!1}return!1},"test_match"),next:(0,r.K)(function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),a=0;a<s.length;a++)if((i=this._input.match(this.rules[s[a]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,r.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,r.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,r.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,r.K)(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,r.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,r.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,r.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,r.K)(function(t,e,i,n){switch(i){case 0:case 3:return 6;case 1:case 2:return 8;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function k(){this.yy={}}return g.lexer=f,(0,r.K)(k,"Parser"),k.prototype=g,g.Parser=k,new k}();o.parser=o;var l=o,c=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{(0,r.K)(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,(0,a.IU)()}getRoot(){return this.root}addNode(t,e){const i=a.Y2.sanitizeText(e,(0,a.D7)());if(!this.root)return this.root={text:i,children:[]},this.stack=[{level:0,node:this.root}],void(0,a.ke)(i);this.baseLevel??=t;let n=t-this.baseLevel+1;for(n<=0&&(n=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=n;)this.stack.pop();const s={text:i,children:[]};this.stack[this.stack.length-1].node.children.push(s),this.stack.push({level:n,node:s})}getAccTitle(){return(0,a.iN)()}setAccTitle(t){(0,a.SV)(t)}getAccDescription(){return(0,a.m7)()}setAccDescription(t){(0,a.EI)(t)}getDiagramTitle(){return(0,a.ab)()}setDiagramTitle(t){(0,a.ke)(t)}},u=250,d=82*Math.PI/180,y=Math.cos(d),p=Math.sin(d),g=(0,r.K)((t,e,i)=>{const n=t.node().getBBox(),s=n.width+2*e,r=n.height+2*e;(0,a.a$)(t,r,s,i),t.attr("viewBox",`${n.x-e} ${n.y-e} ${s} ${r}`)},"applyPaddedViewBox"),f=(0,r.K)((t,e,i,r)=>{const o=r.db.getRoot();if(!o)return;const l=(0,a.D7)(),{look:c,handDrawnSeed:d,themeVariables:y}=l,p=(0,s.I5)(l.fontSize)[0]??14,f="handDrawn"===c,w=o.children??[],x=l.ishikawa?.diagramPadding??20,b=l.ishikawa?.useMaxWidth??!1,v=(0,n.D)(e),S=v.append("g").attr("class","ishikawa"),K=f?h.A.svg(v.node()):void 0,$=K?{roughSvg:K,seed:d??0,lineColor:y?.lineColor??"#333",fillColor:y?.mainBkg??"#fff"}:void 0,E=`ishikawa-arrow-${e}`;f||S.append("defs").append("marker").attr("id",E).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let A=0,C=u;const L=f?void 0:I(S,A,C,A,C,"ishikawa-spine");if(m(S,A,C,o.text,p,$),!w.length)return f&&I(S,A,C,A,C,"ishikawa-spine",$),void g(v,x,b);A-=20;const M=w.filter((t,e)=>e%2==0),P=w.filter((t,e)=>e%2==1),T=k(M),B=k(P),D=T.total+B.total;let N=u,O=u;if(D>0){const t=500,e=75;N=Math.max(e,t*(T.total/D)),O=Math.max(e,t*(B.total/D))}const W=2*p;N=Math.max(N,T.max*W),O=Math.max(O,B.max*W),C=Math.max(N,u),L&&L.attr("y1",C).attr("y2",C),S.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const j=Math.ceil(w.length/2);for(let t=0;t<j;t++){const e=S.append("g").attr("class","ishikawa-pair");for(const[i,n,s]of[[w[2*t],-1,N],[w[2*t+1],1,O]])i&&_(e,i,A,C,n,s,p,$);A=e.selectAll("text").nodes().reduce((t,e)=>Math.min(t,e.getBBox().x),1/0)}if(f)I(S,A,C,0,C,"ishikawa-spine",$);else{L.attr("x1",A);const t=`url(#${E})`;S.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",t)}g(v,x,b)},"draw"),k=(0,r.K)(t=>{const e=(0,r.K)(t=>t.children.reduce((t,i)=>t+1+e(i),0),"countDescendants");return t.reduce((t,i)=>{const n=e(i);return t.total+=n,t.max=Math.max(t.max,n),t},{total:0,max:0})},"sideStats"),m=(0,r.K)((t,e,i,n,s,a)=>{const r=Math.max(6,Math.floor(110/(.6*s))),h=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${i})`),o=K(h,S(n,r),0,0,"ishikawa-head-label","start",s),l=o.node().getBBox(),c=Math.max(60,l.width+6),u=Math.max(40,2*l.height+40),d=`M 0 ${-u/2} L 0 ${u/2} Q ${2.4*c} 0 0 ${-u/2} Z`;if(a){const t=a.roughSvg.path(d,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});h.insert(()=>t,":first-child").attr("class","ishikawa-head")}else h.insert("path",":first-child").attr("class","ishikawa-head").attr("d",d);o.attr("transform",`translate(${(c-l.width)/2-l.x+3},${-l.y-l.height/2})`)},"drawHead"),w=(0,r.K)((t,e)=>{const i=[],n=[],s=(0,r.K)((t,a,r)=>{const h=-1===e?[...t].reverse():t;for(const t of h){const e=i.length,h=t.children??[];i.push({depth:r,text:S(t.text,15),parentIndex:a,childCount:h.length}),r%2==0?(n.push(e),h.length&&s(h,e,r+1)):(h.length&&s(h,e,r+1),n.push(e))}},"walk");return s(t,-1,2),{entries:i,yOrder:n}},"flattenTree"),x=(0,r.K)((t,e,i,n,s,a,r)=>{const h=t.append("g").attr("class","ishikawa-label-group"),o=K(h,e,i,n+11*s,"ishikawa-label cause","middle",a).node().getBBox();if(r){const t=r.roughSvg.rectangle(o.x-20,o.y-2,o.width+40,o.height+4,{roughness:1.5,seed:r.seed,fill:r.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:r.lineColor,strokeWidth:2});h.insert(()=>t,":first-child").attr("class","ishikawa-label-box")}else h.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",o.x-20).attr("y",o.y-2).attr("width",o.width+40).attr("height",o.height+4)},"drawCauseLabel"),b=(0,r.K)((t,e,i,n,s,a)=>{const r=Math.sqrt(n*n+s*s);if(0===r)return;const h=n/r,o=s/r,l=6*-o,c=6*h,u=`M ${e} ${i} L ${e-6*h*2+l} ${i-6*o*2+c} L ${e-6*h*2-l} ${i-6*o*2-c} Z`,d=a.roughSvg.path(u,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>d)},"drawArrowMarker"),_=(0,r.K)((t,e,i,n,s,a,r,h)=>{const o=e.children??[],l=a*(o.length?1:.2),c=p*l*s,u=i+-y*l,d=n+c;if(I(t,i,n,u,d,"ishikawa-branch",h),h&&b(t,i,n,i-u,n-d,h),x(t,e.text,u,d,s,r,h),!o.length)return;const{entries:g,yOrder:f}=w(o,s),k=g.length,m=new Array(k);for(const[t,e]of f.entries())m[e]=n+c*((t+1)/(k+1));const _=new Map;_.set(-1,{x0:i,y0:n,x1:u,y1:d,childCount:o.length,childrenDrawn:0});const v=-y,S=p*s,E=s<0?"ishikawa-label up":"ishikawa-label down";for(const[e,i]of g.entries()){const n=m[e],s=_.get(i.parentIndex),a=t.append("g").attr("class","ishikawa-sub-group");let o=0,l=0,c=0;if(i.depth%2==0){const t=s.y1-s.y0;o=$(s.x0,s.x1,t?(n-s.y0)/t:.5),l=n,c=o-(i.childCount>0?60+5*i.childCount:30),I(a,o,n,c,n,"ishikawa-sub-branch",h),h&&b(a,o,n,1,0,h),K(a,i.text,c,n,"ishikawa-label align","end",r)}else{const t=s.childrenDrawn++;o=$(s.x0,s.x1,(s.childCount-t)/(s.childCount+1)),l=s.y0,c=o+v*((n-l)/S),I(a,o,l,c,n,"ishikawa-sub-branch",h),h&&b(a,o,l,o-c,l-n,h),K(a,i.text,c,n,E,"end",r)}i.childCount>0&&_.set(e,{x0:o,y0:l,x1:c,y1:n,childCount:i.childCount,childrenDrawn:0})}},"drawBranch"),v=(0,r.K)(t=>t.split(/<br\s*\/?>|\n/),"splitLines"),S=(0,r.K)((t,e)=>{if(t.length<=e)return t;const i=[];for(const n of t.split(/\s+/)){const t=i.length-1;t>=0&&i[t].length+1+n.length<=e?i[t]+=" "+n:i.push(n)}return i.join("\n")},"wrapText"),K=(0,r.K)((t,e,i,n,s,a,r)=>{const h=v(e),o=1.05*r,l=t.append("text").attr("class",s).attr("text-anchor",a).attr("x",i).attr("y",n-(h.length-1)*o/2);for(const[t,e]of h.entries())l.append("tspan").attr("x",i).attr("dy",0===t?0:o).text(e);return l},"drawMultilineText"),$=(0,r.K)((t,e,i)=>t+(e-t)*i,"lerp"),I=(0,r.K)((t,e,i,n,s,a,r)=>{if(r){const h=r.roughSvg.line(e,i,n,s,{roughness:1.5,seed:r.seed,stroke:r.lineColor,strokeWidth:2});return void t.append(()=>h).attr("class",a)}return t.append("line").attr("class",a).attr("x1",e).attr("y1",i).attr("x2",n).attr("y2",s)},"drawLine"),E={draw:f},A=(0,r.K)(t=>`\n.ishikawa .ishikawa-spine,\n.ishikawa .ishikawa-branch,\n.ishikawa .ishikawa-sub-branch {\n stroke: ${t.lineColor};\n stroke-width: 2;\n fill: none;\n}\n\n.ishikawa .ishikawa-sub-branch {\n stroke-width: 1;\n}\n\n.ishikawa .ishikawa-arrow {\n fill: ${t.lineColor};\n}\n\n.ishikawa .ishikawa-head {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa .ishikawa-label-box {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa text {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n fill: ${t.textColor};\n}\n\n.ishikawa .ishikawa-head-label {\n font-weight: 600;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: 14px;\n}\n\n.ishikawa .ishikawa-label {\n text-anchor: end;\n}\n\n.ishikawa .ishikawa-label.cause {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.align {\n text-anchor: end;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.up {\n dominant-baseline: baseline;\n}\n\n.ishikawa .ishikawa-label.down {\n dominant-baseline: hanging;\n}\n`,"getStyles"),C={parser:l,get db(){return new c},renderer:E,styles:A}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6806],{77454(e,t,a){function i(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}a.d(t,{S:()=>i}),(0,a(86827).K)(i,"populateCommonDb")},76806(e,t,a){a.d(t,{diagram:()=>k});var i=a(77454),n=a(5637),l=a(12505),r=a(86535),s=a(31293),o=a(86827),c=a(34376),d=a(51444),p=r.UI.pie,h={sections:new Map,showData:!1,config:p},g=h.sections,u=h.showData,f=structuredClone(p),m=(0,o.K)(()=>structuredClone(f),"getConfig"),w=(0,o.K)(()=>{g=new Map,u=h.showData,(0,r.IU)()},"clear"),S=(0,o.K)(({label:e,value:t})=>{if(t<0)throw new Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);g.has(e)||(g.set(e,t),s.R.debug(`added new section: ${e}, with value: ${t}`))},"addSection"),$=(0,o.K)(()=>g,"getSections"),x=(0,o.K)(e=>{u=e},"setShowData"),b=(0,o.K)(()=>u,"getShowData"),D={getConfig:m,clear:w,setDiagramTitle:r.ke,getDiagramTitle:r.ab,setAccTitle:r.SV,getAccTitle:r.iN,setAccDescription:r.EI,getAccDescription:r.m7,addSection:S,getSections:$,setShowData:x,getShowData:b},v=(0,o.K)((e,t)=>{(0,i.S)(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},"populateDb"),y={parse:(0,o.K)(async e=>{const t=await(0,c.qg)("pie",e);s.R.debug(t),v(t,D)},"parse")},C=(0,o.K)(e=>`\n .pieCircle{\n stroke: ${e.pieStrokeColor};\n stroke-width : ${e.pieStrokeWidth};\n opacity : ${e.pieOpacity};\n }\n .pieCircle.highlighted{\n scale: 1.05;\n opacity: 1;\n }\n .pieCircle.highlightedOnHover:hover{\n transition-duration: 250ms;\n scale: 1.05;\n opacity: 1;\n }\n .pieOuterCircle{\n stroke: ${e.pieOuterStrokeColor};\n stroke-width: ${e.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${e.pieTitleTextSize};\n fill: ${e.pieTitleTextColor};\n font-family: ${e.fontFamily};\n }\n .slice {\n font-family: ${e.fontFamily};\n fill: ${e.pieSectionTextColor};\n font-size:${e.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${e.pieLegendTextColor};\n font-family: ${e.fontFamily};\n font-size: ${e.pieLegendTextSize};\n }\n`,"getStyles"),T=(0,o.K)(e=>{const t=[...e.values()].reduce((e,t)=>e+t,0),a=[...e.entries()].map(([e,t])=>({label:e,value:t})).filter(e=>e.value/t*100>=1);return(0,d.rLf)().value(e=>e.value).sort(null)(a)},"createPieArcs"),k={parser:y,db:D,renderer:{draw:(0,o.K)((e,t,a,i)=>{s.R.debug("rendering pie chart\n"+e);const o=i.db,c=(0,r.D7)(),p=(0,l.$t)(o.getConfig(),c.pie),h=18,g=450,u=g,f=(0,n.D)(t),m=f.append("g");m.attr("transform","translate(225,225)");const{themeVariables:w}=c;let[S]=(0,l.I5)(w.pieOuterStrokeWidth);S??=2;const $=p.legendPosition,x=p.textPosition,b=p.donutHole>0&&p.donutHole<=.9?p.donutHole:0,D=Math.min(u,g)/2-40,v=(0,d.JLW)().innerRadius(b*D).outerRadius(D),y=(0,d.JLW)().innerRadius(D*x).outerRadius(D*x),C=m.append("g");C.append("circle").attr("cx",0).attr("cy",0).attr("r",D+S/2).attr("class","pieOuterCircle");const k=o.getSections(),A=T(k),K=[w.pie1,w.pie2,w.pie3,w.pie4,w.pie5,w.pie6,w.pie7,w.pie8,w.pie9,w.pie10,w.pie11,w.pie12];let R=0;k.forEach(e=>{R+=e});const M=A.filter(e=>"0"!==(e.data.value/R*100).toFixed(0)),O=(0,d.UMr)(K).domain([...k.keys()]);C.selectAll("mySlices").data(M).enter().append("path").attr("d",v).attr("fill",e=>O(e.data.label)).attr("class",e=>{let t="pieCircle";return"hover"===p.highlightSlice?t+=" highlightedOnHover":p.highlightSlice===e.data.label&&(t+=" highlighted"),t}),C.selectAll("mySlices").data(M).enter().append("text").text(e=>(e.data.value/R*100).toFixed(0)+"%").attr("transform",e=>"translate("+y.centroid(e)+")").style("text-anchor","middle").attr("class","slice");const z=m.append("text").text(o.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText"),W=[...k.entries()].map(([e,t])=>({label:e,value:t})),F=m.selectAll(".legend").data(W).enter().append("g").attr("class","legend");F.append("rect").attr("width",h).attr("height",h).style("fill",e=>O(e.label)).style("stroke",e=>O(e.label)),F.append("text").attr("x",22).attr("y",14).text(e=>o.getShowData()?`${e.label} [${e.value}]`:e.label);const H=Math.max(...F.selectAll("text").nodes().map(e=>e?.getBoundingClientRect().width??0));let L=g,I=490;const B=22,E=W.length*B;switch($){case"center":F.attr("transform",(e,t)=>{const a=B*W.length/2;return"translate("+(-H/2-22)+","+(t*B-a)+")"});break;case"top":L+=E,F.attr("transform",(e,t)=>`translate(${-H/2-22}, ${t*B-D})`),C.attr("transform",()=>`translate(0, ${E+B})`);break;case"bottom":L+=E,F.attr("transform",(e,t)=>"translate("+(-H/2-22)+","+(t*B-(-D-B))+")");break;case"left":I+=22+H,F.attr("transform",(e,t)=>{const a=B*W.length/2;return"translate("+(-D-22)+","+(t*B-a)+")"}),C.attr("transform",()=>`translate(${H+h+4}, 0)`);break;default:I+=22+H,F.attr("transform",(e,t)=>{const a=B*W.length/2;return"translate(216,"+(t*B-a)+")"})}const P=z.node()?.getBoundingClientRect().width??0,U=225-P/2,J=225+P/2,N=Math.min(0,U),V=Math.max(I,J)-N;f.attr("viewBox",`${N} 0 ${V} ${L}`),(0,r.a$)(f,L,V,p.useMaxWidth)},"draw")},styles:C}}}]);
|