@hienlh/ppm 0.8.53 → 0.8.55
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/CHANGELOG.md +39 -0
- package/bun.lock +250 -1
- package/dist/web/assets/_basePickBy-CZovQgWd.js +1 -0
- package/dist/web/assets/_baseUniq-ClnvscgW.js +1 -0
- package/dist/web/assets/{api-client-TUmacMRS.js → api-client-DpGMOZNf.js} +1 -1
- package/dist/web/assets/api-settings--eVrUeZM.js +1 -0
- package/dist/web/assets/arc-C2Qaz-ch.js +1 -0
- package/dist/web/assets/architecture-PBZL5I3N-ChOahOB7.js +1 -0
- package/dist/web/assets/architectureDiagram-2XIMDMQ5-Jq91S_rs.js +36 -0
- package/dist/web/assets/array-BGFCBI0e.js +1 -0
- package/dist/web/assets/blockDiagram-WCTKOSBZ-CKGufRTy.js +132 -0
- package/dist/web/assets/c4Diagram-IC4MRINW-BNP2L9r_.js +10 -0
- package/dist/web/assets/channel-w7yboq56.js +1 -0
- package/dist/web/assets/chat-tab-BUOCxR2G.js +7 -0
- package/dist/web/assets/chunk-4BX2VUAB-BptTlTyl.js +1 -0
- package/dist/web/assets/chunk-55IACEB6-C4mUdyio.js +1 -0
- package/dist/web/assets/chunk-7E7YKBS2-6xAQfBwa.js +1 -0
- package/dist/web/assets/chunk-7R4GIKGN-DXaGAn_K.js +80 -0
- package/dist/web/assets/chunk-C72U2L5F-DOtEiN5f.js +1 -0
- package/dist/web/assets/chunk-CFjPhJqf.js +1 -0
- package/dist/web/assets/chunk-EGIJ26TM-D0KJTa_T.js +1 -0
- package/dist/web/assets/chunk-FMBD7UC4-C_1aG0eb.js +15 -0
- package/dist/web/assets/chunk-GEFDOKGD-DwVPiYfW.js +2 -0
- package/dist/web/assets/chunk-GLR3WWYH-D9pZakqr.js +2 -0
- package/dist/web/assets/chunk-HHEYEP7N-Dld5BpGB.js +1 -0
- package/dist/web/assets/chunk-JSJVCQXG-BSrqCL_3.js +1 -0
- package/dist/web/assets/chunk-KX2RTZJC-BCxGmbzy.js +1 -0
- package/dist/web/assets/chunk-KYZI473N-BKO5gMeU.js +53 -0
- package/dist/web/assets/chunk-L3YUKLVL-3wBgkSvL.js +1 -0
- package/dist/web/assets/chunk-MX3YWQON-BgjSEzus.js +1 -0
- package/dist/web/assets/chunk-NQ4KR5QH-DLrZwBEm.js +220 -0
- package/dist/web/assets/chunk-O4XLMI2P-BurQy8tt.js +7 -0
- package/dist/web/assets/chunk-OZEHJAEY-YTn24bGg.js +1 -0
- package/dist/web/assets/chunk-PQ6SQG4A-BxtUGYhW.js +1 -0
- package/dist/web/assets/chunk-PU5JKC2W-B66ELkQm.js +70 -0
- package/dist/web/assets/chunk-QZHKN3VN-DwSXwtjH.js +1 -0
- package/dist/web/assets/chunk-R5LLSJPH-euR2RxLN.js +1 -0
- package/dist/web/assets/chunk-WL4C6EOR-_2CBOJdI.js +189 -0
- package/dist/web/assets/chunk-XIRO2GV7-kqQ0g6wW.js +1 -0
- package/dist/web/assets/chunk-XPW4576I-CtcaMb09.js +32 -0
- package/dist/web/assets/chunk-XZSTWKYB-BYxFzZwS.js +94 -0
- package/dist/web/assets/chunk-YBOYWFTD-Dx_fX35n.js +1 -0
- package/dist/web/assets/classDiagram-VBA2DB6C-BpJ6Oog2.js +1 -0
- package/dist/web/assets/classDiagram-v2-RAHNMMFH-Bj8gIhkP.js +1 -0
- package/dist/web/assets/clone-BSi6cgDh.js +1 -0
- package/dist/web/assets/code-editor-os78eUN8.js +1 -0
- package/dist/web/assets/columns-2-ChOTgl3e.js +1 -0
- package/dist/web/assets/cose-bilkent-S5V4N54A-CHHjH2dV.js +1 -0
- package/dist/web/assets/cytoscape.esm-Ccan6xou.js +321 -0
- package/dist/web/assets/dagre-CNtSxiE_.js +1 -0
- package/dist/web/assets/dagre-KLK3FWXG-ChenfPp1.js +4 -0
- package/dist/web/assets/database-viewer-DTwe0h8F.js +1 -0
- package/dist/web/assets/defaultLocale-CRZydyG6.js +1 -0
- package/dist/web/assets/diagram-E7M64L7V-CzKYZM0Y.js +24 -0
- package/dist/web/assets/diagram-IFDJBPK2-ChB_paPo.js +43 -0
- package/dist/web/assets/diagram-P4PSJMXO-D1eW1dkL.js +24 -0
- package/dist/web/assets/diff-viewer-CSyOOmS2.js +4 -0
- package/dist/web/assets/dist-Cce3efmT.js +1 -0
- package/dist/web/assets/{dist-QgqOdSYG.js → dist-T0Vhi0Mh.js} +1 -1
- package/dist/web/assets/erDiagram-INFDFZHY-mCvUFSn6.js +70 -0
- package/dist/web/assets/flowDiagram-PKNHOUZH-14ohZ1M1.js +162 -0
- package/dist/web/assets/ganttDiagram-A5KZAMGK-DIX0pLbk.js +292 -0
- package/dist/web/assets/git-graph-CwYW3F4P.js +1 -0
- package/dist/web/assets/gitGraph-HDMCJU4V-CEee2FCA.js +1 -0
- package/dist/web/assets/gitGraphDiagram-K3NZZRJ6-yEWZbdf_.js +65 -0
- package/dist/web/assets/graphlib-DhOZxqsh.js +1 -0
- package/dist/web/assets/index-WKLuYsBY.css +2 -0
- package/dist/web/assets/index-yMR7OUDx.js +37 -0
- package/dist/web/assets/info-3K5VOQVL-ce_pi3En.js +1 -0
- package/dist/web/assets/infoDiagram-LFFYTUFH-BzqyoqXw.js +2 -0
- package/dist/web/assets/init-B8gtcn7T.js +1 -0
- package/dist/web/assets/input-Brjz2Vv-.js +41 -0
- package/dist/web/assets/isArrayLikeObject-B4pdpV8V.js +1 -0
- package/dist/web/assets/isEmpty-C0YYdhYj.js +1 -0
- package/dist/web/assets/ishikawaDiagram-PHBUUO56-olazD6dZ.js +70 -0
- package/dist/web/assets/journeyDiagram-4ABVD52K-CttDH9bb.js +139 -0
- package/dist/web/assets/jsx-runtime-BRW_vwa9.js +1 -0
- package/dist/web/assets/kanban-definition-K7BYSVSG-BBXbI37U.js +89 -0
- package/dist/web/assets/katex-Bbu770d9.js +265 -0
- package/dist/web/assets/keybindings-store-B-BLLKiZ.js +1 -0
- package/dist/web/assets/line-DBLLF7lH.js +1 -0
- package/dist/web/assets/linear-BLFWatDe.js +1 -0
- package/dist/web/assets/markdown-renderer-DQWY7QvX.js +69 -0
- package/dist/web/assets/math-DwgHI-Cu.js +1 -0
- package/dist/web/assets/mermaid-parser.core-BKiGOTjR.js +4 -0
- package/dist/web/assets/mindmap-definition-YRQLILUH-DoT7m4Sz.js +68 -0
- package/dist/web/assets/ordinal-CCj7PWgZ.js +1 -0
- package/dist/web/assets/packet-RMMSAZCW-CdYSLjRL.js +1 -0
- package/dist/web/assets/path-DZF-JdEe.js +1 -0
- package/dist/web/assets/pie-UPGHQEXC-Bm5LiD-6.js +1 -0
- package/dist/web/assets/pieDiagram-SKSYHLDU-Bkh2E4zE.js +30 -0
- package/dist/web/assets/postgres-viewer-Ctv7NTI_.js +1 -0
- package/dist/web/assets/preload-helper-qlgyTAkD.js +1 -0
- package/dist/web/assets/quadrantDiagram-337W2JSQ-B7zgALOL.js +7 -0
- package/dist/web/assets/radar-KQ55EAFF-C4PnyG7_.js +1 -0
- package/dist/web/assets/react-BGf7KNLk.js +1 -0
- package/dist/web/assets/react-nm2Ru1Pt.js +1 -0
- package/dist/web/assets/requirementDiagram-Z7DCOOCP-D_5GXNRo.js +73 -0
- package/dist/web/assets/rough.esm-VLpapkIG.js +1 -0
- package/dist/web/assets/sankeyDiagram-WA2Y5GQK-BA9EFAAe.js +10 -0
- package/dist/web/assets/sequenceDiagram-2WXFIKYE-fyWIrHiG.js +145 -0
- package/dist/web/assets/settings-store-Bbhg_ptG.js +2 -0
- package/dist/web/assets/settings-tab-Daap0c_B.js +1 -0
- package/dist/web/assets/sqlite-viewer-DtNk76CE.js +1 -0
- package/dist/web/assets/src-BoSBNdA_.js +1 -0
- package/dist/web/assets/stateDiagram-RAJIS63D-DfRBcaBu.js +1 -0
- package/dist/web/assets/stateDiagram-v2-FVOUBMTO-CMN4M2Em.js +1 -0
- package/dist/web/assets/{tab-store-NOBndc0_.js → tab-store-dpsCvqhH.js} +1 -1
- package/dist/web/assets/{table-B6neW6Hr.js → table-Yo02WRH-.js} +1 -1
- package/dist/web/assets/{tag-DJUYe5BQ.js → tag-CaC1ng2E.js} +1 -1
- package/dist/web/assets/{terminal-tab-DAFbT7Sv.js → terminal-tab-JEpjt3RD.js} +2 -2
- package/dist/web/assets/timeline-definition-YZTLITO2-DYfwJ1jM.js +61 -0
- package/dist/web/assets/treemap-KZPCXAKY-2_y-mhkz.js +1 -0
- package/dist/web/assets/{use-monaco-theme-DwP4EHdO.js → use-monaco-theme-DHbyUrzJ.js} +1 -1
- package/dist/web/assets/vennDiagram-LZ73GAT5-DqbKNRD9.js +34 -0
- package/dist/web/assets/xychartDiagram-JWTSCODW-DhUL86qT.js +7 -0
- package/dist/web/index.html +13 -11
- package/dist/web/sw.js +1 -1
- package/docs/project-changelog.md +78 -0
- package/docs/project-roadmap.md +1 -0
- package/docs/system-architecture.md +13 -1
- package/package.json +2 -1
- package/src/cli/commands/stop.ts +3 -2
- package/src/cli/commands/upgrade.ts +49 -0
- package/src/index.ts +9 -0
- package/src/providers/claude-agent-sdk.ts +7 -0
- package/src/server/index.ts +31 -18
- package/src/server/routes/accounts.ts +3 -8
- package/src/server/routes/upgrade.ts +57 -0
- package/src/services/account-selector.service.ts +52 -9
- package/src/services/db.service.ts +1 -1
- package/src/services/fs-browse.service.ts +10 -7
- package/src/services/supervisor.ts +83 -1
- package/src/services/upgrade.service.ts +115 -0
- package/src/web/app.tsx +12 -0
- package/src/web/components/chat/account-dialogs.tsx +377 -0
- package/src/web/components/chat/message-list.tsx +196 -45
- package/src/web/components/chat/usage-badge.tsx +56 -20
- package/src/web/components/layout/upgrade-banner.tsx +102 -0
- package/src/web/components/settings/settings-tab.tsx +2 -5
- package/src/web/components/shared/diagram-overlay.tsx +139 -0
- package/src/web/components/shared/image-overlay.tsx +45 -0
- package/src/web/components/shared/markdown-renderer.tsx +55 -2
- package/src/web/stores/diagram-overlay-store.ts +16 -0
- package/src/web/stores/image-overlay-store.ts +18 -0
- package/dist/web/assets/api-settings-D4bgXrLU.js +0 -1
- package/dist/web/assets/chat-tab-wunayDmr.js +0 -7
- package/dist/web/assets/code-editor-Fw_VrmHT.js +0 -1
- package/dist/web/assets/columns-2-BZ5wv2wA.js +0 -1
- package/dist/web/assets/database-viewer-CZjxdELm.js +0 -1
- package/dist/web/assets/diff-viewer-B51YfMeK.js +0 -4
- package/dist/web/assets/git-graph-fCVmtbaj.js +0 -1
- package/dist/web/assets/index-CoyMn-Mj.css +0 -2
- package/dist/web/assets/index-DMlEKjZt.js +0 -37
- package/dist/web/assets/input-CE3bFwLk.js +0 -41
- package/dist/web/assets/jsx-runtime-wQxeESYQ.js +0 -1
- package/dist/web/assets/keybindings-store-BzXZa5uC.js +0 -1
- package/dist/web/assets/markdown-renderer-D_OeJdOH.js +0 -59
- package/dist/web/assets/postgres-viewer-BlEIES7N.js +0 -1
- package/dist/web/assets/react-CYzKIDNi.js +0 -1
- package/dist/web/assets/react-rgzL83kk.js +0 -1
- package/dist/web/assets/settings-store-DL2KEbtc.js +0 -2
- package/dist/web/assets/settings-tab-DnU5t6Fy.js +0 -1
- package/dist/web/assets/sqlite-viewer-BJ2s8Dng.js +0 -1
- /package/dist/web/assets/{utils-DC-bdPS3.js → utils-btZ8C8-R.js} +0 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import{o as e,t}from"./chunk-CFjPhJqf.js";import{h as n}from"./chunk-GEFDOKGD-DwVPiYfW.js";import{a as r,c as i,d as a,f as o,g as s,h as c,i as l,p as u,s as d,u as f,v as p}from"./src-BoSBNdA_.js";import{B as m,C as h,V as g,W as _,_ as v,a as y,b,c as x,s as S,v as C}from"./chunk-7R4GIKGN-DXaGAn_K.js";import{a as w,i as T,n as E,r as D,t as O}from"./linear-BLFWatDe.js";import"./defaultLocale-CRZydyG6.js";import{t as k}from"./init-B8gtcn7T.js";import{t as ee}from"./dist-Cce3efmT.js";function A(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function te(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ne(e){return e}var re=1,ie=2,ae=3,oe=4,se=1e-6;function ce(e){return`translate(`+e+`,0)`}function le(e){return`translate(0,`+e+`)`}function ue(e){return t=>+e(t)}function de(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function fe(){return!this.__axis}function pe(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,c=typeof window<`u`&&window.devicePixelRatio>1?0:.5,l=e===re||e===oe?-1:1,u=e===oe||e===ie?`x`:`y`,d=e===re||e===ae?ce:le;function f(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):ne),h=Math.max(a,0)+s,g=t.range(),_=+g[0]+c,v=+g[g.length-1]+c,y=(t.bandwidth?de:ue)(t.copy(),c),b=f.selection?f.selection():f,x=b.selectAll(`.domain`).data([null]),S=b.selectAll(`.tick`).data(p,t).order(),C=S.exit(),w=S.enter().append(`g`).attr(`class`,`tick`),T=S.select(`line`),E=S.select(`text`);x=x.merge(x.enter().insert(`path`,`.tick`).attr(`class`,`domain`).attr(`stroke`,`currentColor`)),S=S.merge(w),T=T.merge(w.append(`line`).attr(`stroke`,`currentColor`).attr(u+`2`,l*a)),E=E.merge(w.append(`text`).attr(`fill`,`currentColor`).attr(u,l*h).attr(`dy`,e===re?`0em`:e===ae?`0.71em`:`0.32em`)),f!==b&&(x=x.transition(f),S=S.transition(f),T=T.transition(f),E=E.transition(f),C=C.transition(f).attr(`opacity`,se).attr(`transform`,function(e){return isFinite(e=y(e))?d(e+c):this.getAttribute(`transform`)}),w.attr(`opacity`,se).attr(`transform`,function(e){var t=this.parentNode.__axis;return d((t&&isFinite(t=t(e))?t:y(e))+c)})),C.remove(),x.attr(`d`,e===oe||e===ie?o?`M`+l*o+`,`+_+`H`+c+`V`+v+`H`+l*o:`M`+c+`,`+_+`V`+v:o?`M`+_+`,`+l*o+`V`+c+`H`+v+`V`+l*o:`M`+_+`,`+c+`H`+v),S.attr(`opacity`,1).attr(`transform`,function(e){return d(y(e)+c)}),T.attr(u+`2`,l*a),E.attr(u,l*h).text(m),b.filter(fe).attr(`fill`,`none`).attr(`font-size`,10).attr(`font-family`,`sans-serif`).attr(`text-anchor`,e===ie?`start`:e===oe?`end`:`middle`),b.each(function(){this.__axis=y})}return f.scale=function(e){return arguments.length?(t=e,f):t},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(e){return arguments.length?(n=e==null?[]:Array.from(e),f):n.slice()},f.tickValues=function(e){return arguments.length?(r=e==null?null:Array.from(e),f):r&&r.slice()},f.tickFormat=function(e){return arguments.length?(i=e,f):i},f.tickSize=function(e){return arguments.length?(a=o=+e,f):a},f.tickSizeInner=function(e){return arguments.length?(a=+e,f):a},f.tickSizeOuter=function(e){return arguments.length?(o=+e,f):o},f.tickPadding=function(e){return arguments.length?(s=+e,f):s},f.offset=function(e){return arguments.length?(c=+e,f):c},f}function me(e){return pe(re,e)}function he(e){return pe(ae,e)}var ge=Math.PI/180,_e=180/Math.PI,ve=18,ye=.96422,be=1,xe=.82521,Se=4/29,Ce=6/29,we=3*Ce*Ce,Te=Ce*Ce*Ce;function Ee(e){if(e instanceof j)return new j(e.l,e.a,e.b,e.opacity);if(e instanceof M)return Pe(e);e instanceof i||(e=f(e));var t=je(e.r),n=je(e.g),r=je(e.b),a=Oe((.2225045*t+.7168786*n+.0606169*r)/be),o,s;return t===n&&n===r?o=s=a:(o=Oe((.4360747*t+.3850649*n+.1430804*r)/ye),s=Oe((.0139322*t+.0971045*n+.7141733*r)/xe)),new j(116*a-16,500*(o-a),200*(a-s),e.opacity)}function De(e,t,n,r){return arguments.length===1?Ee(e):new j(e,t,n,r??1)}function j(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}a(j,De,o(d,{brighter(e){return new j(this.l+ve*(e??1),this.a,this.b,this.opacity)},darker(e){return new j(this.l-ve*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=ye*ke(t),e=be*ke(e),n=xe*ke(n),new i(Ae(3.1338561*t-1.6168667*e-.4906146*n),Ae(-.9787684*t+1.9161415*e+.033454*n),Ae(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Oe(e){return e>Te?e**(1/3):e/we+Se}function ke(e){return e>Ce?e*e*e:we*(e-Se)}function Ae(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function je(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Me(e){if(e instanceof M)return new M(e.h,e.c,e.l,e.opacity);if(e instanceof j||(e=Ee(e)),e.a===0&&e.b===0)return new M(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*_e;return new M(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Ne(e,t,n,r){return arguments.length===1?Me(e):new M(e,t,n,r??1)}function M(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Pe(e){if(isNaN(e.h))return new j(e.l,0,0,e.opacity);var t=e.h*ge;return new j(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}a(M,Ne,o(d,{brighter(e){return new M(this.h,this.c,this.l+ve*(e??1),this.opacity)},darker(e){return new M(this.h,this.c,this.l-ve*(e??1),this.opacity)},rgb(){return Pe(this).rgb()}}));function Fe(e){return function(t,n){var i=e((t=Ne(t)).h,(n=Ne(n)).h),a=r(t.c,n.c),o=r(t.l,n.l),s=r(t.opacity,n.opacity);return function(e){return t.h=i(e),t.c=a(e),t.l=o(e),t.opacity=s(e),t+``}}}var Ie=Fe(l);function Le(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}var Re=new Date,ze=new Date;function N(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>N(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(Re.setTime(+t),ze.setTime(+r),e(Re),e(ze),Math.floor(n(Re,ze))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var P=N(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);P.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?N(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):P),P.range;var F=1e3,I=F*60,L=I*60,R=L*24,Be=R*7,Ve=R*30,He=R*365,z=N(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*F)},(e,t)=>(t-e)/F,e=>e.getUTCSeconds());z.range;var Ue=N(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*F)},(e,t)=>{e.setTime(+e+t*I)},(e,t)=>(t-e)/I,e=>e.getMinutes());Ue.range;var We=N(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*I)},(e,t)=>(t-e)/I,e=>e.getUTCMinutes());We.range;var Ge=N(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*F-e.getMinutes()*I)},(e,t)=>{e.setTime(+e+t*L)},(e,t)=>(t-e)/L,e=>e.getHours());Ge.range;var Ke=N(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*L)},(e,t)=>(t-e)/L,e=>e.getUTCHours());Ke.range;var B=N(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*I)/R,e=>e.getDate()-1);B.range;var qe=N(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/R,e=>e.getUTCDate()-1);qe.range;var Je=N(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/R,e=>Math.floor(e/R));Je.range;function V(e){return N(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*I)/Be)}var Ye=V(0),Xe=V(1),Ze=V(2),Qe=V(3),H=V(4),$e=V(5),et=V(6);Ye.range,Xe.range,Ze.range,Qe.range,H.range,$e.range,et.range;function U(e){return N(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/Be)}var tt=U(0),nt=U(1),rt=U(2),it=U(3),W=U(4),at=U(5),ot=U(6);tt.range,nt.range,rt.range,it.range,W.range,at.range,ot.range;var st=N(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());st.range;var ct=N(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ct.range;var G=N(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());G.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:N(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),G.range;var K=N(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());K.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:N(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),K.range;function lt(e,t,n,r,i,a){let o=[[z,1,F],[z,5,5*F],[z,15,15*F],[z,30,30*F],[a,1,I],[a,5,5*I],[a,15,15*I],[a,30,30*I],[i,1,L],[i,3,3*L],[i,6,6*L],[i,12,12*L],[r,1,R],[r,2,2*R],[n,1,Be],[t,1,Ve],[t,3,3*Ve],[e,1,He]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=w(([,,e])=>e).right(o,i);if(a===o.length)return e.every(T(t/He,n/He,r));if(a===0)return P.every(Math.max(T(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[ut,dt]=lt(K,ct,tt,Je,Ke,We),[ft,pt]=lt(G,st,Ye,B,Ge,Ue);function mt(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ht(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function gt(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function _t(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=St(i),u=Ct(i),d=St(a),f=Ct(a),p=St(o),m=Ct(o),h=St(s),g=Ct(s),_=St(c),v=Ct(c),y={a:ne,A:re,b:ie,B:ae,c:null,d:Wt,e:Wt,f:Yt,g:sn,G:ln,H:Gt,I:Kt,j:qt,L:Jt,m:Xt,M:Zt,p:oe,q:se,Q:Mn,s:Nn,S:Qt,u:$t,U:en,V:nn,w:rn,W:an,x:null,X:null,y:on,Y:cn,Z:un,"%":jn},b={a:ce,A:le,b:ue,B:de,c:null,d:dn,e:dn,f:gn,g:Dn,G:kn,H:fn,I:pn,j:mn,L:hn,m:_n,M:vn,p:fe,q:pe,Q:Mn,s:Nn,S:yn,u:bn,U:xn,V:Cn,w:wn,W:Tn,x:null,X:null,y:En,Y:On,Z:An,"%":jn},x={a:E,A:D,b:O,B:k,c:ee,d:Pt,e:Pt,f:Bt,g:At,G:kt,H:It,I:It,j:Ft,L:zt,m:Nt,M:Lt,p:T,q:Mt,Q:Ht,s:Ut,S:Rt,u:Tt,U:Et,V:Dt,w:wt,W:Ot,x:A,X:te,y:At,Y:kt,Z:jt,"%":Vt};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=vt[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=gt(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=ht(gt(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?nt.ceil(a):nt(a),a=qe.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=mt(gt(r.y,0,1)),o=a.getDay(),a=o>4||o===0?Xe.ceil(a):Xe(a),a=B.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else (`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:`W`in r?1:0),o=`Z`in r?ht(gt(r.y,0,1)).getUTCDay():mt(gt(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,ht(r)):mt(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in vt?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function ee(e,n,r){return w(e,t,n,r)}function A(e,t,r){return w(e,n,t,r)}function te(e,t,n){return w(e,r,t,n)}function ne(e){return o[e.getDay()]}function re(e){return a[e.getDay()]}function ie(e){return c[e.getMonth()]}function ae(e){return s[e.getMonth()]}function oe(e){return i[+(e.getHours()>=12)]}function se(e){return 1+~~(e.getMonth()/3)}function ce(e){return o[e.getUTCDay()]}function le(e){return a[e.getUTCDay()]}function ue(e){return c[e.getUTCMonth()]}function de(e){return s[e.getUTCMonth()]}function fe(e){return i[+(e.getUTCHours()>=12)]}function pe(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var vt={"-":``,_:` `,0:`0`},q=/^\s*\d+/,yt=/^%/,bt=/[\\^$*+?|[\]().{}]/g;function J(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function xt(e){return e.replace(bt,`\\$&`)}function St(e){return RegExp(`^(?:`+e.map(xt).join(`|`)+`)`,`i`)}function Ct(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function wt(e,t,n){var r=q.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Tt(e,t,n){var r=q.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Et(e,t,n){var r=q.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Dt(e,t,n){var r=q.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ot(e,t,n){var r=q.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function kt(e,t,n){var r=q.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function At(e,t,n){var r=q.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function jt(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function Mt(e,t,n){var r=q.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Nt(e,t,n){var r=q.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Pt(e,t,n){var r=q.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ft(e,t,n){var r=q.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function It(e,t,n){var r=q.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Lt(e,t,n){var r=q.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Rt(e,t,n){var r=q.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function zt(e,t,n){var r=q.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Bt(e,t,n){var r=q.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Vt(e,t,n){var r=yt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ht(e,t,n){var r=q.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ut(e,t,n){var r=q.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Wt(e,t){return J(e.getDate(),t,2)}function Gt(e,t){return J(e.getHours(),t,2)}function Kt(e,t){return J(e.getHours()%12||12,t,2)}function qt(e,t){return J(1+B.count(G(e),e),t,3)}function Jt(e,t){return J(e.getMilliseconds(),t,3)}function Yt(e,t){return Jt(e,t)+`000`}function Xt(e,t){return J(e.getMonth()+1,t,2)}function Zt(e,t){return J(e.getMinutes(),t,2)}function Qt(e,t){return J(e.getSeconds(),t,2)}function $t(e){var t=e.getDay();return t===0?7:t}function en(e,t){return J(Ye.count(G(e)-1,e),t,2)}function tn(e){var t=e.getDay();return t>=4||t===0?H(e):H.ceil(e)}function nn(e,t){return e=tn(e),J(H.count(G(e),e)+(G(e).getDay()===4),t,2)}function rn(e){return e.getDay()}function an(e,t){return J(Xe.count(G(e)-1,e),t,2)}function on(e,t){return J(e.getFullYear()%100,t,2)}function sn(e,t){return e=tn(e),J(e.getFullYear()%100,t,2)}function cn(e,t){return J(e.getFullYear()%1e4,t,4)}function ln(e,t){var n=e.getDay();return e=n>=4||n===0?H(e):H.ceil(e),J(e.getFullYear()%1e4,t,4)}function un(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+J(t/60|0,`0`,2)+J(t%60,`0`,2)}function dn(e,t){return J(e.getUTCDate(),t,2)}function fn(e,t){return J(e.getUTCHours(),t,2)}function pn(e,t){return J(e.getUTCHours()%12||12,t,2)}function mn(e,t){return J(1+qe.count(K(e),e),t,3)}function hn(e,t){return J(e.getUTCMilliseconds(),t,3)}function gn(e,t){return hn(e,t)+`000`}function _n(e,t){return J(e.getUTCMonth()+1,t,2)}function vn(e,t){return J(e.getUTCMinutes(),t,2)}function yn(e,t){return J(e.getUTCSeconds(),t,2)}function bn(e){var t=e.getUTCDay();return t===0?7:t}function xn(e,t){return J(tt.count(K(e)-1,e),t,2)}function Sn(e){var t=e.getUTCDay();return t>=4||t===0?W(e):W.ceil(e)}function Cn(e,t){return e=Sn(e),J(W.count(K(e),e)+(K(e).getUTCDay()===4),t,2)}function wn(e){return e.getUTCDay()}function Tn(e,t){return J(nt.count(K(e)-1,e),t,2)}function En(e,t){return J(e.getUTCFullYear()%100,t,2)}function Dn(e,t){return e=Sn(e),J(e.getUTCFullYear()%100,t,2)}function On(e,t){return J(e.getUTCFullYear()%1e4,t,4)}function kn(e,t){var n=e.getUTCDay();return e=n>=4||n===0?W(e):W.ceil(e),J(e.getUTCFullYear()%1e4,t,4)}function An(){return`+0000`}function jn(){return`%`}function Mn(e){return+e}function Nn(e){return Math.floor(e/1e3)}var Pn,Fn;In({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function In(e){return Pn=_t(e),Fn=Pn.format,Pn.parse,Pn.utcFormat,Pn.utcParse,Pn}function Ln(e){return new Date(e)}function Rn(e){return e instanceof Date?+e:+new Date(+e)}function zn(e,t,n,r,i,a,o,s,c,l){var u=E(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,Rn)):f().map(Ln)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(Le(n,e)):u},u.copy=function(){return D(u,zn(e,t,n,r,i,a,o,s,c,l))},u}function Bn(){return k.apply(zn(ft,pt,G,st,Ye,B,Ge,Ue,z,Fn).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var Vn=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isoWeek=r()})(e,(function(){var e=`day`;return function(t,n,r){var i=function(t){return t.add(4-t.isoWeekday(),e)},a=n.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var n,a,o,s,c=i(this),l=(n=this.isoWeekYear(),a=this.$u,o=(a?r.utc:r)().year(n).startOf(`year`),s=4-o.isoWeekday(),o.isoWeekday()>4&&(s+=7),o.add(s,e));return c.diff(l,`week`)+1},a.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var o=a.startOf;a.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return n.p(e)===`isoweek`?r?this.date(this.date()-(this.isoWeekday()-1)).startOf(`day`):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf(`day`):o.bind(this)(e,t)}}}))})),Hn=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal;if(this.day=e.match(/\d+/)[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,``)===e&&(this.day=n)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),Un=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_advancedFormat=r()})(e,(function(){return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),a=(e||`YYYY-MM-DDTHH:mm:ssZ`).replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case`Q`:return Math.ceil((t.$M+1)/3);case`Do`:return n.ordinal(t.$D);case`gggg`:return t.weekYear();case`GGGG`:return t.isoWeekYear();case`wo`:return n.ordinal(t.week(),`W`);case`w`:case`ww`:return i.s(t.week(),e===`w`?1:2,`0`);case`W`:case`WW`:return i.s(t.isoWeek(),e===`W`?1:2,`0`);case`k`:case`kk`:return i.s(String(t.$H===0?24:t.$H),e===`k`?1:2,`0`);case`X`:return Math.floor(t.$d.getTime()/1e3);case`x`:return t.$d.getTime();case`z`:return`[`+t.offsetName()+`]`;case`zzz`:return`[`+t.offsetName(`long`)+`]`;default:return e}}));return r.bind(this)(a)}}}))})),Wn=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_duration=r()})(e,(function(){var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,s=31536e6,c=2628e6,l=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:s,months:c,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof v},f=function(e,t,n){return new v(e,n,t.$l)},p=function(e){return t.p(e)+`s`},m=function(e){return e<0},h=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},_=function(e,t){return e?m(e)?{negative:!0,format:``+g(e)+t}:{negative:!1,format:``+e+t}:{negative:!1,format:``}},v=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,e===void 0&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*u[p(t)],this);if(typeof e==`number`)return this.$ms=e,this.parseFromMilliseconds(),this;if(typeof e==`object`)return Object.keys(e).forEach((function(t){r.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if(typeof e==`string`){var i=e.match(l);if(i){var a=i.slice(2).map((function(e){return e==null?0:Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/s),e%=s,this.$d.months=h(e/c),e%=c,this.$d.days=h(e/a),e%=a,this.$d.hours=h(e/i),e%=i,this.$d.minutes=h(e/r),e%=r,this.$d.seconds=h(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=_(this.$d.years,`Y`),t=_(this.$d.months,`M`),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=_(n,`D`),i=_(this.$d.hours,`H`),a=_(this.$d.minutes,`M`),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=_(o,`S`),c=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,l=i.format||a.format||s.format?`T`:``,u=(c?`-`:``)+`P`+e.format+t.format+r.format+l+i.format+a.format+s.format;return u===`P`||u===`-P`?`P0D`:u},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||`YYYY-MM-DDTHH:mm:ss`,r={Y:this.$d.years,YY:t.s(this.$d.years,2,`0`),YYYY:t.s(this.$d.years,4,`0`),M:this.$d.months,MM:t.s(this.$d.months,2,`0`),D:this.$d.days,DD:t.s(this.$d.days,2,`0`),H:this.$d.hours,HH:t.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,`0`),SSS:t.s(this.$d.milliseconds,3,`0`)};return n.replace(o,(function(e,t){return t||String(r[e])}))},g.as=function(e){return this.$ms/u[p(e)]},g.get=function(e){var t=this.$ms,n=p(e);return n===`milliseconds`?t%=1e3:t=n===`weeks`?h(t/u[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*u[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return f(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,`ms`).locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get(`milliseconds`)},g.asMilliseconds=function(){return this.as(`milliseconds`)},g.seconds=function(){return this.get(`seconds`)},g.asSeconds=function(){return this.as(`seconds`)},g.minutes=function(){return this.get(`minutes`)},g.asMinutes=function(){return this.as(`minutes`)},g.hours=function(){return this.get(`hours`)},g.asHours=function(){return this.as(`hours`)},g.days=function(){return this.get(`days`)},g.asDays=function(){return this.as(`days`)},g.weeks=function(){return this.get(`weeks`)},g.asWeeks=function(){return this.as(`weeks`)},g.months=function(){return this.get(`months`)},g.asMonths=function(){return this.as(`months`)},g.years=function(){return this.get(`years`)},g.asYears=function(){return this.as(`years`)},m}(),y=function(e,t,n){return e.add(t.years()*n,`y`).add(t.months()*n,`M`).add(t.days()*n,`d`).add(t.hours()*n,`h`).add(t.minutes()*n,`m`).add(t.seconds()*n,`s`).add(t.milliseconds()*n,`ms`)};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){return f(e,{$l:i.locale()},t)},i.isDuration=d;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?y(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}))})),Gn=ee(),Y=e(p(),1),Kn=e(Vn(),1),qn=e(Hn(),1),Jn=e(Un(),1),Yn=e(Wn(),1),Xn=(function(){var e=c(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],a=[1,29],o=[1,30],s=[1,31],l=[1,32],u=[1,33],d=[1,34],f=[1,9],p=[1,10],m=[1,11],h=[1,12],g=[1,13],_=[1,14],v=[1,15],y=[1,16],b=[1,19],x=[1,20],S=[1,21],C=[1,22],w=[1,23],T=[1,25],E=[1,35],D={trace:c(function(){},`trace`),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:`error`,4:`gantt`,6:`EOF`,8:`SPACE`,10:`NL`,12:`weekday_monday`,13:`weekday_tuesday`,14:`weekday_wednesday`,15:`weekday_thursday`,16:`weekday_friday`,17:`weekday_saturday`,18:`weekday_sunday`,20:`weekend_friday`,21:`weekend_saturday`,22:`dateFormat`,23:`inclusiveEndDates`,24:`topAxis`,25:`axisFormat`,26:`tickInterval`,27:`excludes`,28:`includes`,29:`todayMarker`,30:`title`,31:`acc_title`,32:`acc_title_value`,33:`acc_descr`,34:`acc_descr_value`,35:`acc_descr_multiline_value`,36:`section`,38:`taskTxt`,39:`taskData`,40:`click`,41:`callbackname`,42:`callbackargs`,43:`href`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:c(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setWeekday(`monday`);break;case 9:r.setWeekday(`tuesday`);break;case 10:r.setWeekday(`wednesday`);break;case 11:r.setWeekday(`thursday`);break;case 12:r.setWeekday(`friday`);break;case 13:r.setWeekday(`saturday`);break;case 14:r.setWeekday(`sunday`);break;case 15:r.setWeekend(`friday`);break;case 16:r.setWeekend(`saturday`);break;case 17:r.setDateFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 18:r.enableInclusiveEndDates(),this.$=a[s].substr(18);break;case 19:r.TopAxis(),this.$=a[s].substr(8);break;case 20:r.setAxisFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 21:r.setTickInterval(a[s].substr(13)),this.$=a[s].substr(13);break;case 22:r.setExcludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 23:r.setIncludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 24:r.setTodayMarker(a[s].substr(12)),this.$=a[s].substr(12);break;case 27:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 28:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 29:case 30:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 31:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 33:r.addTask(a[s-1],a[s]),this.$=`task`;break;case 34:this.$=a[s-1],r.setClickEvent(a[s-1],a[s],null);break;case 35:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 36:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],null),r.setLink(a[s-2],a[s]);break;case 37:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setLink(a[s-3],a[s]);break;case 38:this.$=a[s-2],r.setClickEvent(a[s-2],a[s],null),r.setLink(a[s-2],a[s-1]);break;case 39:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-1],a[s]),r.setLink(a[s-3],a[s-2]);break;case 40:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 41:case 47:this.$=a[s-1]+` `+a[s];break;case 42:case 43:case 45:this.$=a[s-2]+` `+a[s-1]+` `+a[s];break;case 44:case 46:this.$=a[s-3]+` `+a[s-2]+` `+a[s-1]+` `+a[s];break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:l,19:18,20:u,21:d,22:f,23:p,24:m,25:h,26:g,27:_,28:v,29:y,30:b,31:x,33:S,35:C,36:w,37:24,38:T,40:E},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:l,19:18,20:u,21:d,22:f,23:p,24:m,25:h,26:g,27:_,28:v,29:y,30:b,31:x,33:S,35:C,36:w,37:24,38:T,40:E},e(t,[2,5]),e(t,[2,6]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,20]),e(t,[2,21]),e(t,[2,22]),e(t,[2,23]),e(t,[2,24]),e(t,[2,25]),e(t,[2,26]),e(t,[2,27]),{32:[1,37]},{34:[1,38]},e(t,[2,30]),e(t,[2,31]),e(t,[2,32]),{39:[1,39]},e(t,[2,8]),e(t,[2,9]),e(t,[2,10]),e(t,[2,11]),e(t,[2,12]),e(t,[2,13]),e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),{41:[1,40],43:[1,41]},e(t,[2,4]),e(t,[2,28]),e(t,[2,29]),e(t,[2,33]),e(t,[2,34],{42:[1,42],43:[1,43]}),e(t,[2,40],{41:[1,44]}),e(t,[2,35],{43:[1,45]}),e(t,[2,36]),e(t,[2,38],{42:[1,46]}),e(t,[2,37]),e(t,[2,39])],defaultActions:{},parseError:c(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:c(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,p=1,m=a.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;a.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,i.length-=e,a.length-=e}c(b,`popStack`);function x(){var e=r.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}c(x,`lex`);for(var S,C,w,T,E,D={},O,k,ee,A;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=o[w]&&o[w][S]),T===void 0||!T.length||!T[0]){var te=``;for(O in A=[],o[w])this.terminals_[O]&&O>f&&A.push(`'`+this.terminals_[O]+`'`);te=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
|
+
`+h.showPosition()+`
|
|
3
|
+
Expecting `+A.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(te,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:A})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),i.push(h.yytext),a.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,s=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=i[i.length-k],D._$={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},y&&(D._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),E=this.performAction.apply(D,[s,u,l,g.yy,T[1],i,a].concat(m)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),a=a.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),i.push(D.$),a.push(D._$),ee=o[n[n.length-2]][n[n.length-1]],n.push(ee);break;case 3:return!0}}return!0},`parse`)};D.lexer=(function(){return{EOF:1,parseError:c(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:c(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:c(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.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),e},`input`),unput:c(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:c(function(){return this._more=!0,this},`more`),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:c(function(e){this.unput(this.match.slice(e))},`less`),pastInput:c(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:c(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:c(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
5
|
+
`+t+`^`},`showPosition`),test_match:c(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={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&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,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(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:c(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:c(function(){return this.next()||this.lex()},`lex`),begin:c(function(e){this.conditionStack.push(e)},`begin`),popState:c(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:c(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:c(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:c(function(e){this.begin(e)},`pushState`),stateStackSize:c(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:c(function(e,t,n,r){switch(n){case 0:return this.begin(`open_directive`),`open_directive`;case 1:return this.begin(`acc_title`),31;case 2:return this.popState(),`acc_title_value`;case 3:return this.begin(`acc_descr`),33;case 4:return this.popState(),`acc_descr_value`;case 5:this.begin(`acc_descr_multiline`);break;case 6:this.popState();break;case 7:return`acc_descr_multiline_value`;case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin(`href`);break;case 15:this.popState();break;case 16:return 43;case 17:this.begin(`callbackname`);break;case 18:this.popState();break;case 19:this.popState(),this.begin(`callbackargs`);break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin(`click`);break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return`date`;case 45:return 30;case 46:return`accDescription`;case 47:return 36;case 48:return 38;case 49:return 39;case 50:return`:`;case 51:return 6;case 52:return`INVALID`}},`anonymous`),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}}})();function O(){this.yy={}}return c(O,`Parser`),O.prototype=D,D.Parser=O,new O})();Xn.parser=Xn;var Zn=Xn;Y.default.extend(Kn.default),Y.default.extend(qn.default),Y.default.extend(Jn.default);var Qn={friday:5,saturday:6},X=``,$n=``,er=void 0,tr=``,nr=[],rr=[],ir=new Map,ar=[],or=[],sr=``,cr=``,lr=[`active`,`done`,`crit`,`milestone`,`vert`],ur=[],dr=!1,fr=!1,pr=`sunday`,mr=`saturday`,hr=0,gr=c(function(){ar=[],or=[],sr=``,ur=[],Jr=0,Qr=void 0,$r=void 0,Z=[],X=``,$n=``,cr=``,er=void 0,tr=``,nr=[],rr=[],dr=!1,fr=!1,hr=0,ir=new Map,y(),pr=`sunday`,mr=`saturday`},`clear`),_r=c(function(e){$n=e},`setAxisFormat`),vr=c(function(){return $n},`getAxisFormat`),yr=c(function(e){er=e},`setTickInterval`),br=c(function(){return er},`getTickInterval`),xr=c(function(e){tr=e},`setTodayMarker`),Sr=c(function(){return tr},`getTodayMarker`),Cr=c(function(e){X=e},`setDateFormat`),wr=c(function(){dr=!0},`enableInclusiveEndDates`),Tr=c(function(){return dr},`endDatesAreInclusive`),Er=c(function(){fr=!0},`enableTopAxis`),Dr=c(function(){return fr},`topAxisEnabled`),Or=c(function(e){cr=e},`setDisplayMode`),kr=c(function(){return cr},`getDisplayMode`),Ar=c(function(){return X},`getDateFormat`),jr=c(function(e){nr=e.toLowerCase().split(/[\s,]+/)},`setIncludes`),Mr=c(function(){return nr},`getIncludes`),Nr=c(function(e){rr=e.toLowerCase().split(/[\s,]+/)},`setExcludes`),Pr=c(function(){return rr},`getExcludes`),Fr=c(function(){return ir},`getLinks`),Ir=c(function(e){sr=e,ar.push(e)},`addSection`),Lr=c(function(){return ar},`getSections`),Rr=c(function(){let e=ri(),t=0;for(;!e&&t<10;)e=ri(),t++;return or=Z,or},`getTasks`),zr=c(function(e,t,n,r){let i=e.format(t.trim()),a=e.format(`YYYY-MM-DD`);return r.includes(i)||r.includes(a)?!1:n.includes(`weekends`)&&(e.isoWeekday()===Qn[mr]||e.isoWeekday()===Qn[mr]+1)||n.includes(e.format(`dddd`).toLowerCase())?!0:n.includes(i)||n.includes(a)},`isInvalidDate`),Br=c(function(e){pr=e},`setWeekday`),Vr=c(function(){return pr},`getWeekday`),Hr=c(function(e){mr=e},`setWeekend`),Ur=c(function(e,t,n,r){if(!n.length||e.manualEndTime)return;let i;i=e.startTime instanceof Date?(0,Y.default)(e.startTime):(0,Y.default)(e.startTime,t,!0),i=i.add(1,`d`);let a;a=e.endTime instanceof Date?(0,Y.default)(e.endTime):(0,Y.default)(e.endTime,t,!0);let[o,s]=Wr(i,a,t,n,r);e.endTime=o.toDate(),e.renderEndTime=s},`checkTaskDates`),Wr=c(function(e,t,n,r,i){let a=!1,o=null;for(;e<=t;)a||(o=t.toDate()),a=zr(e,n,r,i),a&&(t=t.add(1,`d`)),e=e.add(1,`d`);return[t,o]},`fixTaskDates`),Gr=c(function(e,t,n){if(n=n.trim(),c(e=>{let t=e.trim();return t===`x`||t===`X`},`isTimestampFormat`)(t)&&/^\d+$/.test(n))return new Date(Number(n));let r=/^after\s+(?<ids>[\d\w- ]+)/.exec(n);if(r!==null){let e=null;for(let t of r.groups.ids.split(` `)){let n=Q(t);n!==void 0&&(!e||n.endTime>e.endTime)&&(e=n)}if(e)return e.endTime;let t=new Date;return t.setHours(0,0,0,0),t}let i=(0,Y.default)(n,t.trim(),!0);if(i.isValid())return i.toDate();{s.debug(`Invalid date:`+n),s.debug(`With date format:`+t.trim());let e=new Date(n);if(e===void 0||isNaN(e.getTime())||e.getFullYear()<-1e4||e.getFullYear()>1e4)throw Error(`Invalid date:`+n);return e}},`getStartDate`),Kr=c(function(e){let t=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(e.trim());return t===null?[NaN,`ms`]:[Number.parseFloat(t[1]),t[2]]},`parseDuration`),qr=c(function(e,t,n,r=!1){n=n.trim();let i=/^until\s+(?<ids>[\d\w- ]+)/.exec(n);if(i!==null){let e=null;for(let t of i.groups.ids.split(` `)){let n=Q(t);n!==void 0&&(!e||n.startTime<e.startTime)&&(e=n)}if(e)return e.startTime;let t=new Date;return t.setHours(0,0,0,0),t}let a=(0,Y.default)(n,t.trim(),!0);if(a.isValid())return r&&(a=a.add(1,`d`)),a.toDate();let o=(0,Y.default)(e),[s,c]=Kr(n);if(!Number.isNaN(s)){let e=o.add(s,c);e.isValid()&&(o=e)}return o.toDate()},`getEndDate`),Jr=0,Yr=c(function(e){return e===void 0?(Jr+=1,`task`+Jr):e},`parseId`),Xr=c(function(e,t){let n;n=t.substr(0,1)===`:`?t.substr(1,t.length):t;let r=n.split(`,`),i={};li(r,i,lr);for(let e=0;e<r.length;e++)r[e]=r[e].trim();let a=``;switch(r.length){case 1:i.id=Yr(),i.startTime=e.endTime,a=r[0];break;case 2:i.id=Yr(),i.startTime=Gr(void 0,X,r[0]),a=r[1];break;case 3:i.id=Yr(r[0]),i.startTime=Gr(void 0,X,r[1]),a=r[2];break;default:}return a&&(i.endTime=qr(i.startTime,X,a,dr),i.manualEndTime=(0,Y.default)(a,`YYYY-MM-DD`,!0).isValid(),Ur(i,X,rr,nr)),i},`compileData`),Zr=c(function(e,t){let n;n=t.substr(0,1)===`:`?t.substr(1,t.length):t;let r=n.split(`,`),i={};li(r,i,lr);for(let e=0;e<r.length;e++)r[e]=r[e].trim();switch(r.length){case 1:i.id=Yr(),i.startTime={type:`prevTaskEnd`,id:e},i.endTime={data:r[0]};break;case 2:i.id=Yr(),i.startTime={type:`getStartDate`,startData:r[0]},i.endTime={data:r[1]};break;case 3:i.id=Yr(r[0]),i.startTime={type:`getStartDate`,startData:r[1]},i.endTime={data:r[2]};break;default:}return i},`parseData`),Qr,$r,Z=[],ei={},ti=c(function(e,t){let n={section:sr,type:sr,processed:!1,manualEndTime:!1,renderEndTime:null,raw:{data:t},task:e,classes:[]},r=Zr($r,t);n.raw.startTime=r.startTime,n.raw.endTime=r.endTime,n.id=r.id,n.prevTaskId=$r,n.active=r.active,n.done=r.done,n.crit=r.crit,n.milestone=r.milestone,n.vert=r.vert,n.order=hr,hr++;let i=Z.push(n);$r=n.id,ei[n.id]=i-1},`addTask`),Q=c(function(e){let t=ei[e];return Z[t]},`findTaskById`),ni=c(function(e,t){let n={section:sr,type:sr,description:e,task:e,classes:[]},r=Xr(Qr,t);n.startTime=r.startTime,n.endTime=r.endTime,n.id=r.id,n.active=r.active,n.done=r.done,n.crit=r.crit,n.milestone=r.milestone,n.vert=r.vert,Qr=n,or.push(n)},`addTaskOrg`),ri=c(function(){let e=c(function(e){let t=Z[e],n=``;switch(Z[e].raw.startTime.type){case`prevTaskEnd`:t.startTime=Q(t.prevTaskId).endTime;break;case`getStartDate`:n=Gr(void 0,X,Z[e].raw.startTime.startData),n&&(Z[e].startTime=n);break}return Z[e].startTime&&(Z[e].endTime=qr(Z[e].startTime,X,Z[e].raw.endTime.data,dr),Z[e].endTime&&(Z[e].processed=!0,Z[e].manualEndTime=(0,Y.default)(Z[e].raw.endTime.data,`YYYY-MM-DD`,!0).isValid(),Ur(Z[e],X,rr,nr))),Z[e].processed},`compileTask`),t=!0;for(let[n,r]of Z.entries())e(n),t&&=r.processed;return t},`compileTasks`),ii=c(function(e,t){let n=t;b().securityLevel!==`loose`&&(n=(0,Gn.sanitizeUrl)(t)),e.split(`,`).forEach(function(e){Q(e)!==void 0&&(si(e,()=>{window.open(n,`_self`)}),ir.set(e,n))}),ai(e,`clickable`)},`setLink`),ai=c(function(e,t){e.split(`,`).forEach(function(e){let n=Q(e);n!==void 0&&n.classes.push(t)})},`setClass`),oi=c(function(e,t,r){if(b().securityLevel!==`loose`||t===void 0)return;let i=[];if(typeof r==`string`){i=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e<i.length;e++){let t=i[e].trim();t.startsWith(`"`)&&t.endsWith(`"`)&&(t=t.substr(1,t.length-2)),i[e]=t}}i.length===0&&i.push(e),Q(e)!==void 0&&si(e,()=>{n.runFunc(t,...i)})},`setClickFun`),si=c(function(e,t){ur.push(function(){let n=document.querySelector(`[id="${e}"]`);n!==null&&n.addEventListener(`click`,function(){t()})},function(){let n=document.querySelector(`[id="${e}-text"]`);n!==null&&n.addEventListener(`click`,function(){t()})})},`pushFun`),ci={getConfig:c(()=>b().gantt,`getConfig`),clear:gr,setDateFormat:Cr,getDateFormat:Ar,enableInclusiveEndDates:wr,endDatesAreInclusive:Tr,enableTopAxis:Er,topAxisEnabled:Dr,setAxisFormat:_r,getAxisFormat:vr,setTickInterval:yr,getTickInterval:br,setTodayMarker:xr,getTodayMarker:Sr,setAccTitle:g,getAccTitle:C,setDiagramTitle:_,getDiagramTitle:h,setDisplayMode:Or,getDisplayMode:kr,setAccDescription:m,getAccDescription:v,addSection:Ir,getSections:Lr,getTasks:Rr,addTask:ti,findTaskById:Q,addTaskOrg:ni,setIncludes:jr,getIncludes:Mr,setExcludes:Nr,getExcludes:Pr,setClickEvent:c(function(e,t,n){e.split(`,`).forEach(function(e){oi(e,t,n)}),ai(e,`clickable`)},`setClickEvent`),setLink:ii,getLinks:Fr,bindFunctions:c(function(e){ur.forEach(function(t){t(e)})},`bindFunctions`),parseDuration:Kr,isInvalidDate:zr,setWeekday:Br,getWeekday:Vr,setWeekend:Hr};function li(e,t,n){let r=!0;for(;r;)r=!1,n.forEach(function(n){let i=`^\\s*`+n+`\\s*$`,a=new RegExp(i);e[0].match(a)&&(t[n]=!0,e.shift(1),r=!0)})}c(li,`getTaskTags`),Y.default.extend(Yn.default);var ui=c(function(){s.debug(`Something is calling, setConf, remove the call`)},`setConf`),di={monday:Xe,tuesday:Ze,wednesday:Qe,thursday:H,friday:$e,saturday:et,sunday:Ye},fi=c((e,t)=>{let n=[...e].map(()=>-1/0),r=[...e].sort((e,t)=>e.startTime-t.startTime||e.order-t.order),i=0;for(let e of r)for(let r=0;r<n.length;r++)if(e.startTime>=n[r]){n[r]=e.endTime,e.order=r+t,r>i&&(i=r);break}return i},`getMaxIntersections`),$,pi=1e4,mi={parser:Zn,db:ci,renderer:{setConf:ui,draw:c(function(e,t,n,r){let i=b().gantt,a=b().securityLevel,o;a===`sandbox`&&(o=u(`#i`+t));let l=u(a===`sandbox`?o.nodes()[0].contentDocument.body:`body`),d=a===`sandbox`?o.nodes()[0].contentDocument:document,f=d.getElementById(t);$=f.parentElement.offsetWidth,$===void 0&&($=1200),i.useWidth!==void 0&&($=i.useWidth);let p=r.db.getTasks(),m=[];for(let e of p)m.push(e.type);m=ne(m);let h={},g=2*i.topPadding;if(r.db.getDisplayMode()===`compact`||i.displayMode===`compact`){let e={};for(let t of p)e[t.section]===void 0?e[t.section]=[t]:e[t.section].push(t);let t=0;for(let n of Object.keys(e)){let r=fi(e[n],t)+1;t+=r,g+=r*(i.barHeight+i.barGap),h[n]=r}}else{g+=p.length*(i.barHeight+i.barGap);for(let e of m)h[e]=p.filter(t=>t.type===e).length}f.setAttribute(`viewBox`,`0 0 `+$+` `+g);let _=l.select(`[id="${t}"]`),v=Bn().domain([te(p,function(e){return e.startTime}),A(p,function(e){return e.endTime})]).rangeRound([0,$-i.leftPadding-i.rightPadding]);function y(e,t){let n=e.startTime,r=t.startTime,i=0;return n>r?i=1:n<r&&(i=-1),i}c(y,`taskCompare`),p.sort(y),C(p,$,g),x(_,g,$,i.useMaxWidth),_.append(`text`).text(r.db.getDiagramTitle()).attr(`x`,$/2).attr(`y`,i.titleTopMargin).attr(`class`,`titleText`);function C(e,t,n){let a=i.barHeight,o=a+i.barGap,s=i.topPadding,c=i.leftPadding,l=O().domain([0,m.length]).range([`#00B9FA`,`#F95002`]).interpolate(Ie);T(o,s,c,t,n,e,r.db.getExcludes(),r.db.getIncludes()),D(c,s,t,n),w(e,o,s,c,a,l,t,n),k(o,s,c,a,l),ee(c,s,t,n)}c(C,`makeGantt`);function w(e,n,a,o,s,c,l){e.sort((e,t)=>e.vert===t.vert?0:e.vert?1:-1);let d=[...new Set(e.map(e=>e.order))].map(t=>e.find(e=>e.order===t));_.append(`g`).selectAll(`rect`).data(d).enter().append(`rect`).attr(`x`,0).attr(`y`,function(e,t){return t=e.order,t*n+a-2}).attr(`width`,function(){return l-i.rightPadding/2}).attr(`height`,n).attr(`class`,function(e){for(let[t,n]of m.entries())if(e.type===n)return`section section`+t%i.numberSectionStyles;return`section section0`}).enter();let f=_.append(`g`).selectAll(`rect`).data(e).enter(),h=r.db.getLinks();if(f.append(`rect`).attr(`id`,function(e){return e.id}).attr(`rx`,3).attr(`ry`,3).attr(`x`,function(e){return e.milestone?v(e.startTime)+o+.5*(v(e.endTime)-v(e.startTime))-.5*s:v(e.startTime)+o}).attr(`y`,function(e,t){return t=e.order,e.vert?i.gridLineStartPadding:t*n+a}).attr(`width`,function(e){return e.milestone?s:e.vert?.08*s:v(e.renderEndTime||e.endTime)-v(e.startTime)}).attr(`height`,function(e){return e.vert?p.length*(i.barHeight+i.barGap)+i.barHeight*2:s}).attr(`transform-origin`,function(e,t){return t=e.order,(v(e.startTime)+o+.5*(v(e.endTime)-v(e.startTime))).toString()+`px `+(t*n+a+.5*s).toString()+`px`}).attr(`class`,function(e){let t=``;e.classes.length>0&&(t=e.classes.join(` `));let n=0;for(let[t,r]of m.entries())e.type===r&&(n=t%i.numberSectionStyles);let r=``;return e.active?e.crit?r+=` activeCrit`:r=` active`:e.done?r=e.crit?` doneCrit`:` done`:e.crit&&(r+=` crit`),r.length===0&&(r=` task`),e.milestone&&(r=` milestone `+r),e.vert&&(r=` vert `+r),r+=n,r+=` `+t,`task`+r}),f.append(`text`).attr(`id`,function(e){return e.id+`-text`}).text(function(e){return e.task}).attr(`font-size`,i.fontSize).attr(`x`,function(e){let t=v(e.startTime),n=v(e.renderEndTime||e.endTime);if(e.milestone&&(t+=.5*(v(e.endTime)-v(e.startTime))-.5*s,n=t+s),e.vert)return v(e.startTime)+o;let r=this.getBBox().width;return r>n-t?n+r+1.5*i.leftPadding>l?t+o-5:n+o+5:(n-t)/2+t+o}).attr(`y`,function(e,t){return e.vert?i.gridLineStartPadding+p.length*(i.barHeight+i.barGap)+60:(t=e.order,t*n+i.barHeight/2+(i.fontSize/2-2)+a)}).attr(`text-height`,s).attr(`class`,function(e){let t=v(e.startTime),n=v(e.endTime);e.milestone&&(n=t+s);let r=this.getBBox().width,a=``;e.classes.length>0&&(a=e.classes.join(` `));let o=0;for(let[t,n]of m.entries())e.type===n&&(o=t%i.numberSectionStyles);let c=``;return e.active&&(c=e.crit?`activeCritText`+o:`activeText`+o),e.done?c=e.crit?c+` doneCritText`+o:c+` doneText`+o:e.crit&&(c=c+` critText`+o),e.milestone&&(c+=` milestoneText`),e.vert&&(c+=` vertText`),r>n-t?n+r+1.5*i.leftPadding>l?a+` taskTextOutsideLeft taskTextOutside`+o+` `+c:a+` taskTextOutsideRight taskTextOutside`+o+` `+c+` width-`+r:a+` taskText taskText`+o+` `+c+` width-`+r}),b().securityLevel===`sandbox`){let e;e=u(`#i`+t);let n=e.nodes()[0].contentDocument;f.filter(function(e){return h.has(e.id)}).each(function(e){var t=n.querySelector(`#`+e.id),r=n.querySelector(`#`+e.id+`-text`);let i=t.parentNode;var a=n.createElement(`a`);a.setAttribute(`xlink:href`,h.get(e.id)),a.setAttribute(`target`,`_top`),i.appendChild(a),a.appendChild(t),a.appendChild(r)})}}c(w,`drawRects`);function T(e,t,n,a,o,c,l,u){if(l.length===0&&u.length===0)return;let d,f;for(let{startTime:e,endTime:t}of c)(d===void 0||e<d)&&(d=e),(f===void 0||t>f)&&(f=t);if(!d||!f)return;if((0,Y.default)(f).diff((0,Y.default)(d),`year`)>5){s.warn(`The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.`);return}let p=r.db.getDateFormat(),m=[],h=null,g=(0,Y.default)(d);for(;g.valueOf()<=f;)r.db.isInvalidDate(g,p,l,u)?h?h.end=g:h={start:g,end:g}:h&&=(m.push(h),null),g=g.add(1,`d`);_.append(`g`).selectAll(`rect`).data(m).enter().append(`rect`).attr(`id`,e=>`exclude-`+e.start.format(`YYYY-MM-DD`)).attr(`x`,e=>v(e.start.startOf(`day`))+n).attr(`y`,i.gridLineStartPadding).attr(`width`,e=>v(e.end.endOf(`day`))-v(e.start.startOf(`day`))).attr(`height`,o-t-i.gridLineStartPadding).attr(`transform-origin`,function(t,r){return(v(t.start)+n+.5*(v(t.end)-v(t.start))).toString()+`px `+(r*e+.5*o).toString()+`px`}).attr(`class`,`exclude-range`)}c(T,`drawExcludeDays`);function E(e,t,n,r){if(n<=0||e>t)return 1/0;let i=t-e,a=Y.default.duration({[r??`day`]:n}).asMilliseconds();return a<=0?1/0:Math.ceil(i/a)}c(E,`getEstimatedTickCount`);function D(e,t,n,a){let o=r.db.getDateFormat(),c=r.db.getAxisFormat(),l;l=c||(o===`D`?`%d`:i.axisFormat??`%Y-%m-%d`);let u=he(v).tickSize(-a+t+i.gridLineStartPadding).tickFormat(Fn(l)),d=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(d!==null){let e=parseInt(d[1],10);if(isNaN(e)||e<=0)s.warn(`Invalid tick interval value: "${d[1]}". Skipping custom tick interval.`);else{let t=d[2],n=r.db.getWeekday()||i.weekday,a=v.domain(),o=a[0],c=a[1],l=E(o,c,e,t);if(l>pi)s.warn(`The tick interval "${e}${t}" would generate ${l} ticks, which exceeds the maximum allowed (${pi}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(t){case`millisecond`:u.ticks(P.every(e));break;case`second`:u.ticks(z.every(e));break;case`minute`:u.ticks(Ue.every(e));break;case`hour`:u.ticks(Ge.every(e));break;case`day`:u.ticks(B.every(e));break;case`week`:u.ticks(di[n].every(e));break;case`month`:u.ticks(st.every(e));break}}}if(_.append(`g`).attr(`class`,`grid`).attr(`transform`,`translate(`+e+`, `+(a-50)+`)`).call(u).selectAll(`text`).style(`text-anchor`,`middle`).attr(`fill`,`#000`).attr(`stroke`,`none`).attr(`font-size`,10).attr(`dy`,`1em`),r.db.topAxisEnabled()||i.topAxis){let n=me(v).tickSize(-a+t+i.gridLineStartPadding).tickFormat(Fn(l));if(d!==null){let e=parseInt(d[1],10);if(isNaN(e)||e<=0)s.warn(`Invalid tick interval value: "${d[1]}". Skipping custom tick interval.`);else{let t=d[2],a=r.db.getWeekday()||i.weekday,o=v.domain(),s=o[0],c=o[1];if(E(s,c,e,t)<=pi)switch(t){case`millisecond`:n.ticks(P.every(e));break;case`second`:n.ticks(z.every(e));break;case`minute`:n.ticks(Ue.every(e));break;case`hour`:n.ticks(Ge.every(e));break;case`day`:n.ticks(B.every(e));break;case`week`:n.ticks(di[a].every(e));break;case`month`:n.ticks(st.every(e));break}}}_.append(`g`).attr(`class`,`grid`).attr(`transform`,`translate(`+e+`, `+t+`)`).call(n).selectAll(`text`).style(`text-anchor`,`middle`).attr(`fill`,`#000`).attr(`stroke`,`none`).attr(`font-size`,10)}}c(D,`makeGrid`);function k(e,t){let n=0,r=Object.keys(h).map(e=>[e,h[e]]);_.append(`g`).selectAll(`text`).data(r).enter().append(function(e){let t=e[0].split(S.lineBreakRegex),n=-(t.length-1)/2,r=d.createElementNS(`http://www.w3.org/2000/svg`,`text`);r.setAttribute(`dy`,n+`em`);for(let[e,n]of t.entries()){let t=d.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);t.setAttribute(`alignment-baseline`,`central`),t.setAttribute(`x`,`10`),e>0&&t.setAttribute(`dy`,`1em`),t.textContent=n,r.appendChild(t)}return r}).attr(`x`,10).attr(`y`,function(i,a){if(a>0)for(let o=0;o<a;o++)return n+=r[a-1][1],i[1]*e/2+n*e+t;else return i[1]*e/2+t}).attr(`font-size`,i.sectionFontSize).attr(`class`,function(e){for(let[t,n]of m.entries())if(e[0]===n)return`sectionTitle sectionTitle`+t%i.numberSectionStyles;return`sectionTitle`})}c(k,`vertLabels`);function ee(e,t,n,a){let o=r.db.getTodayMarker();if(o===`off`)return;let s=_.append(`g`).attr(`class`,`today`),c=new Date,l=s.append(`line`);l.attr(`x1`,v(c)+e).attr(`x2`,v(c)+e).attr(`y1`,i.titleTopMargin).attr(`y2`,a-i.titleTopMargin).attr(`class`,`today`),o!==``&&l.attr(`style`,o.replace(/,/g,`;`))}c(ee,`drawToday`);function ne(e){let t={},n=[];for(let r=0,i=e.length;r<i;++r)Object.prototype.hasOwnProperty.call(t,e[r])||(t[e[r]]=!0,n.push(e[r]));return n}c(ne,`checkUnique`)},`draw`)},styles:c(e=>`
|
|
7
|
+
.mermaid-main-font {
|
|
8
|
+
font-family: ${e.fontFamily};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.exclude-range {
|
|
12
|
+
fill: ${e.excludeBkgColor};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.section {
|
|
16
|
+
stroke: none;
|
|
17
|
+
opacity: 0.2;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.section0 {
|
|
21
|
+
fill: ${e.sectionBkgColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.section2 {
|
|
25
|
+
fill: ${e.sectionBkgColor2};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.section1,
|
|
29
|
+
.section3 {
|
|
30
|
+
fill: ${e.altSectionBkgColor};
|
|
31
|
+
opacity: 0.2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.sectionTitle0 {
|
|
35
|
+
fill: ${e.titleColor};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.sectionTitle1 {
|
|
39
|
+
fill: ${e.titleColor};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.sectionTitle2 {
|
|
43
|
+
fill: ${e.titleColor};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.sectionTitle3 {
|
|
47
|
+
fill: ${e.titleColor};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.sectionTitle {
|
|
51
|
+
text-anchor: start;
|
|
52
|
+
font-family: ${e.fontFamily};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
/* Grid and axis */
|
|
57
|
+
|
|
58
|
+
.grid .tick {
|
|
59
|
+
stroke: ${e.gridColor};
|
|
60
|
+
opacity: 0.8;
|
|
61
|
+
shape-rendering: crispEdges;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.grid .tick text {
|
|
65
|
+
font-family: ${e.fontFamily};
|
|
66
|
+
fill: ${e.textColor};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.grid path {
|
|
70
|
+
stroke-width: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
/* Today line */
|
|
75
|
+
|
|
76
|
+
.today {
|
|
77
|
+
fill: none;
|
|
78
|
+
stroke: ${e.todayLineColor};
|
|
79
|
+
stroke-width: 2px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
/* Task styling */
|
|
84
|
+
|
|
85
|
+
/* Default task */
|
|
86
|
+
|
|
87
|
+
.task {
|
|
88
|
+
stroke-width: 2;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.taskText {
|
|
92
|
+
text-anchor: middle;
|
|
93
|
+
font-family: ${e.fontFamily};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.taskTextOutsideRight {
|
|
97
|
+
fill: ${e.taskTextDarkColor};
|
|
98
|
+
text-anchor: start;
|
|
99
|
+
font-family: ${e.fontFamily};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.taskTextOutsideLeft {
|
|
103
|
+
fill: ${e.taskTextDarkColor};
|
|
104
|
+
text-anchor: end;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
/* Special case clickable */
|
|
109
|
+
|
|
110
|
+
.task.clickable {
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.taskText.clickable {
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
fill: ${e.taskTextClickableColor} !important;
|
|
117
|
+
font-weight: bold;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.taskTextOutsideLeft.clickable {
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
fill: ${e.taskTextClickableColor} !important;
|
|
123
|
+
font-weight: bold;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.taskTextOutsideRight.clickable {
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
fill: ${e.taskTextClickableColor} !important;
|
|
129
|
+
font-weight: bold;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
/* Specific task settings for the sections*/
|
|
134
|
+
|
|
135
|
+
.taskText0,
|
|
136
|
+
.taskText1,
|
|
137
|
+
.taskText2,
|
|
138
|
+
.taskText3 {
|
|
139
|
+
fill: ${e.taskTextColor};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.task0,
|
|
143
|
+
.task1,
|
|
144
|
+
.task2,
|
|
145
|
+
.task3 {
|
|
146
|
+
fill: ${e.taskBkgColor};
|
|
147
|
+
stroke: ${e.taskBorderColor};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.taskTextOutside0,
|
|
151
|
+
.taskTextOutside2
|
|
152
|
+
{
|
|
153
|
+
fill: ${e.taskTextOutsideColor};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.taskTextOutside1,
|
|
157
|
+
.taskTextOutside3 {
|
|
158
|
+
fill: ${e.taskTextOutsideColor};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
/* Active task */
|
|
163
|
+
|
|
164
|
+
.active0,
|
|
165
|
+
.active1,
|
|
166
|
+
.active2,
|
|
167
|
+
.active3 {
|
|
168
|
+
fill: ${e.activeTaskBkgColor};
|
|
169
|
+
stroke: ${e.activeTaskBorderColor};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.activeText0,
|
|
173
|
+
.activeText1,
|
|
174
|
+
.activeText2,
|
|
175
|
+
.activeText3 {
|
|
176
|
+
fill: ${e.taskTextDarkColor} !important;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
/* Completed task */
|
|
181
|
+
|
|
182
|
+
.done0,
|
|
183
|
+
.done1,
|
|
184
|
+
.done2,
|
|
185
|
+
.done3 {
|
|
186
|
+
stroke: ${e.doneTaskBorderColor};
|
|
187
|
+
fill: ${e.doneTaskBkgColor};
|
|
188
|
+
stroke-width: 2;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.doneText0,
|
|
192
|
+
.doneText1,
|
|
193
|
+
.doneText2,
|
|
194
|
+
.doneText3 {
|
|
195
|
+
fill: ${e.taskTextDarkColor} !important;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* Done task text displayed outside the bar sits against the diagram background,
|
|
199
|
+
not against the done-task bar, so it must use the outside/contrast color. */
|
|
200
|
+
.doneText0.taskTextOutsideLeft,
|
|
201
|
+
.doneText0.taskTextOutsideRight,
|
|
202
|
+
.doneText1.taskTextOutsideLeft,
|
|
203
|
+
.doneText1.taskTextOutsideRight,
|
|
204
|
+
.doneText2.taskTextOutsideLeft,
|
|
205
|
+
.doneText2.taskTextOutsideRight,
|
|
206
|
+
.doneText3.taskTextOutsideLeft,
|
|
207
|
+
.doneText3.taskTextOutsideRight {
|
|
208
|
+
fill: ${e.taskTextOutsideColor} !important;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
/* Tasks on the critical line */
|
|
213
|
+
|
|
214
|
+
.crit0,
|
|
215
|
+
.crit1,
|
|
216
|
+
.crit2,
|
|
217
|
+
.crit3 {
|
|
218
|
+
stroke: ${e.critBorderColor};
|
|
219
|
+
fill: ${e.critBkgColor};
|
|
220
|
+
stroke-width: 2;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.activeCrit0,
|
|
224
|
+
.activeCrit1,
|
|
225
|
+
.activeCrit2,
|
|
226
|
+
.activeCrit3 {
|
|
227
|
+
stroke: ${e.critBorderColor};
|
|
228
|
+
fill: ${e.activeTaskBkgColor};
|
|
229
|
+
stroke-width: 2;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.doneCrit0,
|
|
233
|
+
.doneCrit1,
|
|
234
|
+
.doneCrit2,
|
|
235
|
+
.doneCrit3 {
|
|
236
|
+
stroke: ${e.critBorderColor};
|
|
237
|
+
fill: ${e.doneTaskBkgColor};
|
|
238
|
+
stroke-width: 2;
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
shape-rendering: crispEdges;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.milestone {
|
|
244
|
+
transform: rotate(45deg) scale(0.8,0.8);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.milestoneText {
|
|
248
|
+
font-style: italic;
|
|
249
|
+
}
|
|
250
|
+
.doneCritText0,
|
|
251
|
+
.doneCritText1,
|
|
252
|
+
.doneCritText2,
|
|
253
|
+
.doneCritText3 {
|
|
254
|
+
fill: ${e.taskTextDarkColor} !important;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/* Done-crit task text outside the bar \u2014 same reasoning as doneText above. */
|
|
258
|
+
.doneCritText0.taskTextOutsideLeft,
|
|
259
|
+
.doneCritText0.taskTextOutsideRight,
|
|
260
|
+
.doneCritText1.taskTextOutsideLeft,
|
|
261
|
+
.doneCritText1.taskTextOutsideRight,
|
|
262
|
+
.doneCritText2.taskTextOutsideLeft,
|
|
263
|
+
.doneCritText2.taskTextOutsideRight,
|
|
264
|
+
.doneCritText3.taskTextOutsideLeft,
|
|
265
|
+
.doneCritText3.taskTextOutsideRight {
|
|
266
|
+
fill: ${e.taskTextOutsideColor} !important;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.vert {
|
|
270
|
+
stroke: ${e.vertLineColor};
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.vertText {
|
|
274
|
+
font-size: 15px;
|
|
275
|
+
text-anchor: middle;
|
|
276
|
+
fill: ${e.vertLineColor} !important;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.activeCritText0,
|
|
280
|
+
.activeCritText1,
|
|
281
|
+
.activeCritText2,
|
|
282
|
+
.activeCritText3 {
|
|
283
|
+
fill: ${e.taskTextDarkColor} !important;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.titleText {
|
|
287
|
+
text-anchor: middle;
|
|
288
|
+
font-size: 18px;
|
|
289
|
+
fill: ${e.titleColor||e.textColor};
|
|
290
|
+
font-family: ${e.fontFamily};
|
|
291
|
+
}
|
|
292
|
+
`,`getStyles`)};export{mi as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{t}from"./react-nm2Ru1Pt.js";import{M as n,N as r,j as i,n as a,t as o}from"./input-Brjz2Vv-.js";import{n as s,t as c}from"./jsx-runtime-BRW_vwa9.js";import{a as l,t as u}from"./tab-store-dpsCvqhH.js";import{t as d}from"./tag-CaC1ng2E.js";import{t as f}from"./utils-btZ8C8-R.js";import{i as p,t as m}from"./api-client-DpGMOZNf.js";import{D as h,M as g,N as _,V as v,Y as y,_ as b,c as x,d as S,f as C,g as w,h as T,it as E,j as D,k as O,l as k,m as A,p as j,q as M,v as N,z as P}from"./index-yMR7OUDx.js";var F=s(`cherry`,[[`path`,{d:`M2 17a5 5 0 0 0 10 0c0-2.76-2.5-5-5-3-2.5-2-5 .24-5 3Z`,key:`cvxqlc`}],[`path`,{d:`M12 17a5 5 0 0 0 10 0c0-2.76-2.5-5-5-3-2.5-2-5 .24-5 3Z`,key:`1ostrc`}],[`path`,{d:`M7 14c3.22-2.91 4.29-8.75 5-12 1.66 2.38 4.94 9 5 12`,key:`hqx58h`}],[`path`,{d:`M22 9c-4.29 0-7.14-2.33-10-7 5.71 0 10 4.67 10 7Z`,key:`eykp1o`}]]),I=s(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),L=e(t(),1),R=[`#0085d9`,`#d73a49`,`#6f42c1`,`#2cbe4e`,`#e36209`,`#005cc5`,`#b31d28`,`#5a32a3`,`#22863a`,`#cb2431`];function ee(e){let t=new Map;if(!e)return t;let n=new Set;for(let t of e.branches)if(!t.remote)for(let e of t.remotes)n.add(`remotes/${e}/${t.name}`);for(let r of e.branches)if(r.remote){if(n.has(r.name))continue;let e=t.get(r.commitHash)??[],i=r.name.replace(/^remotes\//,``);e.push({name:i,type:`branch`,remotes:[],current:!1}),t.set(r.commitHash,e)}else{let e=t.get(r.commitHash)??[];e.push({name:r.name,type:`branch`,remotes:r.remotes,current:r.current}),t.set(r.commitHash,e)}for(let n of e.commits)for(let e of n.refs)if(e.startsWith(`tag: `)){let r=e.replace(`tag: `,``),i=t.get(n.hash)??[];i.push({name:r,type:`tag`,remotes:[],current:!1}),t.set(n.hash,i)}return t}function te(e){let t=new Map;if(!e)return{laneMap:t,maxLane:0,unloadedParentLanes:new Map};let n=0,r=0,i=new Map,a=new Set(e.commits.map(e=>e.hash)),o=[],s=()=>o.length>0?(o.sort((e,t)=>e-t),o.shift()):n++;for(let n of e.commits){let e=i.get(n.hash);e===void 0&&(e=s()),t.set(n.hash,e),e>r&&(r=e),i.delete(n.hash);let a=!1;for(let t=0;t<n.parents.length;t++){let o=n.parents[t];if(!i.has(o))if(t===0)i.set(o,e),a=!0;else{let e=s();i.set(o,e),e>r&&(r=e)}}a||o.push(e)}let c=new Map;for(let[e,t]of i)a.has(e)||c.set(e,t);return{laneMap:t,maxLane:r,unloadedParentLanes:c}}function ne(e,t,n,r){if(!e)return[];let i=[],a=new Set(e.commits.map(e=>e.hash));for(let o=0;o<e.commits.length;o++){let s=e.commits[o],c=t.get(s.hash)??0,l=R[c%R.length];for(let u of s.parents){let d=e.commits.findIndex(e=>e.hash===u);if(d>=0){let e=t.get(u)??0,n=R[e%R.length],r=c*16+16/2,a=o*24+24/2,f=e*16+16/2,p=d*24+24/2,m,h=s.parents.indexOf(u)>0;if(r===f)m=`M ${r} ${a} L ${f} ${p}`;else if(h){let e=a+24;m=`M ${r} ${a} C ${r} ${e} ${f} ${a} ${f} ${e} L ${f} ${p}`}else{let e=p-24;m=`M ${r} ${a} L ${r} ${e} C ${r} ${p} ${f} ${e} ${f} ${p}`}let g=s.parents.indexOf(u)===0?l:n;i.push({d:m,color:g})}else if(!a.has(u)){let e=n.get(u)??c,t=R[e%R.length],a=c*16+16/2,s=o*24+24/2,d=e*16+16/2;if(a===d)i.push({d:`M ${a} ${s} L ${a} ${r}`,color:l});else{let e=s+24,n=`M ${a} ${s} C ${a} ${e} ${d} ${s} ${d} ${e} L ${d} ${r}`;i.push({d:n,color:t})}}}}return i}function z(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return`just now`;if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let a=Math.floor(i/24);if(a<30)return`${a}d ago`;let o=Math.floor(a/30);return o<12?`${o}mo ago`:`${Math.floor(o/12)}y ago`}var B=200;function re(e){let[t,n]=(0,L.useState)(null),[r,i]=(0,L.useState)(!0),[a,o]=(0,L.useState)(!1),[s,c]=(0,L.useState)(!0),[l,d]=(0,L.useState)(null),[f,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(null),[v,y]=(0,L.useState)([]),[b,x]=(0,L.useState)(!1),[S,C]=(0,L.useState)(`__all__`),[w,T]=(0,L.useState)(``),[E,D]=(0,L.useState)(!1),{openTab:O}=u(),k=(0,L.useRef)(0),A=(0,L.useCallback)(async()=>{if(e)try{i(!0);let t=Math.max(B,k.current),r=await m.get(`${p(e)}/git/graph?max=${t}`);n(r),k.current=r.commits.length,c(r.commits.length>=t),d(null)}catch(e){d(e instanceof Error?e.message:`Failed to fetch graph`)}finally{i(!1)}},[e]),j=(0,L.useCallback)(async()=>{if(!(!e||a||!s))try{o(!0);let t=k.current,r=await m.get(`${p(e)}/git/graph?max=${B}&skip=${t}`);if(r.commits.length===0){c(!1);return}n(e=>{if(!e)return r;let t=new Set(e.commits.map(e=>e.hash)),n=r.commits.filter(e=>!t.has(e.hash)),i=new Set(e.branches.map(e=>e.name)),a=r.branches.filter(e=>!i.has(e.name));return{commits:[...e.commits,...n],branches:[...e.branches,...a],head:e.head}}),k.current=t+r.commits.length,c(r.commits.length>=B)}catch(e){d(e instanceof Error?e.message:`Failed to load more`)}finally{o(!1)}},[e,a,s]);(0,L.useEffect)(()=>{A();let e=setInterval(A,1e4);return()=>clearInterval(e)},[A]);let M=async(t,n)=>{if(e){h(!0);try{await m.post(`${p(e)}${t}`,n),await A()}catch(e){d(e instanceof Error?e.message:`Action failed`)}finally{h(!1)}}},N=()=>M(`/git/fetch`,{}),P=e=>M(`/git/checkout`,{ref:e}),F=e=>M(`/git/cherry-pick`,{hash:e}),I=e=>M(`/git/revert`,{hash:e}),R=e=>M(`/git/merge`,{source:e}),z=e=>M(`/git/branch/delete`,{name:e}),re=e=>M(`/git/push`,{branch:e}),V=(e,t)=>M(`/git/tag`,{name:e,hash:t}),H=e=>navigator.clipboard.writeText(e),U=async(e,n)=>{if(t?.branches.some(t=>t.name===e||t.name.endsWith(`/${e}`))){if(!window.confirm(`Branch "${e}" already exists.\nDelete and recreate from this commit?`))return;await M(`/git/branch/delete`,{name:e})}await M(`/git/branch/create`,{name:e,from:n})},W=async t=>{if(e)try{let n=await m.get(`${p(e)}/git/pr-url?branch=${encodeURIComponent(t)}`);n.url&&window.open(n.url,`_blank`)}catch{}},G=async t=>{if(g?.hash===t.hash){_(null);return}_(t),x(!0);try{let n=t.parents[0]??``,r=n?`ref1=${encodeURIComponent(n)}&`:``,i=await m.get(`${p(e)}/git/diff-stat?${r}ref2=${encodeURIComponent(t.hash)}`);y(Array.isArray(i)?i:[])}catch{y([])}finally{x(!1)}},K=t=>O({type:`git-diff`,title:`Diff ${t.abbreviatedHash}`,closable:!0,metadata:{projectName:e,ref1:t.parents[0]??void 0,ref2:t.hash},projectId:e??null}),q=(0,L.useMemo)(()=>ee(t),[t]),J=t?.branches.find(e=>e.current),Y=t?.head??``,X=(0,L.useMemo)(()=>{if(!t)return[];let e=t.commits;if(S!==`__all__`){let n=t.branches.find(e=>e.name===S);if(n){let r=new Set,i=[n.commitHash];for(;i.length>0;){let e=i.pop();if(r.has(e))continue;r.add(e);let n=t.commits.find(t=>t.hash===e);n&&i.push(...n.parents)}e=e.filter(e=>r.has(e.hash))}}if(w.trim()){let t=w.toLowerCase();e=e.filter(e=>e.subject.toLowerCase().includes(t)||e.authorName.toLowerCase().includes(t)||e.abbreviatedHash.includes(t)||e.hash.includes(t))}return e},[t,S,w]),Z=(0,L.useMemo)(()=>t?{...t,commits:X}:null,[t,X]),Q=(0,L.useMemo)(()=>te(Z),[Z]),$=X.length*24+48;return{data:t,loading:r,loadingMore:a,hasMore:s,error:l,acting:f,selectedCommit:g,setSelectedCommit:_,commitFiles:v,loadingDetail:b,branchFilter:S,setBranchFilter:C,searchQuery:w,setSearchQuery:T,showSearch:E,setShowSearch:D,fetchGraph:A,fetchFromRemotes:N,loadMore:j,handleCheckout:P,handleCherryPick:F,handleRevert:I,handleMerge:R,handleDeleteBranch:z,handlePushBranch:re,handleCreateBranch:U,handleCreateTag:V,handleCreatePr:W,copyHash:H,selectCommit:G,openDiffForCommit:K,commitLabels:q,currentBranch:J,headHash:Y,filteredCommits:X,filteredLanes:Q,svgHeight:$,svgPaths:(0,L.useMemo)(()=>ne(Z,Q.laneMap,Q.unloadedParentLanes,$),[Z,Q.laneMap,Q.unloadedParentLanes,$])}}function V(e){let[t,n]=(0,L.useState)(e),r=(0,L.useRef)(e);r.current=t;let i=(0,L.useRef)(!1);return{widths:t,startResize:(e,t)=>{i.current=!0;let a=r.current[e]??80,o=r=>{if(!i.current)return;let o=`touches`in r?r.touches[0].clientX:r.clientX,s=Math.max(40,a+o-t);n(t=>({...t,[e]:s}))},s=()=>{i.current=!1,window.removeEventListener(`mousemove`,o),window.removeEventListener(`mouseup`,s),window.removeEventListener(`touchmove`,o),window.removeEventListener(`touchend`,s)};window.addEventListener(`mousemove`,o),window.addEventListener(`mouseup`,s),window.addEventListener(`touchmove`,o,{passive:!1}),window.addEventListener(`touchend`,s)}}}var H=c();function U({branches:e,branchFilter:t,onBranchFilterChange:r,searchQuery:i,onSearchQueryChange:s,showSearch:c,onToggleSearch:l,onFetch:u,onRefresh:d,onOpenSettings:f,loading:p,acting:m,projectName:v}){let y=e.filter(e=>!e.remote),[b,x]=(0,L.useState)(!1),[S,C]=(0,L.useState)(``),w=(0,L.useRef)(null);(0,L.useEffect)(()=>{if(!b)return;let e=e=>{w.current&&!w.current.contains(e.target)&&(x(!1),C(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[b]);let T=S?y.filter(e=>e.name.toLowerCase().includes(S.toLowerCase())):y,E=t===`__all__`?`Show All`:y.find(e=>e.name===t)?.name??`Show All`;return(0,H.jsx)(`div`,{className:`border-b bg-background`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground shrink-0`,children:[(0,H.jsx)(`span`,{className:`font-semibold`,children:`Repo:`}),(0,H.jsx)(`span`,{className:`font-medium text-foreground truncate max-w-[120px]`,children:v??`—`})]}),(0,H.jsx)(`div`,{className:`w-px h-4 bg-border mx-1`}),(0,H.jsxs)(`div`,{className:`relative shrink-0`,ref:w,children:[(0,H.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 h-6 px-2 text-xs border rounded-md bg-transparent hover:bg-muted/50`,onClick:()=>{x(e=>!e),C(``)},children:[(0,H.jsx)(`span`,{className:`font-semibold text-muted-foreground`,children:`Branches:`}),(0,H.jsx)(`span`,{className:`max-w-[100px] truncate`,children:E}),(0,H.jsx)(n,{className:`size-3 opacity-50`})]}),b&&(0,H.jsxs)(`div`,{className:`absolute top-full left-0 mt-1 z-50 w-[220px] rounded-md border bg-popover shadow-md`,children:[(0,H.jsx)(`div`,{className:`p-1.5`,children:(0,H.jsx)(o,{className:`h-6 text-xs px-2`,placeholder:`Filter branches...`,value:S,onChange:e=>C(e.target.value),autoFocus:!0})}),(0,H.jsxs)(`div`,{className:`max-h-[200px] overflow-y-auto p-1`,children:[(0,H.jsx)(W,{label:`Show All`,selected:t===`__all__`,onClick:()=>{r(`__all__`),x(!1)}}),T.map(e=>(0,H.jsx)(W,{label:e.name,current:e.current,selected:t===e.name,onClick:()=>{r(e.name),x(!1)}},e.name)),T.length===0&&S&&(0,H.jsx)(`div`,{className:`px-2 py-1.5 text-xs text-muted-foreground`,children:`No branches found`})]})]})]}),(0,H.jsx)(`div`,{className:`flex-1`}),c&&(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(o,{className:`h-6 text-xs w-[160px] px-2`,placeholder:`Search commits...`,value:i,onChange:e=>s(e.target.value),autoFocus:!0}),(0,H.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:l,children:(0,H.jsx)(h,{className:`size-3`})})]}),!c&&(0,H.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:l,title:`Find`,children:(0,H.jsx)(g,{className:`size-3.5`})}),(0,H.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:f,title:`Settings`,children:(0,H.jsx)(D,{className:`size-3.5`})}),(0,H.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:u,disabled:m,title:`Fetch`,children:(0,H.jsx)(M,{className:`size-3.5`})}),(0,H.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:d,disabled:m,title:`Refresh`,children:(0,H.jsx)(_,{className:`size-3.5 ${p?`animate-spin`:``}`})})]})})}function W({label:e,selected:t,current:n,onClick:i}){return(0,H.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2 w-full px-2 py-1 text-xs rounded-sm hover:bg-accent hover:text-accent-foreground text-left`,onClick:i,children:[(0,H.jsx)(r,{className:`size-3 shrink-0 ${t?`opacity-100`:`opacity-0`}`}),(0,H.jsx)(`span`,{className:`truncate flex-1`,children:e}),n&&(0,H.jsx)(`span`,{className:`text-[10px] text-muted-foreground italic`,children:`current`})]})}function G({commits:e,laneMap:t,svgPaths:n,width:r,height:i,headHash:a}){return(0,H.jsxs)(`svg`,{width:r,height:i,children:[n.map((e,t)=>(0,H.jsx)(`path`,{d:e.d,stroke:e.color,strokeWidth:2,fill:`none`},t)),e.map((e,n)=>{let r=t.get(e.hash)??0,i=r*16+16/2,o=n*24+24/2,s=R[r%R.length],c=e.hash===a;return(0,H.jsx)(`circle`,{cx:i,cy:o,r:c?5:4,fill:s,stroke:c?`#000`:`none`,strokeWidth:c?2:0},e.hash)})]})}function K({name:e,type:t,remotes:n,isCurrent:r,color:i,currentBranch:a,onCheckout:o,onMerge:s,onPush:c,onCreatePr:u,onDelete:f}){return t===`tag`?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-medium shrink-0 bg-amber-500/20 text-amber-500 border border-amber-500/30`,children:[(0,H.jsx)(d,{className:`size-2.5`}),e]}):(0,H.jsxs)(A,{children:[(0,H.jsx)(N,{asChild:!0,children:(0,H.jsxs)(`span`,{className:`inline-flex items-center rounded text-[10px] font-medium shrink-0 cursor-context-menu overflow-hidden`,style:{border:r?`1.5px solid ${i}`:`1px solid ${i}50`},children:[(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5`,style:{backgroundColor:r?i:`${i}30`,color:r?`#fff`:i},children:[(0,H.jsx)(v,{className:`size-2.5`}),e]}),n.map(e=>(0,H.jsx)(`span`,{className:`px-1.5 py-0.5 italic opacity-70`,style:{borderLeft:`1px solid ${i}40`,color:i,backgroundColor:`${i}15`},children:e},e))]})}),(0,H.jsxs)(T,{children:[(0,H.jsx)(w,{onClick:()=>o(e),children:`Checkout`}),(0,H.jsxs)(w,{onClick:()=>s(e),disabled:e===a?.name,children:[(0,H.jsx)(I,{className:`size-3`}),`Merge into current`]}),(0,H.jsx)(b,{}),(0,H.jsxs)(w,{onClick:()=>c(e),children:[(0,H.jsx)(E,{className:`size-3`}),`Push`]}),(0,H.jsxs)(w,{onClick:()=>u(e),children:[(0,H.jsx)(l,{className:`size-3`}),`Create PR`]}),(0,H.jsx)(b,{}),(0,H.jsxs)(w,{variant:`destructive`,onClick:()=>f(e),disabled:e===a?.name,children:[(0,H.jsx)(O,{className:`size-3`}),`Delete`]})]})]})}function q({commit:e,lane:t,isSelected:n,isHead:r,labels:a,currentBranch:o,onSelect:s,onCheckout:c,onCherryPick:l,onRevert:u,onMerge:f,onDeleteBranch:p,onPushBranch:m,onCreatePr:h,onOpenCreateBranch:g,onOpenCreateTag:_,onOpenDiff:x,onCopyHash:S}){let C=R[t%R.length],E=a.filter(e=>e.type===`branch`),D=a.filter(e=>e.type===`tag`);return(0,H.jsxs)(A,{children:[(0,H.jsx)(N,{asChild:!0,children:(0,H.jsxs)(`tr`,{className:`hover:bg-muted/50 cursor-pointer border-b border-border/20 ${n?`bg-primary/10`:``} ${r?`font-medium`:``}`,style:{height:`24px`},onClick:s,children:[(0,H.jsx)(`td`,{className:`px-2 truncate max-w-0`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[E.map(e=>(0,H.jsx)(K,{name:e.name,type:`branch`,remotes:e.remotes,isCurrent:e.current,color:C,currentBranch:o,onCheckout:c,onMerge:f,onPush:m,onCreatePr:h,onDelete:p},`branch-${e.name}`)),D.map(e=>(0,H.jsx)(K,{name:e.name,type:`tag`,remotes:[],isCurrent:!1,color:C,currentBranch:o,onCheckout:c,onMerge:f,onPush:m,onCreatePr:h,onDelete:p},`tag-${e.name}`)),(0,H.jsx)(`span`,{className:`truncate text-xs`,children:e.subject})]})}),(0,H.jsx)(`td`,{className:`px-2 text-xs text-muted-foreground whitespace-nowrap shrink-0`,children:z(e.authorDate)}),(0,H.jsx)(`td`,{className:`px-2 text-xs text-muted-foreground truncate max-w-[120px]`,children:e.authorName}),(0,H.jsx)(`td`,{className:`px-2 text-xs text-muted-foreground font-mono whitespace-nowrap`,children:e.abbreviatedHash})]})}),(0,H.jsxs)(T,{children:[(0,H.jsx)(w,{onClick:()=>c(e.hash),children:`Checkout`}),(0,H.jsxs)(w,{onClick:()=>g(e.hash),children:[(0,H.jsx)(v,{className:`size-3`}),`Create Branch...`]}),(0,H.jsx)(b,{}),(0,H.jsxs)(w,{onClick:()=>l(e.hash),children:[(0,H.jsx)(F,{className:`size-3`}),`Cherry Pick`]}),(0,H.jsxs)(w,{onClick:()=>u(e.hash),children:[(0,H.jsx)(i,{className:`size-3`}),`Revert`]}),(0,H.jsxs)(w,{onClick:()=>_(e.hash),children:[(0,H.jsx)(d,{className:`size-3`}),`Create Tag...`]}),(0,H.jsx)(b,{}),(0,H.jsx)(w,{onClick:x,children:`View Diff`}),(0,H.jsxs)(w,{onClick:S,children:[(0,H.jsx)(y,{className:`size-3`}),`Copy Hash`]})]})]})}function J({commit:e,files:t,loadingDetail:n,projectName:r,onClose:i,copyHash:o}){let{openTab:s}=u();return(0,H.jsxs)(`div`,{className:`border-t bg-muted/30 max-h-[40%] overflow-auto`,children:[(0,H.jsxs)(`div`,{className:`px-3 py-2 border-b flex items-center justify-between`,children:[(0,H.jsxs)(`span`,{className:`text-sm font-medium truncate`,children:[e.abbreviatedHash,` — `,e.subject]}),(0,H.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:i,children:`✕`})]}),(0,H.jsxs)(`div`,{className:`px-3 py-2 text-xs space-y-1`,children:[(0,H.jsxs)(`div`,{className:`flex gap-4`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground w-12 shrink-0`,children:`Author`}),(0,H.jsxs)(`span`,{children:[e.authorName,` <`,e.authorEmail,`>`]})]}),(0,H.jsxs)(`div`,{className:`flex gap-4`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground w-12 shrink-0`,children:`Date`}),(0,H.jsx)(`span`,{children:new Date(e.authorDate).toLocaleString()})]}),(0,H.jsxs)(`div`,{className:`flex gap-4`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground w-12 shrink-0`,children:`Hash`}),(0,H.jsx)(`span`,{className:`font-mono cursor-pointer hover:text-primary`,onClick:()=>o(e.hash),children:e.hash})]}),e.parents.length>0&&(0,H.jsxs)(`div`,{className:`flex gap-4`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground w-12 shrink-0`,children:`Parents`}),(0,H.jsx)(`span`,{className:`font-mono`,children:e.parents.map(e=>e.slice(0,7)).join(`, `)})]}),e.body&&(0,H.jsx)(`div`,{className:`mt-2 p-2 bg-background rounded text-xs whitespace-pre-wrap`,children:e.body})]}),(0,H.jsxs)(`div`,{className:`px-3 py-1 border-t`,children:[(0,H.jsx)(`div`,{className:`text-xs text-muted-foreground py-1`,children:n?`Loading files...`:`${t.length} file${t.length===1?``:`s`} changed`}),t.map(t=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2 py-0.5 text-xs hover:bg-muted/50 rounded px-1 cursor-pointer`,onClick:()=>s({type:`git-diff`,title:`Diff ${f(t.path)}`,closable:!0,metadata:{projectName:r,ref1:e.parents[0]??void 0,ref2:e.hash,filePath:t.path},projectId:r}),children:[(0,H.jsx)(`span`,{className:`flex-1 truncate font-mono`,children:t.path}),t.additions>0&&(0,H.jsxs)(`span`,{className:`text-green-500`,children:[`+`,t.additions]}),t.deletions>0&&(0,H.jsxs)(`span`,{className:`text-red-500`,children:[`-`,t.deletions]})]},t.path))]})]})}function Y({type:e,hash:t,onClose:n,onCreateBranch:r,onCreateTag:i}){let[s,c]=(0,L.useState)(``),l=()=>{s.trim()&&(e===`branch`?r(s.trim(),t):i(s.trim(),t),n())};return(0,H.jsx)(x,{open:e!==null,onOpenChange:e=>{e||n()},children:(0,H.jsxs)(k,{children:[(0,H.jsx)(C,{children:(0,H.jsx)(j,{children:e===`branch`?`Create Branch`:`Create Tag`})}),(0,H.jsx)(o,{placeholder:e===`branch`?`Branch name`:`Tag name`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&l()},autoFocus:!0}),(0,H.jsxs)(S,{children:[(0,H.jsx)(a,{variant:`outline`,onClick:n,children:`Cancel`}),(0,H.jsx)(a,{disabled:!s.trim(),onClick:l,children:`Create`})]})]})})}function X({open:e,onClose:t,projectName:n,branches:r}){let i=r.filter(e=>!e.remote),a=r.filter(e=>e.remote),o=new Map;for(let e of a){let t=e.name.replace(/^remotes\//,``),n=t.indexOf(`/`);if(n<0)continue;let r=t.slice(0,n),i=t.slice(n+1),a=o.get(r)??[];a.push(i),o.set(r,a)}return(0,H.jsx)(x,{open:e,onOpenChange:e=>{e||t()},children:(0,H.jsxs)(k,{className:`max-w-md`,children:[(0,H.jsx)(C,{children:(0,H.jsx)(j,{children:`Repository Settings`})}),(0,H.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[(0,H.jsxs)(Z,{title:`General`,children:[(0,H.jsx)(Q,{label:`Name`,value:n}),(0,H.jsx)(Q,{label:`Branches`,value:`${i.length} local, ${a.length} remote`})]}),(0,H.jsx)(Z,{title:`Local Branches`,children:i.map(e=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2 py-0.5`,children:[(0,H.jsx)(`span`,{className:`text-xs ${e.current?`font-semibold text-primary`:`text-foreground`}`,children:e.name}),e.current&&(0,H.jsx)(`span`,{className:`text-[10px] text-muted-foreground italic`,children:`HEAD`}),e.remotes.length>0&&(0,H.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[`(`,e.remotes.join(`, `),`)`]})]},e.name))}),(0,H.jsxs)(Z,{title:`Remotes`,children:[[...o.entries()].map(([e,t])=>(0,H.jsxs)(`div`,{className:`py-0.5`,children:[(0,H.jsx)(`span`,{className:`text-xs font-medium`,children:e}),(0,H.jsxs)(`span`,{className:`text-[10px] text-muted-foreground ml-2`,children:[t.length,` branch`,t.length===1?``:`es`]})]},e)),o.size===0&&(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`No remotes configured`})]})]})]})})}function Z({title:e,children:t}){return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h4`,{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-1.5`,children:e}),(0,H.jsx)(`div`,{className:`pl-1`,children:t})]})}function Q({label:e,value:t}){return(0,H.jsxs)(`div`,{className:`flex items-center gap-3 py-0.5`,children:[(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground w-16 shrink-0`,children:e}),(0,H.jsx)(`span`,{className:`text-xs`,children:t})]})}function $({metadata:e}){let t=e?.projectName,n=re(t),[r,i]=(0,L.useState)({type:null}),[a,o]=(0,L.useState)(!1),s=(typeof window<`u`&&window.innerWidth<768?6:10)*16+16,[c,l]=(0,L.useState)(s),u=(0,L.useRef)(s);u.current=c;let d=(0,L.useRef)(!1),f=e=>{d.current=!0;let t=u.current,n=n=>{if(!d.current)return;let r=`touches`in n?n.touches[0].clientX:n.clientX;l(Math.max(40,t+r-e))},r=()=>{d.current=!1,window.removeEventListener(`mousemove`,n),window.removeEventListener(`mouseup`,r),window.removeEventListener(`touchmove`,n),window.removeEventListener(`touchend`,r)};window.addEventListener(`mousemove`,n),window.addEventListener(`mouseup`,r),window.addEventListener(`touchmove`,n,{passive:!1}),window.addEventListener(`touchend`,r)},{widths:p,startResize:m}=V({date:80,author:120,commit:70}),h=(0,L.useRef)(n.loadMore);h.current=n.loadMore;let g=(0,L.useCallback)(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<200&&h.current()},[]);return t?n.loading&&!n.data?(0,H.jsx)(oe,{}):n.error&&!n.data?(0,H.jsx)(se,{error:n.error,onRetry:n.fetchGraph}):(0,H.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,H.jsx)(U,{branches:n.data?.branches??[],branchFilter:n.branchFilter,onBranchFilterChange:n.setBranchFilter,searchQuery:n.searchQuery,onSearchQueryChange:n.setSearchQuery,showSearch:n.showSearch,onToggleSearch:()=>n.setShowSearch(!n.showSearch),onFetch:n.fetchFromRemotes,onRefresh:n.fetchGraph,onOpenSettings:()=>o(!0),loading:n.loading,acting:n.acting,projectName:t}),n.error&&(0,H.jsx)(`div`,{className:`px-3 py-1.5 text-xs text-destructive bg-destructive/10`,children:n.error}),(0,H.jsx)(`div`,{className:`flex-1 overflow-auto`,onScroll:g,children:(0,H.jsxs)(`div`,{className:`flex min-w-max md:min-w-0`,children:[(0,H.jsxs)(`div`,{className:`sticky left-0 z-10 shrink-0 bg-background relative overflow-hidden`,style:{width:`${c}px`},children:[(0,H.jsx)(`div`,{className:`text-[11px] font-semibold text-muted-foreground px-2 border-b bg-background sticky top-0 z-20`,style:{height:`24px`,lineHeight:`24px`},children:`Graph`}),(0,H.jsx)(G,{commits:n.filteredCommits,laneMap:n.filteredLanes.laneMap,svgPaths:n.svgPaths,width:(n.filteredLanes.maxLane+2)*16,height:n.svgHeight,headHash:n.headHash}),(0,H.jsx)(`div`,{className:`absolute top-0 right-0 w-1.5 h-full cursor-col-resize hover:bg-primary/30`,onMouseDown:e=>{e.preventDefault(),f(e.clientX)},onTouchStart:e=>f(e.touches[0].clientX)})]}),(0,H.jsxs)(`div`,{className:`flex-1 min-w-[400px]`,children:[(0,H.jsxs)(`table`,{className:`w-full border-collapse text-xs`,style:{tableLayout:`fixed`},children:[(0,H.jsxs)(`colgroup`,{children:[(0,H.jsx)(`col`,{}),(0,H.jsx)(`col`,{style:{width:`${p.date}px`}}),(0,H.jsx)(`col`,{style:{width:`${p.author}px`}}),(0,H.jsx)(`col`,{style:{width:`${p.commit}px`}})]}),(0,H.jsx)(`thead`,{className:`sticky top-0 z-10 bg-background`,children:(0,H.jsxs)(`tr`,{className:`border-b text-[11px] font-semibold text-muted-foreground`,style:{height:`24px`},children:[(0,H.jsx)(`th`,{className:`text-left px-2 font-semibold`,children:`Description`}),(0,H.jsx)(ie,{label:`Date`,colKey:`date`,onStartResize:m}),(0,H.jsx)(ie,{label:`Author`,colKey:`author`,onStartResize:m}),(0,H.jsx)(`th`,{className:`text-left px-2 font-semibold`,children:`Commit`})]})}),(0,H.jsx)(`tbody`,{children:n.filteredCommits.map(e=>(0,H.jsx)(q,{commit:e,lane:n.filteredLanes.laneMap.get(e.hash)??0,isSelected:n.selectedCommit?.hash===e.hash,isHead:e.hash===n.headHash,labels:n.commitLabels.get(e.hash)??[],currentBranch:n.currentBranch,onSelect:()=>n.selectCommit(e),onCheckout:n.handleCheckout,onCherryPick:n.handleCherryPick,onRevert:n.handleRevert,onMerge:n.handleMerge,onDeleteBranch:n.handleDeleteBranch,onPushBranch:n.handlePushBranch,onCreatePr:n.handleCreatePr,onOpenCreateBranch:e=>i({type:`branch`,hash:e}),onOpenCreateTag:e=>i({type:`tag`,hash:e}),onOpenDiff:()=>n.openDiffForCommit(e),onCopyHash:()=>n.copyHash(e.hash)},e.hash))})]}),n.loadingMore&&(0,H.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-3 text-xs text-muted-foreground`,children:[(0,H.jsx)(P,{className:`size-3.5 animate-spin`}),` Loading more commits...`]}),!n.hasMore&&n.data&&n.data.commits.length>0&&(0,H.jsxs)(`div`,{className:`text-center py-2 text-xs text-muted-foreground`,children:[n.data.commits.length,` commits loaded`]})]})]})}),n.selectedCommit&&t&&(0,H.jsx)(J,{commit:n.selectedCommit,files:n.commitFiles,loadingDetail:n.loadingDetail,projectName:t,onClose:()=>n.setSelectedCommit(null),copyHash:n.copyHash}),(0,H.jsx)(Y,{type:r.type,hash:r.hash,onClose:()=>i({type:null}),onCreateBranch:n.handleCreateBranch,onCreateTag:n.handleCreateTag}),(0,H.jsx)(X,{open:a,onClose:()=>o(!1),projectName:t,branches:n.data?.branches??[]})]}):(0,H.jsx)(ae,{msg:`No project selected.`})}function ie({label:e,colKey:t,onStartResize:n}){return(0,H.jsxs)(`th`,{className:`text-left px-2 font-semibold relative`,children:[e,(0,H.jsx)(`div`,{className:`absolute top-0 right-0 w-1.5 h-full cursor-col-resize hover:bg-primary/30`,onMouseDown:e=>{e.preventDefault(),n(t,e.clientX)},onTouchStart:e=>n(t,e.touches[0].clientX)})]})}function ae({msg:e}){return(0,H.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm`,children:e})}function oe(){return(0,H.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-muted-foreground`,children:[(0,H.jsx)(P,{className:`size-5 animate-spin`}),(0,H.jsx)(`span`,{className:`text-sm`,children:`Loading git graph...`})]})}function se({error:e,onRetry:t}){return(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-2 text-destructive text-sm`,children:[(0,H.jsx)(`p`,{children:e}),(0,H.jsx)(a,{variant:`outline`,size:`sm`,onClick:t,children:`Retry`})]})}export{$ as GitGraph};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-XZSTWKYB-BYxFzZwS.js";import{n as e}from"./chunk-7E7YKBS2-6xAQfBwa.js";export{e as createGitGraphServices};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import"./chunk-XZSTWKYB-BYxFzZwS.js";import{h as e,p as t,r as n}from"./chunk-GEFDOKGD-DwVPiYfW.js";import"./chunk-R5LLSJPH-euR2RxLN.js";import"./chunk-7E7YKBS2-6xAQfBwa.js";import"./chunk-EGIJ26TM-D0KJTa_T.js";import"./chunk-C72U2L5F-DOtEiN5f.js";import"./chunk-XIRO2GV7-kqQ0g6wW.js";import"./chunk-L3YUKLVL-3wBgkSvL.js";import"./chunk-OZEHJAEY-YTn24bGg.js";import{g as r,h as i,p as a}from"./src-BoSBNdA_.js";import{B as o,C as s,V as c,W as l,_ as u,a as d,d as f,q as ee,s as p,v as te,y as m}from"./chunk-7R4GIKGN-DXaGAn_K.js";import"./dist-Cce3efmT.js";import{t as h}from"./chunk-4BX2VUAB-BptTlTyl.js";import{t as g}from"./mermaid-parser.core-BKiGOTjR.js";import{t as ne}from"./chunk-QZHKN3VN-DwSXwtjH.js";var _={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},re=f.gitGraph,v=i(()=>n({...re,...m().gitGraph}),`getConfig`),y=new ne(()=>{let e=v(),t=e.mainBranchName,n=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:n}]]),branches:new Map([[t,null]]),currBranch:t,direction:`LR`,seq:0,options:{}}});function b(){return t({length:7})}i(b,`getID`);function x(e,t){let n=Object.create(null);return e.reduce((e,r)=>{let i=t(r);return n[i]||(n[i]=!0,e.push(r)),e},[])}i(x,`uniqBy`);var S=i(function(e){y.records.direction=e},`setDirection`),C=i(function(e){r.debug(`options str`,e),e=e?.trim(),e||=`{}`;try{y.records.options=JSON.parse(e)}catch(e){r.error(`error while parsing gitGraph options`,e.message)}},`setOptions`),ie=i(function(){return y.records.options},`getOptions`),ae=i(function(e){let t=e.msg,n=e.id,i=e.type,a=e.tags;r.info(`commit`,t,n,i,a),r.debug(`Entering commit:`,t,n,i,a);let o=v();n=p.sanitizeText(n,o),t=p.sanitizeText(t,o),a=a?.map(e=>p.sanitizeText(e,o));let s={id:n||y.records.seq+`-`+b(),message:t,seq:y.records.seq++,type:i??_.NORMAL,tags:a??[],parents:y.records.head==null?[]:[y.records.head.id],branch:y.records.currBranch};y.records.head=s,r.info(`main branch`,o.mainBranchName),y.records.commits.has(s.id)&&r.warn(`Commit ID ${s.id} already exists`),y.records.commits.set(s.id,s),y.records.branches.set(y.records.currBranch,s.id),r.debug(`in pushCommit `+s.id)},`commit`),oe=i(function(e){let t=e.name,n=e.order;if(t=p.sanitizeText(t,v()),y.records.branches.has(t))throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${t}")`);y.records.branches.set(t,y.records.head==null?null:y.records.head.id),y.records.branchConfig.set(t,{name:t,order:n}),w(t),r.debug(`in createBranch`)},`branch`),se=i(e=>{let t=e.branch,n=e.id,i=e.type,a=e.tags,o=v();t=p.sanitizeText(t,o),n&&=p.sanitizeText(n,o);let s=y.records.branches.get(y.records.currBranch),c=y.records.branches.get(t),l=s?y.records.commits.get(s):void 0,u=c?y.records.commits.get(c):void 0;if(l&&u&&l.branch===t)throw Error(`Cannot merge branch '${t}' into itself.`);if(y.records.currBranch===t){let e=Error(`Incorrect usage of "merge". Cannot merge a branch to itself`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(l===void 0||!l){let e=Error(`Incorrect usage of "merge". Current branch (${y.records.currBranch})has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`commit`]},e}if(!y.records.branches.has(t)){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) does not exist`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},e}if(u===void 0||!u){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`"commit"`]},e}if(l===u){let e=Error(`Incorrect usage of "merge". Both branches have same head`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(n&&y.records.commits.has(n)){let e=Error(`Incorrect usage of "merge". Commit with id:`+n+` already exists, use different custom id`);throw e.hash={text:`merge ${t} ${n} ${i} ${a?.join(` `)}`,token:`merge ${t} ${n} ${i} ${a?.join(` `)}`,expected:[`merge ${t} ${n}_UNIQUE ${i} ${a?.join(` `)}`]},e}let d=c||``,f={id:n||`${y.records.seq}-${b()}`,message:`merged branch ${t} into ${y.records.currBranch}`,seq:y.records.seq++,parents:y.records.head==null?[]:[y.records.head.id,d],branch:y.records.currBranch,type:_.MERGE,customType:i,customId:!!n,tags:a??[]};y.records.head=f,y.records.commits.set(f.id,f),y.records.branches.set(y.records.currBranch,f.id),r.debug(y.records.branches),r.debug(`in mergeBranch`)},`merge`),ce=i(function(e){let t=e.id,n=e.targetId,i=e.tags,a=e.parent;r.debug(`Entering cherryPick:`,t,n,i);let o=v();if(t=p.sanitizeText(t,o),n=p.sanitizeText(n,o),i=i?.map(e=>p.sanitizeText(e,o)),a=p.sanitizeText(a,o),!t||!y.records.commits.has(t)){let e=Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let s=y.records.commits.get(t);if(s===void 0||!s)throw Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);if(a&&!(Array.isArray(s.parents)&&s.parents.includes(a)))throw Error(`Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.`);let c=s.branch;if(s.type===_.MERGE&&!a)throw Error(`Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.`);if(!n||!y.records.commits.has(n)){if(c===y.records.currBranch){let e=Error(`Incorrect usage of "cherryPick". Source commit is already on current branch`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let e=y.records.branches.get(y.records.currBranch);if(e===void 0||!e){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${y.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let o=y.records.commits.get(e);if(o===void 0||!o){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${y.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let l={id:y.records.seq+`-`+b(),message:`cherry-picked ${s?.message} into ${y.records.currBranch}`,seq:y.records.seq++,parents:y.records.head==null?[]:[y.records.head.id,s.id],branch:y.records.currBranch,type:_.CHERRY_PICK,tags:i?i.filter(Boolean):[`cherry-pick:${s.id}${s.type===_.MERGE?`|parent:${a}`:``}`]};y.records.head=l,y.records.commits.set(l.id,l),y.records.branches.set(y.records.currBranch,l.id),r.debug(y.records.branches),r.debug(`in cherryPick`)}},`cherryPick`),w=i(function(e){if(e=p.sanitizeText(e,v()),y.records.branches.has(e)){y.records.currBranch=e;let t=y.records.branches.get(y.records.currBranch);t===void 0||!t?y.records.head=null:y.records.head=y.records.commits.get(t)??null}else{let t=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw t.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},t}},`checkout`);function T(e,t,n){let r=e.indexOf(t);r===-1?e.push(n):e.splice(r,1,n)}i(T,`upsert`);function E(e){let t=e.reduce((e,t)=>e.seq>t.seq?e:t,e[0]),n=``;e.forEach(function(e){e===t?n+=` *`:n+=` |`});let i=[n,t.id,t.seq];for(let e in y.records.branches)y.records.branches.get(e)===t.id&&i.push(e);if(r.debug(i.join(` `)),t.parents&&t.parents.length==2&&t.parents[0]&&t.parents[1]){let n=y.records.commits.get(t.parents[0]);T(e,t,n),t.parents[1]&&e.push(y.records.commits.get(t.parents[1]))}else if(t.parents.length==0)return;else if(t.parents[0]){let n=y.records.commits.get(t.parents[0]);T(e,t,n)}e=x(e,e=>e.id),E(e)}i(E,`prettyPrintCommitHistory`);var le=i(function(){r.debug(y.records.commits);let e=D()[0];E([e])},`prettyPrint`),ue=i(function(){y.reset(),d()},`clear`),de=i(function(){return[...y.records.branchConfig.values()].map((e,t)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}))},`getBranchesAsObjArray`),fe=i(function(){return y.records.branches},`getBranches`),pe=i(function(){return y.records.commits},`getCommits`),D=i(function(){let e=[...y.records.commits.values()];return e.forEach(function(e){r.debug(e.id)}),e.sort((e,t)=>e.seq-t.seq),e},`getCommitsArray`),O={commitType:_,getConfig:v,setDirection:S,setOptions:C,getOptions:ie,commit:ae,branch:oe,merge:se,cherryPick:ce,checkout:w,prettyPrint:le,clear:ue,getBranchesAsObjArray:de,getBranches:fe,getCommits:pe,getCommitsArray:D,getCurrentBranch:i(function(){return y.records.currBranch},`getCurrentBranch`),getDirection:i(function(){return y.records.direction},`getDirection`),getHead:i(function(){return y.records.head},`getHead`),setAccTitle:c,getAccTitle:te,getAccDescription:u,setAccDescription:o,setDiagramTitle:l,getDiagramTitle:s},k=i((e,t)=>{h(e,t),e.dir&&t.setDirection(e.dir);for(let n of e.statements)A(n,t)},`populate`),A=i((e,t)=>{let n={Commit:i(e=>t.commit(j(e)),`Commit`),Branch:i(e=>t.branch(M(e)),`Branch`),Merge:i(e=>t.merge(N(e)),`Merge`),Checkout:i(e=>t.checkout(P(e)),`Checkout`),CherryPicking:i(e=>t.cherryPick(F(e)),`CherryPicking`)}[e.$type];n?n(e):r.error(`Unknown statement type: ${e.$type}`)},`parseStatement`),j=i(e=>({id:e.id,msg:e.message??``,type:e.type===void 0?_.NORMAL:_[e.type],tags:e.tags??void 0}),`parseCommit`),M=i(e=>({name:e.name,order:e.order??0}),`parseBranch`),N=i(e=>({branch:e.branch,id:e.id??``,type:e.type===void 0?void 0:_[e.type],tags:e.tags??void 0}),`parseMerge`),P=i(e=>e.branch,`parseCheckout`),F=i(e=>({id:e.id,targetId:``,tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),`parseCherryPicking`),I={parse:i(async e=>{let t=await g(`gitGraph`,e);r.debug(t),k(t,O)},`parse`)},L=10,R=40,z=4,B=2,V=8,H=new Map,U=new Map,W=30,G=new Map,K=[],q=0,J=`LR`,me=i(()=>{H.clear(),U.clear(),G.clear(),q=0,K=[],J=`LR`},`clear`),Y=i(e=>{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);return(typeof e==`string`?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(e=>{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);n.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`),n.setAttribute(`dy`,`1em`),n.setAttribute(`x`,`0`),n.setAttribute(`class`,`row`),n.textContent=e.trim(),t.appendChild(n)}),t},`drawText`),X=i(e=>{let t,n,r;return J===`BT`?(n=i((e,t)=>e<=t,`comparisonFunc`),r=1/0):(n=i((e,t)=>e>=t,`comparisonFunc`),r=0),e.forEach(e=>{let i=J===`TB`||J==`BT`?U.get(e)?.y:U.get(e)?.x;i!==void 0&&n(i,r)&&(t=e,r=i)}),t},`findClosestParent`),he=i(e=>{let t=``,n=1/0;return e.forEach(e=>{let r=U.get(e).y;r<=n&&(t=e,n=r)}),t||void 0},`findClosestParentBT`),ge=i((e,t,n)=>{let r=n,i=n,a=[];e.forEach(e=>{let n=t.get(e);if(!n)throw Error(`Commit not found for key ${e}`);n.parents.length?(r=ve(n),i=Math.max(r,i)):a.push(n),ye(n,r)}),r=i,a.forEach(e=>{be(e,r,n)}),e.forEach(e=>{let n=t.get(e);if(n?.parents.length){let e=he(n.parents);r=U.get(e).y-R,r<=i&&(i=r);let t=H.get(n.branch).pos,a=r-L;U.set(n.id,{x:t,y:a})}})},`setParallelBTPos`),_e=i(e=>{let t=X(e.parents.filter(e=>e!==null));if(!t)throw Error(`Closest parent not found for commit ${e.id}`);let n=U.get(t)?.y;if(n===void 0)throw Error(`Closest parent position not found for commit ${e.id}`);return n},`findClosestParentPos`),ve=i(e=>_e(e)+R,`calculateCommitPosition`),ye=i((e,t)=>{let n=H.get(e.branch);if(!n)throw Error(`Branch not found for commit ${e.id}`);let r=n.pos,i=t+L;return U.set(e.id,{x:r,y:i}),{x:r,y:i}},`setCommitPosition`),be=i((e,t,n)=>{let r=H.get(e.branch);if(!r)throw Error(`Branch not found for commit ${e.id}`);let i=t+n,a=r.pos;U.set(e.id,{x:a,y:i})},`setRootPosition`),xe=i((e,t,n,r,i,a)=>{if(a===_.HIGHLIGHT)e.append(`rect`).attr(`x`,n.x-10).attr(`y`,n.y-10).attr(`width`,20).attr(`height`,20).attr(`class`,`commit ${t.id} commit-highlight${i%V} ${r}-outer`),e.append(`rect`).attr(`x`,n.x-6).attr(`y`,n.y-6).attr(`width`,12).attr(`height`,12).attr(`class`,`commit ${t.id} commit${i%V} ${r}-inner`);else if(a===_.CHERRY_PICK)e.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,10).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x-3).attr(`cy`,n.y+2).attr(`r`,2.75).attr(`fill`,`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x+3).attr(`cy`,n.y+2).attr(`r`,2.75).attr(`fill`,`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x+3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x-3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,`#fff`).attr(`class`,`commit ${t.id} ${r}`);else{let o=e.append(`circle`);if(o.attr(`cx`,n.x),o.attr(`cy`,n.y),o.attr(`r`,t.type===_.MERGE?9:10),o.attr(`class`,`commit ${t.id} commit${i%V}`),a===_.MERGE){let a=e.append(`circle`);a.attr(`cx`,n.x),a.attr(`cy`,n.y),a.attr(`r`,6),a.attr(`class`,`commit ${r} ${t.id} commit${i%V}`)}a===_.REVERSE&&e.append(`path`).attr(`d`,`M ${n.x-5},${n.y-5}L${n.x+5},${n.y+5}M${n.x-5},${n.y+5}L${n.x+5},${n.y-5}`).attr(`class`,`commit ${r} ${t.id} commit${i%V}`)}},`drawCommitBullet`),Se=i((e,t,n,r,i)=>{if(t.type!==_.CHERRY_PICK&&(t.customId&&t.type===_.MERGE||t.type!==_.MERGE)&&i.showCommitLabel){let a=e.append(`g`),o=a.insert(`rect`).attr(`class`,`commit-label-bkg`),s=a.append(`text`).attr(`x`,r).attr(`y`,n.y+25).attr(`class`,`commit-label`).text(t.id),c=s.node()?.getBBox();if(c&&(o.attr(`x`,n.posWithOffset-c.width/2-B).attr(`y`,n.y+13.5).attr(`width`,c.width+2*B).attr(`height`,c.height+2*B),J===`TB`||J===`BT`?(o.attr(`x`,n.x-(c.width+4*z+5)).attr(`y`,n.y-12),s.attr(`x`,n.x-(c.width+4*z)).attr(`y`,n.y+c.height-12)):s.attr(`x`,n.posWithOffset-c.width/2),i.rotateCommitLabel))if(J===`TB`||J===`BT`)s.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`),o.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`);else{let e=-7.5-(c.width+10)/25*9.5,t=10+c.width/25*8.5;a.attr(`transform`,`translate(`+e+`, `+t+`) rotate(-45, `+r+`, `+n.y+`)`)}}},`drawCommitLabel`),Z=i((e,t,n,r)=>{if(t.tags.length>0){let i=0,a=0,o=0,s=[];for(let r of t.tags.reverse()){let t=e.insert(`polygon`),c=e.append(`circle`),l=e.append(`text`).attr(`y`,n.y-16-i).attr(`class`,`tag-label`).text(r),u=l.node()?.getBBox();if(!u)throw Error(`Tag bbox not found`);a=Math.max(a,u.width),o=Math.max(o,u.height),l.attr(`x`,n.posWithOffset-u.width/2),s.push({tag:l,hole:c,rect:t,yOffset:i}),i+=20}for(let{tag:e,hole:t,rect:i,yOffset:c}of s){let s=o/2,l=n.y-19.2-c;if(i.attr(`class`,`tag-label-bkg`).attr(`points`,`
|
|
2
|
+
${r-a/2-z/2},${l+B}
|
|
3
|
+
${r-a/2-z/2},${l-B}
|
|
4
|
+
${n.posWithOffset-a/2-z},${l-s-B}
|
|
5
|
+
${n.posWithOffset+a/2+z},${l-s-B}
|
|
6
|
+
${n.posWithOffset+a/2+z},${l+s+B}
|
|
7
|
+
${n.posWithOffset-a/2-z},${l+s+B}`),t.attr(`cy`,l).attr(`cx`,r-a/2+z/2).attr(`r`,1.5).attr(`class`,`tag-hole`),J===`TB`||J===`BT`){let o=r+c;i.attr(`class`,`tag-label-bkg`).attr(`points`,`
|
|
8
|
+
${n.x},${o+2}
|
|
9
|
+
${n.x},${o-2}
|
|
10
|
+
${n.x+L},${o-s-2}
|
|
11
|
+
${n.x+L+a+4},${o-s-2}
|
|
12
|
+
${n.x+L+a+4},${o+s+2}
|
|
13
|
+
${n.x+L},${o+s+2}`).attr(`transform`,`translate(12,12) rotate(45, `+n.x+`,`+r+`)`),t.attr(`cx`,n.x+z/2).attr(`cy`,o).attr(`transform`,`translate(12,12) rotate(45, `+n.x+`,`+r+`)`),e.attr(`x`,n.x+5).attr(`y`,o+3).attr(`transform`,`translate(14,14) rotate(45, `+n.x+`,`+r+`)`)}}}},`drawCommitTags`),Ce=i(e=>{switch(e.customType??e.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`),we=i((e,t,n,r)=>{let i={x:0,y:0};if(e.parents.length>0){let n=X(e.parents);if(n){let a=r.get(n)??i;return t===`TB`?a.y+R:t===`BT`?(r.get(e.id)??i).y-R:a.x+R}}else if(t===`TB`)return W;else if(t===`BT`)return(r.get(e.id)??i).y-R;else return 0;return 0},`calculatePosition`),Te=i((e,t,n)=>{let r=J===`BT`&&n?t:t+L,i=J===`TB`||J===`BT`?r:H.get(e.branch)?.pos,a=J===`TB`||J===`BT`?H.get(e.branch)?.pos:r;if(a===void 0||i===void 0)throw Error(`Position were undefined for commit ${e.id}`);return{x:a,y:i,posWithOffset:r}},`getCommitPosition`),Q=i((e,t,n,r)=>{let a=e.append(`g`).attr(`class`,`commit-bullets`),o=e.append(`g`).attr(`class`,`commit-labels`),s=J===`TB`||J===`BT`?W:0,c=[...t.keys()],l=r.parallelCommits??!1,u=i((e,n)=>{let r=t.get(e)?.seq,i=t.get(n)?.seq;return r!==void 0&&i!==void 0?r-i:0},`sortKeys`),d=c.sort(u);J===`BT`&&(l&&ge(d,t,s),d=d.reverse()),d.forEach(e=>{let i=t.get(e);if(!i)throw Error(`Commit not found for key ${e}`);l&&(s=we(i,J,s,U));let c=Te(i,s,l);if(n){let e=Ce(i),t=i.customType??i.type;xe(a,i,c,e,H.get(i.branch)?.index??0,t),Se(o,i,c,s,r),Z(o,i,c,s)}J===`TB`||J===`BT`?U.set(i.id,{x:c.x,y:c.posWithOffset}):U.set(i.id,{x:c.posWithOffset,y:c.y}),s=J===`BT`&&l?s+R:s+R+L,s>q&&(q=s)})},`drawCommits`),Ee=i((e,t,n,r,a)=>{let o=(J===`TB`||J===`BT`?n.x<r.x:n.y<r.y)?t.branch:e.branch,s=i(e=>e.branch===o,`isOnBranchToGetCurve`),c=i(n=>n.seq>e.seq&&n.seq<t.seq,`isBetweenCommits`);return[...a.values()].some(e=>c(e)&&s(e))},`shouldRerouteArrow`),$=i((e,t,n=0)=>{let r=e+Math.abs(e-t)/2;return n>5?r:K.every(e=>Math.abs(e-r)>=10)?(K.push(r),r):$(e,t-Math.abs(e-t)/5,n+1)},`findLane`),De=i((e,t,n,r)=>{let i=U.get(t.id),a=U.get(n.id);if(i===void 0||a===void 0)throw Error(`Commit positions not found for commits ${t.id} and ${n.id}`);let o=Ee(t,n,i,a,r),s=``,c=``,l=0,u=0,d=H.get(n.branch)?.index;n.type===_.MERGE&&t.id!==n.parents[0]&&(d=H.get(t.branch)?.index);let f;if(o){s=`A 10 10, 0, 0, 0,`,c=`A 10 10, 0, 0, 1,`,l=10,u=10;let e=i.y<a.y?$(i.y,a.y):$(a.y,i.y),n=i.x<a.x?$(i.x,a.x):$(a.x,i.x);J===`TB`?i.x<a.x?f=`M ${i.x} ${i.y} L ${n-l} ${i.y} ${c} ${n} ${i.y+u} L ${n} ${a.y-l} ${s} ${n+u} ${a.y} L ${a.x} ${a.y}`:(d=H.get(t.branch)?.index,f=`M ${i.x} ${i.y} L ${n+l} ${i.y} ${s} ${n} ${i.y+u} L ${n} ${a.y-l} ${c} ${n-u} ${a.y} L ${a.x} ${a.y}`):J===`BT`?i.x<a.x?f=`M ${i.x} ${i.y} L ${n-l} ${i.y} ${s} ${n} ${i.y-u} L ${n} ${a.y+l} ${c} ${n+u} ${a.y} L ${a.x} ${a.y}`:(d=H.get(t.branch)?.index,f=`M ${i.x} ${i.y} L ${n+l} ${i.y} ${c} ${n} ${i.y-u} L ${n} ${a.y+l} ${s} ${n-u} ${a.y} L ${a.x} ${a.y}`):i.y<a.y?f=`M ${i.x} ${i.y} L ${i.x} ${e-l} ${s} ${i.x+u} ${e} L ${a.x-l} ${e} ${c} ${a.x} ${e+u} L ${a.x} ${a.y}`:(d=H.get(t.branch)?.index,f=`M ${i.x} ${i.y} L ${i.x} ${e+l} ${c} ${i.x+u} ${e} L ${a.x-l} ${e} ${s} ${a.x} ${e-u} L ${a.x} ${a.y}`)}else s=`A 20 20, 0, 0, 0,`,c=`A 20 20, 0, 0, 1,`,l=20,u=20,J===`TB`?(i.x<a.x&&(f=n.type===_.MERGE&&t.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y-l} ${s} ${i.x+u} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x-l} ${i.y} ${c} ${a.x} ${i.y+u} L ${a.x} ${a.y}`),i.x>a.x&&(s=`A 20 20, 0, 0, 0,`,c=`A 20 20, 0, 0, 1,`,l=20,u=20,f=n.type===_.MERGE&&t.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y-l} ${c} ${i.x-u} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x+l} ${i.y} ${s} ${a.x} ${i.y+u} L ${a.x} ${a.y}`),i.x===a.x&&(f=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):J===`BT`?(i.x<a.x&&(f=n.type===_.MERGE&&t.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y+l} ${c} ${i.x+u} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x-l} ${i.y} ${s} ${a.x} ${i.y-u} L ${a.x} ${a.y}`),i.x>a.x&&(s=`A 20 20, 0, 0, 0,`,c=`A 20 20, 0, 0, 1,`,l=20,u=20,f=n.type===_.MERGE&&t.id!==n.parents[0]?`M ${i.x} ${i.y} L ${i.x} ${a.y+l} ${s} ${i.x-u} ${a.y} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${a.x+l} ${i.y} ${c} ${a.x} ${i.y-u} L ${a.x} ${a.y}`),i.x===a.x&&(f=`M ${i.x} ${i.y} L ${a.x} ${a.y}`)):(i.y<a.y&&(f=n.type===_.MERGE&&t.id!==n.parents[0]?`M ${i.x} ${i.y} L ${a.x-l} ${i.y} ${c} ${a.x} ${i.y+u} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${i.x} ${a.y-l} ${s} ${i.x+u} ${a.y} L ${a.x} ${a.y}`),i.y>a.y&&(f=n.type===_.MERGE&&t.id!==n.parents[0]?`M ${i.x} ${i.y} L ${a.x-l} ${i.y} ${s} ${a.x} ${i.y-u} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${i.x} ${a.y+l} ${c} ${i.x+u} ${a.y} L ${a.x} ${a.y}`),i.y===a.y&&(f=`M ${i.x} ${i.y} L ${a.x} ${a.y}`));if(f===void 0)throw Error(`Line definition not found`);e.append(`path`).attr(`d`,f).attr(`class`,`arrow arrow`+d%V)},`drawArrow`),Oe=i((e,t)=>{let n=e.append(`g`).attr(`class`,`commit-arrows`);[...t.keys()].forEach(e=>{let r=t.get(e);r.parents&&r.parents.length>0&&r.parents.forEach(e=>{De(n,t.get(e),r,t)})})},`drawArrows`),ke=i((e,t,n)=>{let r=e.append(`g`);t.forEach((e,t)=>{let i=t%V,a=H.get(e.name)?.pos;if(a===void 0)throw Error(`Position not found for branch ${e.name}`);let o=r.append(`line`);o.attr(`x1`,0),o.attr(`y1`,a),o.attr(`x2`,q),o.attr(`y2`,a),o.attr(`class`,`branch branch`+i),J===`TB`?(o.attr(`y1`,W),o.attr(`x1`,a),o.attr(`y2`,q),o.attr(`x2`,a)):J===`BT`&&(o.attr(`y1`,q),o.attr(`x1`,a),o.attr(`y2`,W),o.attr(`x2`,a)),K.push(a);let s=e.name,c=Y(s),l=r.insert(`rect`),u=r.insert(`g`).attr(`class`,`branchLabel`).insert(`g`).attr(`class`,`label branch-label`+i);u.node().appendChild(c);let d=c.getBBox();l.attr(`class`,`branchLabelBkg label`+i).attr(`rx`,4).attr(`ry`,4).attr(`x`,-d.width-4-(n.rotateCommitLabel===!0?30:0)).attr(`y`,-d.height/2+8).attr(`width`,d.width+18).attr(`height`,d.height+4),u.attr(`transform`,`translate(`+(-d.width-14-(n.rotateCommitLabel===!0?30:0))+`, `+(a-d.height/2-1)+`)`),J===`TB`?(l.attr(`x`,a-d.width/2-10).attr(`y`,0),u.attr(`transform`,`translate(`+(a-d.width/2-5)+`, 0)`)):J===`BT`?(l.attr(`x`,a-d.width/2-10).attr(`y`,q),u.attr(`transform`,`translate(`+(a-d.width/2-5)+`, `+q+`)`)):l.attr(`transform`,`translate(-19, `+(a-d.height/2)+`)`)})},`drawBranches`),Ae=i(function(e,t,n,r,i){return H.set(e,{pos:t,index:n}),t+=50+(i?40:0)+(J===`TB`||J===`BT`?r.width/2:0),t},`setBranchPosition`),je={parser:I,db:O,renderer:{draw:i(function(t,n,i,o){me(),r.debug(`in gitgraph renderer`,t+`
|
|
14
|
+
`,`id:`,n,i);let s=o.db;if(!s.getConfig){r.error(`getConfig method is not available on db`);return}let c=s.getConfig(),l=c.rotateCommitLabel??!1;G=s.getCommits();let u=s.getBranchesAsObjArray();J=s.getDirection();let d=a(`[id="${n}"]`),f=0;u.forEach((e,t)=>{let n=Y(e.name),r=d.append(`g`),i=r.insert(`g`).attr(`class`,`branchLabel`),a=i.insert(`g`).attr(`class`,`label branch-label`);a.node()?.appendChild(n);let o=n.getBBox();f=Ae(e.name,f,t,o,l),a.remove(),i.remove(),r.remove()}),Q(d,G,!1,c),c.showBranches&&ke(d,u,c),Oe(d,G),Q(d,G,!0,c),e.insertTitle(d,`gitTitleText`,c.titleTopMargin??0,s.getDiagramTitle()),ee(void 0,d,c.diagramPadding,c.useMaxWidth)},`draw`)},styles:i(e=>`
|
|
15
|
+
.commit-id,
|
|
16
|
+
.commit-msg,
|
|
17
|
+
.branch-label {
|
|
18
|
+
fill: lightgrey;
|
|
19
|
+
color: lightgrey;
|
|
20
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
21
|
+
font-family: var(--mermaid-font-family);
|
|
22
|
+
}
|
|
23
|
+
${[0,1,2,3,4,5,6,7].map(t=>`
|
|
24
|
+
.branch-label${t} { fill: ${e[`gitBranchLabel`+t]}; }
|
|
25
|
+
.commit${t} { stroke: ${e[`git`+t]}; fill: ${e[`git`+t]}; }
|
|
26
|
+
.commit-highlight${t} { stroke: ${e[`gitInv`+t]}; fill: ${e[`gitInv`+t]}; }
|
|
27
|
+
.label${t} { fill: ${e[`git`+t]}; }
|
|
28
|
+
.arrow${t} { stroke: ${e[`git`+t]}; }
|
|
29
|
+
`).join(`
|
|
30
|
+
`)}
|
|
31
|
+
|
|
32
|
+
.branch {
|
|
33
|
+
stroke-width: 1;
|
|
34
|
+
stroke: ${e.lineColor};
|
|
35
|
+
stroke-dasharray: 2;
|
|
36
|
+
}
|
|
37
|
+
.commit-label { font-size: ${e.commitLabelFontSize}; fill: ${e.commitLabelColor};}
|
|
38
|
+
.commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${e.commitLabelBackground}; opacity: 0.5; }
|
|
39
|
+
.tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
|
|
40
|
+
.tag-label-bkg { fill: ${e.tagLabelBackground}; stroke: ${e.tagLabelBorder}; }
|
|
41
|
+
.tag-hole { fill: ${e.textColor}; }
|
|
42
|
+
|
|
43
|
+
.commit-merge {
|
|
44
|
+
stroke: ${e.primaryColor};
|
|
45
|
+
fill: ${e.primaryColor};
|
|
46
|
+
}
|
|
47
|
+
.commit-reverse {
|
|
48
|
+
stroke: ${e.primaryColor};
|
|
49
|
+
fill: ${e.primaryColor};
|
|
50
|
+
stroke-width: 3;
|
|
51
|
+
}
|
|
52
|
+
.commit-highlight-outer {
|
|
53
|
+
}
|
|
54
|
+
.commit-highlight-inner {
|
|
55
|
+
stroke: ${e.primaryColor};
|
|
56
|
+
fill: ${e.primaryColor};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.arrow { stroke-width: 8; stroke-linecap: round; fill: none}
|
|
60
|
+
.gitTitleText {
|
|
61
|
+
text-anchor: middle;
|
|
62
|
+
font-size: 18px;
|
|
63
|
+
fill: ${e.textColor};
|
|
64
|
+
}
|
|
65
|
+
`,`getStyles`)};export{je as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e,P as t,R as n,t as r}from"./isArrayLikeObject-B4pdpV8V.js";import{D as i,S as a,a as o,i as s,n as c,r as l,s as u,t as d}from"./_baseUniq-ClnvscgW.js";import{t as f}from"./isEmpty-C0YYdhYj.js";var p=e(function(e){return d(a(e,1,r,!0))}),m=`\0`,h=`\0`,g=``,_=class{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,`directed`)?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,`multigraph`)?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,`compound`)?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=t(void 0),this._defaultEdgeLabelFn=t(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[h]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return n(e)||(e=t(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return i(this._nodes)}sources(){var e=this;return o(this.nodes(),function(t){return f(e._in[t])})}sinks(){var e=this;return o(this.nodes(),function(t){return f(e._out[t])})}setNodes(e,t){var n=arguments,r=this;return u(e,function(e){n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=h,this._children[e]={},this._children[h][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],u(this.children(e),e=>{this.setParent(e)}),delete this._children[e]),u(i(this._in[e]),t),delete this._in[e],delete this._preds[e],u(i(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(l(t))t=h;else{t+=``;for(var n=t;!l(n);n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==h)return t}}children(e){if(l(e)&&(e=h),this._isCompound){var t=this._children[e];if(t)return i(t)}else if(e===h)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){var t=this._preds[e];if(t)return i(t)}successors(e){var t=this._sucs[e];if(t)return i(t)}neighbors(e){var t=this.predecessors(e);if(t)return p(t,this.successors(e))}isLeaf(e){return(this.isDirected()?this.successors(e):this.neighbors(e)).length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;u(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),u(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};function i(e){var a=n.parent(e);return a===void 0||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&u(t.nodes(),function(e){t.setParent(e,i(e))}),t}setDefaultEdgeLabel(e){return n(e)||(e=t(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return s(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return c(e,function(e,i){return r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i}),this}setEdge(){var e,t,n,r,i=!1,a=arguments[0];typeof a==`object`&&a&&`v`in a?(e=a.v,t=a.w,n=a.name,arguments.length===2&&(r=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=``+e,t=``+t,l(n)||(n=``+n);var o=b(this._isDirected,e,t,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(!l(n)&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(e),this.setNode(t),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(e,t,n);var s=x(this._isDirected,e,t,n);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,v(this._preds[t],e),v(this._sucs[e],t),this._in[t][o]=s,this._out[e][o]=s,this._edgeCount++,this}edge(e,t,n){var r=arguments.length===1?S(this._isDirected,arguments[0]):b(this._isDirected,e,t,n);return this._edgeLabels[r]}hasEdge(e,t,n){var r=arguments.length===1?S(this._isDirected,arguments[0]):b(this._isDirected,e,t,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,r)}removeEdge(e,t,n){var r=arguments.length===1?S(this._isDirected,arguments[0]):b(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],y(this._preds[t],e),y(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){var n=this._in[e];if(n){var r=s(n);return t?o(r,function(e){return e.v===t}):r}}outEdges(e,t){var n=this._out[e];if(n){var r=s(n);return t?o(r,function(e){return e.w===t}):r}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}};_.prototype._nodeCount=0,_.prototype._edgeCount=0;function v(e,t){e[t]?e[t]++:e[t]=1}function y(e,t){--e[t]||delete e[t]}function b(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}return i+g+a+g+(l(r)?m:r)}function x(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return r&&(s.name=r),s}function S(e,t){return b(e,t.v,t.w,t.name)}export{_ as t};
|