You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
venv/PyCharm 2025.2.1.1/plugins/python/jupyter-web/5970.js

1 line
24 KiB

"use strict";(self.webpackChunkjupyter_web=self.webpackChunkjupyter_web||[]).push([[5970],{55970:(Ue,q,B)=>{B.r(q),B.d(q,{diagram:()=>Fe});var K=B(53420),z=B(23854),Z=B(91035),I=B(62477),n=B(3685),J=B(32928),X=B(31083),x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},V=n.vZ.gitGraph,M=(0,n.eW)(()=>(0,I.Rb)({...V,...(0,n.iE)().gitGraph}),"getConfig"),i=new Z.A(()=>{const r=M(),e=r.mainBranchName,s=r.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:s}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function _(){return(0,I.MX)({length:7})}function H(r,e){const s=Object.create(null);return r.reduce((o,t)=>{const a=e(t);return s[a]||(s[a]=!0,o.push(t)),o},[])}(0,n.eW)(_,"getID"),(0,n.eW)(H,"uniqBy");var Q=(0,n.eW)(function(r){i.records.direction=r},"setDirection"),ee=(0,n.eW)(function(r){n.cM.debug("options str",r),r=r?.trim(),r=r||"{}";try{i.records.options=JSON.parse(r)}catch(e){n.cM.error("error while parsing gitGraph options",e.message)}},"setOptions"),te=(0,n.eW)(function(){return i.records.options},"getOptions"),re=(0,n.eW)(function(r){let e=r.msg,s=r.id;const o=r.type;let t=r.tags;n.cM.info("commit",e,s,o,t),n.cM.debug("Entering commit:",e,s,o,t);const a=M();s=n.SY.sanitizeText(s,a),e=n.SY.sanitizeText(e,a),t=t?.map(c=>n.SY.sanitizeText(c,a));const h={id:s||i.records.seq+"-"+_(),message:e,seq:i.records.seq++,type:o??x.NORMAL,tags:t??[],parents:null==i.records.head?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=h,n.cM.info("main branch",a.mainBranchName),i.records.commits.set(h.id,h),i.records.branches.set(i.records.currBranch,h.id),n.cM.debug("in pushCommit "+h.id)},"commit"),ae=(0,n.eW)(function(r){let e=r.name;const s=r.order;if(e=n.SY.sanitizeText(e,M()),i.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);i.records.branches.set(e,null!=i.records.head?i.records.head.id:null),i.records.branchConfig.set(e,{name:e,order:s}),N(e),n.cM.debug("in createBranch")},"branch"),se=(0,n.eW)(r=>{let e=r.branch,s=r.id;const o=r.type,t=r.tags,a=M();e=n.SY.sanitizeText(e,a),s&&(s=n.SY.sanitizeText(s,a));const h=i.records.branches.get(i.records.currBranch),c=i.records.branches.get(e),p=h?i.records.commits.get(h):void 0,l=c?i.records.commits.get(c):void 0;if(p&&l&&p.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(i.records.currBranch===e){const d=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw d.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},d}if(void 0===p||!p){const d=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw d.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},d}if(!i.records.branches.has(e)){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw d.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},d}if(void 0===l||!l){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw d.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},d}if(p===l){const d=new Error('Incorrect usage of "merge". Both branches have same head');throw d.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},d}if(s&&i.records.commits.has(s)){const d=new Error('Incorrect usage of "merge". Commit with id:'+s+" already exists, use different custom Id");throw d.hash={text:`merge ${e} ${s} ${o} ${t?.join(" ")}`,token:`merge ${e} ${s} ${o} ${t?.join(" ")}`,expected:[`merge ${e} ${s}_UNIQUE ${o} ${t?.join(" ")}`]},d}const m=c||"",g={id:s||`${i.records.seq}-${_()}`,message:`merged branch ${e} into ${i.records.currBranch}`,seq:i.records.seq++,parents:null==i.records.head?[]:[i.records.head.id,m],branch:i.records.currBranch,type:x.MERGE,customType:o,customId:!!s,tags:t??[]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),n.cM.debug(i.records.branches),n.cM.debug("in mergeBranch")},"merge"),oe=(0,n.eW)(function(r){let e=r.id,s=r.targetId,o=r.tags,t=r.parent;n.cM.debug("Entering cherryPick:",e,s,o);const a=M();if(e=n.SY.sanitizeText(e,a),s=n.SY.sanitizeText(s,a),o=o?.map(p=>n.SY.sanitizeText(p,a)),t=n.SY.sanitizeText(t,a),!e||!i.records.commits.has(e)){const p=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw p.hash={text:`cherryPick ${e} ${s}`,token:`cherryPick ${e} ${s}`,expected:["cherry-pick abc"]},p}const h=i.records.commits.get(e);if(void 0===h||!h)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(t&&(!Array.isArray(h.parents)||!h.parents.includes(t)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const c=h.branch;if(h.type===x.MERGE&&!t)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!s||!i.records.commits.has(s)){if(c===i.records.currBranch){const g=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw g.hash={text:`cherryPick ${e} ${s}`,token:`cherryPick ${e} ${s}`,expected:["cherry-pick abc"]},g}const p=i.records.branches.get(i.records.currBranch);if(void 0===p||!p){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${e} ${s}`,token:`cherryPick ${e} ${s}`,expected:["cherry-pick abc"]},g}const l=i.records.commits.get(p);if(void 0===l||!l){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${e} ${s}`,token:`cherryPick ${e} ${s}`,expected:["cherry-pick abc"]},g}const m={id:i.records.seq+"-"+_(),message:`cherry-picked ${h?.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:null==i.records.head?[]:[i.records.head.id,h.id],branch:i.records.currBranch,type:x.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${h.id}${h.type===x.MERGE?`|parent:${t}`:""}`]};i.records.head=m,i.records.commits.set(m.id,m),i.records.branches.set(i.records.currBranch,m.id),n.cM.debug(i.records.branches),n.cM.debug("in cherryPick")}},"cherryPick"),N=(0,n.eW)(function(r){if(r=n.SY.sanitizeText(r,M()),!i.records.branches.has(r)){const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${r}")`);throw e.hash={text:`checkout ${r}`,token:`checkout ${r}`,expected:[`branch ${r}`]},e}{i.records.currBranch=r;const e=i.records.branches.get(i.records.currBranch);i.records.head=void 0!==e&&e?i.records.commits.get(e)??null:null}},"checkout");function G(r,e,s){const o=r.indexOf(e);-1===o?r.push(s):r.splice(o,1,s)}function D(r){const e=r.reduce((t,a)=>t.seq>a.seq?t:a,r[0]);let s="";r.forEach(function(t){s+=t===e?"\t*":"\t|"});const o=[s,e.id,e.seq];for(const t in i.records.branches)i.records.branches.get(t)===e.id&&o.push(t);if(n.cM.debug(o.join(" ")),e.parents&&2==e.parents.length&&e.parents[0]&&e.parents[1]){const t=i.records.commits.get(e.parents[0]);G(r,e,t),e.parents[1]&&r.push(i.records.commits.get(e.parents[1]))}else{if(0==e.parents.length)return;if(e.parents[0]){const t=i.records.commits.get(e.parents[0]);G(r,e,t)}}D(r=H(r,t=>t.id))}(0,n.eW)(G,"upsert"),(0,n.eW)(D,"prettyPrintCommitHistory");var ne=(0,n.eW)(function(){n.cM.debug(i.records.commits);D([S()[0]])},"prettyPrint"),ce=(0,n.eW)(function(){i.reset(),(0,n.ZH)()},"clear"),ie=(0,n.eW)(function(){return[...i.records.branchConfig.values()].map((e,s)=>null!==e.order&&void 0!==e.order?e:{...e,order:parseFloat(`0.${s}`)}).sort((e,s)=>(e.order??0)-(s.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),de=(0,n.eW)(function(){return i.records.branches},"getBranches"),he=(0,n.eW)(function(){return i.records.commits},"getCommits"),S=(0,n.eW)(function(){const r=[...i.records.commits.values()];return r.forEach(function(e){n.cM.debug(e.id)}),r.sort((e,s)=>e.seq-s.seq),r},"getCommitsArray"),j={commitType:x,getConfig:M,setDirection:Q,setOptions:ee,getOptions:te,commit:re,branch:ae,merge:se,cherryPick:oe,checkout:N,prettyPrint:ne,clear:ce,getBranchesAsObjArray:ie,getBranches:de,getCommits:he,getCommitsArray:S,getCurrentBranch:(0,n.eW)(function(){return i.records.currBranch},"getCurrentBranch"),getDirection:(0,n.eW)(function(){return i.records.direction},"getDirection"),getHead:(0,n.eW)(function(){return i.records.head},"getHead"),setAccTitle:n.GN,getAccTitle:n.eu,getAccDescription:n.Mx,setAccDescription:n.U$,setDiagramTitle:n.g2,getDiagramTitle:n.Kr},ge=(0,n.eW)((r,e)=>{(0,z.A)(r,e),r.dir&&e.setDirection(r.dir);for(const s of r.statements)fe(s,e)},"populate"),fe=(0,n.eW)((r,e)=>{const o={Commit:(0,n.eW)(t=>e.commit(ye(t)),"Commit"),Branch:(0,n.eW)(t=>e.branch($e(t)),"Branch"),Merge:(0,n.eW)(t=>e.merge(xe(t)),"Merge"),Checkout:(0,n.eW)(t=>e.checkout(ue(t)),"Checkout"),CherryPicking:(0,n.eW)(t=>e.cherryPick(be(t)),"CherryPicking")}[r.$type];o?o(r):n.cM.error(`Unknown statement type: ${r.$type}`)},"parseStatement"),ye=(0,n.eW)(r=>({id:r.id,msg:r.message??"",type:void 0!==r.type?x[r.type]:x.NORMAL,tags:r.tags??void 0}),"parseCommit"),$e=(0,n.eW)(r=>({name:r.name,order:r.order??0}),"parseBranch"),xe=(0,n.eW)(r=>({branch:r.branch,id:r.id??"",type:void 0!==r.type?x[r.type]:void 0,tags:r.tags??void 0}),"parseMerge"),ue=(0,n.eW)(r=>r.branch,"parseCheckout"),be=(0,n.eW)(r=>({id:r.id,targetId:"",tags:0===r.tags?.length?void 0:r.tags,parent:r.parent}),"parseCherryPicking"),we={parse:(0,n.eW)(function(){var r=(0,K.Z)(function*(e){const s=yield(0,J.Qc)("gitGraph",e);n.cM.debug(s),ge(s,j)});return function(e){return r.apply(this,arguments)}}(),"parse")},w=(0,n.nV)()?.gitGraph,E=10,T=40,u=new Map,b=new Map,P=new Map,R=[],k=0,y="LR",Be=(0,n.eW)(()=>{u.clear(),b.clear(),P.clear(),k=0,R=[],y="LR"},"clear"),Y=(0,n.eW)(r=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof r?r.split(/\\n|\n|<br\s*\/?>/gi):r).forEach(o=>{const t=document.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),t.setAttribute("dy","1em"),t.setAttribute("x","0"),t.setAttribute("class","row"),t.textContent=o.trim(),e.appendChild(t)}),e},"drawText"),F=(0,n.eW)(r=>{let e,s,o;return"BT"===y?(s=(0,n.eW)((t,a)=>t<=a,"comparisonFunc"),o=1/0):(s=(0,n.eW)((t,a)=>t>=a,"comparisonFunc"),o=0),r.forEach(t=>{const a="TB"===y||"BT"==y?b.get(t)?.y:b.get(t)?.x;void 0!==a&&s(a,o)&&(e=t,o=a)}),e},"findClosestParent"),ve=(0,n.eW)(r=>{let e="",s=1/0;return r.forEach(o=>{const t=b.get(o).y;t<=s&&(e=o,s=t)}),e||void 0},"findClosestParentBT"),Ee=(0,n.eW)((r,e,s)=>{let o=s,t=s;const a=[];r.forEach(h=>{const c=e.get(h);if(!c)throw new Error(`Commit not found for key ${h}`);c.parents.length?(o=ke(c),t=Math.max(o,t)):a.push(c),Me(c,o)}),o=t,a.forEach(h=>{Le(h,o,s)}),r.forEach(h=>{const c=e.get(h);if(c?.parents.length){const p=ve(c.parents);o=b.get(p).y-T,o<=t&&(t=o);const l=u.get(c.branch).pos,m=o-E;b.set(c.id,{x:l,y:m})}})},"setParallelBTPos"),Te=(0,n.eW)(r=>{const e=F(r.parents.filter(o=>null!==o));if(!e)throw new Error(`Closest parent not found for commit ${r.id}`);const s=b.get(e)?.y;if(void 0===s)throw new Error(`Closest parent position not found for commit ${r.id}`);return s},"findClosestParentPos"),ke=(0,n.eW)(r=>Te(r)+T,"calculateCommitPosition"),Me=(0,n.eW)((r,e)=>{const s=u.get(r.branch);if(!s)throw new Error(`Branch not found for commit ${r.id}`);const o=s.pos,t=e+E;return b.set(r.id,{x:o,y:t}),{x:o,y:t}},"setCommitPosition"),Le=(0,n.eW)((r,e,s)=>{const o=u.get(r.branch);if(!o)throw new Error(`Branch not found for commit ${r.id}`);const t=e+s,a=o.pos;b.set(r.id,{x:a,y:t})},"setRootPosition"),Pe=(0,n.eW)((r,e,s,o,t,a)=>{if(a===x.HIGHLIGHT)r.append("rect").attr("x",s.x-10).attr("y",s.y-10).attr("width",20).attr("height",20).attr("class",`commit ${e.id} commit-highlight${t%8} ${o}-outer`),r.append("rect").attr("x",s.x-6).attr("y",s.y-6).attr("width",12).attr("height",12).attr("class",`commit ${e.id} commit${t%8} ${o}-inner`);else if(a===x.CHERRY_PICK)r.append("circle").attr("cx",s.x).attr("cy",s.y).attr("r",10).attr("class",`commit ${e.id} ${o}`),r.append("circle").attr("cx",s.x-3).attr("cy",s.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${o}`),r.append("circle").attr("cx",s.x+3).attr("cy",s.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${o}`),r.append("line").attr("x1",s.x+3).attr("y1",s.y+1).attr("x2",s.x).attr("y2",s.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${o}`),r.append("line").attr("x1",s.x-3).attr("y1",s.y+1).attr("x2",s.x).attr("y2",s.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${o}`);else{const h=r.append("circle");if(h.attr("cx",s.x),h.attr("cy",s.y),h.attr("r",e.type===x.MERGE?9:10),h.attr("class",`commit ${e.id} commit${t%8}`),a===x.MERGE){const c=r.append("circle");c.attr("cx",s.x),c.attr("cy",s.y),c.attr("r",6),c.attr("class",`commit ${o} ${e.id} commit${t%8}`)}a===x.REVERSE&&r.append("path").attr("d",`M ${s.x-5},${s.y-5}L${s.x+5},${s.y+5}M${s.x-5},${s.y+5}L${s.x+5},${s.y-5}`).attr("class",`commit ${o} ${e.id} commit${t%8}`)}},"drawCommitBullet"),We=(0,n.eW)((r,e,s,o)=>{if(e.type!==x.CHERRY_PICK&&(e.customId&&e.type===x.MERGE||e.type!==x.MERGE)&&w?.showCommitLabel){const t=r.append("g"),a=t.insert("rect").attr("class","commit-label-bkg"),h=t.append("text").attr("x",o).attr("y",s.y+25).attr("class","commit-label").text(e.id),c=h.node()?.getBBox();if(c&&(a.attr("x",s.posWithOffset-c.width/2-2).attr("y",s.y+13.5).attr("width",c.width+4).attr("height",c.height+4),"TB"===y||"BT"===y?(a.attr("x",s.x-(c.width+16+5)).attr("y",s.y-12),h.attr("x",s.x-(c.width+16)).attr("y",s.y+c.height-12)):h.attr("x",s.posWithOffset-c.width/2),w.rotateCommitLabel))if("TB"===y||"BT"===y)h.attr("transform","rotate(-45, "+s.x+", "+s.y+")"),a.attr("transform","rotate(-45, "+s.x+", "+s.y+")");else{const p=-7.5-(c.width+10)/25*9.5,l=10+c.width/25*8.5;t.attr("transform","translate("+p+", "+l+") rotate(-45, "+o+", "+s.y+")")}}},"drawCommitLabel"),_e=(0,n.eW)((r,e,s,o)=>{if(e.tags.length>0){let t=0,a=0,h=0;const c=[];for(const p of e.tags.reverse()){const l=r.insert("polygon"),m=r.append("circle"),g=r.append("text").attr("y",s.y-16-t).attr("class","tag-label").text(p),d=g.node()?.getBBox();if(!d)throw new Error("Tag bbox not found");a=Math.max(a,d.width),h=Math.max(h,d.height),g.attr("x",s.posWithOffset-d.width/2),c.push({tag:g,hole:m,rect:l,yOffset:t}),t+=20}for(const{tag:p,hole:l,rect:m,yOffset:g}of c){const d=h/2,f=s.y-19.2-g;if(m.attr("class","tag-label-bkg").attr("points",`\n ${o-a/2-2},${f+2} \n ${o-a/2-2},${f-2}\n ${s.posWithOffset-a/2-4},${f-d-2}\n ${s.posWithOffset+a/2+4},${f-d-2}\n ${s.posWithOffset+a/2+4},${f+d+2}\n ${s.posWithOffset-a/2-4},${f+d+2}`),l.attr("cy",f).attr("cx",o-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===y||"BT"===y){const $=o+g;m.attr("class","tag-label-bkg").attr("points",`\n ${s.x},${$+2}\n ${s.x},${$-2}\n ${s.x+E},${$-d-2}\n ${s.x+E+a+4},${$-d-2}\n ${s.x+E+a+4},${$+d+2}\n ${s.x+E},${$+d+2}`).attr("transform","translate(12,12) rotate(45, "+s.x+","+o+")"),l.attr("cx",s.x+2).attr("cy",$).attr("transform","translate(12,12) rotate(45, "+s.x+","+o+")"),p.attr("x",s.x+5).attr("y",$+3).attr("transform","translate(14,14) rotate(45, "+s.x+","+o+")")}}}},"drawCommitTags"),Oe=(0,n.eW)(r=>{switch(r.customType??r.type){case x.NORMAL:return"commit-normal";case x.REVERSE:return"commit-reverse";case x.HIGHLIGHT:return"commit-highlight";case x.MERGE:return"commit-merge";case x.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Re=(0,n.eW)((r,e,s,o)=>{const t={x:0,y:0};if(!(r.parents.length>0))return"TB"===e?30:"BT"===e?(o.get(r.id)??t).y-T:0;{const a=F(r.parents);if(a){const h=o.get(a)??t;return"TB"===e?h.y+T:"BT"===e?(o.get(r.id)??t).y-T:h.x+T}}return 0},"calculatePosition"),Ie=(0,n.eW)((r,e,s)=>{const o="BT"===y&&s?e:e+E,t="TB"===y||"BT"===y?o:u.get(r.branch)?.pos,a="TB"===y||"BT"===y?u.get(r.branch)?.pos:o;if(void 0===a||void 0===t)throw new Error(`Position were undefined for commit ${r.id}`);return{x:a,y:t,posWithOffset:o}},"getCommitPosition"),U=(0,n.eW)((r,e,s)=>{if(!w)throw new Error("GitGraph config not found");const o=r.append("g").attr("class","commit-bullets"),t=r.append("g").attr("class","commit-labels");let a="TB"===y||"BT"===y?30:0;const h=[...e.keys()],c=w?.parallelCommits??!1,p=(0,n.eW)((m,g)=>{const d=e.get(m)?.seq,f=e.get(g)?.seq;return void 0!==d&&void 0!==f?d-f:0},"sortKeys");let l=h.sort(p);"BT"===y&&(c&&Ee(l,e,a),l=l.reverse()),l.forEach(m=>{const g=e.get(m);if(!g)throw new Error(`Commit not found for key ${m}`);c&&(a=Re(g,y,a,b));const d=Ie(g,a,c);if(s){const f=Oe(g),$=g.customType??g.type,A=u.get(g.branch)?.index??0;Pe(o,g,d,f,A,$),We(t,g,d,a),_e(t,g,d,a)}"TB"===y||"BT"===y?b.set(g.id,{x:d.x,y:d.posWithOffset}):b.set(g.id,{x:d.posWithOffset,y:d.y}),a="BT"===y&&c?a+T:a+T+E,a>k&&(k=a)})},"drawCommits"),Ge=(0,n.eW)((r,e,s,o,t)=>{const h=("TB"===y||"BT"===y?s.x<o.x:s.y<o.y)?e.branch:r.branch,c=(0,n.eW)(l=>l.branch===h,"isOnBranchToGetCurve"),p=(0,n.eW)(l=>l.seq>r.seq&&l.seq<e.seq,"isBetweenCommits");return[...t.values()].some(l=>p(l)&&c(l))},"shouldRerouteArrow"),W=(0,n.eW)((r,e,s=0)=>{const o=r+Math.abs(r-e)/2;if(s>5)return o;if(R.every(h=>Math.abs(h-o)>=10))return R.push(o),o;const a=Math.abs(r-e);return W(r,e-a/5,s+1)},"findLane"),De=(0,n.eW)((r,e,s,o)=>{const t=b.get(e.id),a=b.get(s.id);if(void 0===t||void 0===a)throw new Error(`Commit positions not found for commits ${e.id} and ${s.id}`);const h=Ge(e,s,t,a,o);let d,c="",p="",l=0,m=0,g=u.get(s.branch)?.index;if(s.type===x.MERGE&&e.id!==s.parents[0]&&(g=u.get(e.branch)?.index),h){c="A 10 10, 0, 0, 0,",p="A 10 10, 0, 0, 1,",l=10,m=10;const f=t.y<a.y?W(t.y,a.y):W(a.y,t.y),$=t.x<a.x?W(t.x,a.x):W(a.x,t.x);"TB"===y?t.x<a.x?d=`M ${t.x} ${t.y} L ${$-l} ${t.y} ${p} ${$} ${t.y+m} L ${$} ${a.y-l} ${c} ${$+m} ${a.y} L ${a.x} ${a.y}`:(g=u.get(e.branch)?.index,d=`M ${t.x} ${t.y} L ${$+l} ${t.y} ${c} ${$} ${t.y+m} L ${$} ${a.y-l} ${p} ${$-m} ${a.y} L ${a.x} ${a.y}`):"BT"===y?t.x<a.x?d=`M ${t.x} ${t.y} L ${$-l} ${t.y} ${c} ${$} ${t.y-m} L ${$} ${a.y+l} ${p} ${$+m} ${a.y} L ${a.x} ${a.y}`:(g=u.get(e.branch)?.index,d=`M ${t.x} ${t.y} L ${$+l} ${t.y} ${p} ${$} ${t.y-m} L ${$} ${a.y+l} ${c} ${$-m} ${a.y} L ${a.x} ${a.y}`):t.y<a.y?d=`M ${t.x} ${t.y} L ${t.x} ${f-l} ${c} ${t.x+m} ${f} L ${a.x-l} ${f} ${p} ${a.x} ${f+m} L ${a.x} ${a.y}`:(g=u.get(e.branch)?.index,d=`M ${t.x} ${t.y} L ${t.x} ${f+l} ${p} ${t.x+m} ${f} L ${a.x-l} ${f} ${c} ${a.x} ${f-m} L ${a.x} ${a.y}`)}else c="A 20 20, 0, 0, 0,",p="A 20 20, 0, 0, 1,",l=20,m=20,"TB"===y?(t.x<a.x&&(d=s.type===x.MERGE&&e.id!==s.parents[0]?`M ${t.x} ${t.y} L ${t.x} ${a.y-l} ${c} ${t.x+m} ${a.y} L ${a.x} ${a.y}`:`M ${t.x} ${t.y} L ${a.x-l} ${t.y} ${p} ${a.x} ${t.y+m} L ${a.x} ${a.y}`),t.x>a.x&&(c="A 20 20, 0, 0, 0,",p="A 20 20, 0, 0, 1,",l=20,m=20,d=s.type===x.MERGE&&e.id!==s.parents[0]?`M ${t.x} ${t.y} L ${t.x} ${a.y-l} ${p} ${t.x-m} ${a.y} L ${a.x} ${a.y}`:`M ${t.x} ${t.y} L ${a.x+l} ${t.y} ${c} ${a.x} ${t.y+m} L ${a.x} ${a.y}`),t.x===a.x&&(d=`M ${t.x} ${t.y} L ${a.x} ${a.y}`)):"BT"===y?(t.x<a.x&&(d=s.type===x.MERGE&&e.id!==s.parents[0]?`M ${t.x} ${t.y} L ${t.x} ${a.y+l} ${p} ${t.x+m} ${a.y} L ${a.x} ${a.y}`:`M ${t.x} ${t.y} L ${a.x-l} ${t.y} ${c} ${a.x} ${t.y-m} L ${a.x} ${a.y}`),t.x>a.x&&(c="A 20 20, 0, 0, 0,",p="A 20 20, 0, 0, 1,",l=20,m=20,d=s.type===x.MERGE&&e.id!==s.parents[0]?`M ${t.x} ${t.y} L ${t.x} ${a.y+l} ${c} ${t.x-m} ${a.y} L ${a.x} ${a.y}`:`M ${t.x} ${t.y} L ${a.x-l} ${t.y} ${c} ${a.x} ${t.y-m} L ${a.x} ${a.y}`),t.x===a.x&&(d=`M ${t.x} ${t.y} L ${a.x} ${a.y}`)):(t.y<a.y&&(d=s.type===x.MERGE&&e.id!==s.parents[0]?`M ${t.x} ${t.y} L ${a.x-l} ${t.y} ${p} ${a.x} ${t.y+m} L ${a.x} ${a.y}`:`M ${t.x} ${t.y} L ${t.x} ${a.y-l} ${c} ${t.x+m} ${a.y} L ${a.x} ${a.y}`),t.y>a.y&&(d=s.type===x.MERGE&&e.id!==s.parents[0]?`M ${t.x} ${t.y} L ${a.x-l} ${t.y} ${c} ${a.x} ${t.y-m} L ${a.x} ${a.y}`:`M ${t.x} ${t.y} L ${t.x} ${a.y+l} ${p} ${t.x+m} ${a.y} L ${a.x} ${a.y}`),t.y===a.y&&(d=`M ${t.x} ${t.y} L ${a.x} ${a.y}`));if(void 0===d)throw new Error("Line definition not found");r.append("path").attr("d",d).attr("class","arrow arrow"+g%8)},"drawArrow"),Ae=(0,n.eW)((r,e)=>{const s=r.append("g").attr("class","commit-arrows");[...e.keys()].forEach(o=>{const t=e.get(o);t.parents&&t.parents.length>0&&t.parents.forEach(a=>{De(s,e.get(a),t,e)})})},"drawArrows"),qe=(0,n.eW)((r,e)=>{const s=r.append("g");e.forEach((o,t)=>{const a=t%8,h=u.get(o.name)?.pos;if(void 0===h)throw new Error(`Position not found for branch ${o.name}`);const c=s.append("line");c.attr("x1",0),c.attr("y1",h),c.attr("x2",k),c.attr("y2",h),c.attr("class","branch branch"+a),"TB"===y?(c.attr("y1",30),c.attr("x1",h),c.attr("y2",k),c.attr("x2",h)):"BT"===y&&(c.attr("y1",k),c.attr("x1",h),c.attr("y2",30),c.attr("x2",h)),R.push(h);const p=o.name,l=Y(p),m=s.insert("rect"),d=s.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+a);d.node().appendChild(l);const f=l.getBBox();m.attr("class","branchLabelBkg label"+a).attr("rx",4).attr("ry",4).attr("x",-f.width-4-(!0===w?.rotateCommitLabel?30:0)).attr("y",-f.height/2+8).attr("width",f.width+18).attr("height",f.height+4),d.attr("transform","translate("+(-f.width-14-(!0===w?.rotateCommitLabel?30:0))+", "+(h-f.height/2-1)+")"),"TB"===y?(m.attr("x",h-f.width/2-10).attr("y",0),d.attr("transform","translate("+(h-f.width/2-5)+", 0)")):"BT"===y?(m.attr("x",h-f.width/2-10).attr("y",k),d.attr("transform","translate("+(h-f.width/2-5)+", "+k+")")):m.attr("transform","translate(-19, "+(h-f.height/2)+")")})},"drawBranches"),He=(0,n.eW)(function(r,e,s,o,t){return u.set(r,{pos:e,index:s}),e+=50+(t?40:0)+("TB"===y||"BT"===y?o.width/2:0)},"setBranchPosition"),Fe={parser:we,db:j,renderer:{draw:(0,n.eW)(function(r,e,s,o){if(Be(),n.cM.debug("in gitgraph renderer",r+"\n","id:",e,s),!w)throw new Error("GitGraph config not found");const t=w.rotateCommitLabel??!1,a=o.db;P=a.getCommits();const h=a.getBranchesAsObjArray();y=a.getDirection();const c=(0,X.Ys)(`[id="${e}"]`);let p=0;h.forEach((l,m)=>{const g=Y(l.name),d=c.append("g"),f=d.insert("g").attr("class","branchLabel"),$=f.insert("g").attr("class","label branch-label");$.node()?.appendChild(g);const A=g.getBBox();p=He(l.name,p,m,A,t),$.remove(),f.remove(),d.remove()}),U(c,P,!1),w.showBranches&&qe(c,h),Ae(c,P),U(c,P,!0),I.w8.insertTitle(c,"gitTitleText",w.titleTopMargin??0,a.getDiagramTitle()),(0,n.Rw)(void 0,c,w.diagramPadding,w.useMaxWidth)},"draw")},styles:(0,n.eW)(r=>`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n ${[0,1,2,3,4,5,6,7].map(e=>`\n .branch-label${e} { fill: ${r["gitBranchLabel"+e]}; }\n .commit${e} { stroke: ${r["git"+e]}; fill: ${r["git"+e]}; }\n .commit-highlight${e} { stroke: ${r["gitInv"+e]}; fill: ${r["gitInv"+e]}; }\n .label${e} { fill: ${r["git"+e]}; }\n .arrow${e} { stroke: ${r["git"+e]}; }\n `).join("\n")}\n\n .branch {\n stroke-width: 1;\n stroke: ${r.lineColor};\n stroke-dasharray: 2;\n }\n .commit-label { font-size: ${r.commitLabelFontSize}; fill: ${r.commitLabelColor};}\n .commit-label-bkg { font-size: ${r.commitLabelFontSize}; fill: ${r.commitLabelBackground}; opacity: 0.5; }\n .tag-label { font-size: ${r.tagLabelFontSize}; fill: ${r.tagLabelColor};}\n .tag-label-bkg { fill: ${r.tagLabelBackground}; stroke: ${r.tagLabelBorder}; }\n .tag-hole { fill: ${r.textColor}; }\n\n .commit-merge {\n stroke: ${r.primaryColor};\n fill: ${r.primaryColor};\n }\n .commit-reverse {\n stroke: ${r.primaryColor};\n fill: ${r.primaryColor};\n stroke-width: 3;\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${r.primaryColor};\n fill: ${r.primaryColor};\n }\n\n .arrow { stroke-width: 8; stroke-linecap: round; fill: none}\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${r.textColor};\n }\n`,"getStyles")}}}]);