Files
seagull-game/app/basepak/static/js/mermaid/chunks/mermaid.esm.min/chunk-EFRVIJHI.mjs

3 lines
8.9 KiB
JavaScript
Raw Normal View History

2025-11-23 14:59:17 -08:00
import{a as at}from"./chunk-THXVA4DE.mjs";import{D as v,F as m,I as L,a as w,j as B}from"./chunk-KXVH62NG.mjs";import{$ as K,G as R,J as F,K as O,L as _,M as k,N,O as j,P as A,Q as H,R as z,S as I,T as U,U as X,V as Y,W as J,X as V,Y as q,Z as G,_ as Z,b as d,h as D}from"./chunk-63GW7ZVL.mjs";import{T as Q,k as b}from"./chunk-A4ITRWGT.mjs";import{a,e as st}from"./chunk-GTKDMUJJ.mjs";var nt=st(at(),1);var ct="\u200B",ut={curveBasis:_,curveBasisClosed:k,curveBasisOpen:N,curveBumpX:F,curveBumpY:O,curveBundle:j,curveCardinalClosed:H,curveCardinalOpen:z,curveCardinal:A,curveCatmullRomClosed:U,curveCatmullRomOpen:X,curveCatmullRom:I,curveLinear:R,curveLinearClosed:Y,curveMonotoneX:J,curveMonotoneY:V,curveNatural:q,curveStep:G,curveStepAfter:K,curveStepBefore:Z},lt=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ft=a(function(e,t){let r=rt(e,/(?:init\b)|(?:initialize\b)/),n={};if(Array.isArray(r)){let s=r.map(u=>u.args);B(s),n=w(n,[...s])}else n=r.args;if(!n)return;let i=L(e,t),o="config";return n[o]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[o],delete n[o]),n},"detectInit"),rt=a(function(e,t=null){try{let r=new RegExp(`[%]{2}(?![{]${lt.source})(?=[}][%]{2}).*
`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),d.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let n,i=[];for(;(n=m.exec(e))!==null;)if(n.index===m.lastIndex&&m.lastIndex++,n&&!t||t&&n[1]?.match(t)||t&&n[2]?.match(t)){let o=n[1]?n[1]:n[2],s=n[3]?n[3].trim():n[4]?JSON.parse(n[4].trim()):null;i.push({type:o,args:s})}return i.length===0?{type:e,args:null}:i.length===1?i[0]:i}catch(r){return d.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),zt=a(function(e){return e.replace(m,"")},"removeDirectives"),gt=a(function(e,t){for(let[r,n]of t.entries())if(n.match(e))return r;return-1},"isSubstringInArray");function dt(e,t){if(!e)return t;let r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return ut[r]??t}a(dt,"interpolateToCurve");function ht(e,t){let r=e.trim();if(r)return t.securityLevel!=="loose"?(0,nt.sanitizeUrl)(r):r}a(ht,"formatUrl");var mt=a((e,...t)=>{let r=e.split("."),n=r.length-1,i=r[n],o=window;for(let s=0;s<n;s++)if(o=o[r[s]],!o){d.error(`Function name: ${e} not found in window`);return}o[i](...t)},"runFunc");function it(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}a(it,"distance");function pt(e){let t,r=0;e.forEach(i=>{r+=it(i,t),t=i});let n=r/2;return T(e,n)}a(pt,"traverseEdge");function xt(e){return e.length===1?e[0]:pt(e)}a(xt,"calcLabelPosition");var tt=a((e,t=2)=>{let r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),T=a((e,t)=>{let r,n=t;for(let i of e){if(r){let o=it(i,r);if(o===0)return r;if(o<n)n-=o;else{let s=n/o;if(s<=0)return r;if(s>=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:tt((1-s)*r.x+s*i.x,5),y:tt((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),yt=a((e,t,r)=>{d.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());let i=T(t,25),o=e?10:5,s=Math.atan2(t[0].y-i.y,t[0].x-i.x),u={x:0,y:0};return u.x=Math.sin(s)*o+(t[0].x+i.x)/2,u.y=-Math.cos(s)*o+(t[0].y+i.y)/2,u},"calcCardinalityPosition");function vt(e,t,r){let n=structuredClone(r);d.info("our points",n),t!=="start_left"&&t!=="start_right"&&n.reverse();let i=25+e,o=T(n,i),s=10+e*.5,u=Math.atan2(n[0].y-o.y,n[0].x-o.x),c={x:0,y:0};return t==="start_left"?(c.x=Math.sin(u+Math.PI)*s+(n[0].x+o.x)/2,c.y=-Math.cos(u+Math.PI)*s+(n[0].y+o.y)/2):t==="end_right"?(c.x=Math.sin(u-Math.PI)*s+(n[0].x+o.x)/2-5,c.y=-Math.cos(u-Math.PI)*s+(n[0].y+o.y)/2-5):t==="end_left"?(c.x=Math.sin(u)*s+(n[0].x+o.x)/2-5,c.y=-Math.cos(u)*s+(n[0].y+o.y)/2-5):(c.x=Math.sin(u)*s+(n[0].x+o.x)/2,c.y=-Math.cos(u)*s+(n[0].y+o.y)/2),c}a(vt,"calcTerminalLabelPosition");function bt(e){let t="",r="";for(let n of e)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":t=t+n+";");return{style:t,labelStyle:r}}a(bt,"getStylesFromArray");var et=0,Ct=a(()=>(et++,"id-"+Math.random().toString(36).substr(2,12)+"-"+et),"generateId");function Mt(e){let t="",r="0123456789abcdef",n=r.length;for(let i=0;i<e;i++)t+=r.charAt(Math.floor(Math.random()*n));return t}a(Mt,"makeRandomHex");var wt=a(e=>Mt(e.length),"random"),Pt=a(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Tt=a(function(e,t){let r=t.text.replace(v.lineBreakRegex," "),[,n]=$(t.fontSize),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.style("text-anchor",t.anchor),i.style("font-family",t.fontFamily),i.style("font-size",n),i.style("font-weight",t.fontWeight),i.attr("fill",t.fill),t.class!==void 0&&i.attr("class",t.class);let o=i.append("tspan");return o.attr("x",t.x+t.textMargin*2),o.attr("fill",t.fill),o.text(r),i},"drawSimpleText"),St=b((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),v.lineBreakRegex.test(e)))return e;let n=e.split(" ").filter(Boolean),i=[],o="";return n.forEach((s,u)=>{let c=M(`${s} `,r),l=M(o,r);if(c>t){let{hyphenatedStrings:h,remainingWord:f}=$t(s,t,"-",r);i.push(o,...h),o=f}else l+c>=t?(i.push(o),o=s):