isorite 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/main.js +1541 -59
  2. package/package.json +4 -1
  3. package/web/_app/immutable/assets/{0.DVQOzs4l.css → 0.BGpjfMlq.css} +1 -1
  4. package/web/_app/immutable/chunks/{2BcU70Iq.js → -_CDfwKC.js} +1 -1
  5. package/web/_app/immutable/chunks/{DrPF-vh8.js → -oRvYXNk.js} +1 -1
  6. package/web/_app/immutable/chunks/0qd6IUbO.js +1 -0
  7. package/web/_app/immutable/chunks/{yy6sD_us.js → 7faei0hL.js} +1 -1
  8. package/web/_app/immutable/chunks/{BNlziJ_1.js → BArcFmbE.js} +3 -3
  9. package/web/_app/immutable/chunks/{NgkOM4d0.js → BF1TezEe.js} +1 -1
  10. package/web/_app/immutable/chunks/{DK9wjWIk.js → BF3mdiSX.js} +1 -1
  11. package/web/_app/immutable/chunks/BFOLKM4z.js +1 -0
  12. package/web/_app/immutable/chunks/{BbvUCVY_.js → BezGs1Zj.js} +1 -1
  13. package/web/_app/immutable/chunks/Bg-39frG.js +1 -0
  14. package/web/_app/immutable/chunks/{CM4EA3Wo.js → BleKqNM1.js} +1 -1
  15. package/web/_app/immutable/chunks/{BjLgp18-.js → BpHE30PI.js} +1 -1
  16. package/web/_app/immutable/chunks/{Ds9L6FPB.js → BtF1frCE.js} +1 -1
  17. package/web/_app/immutable/chunks/{D_xpsaTJ.js → BuNfZSU6.js} +1 -1
  18. package/web/_app/immutable/chunks/{0KrpTYPM.js → BubCsN15.js} +1 -1
  19. package/web/_app/immutable/chunks/{_zY4mrA0.js → BvhVny3O.js} +1 -1
  20. package/web/_app/immutable/chunks/{CcRcjPTM.js → Bvs-JCN-.js} +1 -1
  21. package/web/_app/immutable/chunks/{1W6iRjg5.js → C-F98t31.js} +1 -1
  22. package/web/_app/immutable/chunks/{rv_cF9pp.js → C1OaBy7n.js} +1 -1
  23. package/web/_app/immutable/chunks/{CMN7rSZK.js → C4SqDe8e.js} +1 -1
  24. package/web/_app/immutable/chunks/{BBU5FdEo.js → C74H8jNb.js} +1 -1
  25. package/web/_app/immutable/chunks/{Cn7j5NKi.js → C7bouMY8.js} +1 -1
  26. package/web/_app/immutable/chunks/{vGOSIW7X.js → C8IrXs1w.js} +1 -1
  27. package/web/_app/immutable/chunks/{CwcA6hab.js → CGGjDDVZ.js} +1 -1
  28. package/web/_app/immutable/chunks/{CccIbhmH.js → CL9QeiGC.js} +2 -2
  29. package/web/_app/immutable/chunks/{CabmfniL.js → CMAnq3x6.js} +1 -1
  30. package/web/_app/immutable/chunks/{Bx_Vz2qr.js → CMe14KUo.js} +1 -1
  31. package/web/_app/immutable/chunks/{DQJRaTNz.js → CXc9Iibq.js} +1 -1
  32. package/web/_app/immutable/chunks/Cb-KPahQ.js +1 -0
  33. package/web/_app/immutable/chunks/{CpJ4vfn-.js → Cf13Ew0A.js} +1 -1
  34. package/web/_app/immutable/chunks/{CQhfj5-f.js → CkSjC-iE.js} +3 -3
  35. package/web/_app/immutable/chunks/{sBy91tGs.js → Cn8Mg7_E.js} +1 -1
  36. package/web/_app/immutable/chunks/{1MewxdCy.js → CoeYsgbS.js} +1 -1
  37. package/web/_app/immutable/chunks/{DJHLXLij.js → CrqOdm1D.js} +1 -1
  38. package/web/_app/immutable/chunks/{B-04K_Pl.js → CyJXJYoE.js} +1 -1
  39. package/web/_app/immutable/chunks/{CxEu-Di8.js → Cz6kYWmu.js} +1 -1
  40. package/web/_app/immutable/chunks/{ZDjPMhAb.js → CzbFy3_5.js} +1 -1
  41. package/web/_app/immutable/chunks/{yYKJ4mbq.js → D-9suc4b.js} +1 -1
  42. package/web/_app/immutable/chunks/{qfBACIi9.js → D37hxBaz.js} +1 -1
  43. package/web/_app/immutable/chunks/D7yT4F_8.js +517 -0
  44. package/web/_app/immutable/chunks/{CmFzeyfe.js → DNs5kWvM.js} +1 -1
  45. package/web/_app/immutable/chunks/DQp-M3XN.js +1 -0
  46. package/web/_app/immutable/chunks/{C2EzU0qX.js → DR5d84Z7.js} +1 -1
  47. package/web/_app/immutable/chunks/{C2QvvHIN.js → DaEL1AOW.js} +1 -1
  48. package/web/_app/immutable/chunks/{BCsFs14H.js → Dazeexma.js} +1 -1
  49. package/web/_app/immutable/chunks/{DqZ4UzUH.js → Dc2_04md.js} +1 -1
  50. package/web/_app/immutable/chunks/{DfLI-CvW.js → Dcjgv4h2.js} +1 -1
  51. package/web/_app/immutable/chunks/{CRbUrapz.js → DgI3Vj5v.js} +1 -1
  52. package/web/_app/immutable/chunks/{fpNFwizw.js → Dgko1xMH.js} +1 -1
  53. package/web/_app/immutable/chunks/{DS7XcdHs.js → DlgOmQ_G.js} +1 -1
  54. package/web/_app/immutable/chunks/{DMTkA0aK.js → DmS5Qyvl.js} +1 -1
  55. package/web/_app/immutable/chunks/{DeazQJkV.js → DqnDX3G8.js} +1 -1
  56. package/web/_app/immutable/chunks/{DMpFmiFg.js → DyZdoKBK.js} +1 -1
  57. package/web/_app/immutable/chunks/{DEwfz-Il.js → DzAOHjhV.js} +1 -1
  58. package/web/_app/immutable/chunks/{DRKiKCov.js → Iqegk1SI.js} +1 -1
  59. package/web/_app/immutable/chunks/{Cl-Xmm9N.js → ONqdwA3r.js} +1 -1
  60. package/web/_app/immutable/chunks/{Dns-yz2Q.js → Oikibjm2.js} +1 -1
  61. package/web/_app/immutable/chunks/{CdD6waB-.js → T3u7Skc8.js} +1 -1
  62. package/web/_app/immutable/chunks/{Df3spPXn.js → cWWhqL1F.js} +1 -1
  63. package/web/_app/immutable/chunks/{CfTuc06U.js → fRXyV4Ec.js} +1 -1
  64. package/web/_app/immutable/chunks/{Dzu8v7nB.js → jAC4YCqW.js} +1 -1
  65. package/web/_app/immutable/chunks/{CB6ztdCQ.js → kFEqmLql.js} +1 -1
  66. package/web/_app/immutable/chunks/{BBhr3bLI.js → y0C1JQ1v.js} +1 -1
  67. package/web/_app/immutable/chunks/{CAuYgj5q.js → yvD4_bP8.js} +1 -1
  68. package/web/_app/immutable/entry/app.CyEmP0i2.js +2 -0
  69. package/web/_app/immutable/entry/start.BxCHvKWL.js +1 -0
  70. package/web/_app/immutable/nodes/0.Bkbiw_sA.js +11 -0
  71. package/web/_app/immutable/nodes/1.kdx6h8ts.js +1 -0
  72. package/web/_app/immutable/nodes/2.CtK7BGB8.js +1 -0
  73. package/web/_app/immutable/nodes/3.D5PZa2kH.js +1 -0
  74. package/web/_app/immutable/nodes/4.DzS8oPUH.js +3 -0
  75. package/web/_app/immutable/nodes/5.B-1BDKsL.js +19 -0
  76. package/web/_app/immutable/nodes/6.DDT1DtCg.js +1 -0
  77. package/web/_app/immutable/nodes/7.CCNCaItj.js +1 -0
  78. package/web/_app/version.json +1 -1
  79. package/web/index.html +17 -17
  80. package/web/_app/immutable/chunks/BJOSVfg-.js +0 -1
  81. package/web/_app/immutable/chunks/CHjmZsHD.js +0 -1
  82. package/web/_app/immutable/chunks/DH2bqH7t.js +0 -517
  83. package/web/_app/immutable/chunks/Ddw9FbDu.js +0 -1
  84. package/web/_app/immutable/chunks/IECP4ppk.js +0 -1
  85. package/web/_app/immutable/chunks/ZDkogIhD.js +0 -1
  86. package/web/_app/immutable/entry/app.CX19wIuG.js +0 -2
  87. package/web/_app/immutable/entry/start.DaiosA4i.js +0 -1
  88. package/web/_app/immutable/nodes/0.B6_Ycc14.js +0 -3
  89. package/web/_app/immutable/nodes/1.JA1sPybf.js +0 -1
  90. package/web/_app/immutable/nodes/2.DN2phYmE.js +0 -1
  91. package/web/_app/immutable/nodes/3.CbnLNp2F.js +0 -1
  92. package/web/_app/immutable/nodes/4.CIsG7Kdu.js +0 -3
  93. package/web/_app/immutable/nodes/5.D__u9ji8.js +0 -19
  94. package/web/_app/immutable/nodes/6.DBP0fpLt.js +0 -1
  95. package/web/_app/immutable/nodes/7.DuaH9aUr.js +0 -1
@@ -1,2 +1,2 @@
1
- import{h as e}from"./BNlziJ_1.js";function t(e,t){let n=e.indexOf(`
1
+ import{h as e}from"./BArcFmbE.js";function t(e,t){let n=e.indexOf(`
2
2
  `,t);return n===-1?e.length:n}function n(e,t,n){for(let r=0;r<n.length;r++)if((e.charCodeAt(t+r)|32)!==n.charCodeAt(r))return!1;return!0}function r(n,r){let i=n.length,a=r;for(;a<i;){let r=n.charCodeAt(a);if(r===37&&n.charCodeAt(a+1)!==123)a=t(n,a);else{if(r===10)return a;if(e(r))do a++;while(a<i&&e(n.charCodeAt(a)));else if(r===35)a=t(n,a);else return a}}return a}function i(t,n){let r=n;for(;e(t.charCodeAt(r));)r++;return r}function a(e,r,a,o){let s=n(e,r,`accdescr`);if(!s&&!n(e,r,`acctitle`))return r;let c=e.length,l=i(e,r+8),u=e.charCodeAt(l),d=(t,n,r)=>{a.types.push(t),a.texts.push(e.slice(n,r)),a.starts.push(n)};if(u===58){l=i(e,l+1);let n=t(e,l);return d(s?o+2:o,r,l),d(s?o+3:o+1,l,n),n}if(!s||u!==123)return r;for(l=i(e,l+1);e.charCodeAt(l)!==125;){let t=e.indexOf(`}`,l);if(t===-1&&(t=c),d(o+4,l,t),l===c)return c;l=t}return l+1}export{a as i,r as n,t as r,n as t};
@@ -0,0 +1 @@
1
+ import{H as e,U as t,W as n,at as r,it as i,n as a,o,t as s}from"./Cz6kYWmu.js";var c=class{constructor(e,t){this.status=e,this.body=typeof t==`string`?{message:t}:t||{message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}},l=class{constructor(e,t){try{new Headers({location:t})}catch{throw Error(`Invalid redirect location ${JSON.stringify(t)}: this string contains characters that cannot be used in HTTP headers`)}this.status=e,this.location=t}},u=class extends Error{constructor(e,t,n){super(n),this.status=e,this.text=t}};new URL(`sveltekit-internal://`);function d(e,t){return e===`/`||t===`ignore`?e:t===`never`?e.endsWith(`/`)?e.slice(0,-1):e:t===`always`&&!e.endsWith(`/`)?e+`/`:e}function f(e){return e.split(`%25`).map(decodeURI).join(`%25`)}function p(e){for(let t in e)e[t]=decodeURIComponent(e[t]);return e}function m({href:e}){return e.split(`#`)[0]}function ee(e,t,n,r=!1){let i=new URL(e);Object.defineProperty(i,"searchParams",{value:new Proxy(i.searchParams,{get(e,r){if(r===`get`||r===`getAll`||r===`has`)return(t,...i)=>(n(t),e[r](t,...i));t();let i=Reflect.get(e,r);return typeof i==`function`?i.bind(e):i}}),enumerable:!0,configurable:!0});let a=[`href`,`pathname`,`search`,`toString`,`toJSON`];r&&a.push(`hash`);for(let n of a)Object.defineProperty(i,n,{get(){return t(),e[n]},enumerable:!0,configurable:!0});return i}function h(){}function g(...e){let t=5381;for(let n of e)if(typeof n==`string`){let e=n.length;for(;e;)t=t*33^n.charCodeAt(--e)}else if(ArrayBuffer.isView(n)){let e=new Uint8Array(n.buffer,n.byteOffset,n.byteLength),r=e.length;for(;r;)t=t*33^e[--r]}else throw TypeError(`value must be a string or TypedArray`);return(t>>>0).toString(36)}new TextEncoder;function _(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var te=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||`GET`)!==`GET`&&v.delete(x(e)),te(e,t));var v=new Map;function y(e,t){let n=x(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:e,...t}=JSON.parse(r.textContent);r.getAttribute(`data-b64`)!==null&&(e=_(e));let i=r.getAttribute(`data-ttl`);return i&&v.set(n,{body:e,init:t,ttl:1e3*Number(i)}),Promise.resolve(new Response(e,t))}return window.fetch(e,t)}function b(e,t,n){if(v.size>0){let t=x(e,n),r=v.get(t);if(r){if(performance.now()<r.ttl&&[`default`,`force-cache`,`only-if-cached`,void 0].includes(n?.cache))return new Response(r.body,r.init);v.delete(t)}}return window.fetch(t,n)}function x(e,t){let n=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){let e=[];t.headers&&e.push([...new Headers(t.headers)].join(`,`)),t.body&&(typeof t.body==`string`||ArrayBuffer.isView(t.body))&&e.push(t.body),n+=`[data-hash="${g(...e)}"]`}return n}var ne=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/,S=/^\/\((?:[^)]+)\)$/;function re(e){let t=[];return{pattern:e===`/`||S.test(e)?/^\/$/:RegExp(`^${ae(e).map(e=>{let n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(e);if(n)return t.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),`(?:/([^]*))?`;let r=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(e);if(r)return t.push({name:r[1],matcher:r[2],optional:!0,rest:!1,chained:!0}),`(?:/([^/]+))?`;if(!e)return;let i=e.split(/\[(.+?)\](?!\])/);return`/`+i.map((e,n)=>{if(n%2){if(e.startsWith(`x+`))return se(String.fromCharCode(parseInt(e.slice(2),16)));if(e.startsWith(`u+`))return se(String.fromCharCode(...e.slice(2).split(`-`).map(e=>parseInt(e,16))));let[,r,a,o,s]=ne.exec(e);return t.push({name:o,matcher:s,optional:!!r,rest:!!a,chained:a?n===1&&i[0]===``:!1}),a?`([^]*?)`:r?`([^/]*)?`:`([^/]+?)`}return se(e)}).join(``)}).join(``)}/?$`),params:t}}function ie(e){return e!==``&&!/^\([^)]+\)$/.test(e)}function ae(e){return e.slice(1).split(`/`).filter(ie)}function oe(e,t,n){let r={},i=e.slice(1),a=i.filter(e=>e!==void 0),o=0;for(let e=0;e<t.length;e+=1){let s=t[e],c=i[e-o];if(s.chained&&s.rest&&o&&(c=i.slice(e-o,e+1).filter(e=>e).join(`/`),o=0),c===void 0){if(s.rest)c=``;else continue}if(!s.matcher||n[s.matcher](c)){r[s.name]=c;let n=t[e+1],l=i[e+1];n&&!n.rest&&n.optional&&l&&s.chained&&(o=0),!n&&!l&&Object.keys(r).length===a.length&&(o=0)}else if(s.optional&&s.chained)o++;else return}if(!o)return r}function se(e){return e.normalize().replace(/[[\]]/g,`\\$&`).replace(/%/g,`%25`).replace(/\//g,`%2[Ff]`).replace(/\?/g,`%3[Ff]`).replace(/#/g,`%23`).replace(/[.*+?^${}()|\\]/g,`\\$&`)}var ce=/\[(\[)?(\.\.\.)?(\w+?)(?:=(\w+))?\]\]?/g;function le(e,t){let n=ae(e),r=e!=`/`&&e.endsWith(`/`);return`/`+n.map(n=>n.replace(ce,(n,r,i,a)=>{let o=t[a];if(!o){if(r||i&&o!==void 0)return``;throw Error(`Missing parameter '${a}' in route ${e}`)}if(o.startsWith(`/`)||o.endsWith(`/`))throw Error(`Parameter '${a}' in route ${e} cannot start or end with a slash -- this would cause an invalid route like foo//bar`);return o})).filter(Boolean).join(`/`)+(r?`/`:``)}function ue({nodes:e,server_loads:t,dictionary:n,matchers:r}){let i=new Set(t);return Object.entries(n).map(([t,[n,i,s]])=>{let{pattern:c,params:l}=re(t),u={id:t,exec:e=>{let t=c.exec(e);if(t)return oe(t,l,r)},errors:[1,...s||[]].map(t=>e[t]),layouts:[0,...i||[]].map(o),leaf:a(n)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function a(t){let n=t<0;return n&&(t=~t),[n,e[t]]}function o(t){return t===void 0?t:[i.has(t),e[t]]}}function de(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function fe(e,t,n=JSON.stringify){let r=n(t);try{sessionStorage[e]=r}catch{}}var C=globalThis.__sveltekit_kfuis3?.base??``,pe=globalThis.__sveltekit_kfuis3?.assets??C??``;function me(e){return(pe||C)+e}var he=`#`;function ge(...e){if(!e[0].startsWith(`/`))throw Error(`Cannot use \`resolve(...)\` with a non-absolute pathname or route ID (got "${e[0]}"). \`resolve\` is only for internal pathnames and route IDs; external URLs should be used directly.`);return C+he+le(e[0],e[1])}var _e=`1793933745371`,ve=`sveltekit:snapshot`,ye=`sveltekit:scroll`,be=`sveltekit:states`,w=`sveltekit:history`,T=`sveltekit:navigation`,E={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},xe=location.origin;function Se(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){let e=document.getElementsByTagName(`base`);t=e.length?e[0].href:document.URL}return new URL(e,t)}function D(){return{x:pageXOffset,y:pageYOffset}}function O(e,t){return e.getAttribute(`data-sveltekit-${t}`)}var Ce={...E,"":E.hover};function we(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Te(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()===`A`&&e.hasAttribute(`href`))return e;e=we(e)}}function Ee(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){let e=location.hash.split(`#`)[1]||`/`;r.hash=`#${e}${r.hash}`}}catch{}let i=e instanceof SVGAElement?e.target.baseVal:e.target,a=!r||!!i||je(r,t,n)||(e.getAttribute(`rel`)||``).split(/\s+/).includes(`external`),o=r?.origin===xe&&e.hasAttribute(`download`);return{url:r,external:a,target:i,download:o}}function De(e){let t=null,n=null,r=null,i=null,a=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=O(s,`preload-code`)),i===null&&(i=O(s,`preload-data`)),t===null&&(t=O(s,`keepfocus`)),n===null&&(n=O(s,`noscroll`)),a===null&&(a=O(s,`reload`)),o===null&&(o=O(s,`replacestate`)),s=we(s);function c(e){switch(e){case``:case`true`:return!0;case`off`:case`false`:return!1;default:return}}return{preload_code:Ce[r??`off`],preload_data:Ce[i??`off`],keepfocus:c(t),noscroll:c(n),reload:c(a),replace_state:c(o)}}function Oe(e){let t=o(e),n=!0;function r(){n=!0,t.update(e=>e)}function i(e){n=!1,t.set(e)}function a(e){let r;return t.subscribe(t=>{(r===void 0||n&&t!==r)&&e(r=t)})}return{notify:r,set:i,subscribe:a}}var ke={v:h};function Ae(){let{set:e,subscribe:t}=o(!1),n;async function r(){clearTimeout(n);try{let t=await fetch(`${pe}/_app/version.json`,{headers:{pragma:`no-cache`,"cache-control":`no-cache`}});if(!t.ok)return!1;let r=(await t.json()).version!==_e;return r&&(e(!0),ke.v(),clearTimeout(n)),r}catch{return!1}}return{subscribe:t,check:r}}function je(e,t,n){return e.origin!==xe||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Me(e){}var Ne=new Set([`load`,`prerender`,`csr`,`ssr`,`trailingSlash`,`config`]);[...Ne],[...new Set([...Ne])];function Pe(e){return e.filter(e=>e!=null)}function k(e,t){return e+`/`+t}function Fe(e){return e instanceof c||e instanceof u?e.status:500}function Ie(e){return e instanceof u?e.text:`Internal Error`}var A,j,Le,Re=a.toString().includes(`$$`)||/function \w+\(\) \{\}/.test(a.toString()),ze=`a:`;Re?(A={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(ze)},j={current:null},Le={current:!1}):(A=new class{#e=r({});get data(){return e(this.#e)}set data(e){i(this.#e,e)}#t=r(null);get form(){return e(this.#t)}set form(e){i(this.#t,e)}#n=r(null);get error(){return e(this.#n)}set error(e){i(this.#n,e)}#r=r({});get params(){return e(this.#r)}set params(e){i(this.#r,e)}#i=r({id:null});get route(){return e(this.#i)}set route(e){i(this.#i,e)}#a=r({});get state(){return e(this.#a)}set state(e){i(this.#a,e)}#o=r(-1);get status(){return e(this.#o)}set status(e){i(this.#o,e)}#s=r(new URL(ze));get url(){return e(this.#s)}set url(e){i(this.#s,e)}},j=new class{#e=r(null);get current(){return e(this.#e)}set current(e){i(this.#e,e)}},Le=new class{#e=r(!1);get current(){return e(this.#e)}set current(e){i(this.#e,e)}},ke.v=()=>Le.current=!0);function Be(e){Object.assign(A,e)}var Ve={spanContext(){return He},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},He={traceId:``,spanId:``,traceFlags:0},{onMount:Ue,tick:We}=s,Ge=new Set([`icon`,`shortcut icon`,`apple-touch-icon`]),M=null,N=de(`sveltekit:scroll`)??{},P=de(`sveltekit:snapshot`)??{},F={url:Oe({}),page:Oe({}),navigating:o(null),updated:Ae()};function Ke(e){N[e]=D()}function qe(e,t){let n=e+1;for(;N[n];)delete N[n],n+=1;for(n=t+1;P[n];)delete P[n],n+=1}function I(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(h)}async function Je(){if(`serviceWorker`in navigator){let e=await navigator.serviceWorker.getRegistration(C||`/`);e&&await e.update()}}var Ye,Xe,L,R,Ze,z,Qe={},$e={},B=[],V=[],H=null;function U(){H?.fork?.then(e=>e?.discard()),H=null,Q={element:void 0,href:void 0}}var et=new Map,tt=new Set,nt=new Set,W=new Set,G={branch:[],error:null,url:null,nav:null},rt=!1,it=!1,at=!0,K=!1,q=!1,ot=!1,st=!1,ct,J,Y,X,lt=new Set,ut=new Map,dt=new Map;async function ft(e,t,n){if(globalThis.__sveltekit_kfuis3.data){let{q:e={},p:t={},l:n={},f:r={}}=globalThis.__sveltekit_kfuis3.data;for(let t in e)Qe[t]=e[t];for(let e in n)Qe[e]=n[e];for(let e in r)Qe[e]=r[e];for(let e in t)$e[e]=t[e]}document.URL!==location.href&&(location.href=location.href),z=e,await e.hooks.init?.(),Ye=ue(e),R=document.documentElement,Ze=t,Xe=e.nodes[0],L=e.nodes[1],Xe(),L(),J=history.state?.[w],Y=history.state?.[T],J||(J=Y=Date.now(),history.replaceState({...history.state,[w]:J,[T]:Y},``));let r=N[J];function i(){r&&(history.scrollRestoration=`manual`,scrollTo(r.x,r.y))}n?(i(),await Vt(Ze,n)):(await Z({type:`enter`,url:Se(z.hash?qt(new URL(location.href)):location.href),replace_state:!0}),i()),Bt()}function pt(){B.length=0,st=!1}function mt(e){V.some(e=>e?.snapshot)&&(P[e]=V.map(e=>e?.snapshot?.capture()))}function ht(e){P[e]?.forEach((e,t)=>{V[t]?.snapshot?.restore(e)})}function gt(){Ke(J),fe(ye,N),mt(Y),fe(ve,P)}async function _t(e,t,r,i){let a,o;t.invalidateAll&&U(),await Z({type:`goto`,url:Se(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:r,nav_token:i,accept:()=>{if(t.invalidateAll){st=!0,a=new Set;for(let[e,t]of ut)for(let[n,r]of t)r.resource?.reset(),a.add(k(e,n));o=new Set;for(let[e,t]of dt)for(let n of t.keys())o.add(k(e,n))}t.invalidate&&t.invalidate.forEach(zt)}}),t.invalidateAll&&n().then(n).then(()=>{for(let[e,t]of ut)for(let[n,{resource:r}]of t)a?.has(k(e,n))&&r.start();for(let[e,t]of dt)for(let[n,{resource:r}]of t)o?.has(k(e,n))&&r.reconnect()})}async function vt(e){if(e.id!==H?.id){U();let t={};lt.add(t),H={id:e.id,token:t,promise:Ot({...e,preload:t}).then(e=>(lt.delete(t),e.type===`loaded`&&e.state.error&&U(),e)),fork:null}}return H.promise}async function yt(e){let t=(await Mt(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(e=>e[1]()))}async function bt(e,t,n){let r={params:G.params,route:{id:G.route?.id??null},url:new URL(location.href)};if(G={...e.state,nav:r},Be(e.props.page),ct=new z.root({target:t,props:{...e.props,stores:F,components:V},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),n){let e={from:null,to:{...r,scroll:N[J]??D()},willUnload:!1,type:`enter`,complete:Promise.resolve()};W.forEach(t=>t(e))}ht(Y),it=!0}async function xt({url:e,params:t,branch:n,errors:r,status:i,error:a,route:o,form:s}){let c=`never`;if(C&&(e.pathname===C||e.pathname===C+`/`))c=`always`;else for(let e of n)e?.slash!==void 0&&(c=e.slash);e.pathname=d(e.pathname,c),e.search=e.search;let l={type:`loaded`,state:{url:e,params:t,branch:n,error:a,route:o},props:{constructors:Pe(n).map(e=>e.node.component),page:Kt(A)}};s!==void 0&&(l.props.form=s);let u={},f=!A,p=0;for(let e=0;e<Math.max(n.length,G.branch.length);e+=1){let t=n[e],r=G.branch[e];t?.data!==r?.data&&(f=!0),t&&(u={...u,...t.data},f&&(l.props[`data_${p}`]=u),p+=1)}return(!G.url||e.href!==G.url.href||G.error!==a||s!==void 0&&s!==A.form||f)&&(l.props.page={error:a,params:t,route:{id:o?.id??null},state:{},status:i,url:new URL(e),form:s??null,data:f?u:A.data}),l}async function St({loader:e,parent:t,url:n,params:r,route:i,server_data_node:a}){let o=null,s=!0,c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();if(l.universal?.load){function e(...e){for(let t of e){let{href:e}=new URL(t,n);c.dependencies.add(e)}}let u={tracing:{enabled:!1,root:Ve,current:Ve},route:new Proxy(i,{get:(e,t)=>(s&&(c.route=!0),e[t])}),params:new Proxy(r,{get:(e,t)=>(s&&c.params.add(t),e[t])}),data:a?.data??null,url:ee(n,()=>{s&&(c.url=!0)},e=>{s&&c.search_params.add(e)},z.hash),async fetch(t,r){t instanceof Request&&(r={body:t.method===`GET`||t.method===`HEAD`?void 0:await t.blob(),cache:t.cache,credentials:t.credentials,headers:[...t.headers].length>0?t?.headers:void 0,integrity:t.integrity,keepalive:t.keepalive,method:t.method,mode:t.mode,redirect:t.redirect,referrer:t.referrer,referrerPolicy:t.referrerPolicy,signal:t.signal,...r});let{resolved:i,promise:a}=Ct(t,r,n);return s&&e(i.href),a},setHeaders:h,depends:e,parent(){return s&&(c.parent=!0),t()},untrack(e){s=!1;try{return e()}finally{s=!0}}};o=await l.universal.load.call(null,u)??null}return{node:l,loader:e,server:a,universal:l.universal?.load?{type:`data`,data:o,uses:c}:null,data:o??a?.data??null,slash:l.universal?.trailingSlash??a?.slash}}function Ct(e,t,n){let r=e instanceof Request?e.url:e,i=new URL(r,n);return i.origin===n.origin&&(r=i.href.slice(n.origin.length)),{resolved:i,promise:it?b(r,i.href,t):y(r,t)}}function wt(e,t,n,r,i,a){if(st)return!0;if(!i)return!1;if(i.parent&&e||i.route&&t||i.url&&n)return!0;for(let e of i.search_params)if(r.has(e))return!0;for(let e of i.params)if(a[e]!==G.params[e])return!0;for(let e of i.dependencies)if(B.some(t=>t(new URL(e))))return!0;return!1}function Tt(e,t){return e?.type===`data`?e:e?.type===`skip`?t??null:null}function Et(e,t){if(!e)return new Set(t.searchParams.keys());let n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(let r of n){let i=e.searchParams.getAll(r),a=t.searchParams.getAll(r);i.every(e=>a.includes(e))&&a.every(e=>i.includes(e))&&n.delete(r)}return n}function Dt({error:e,url:t,route:n,params:r}){return{type:`loaded`,state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Kt(A),constructors:[]}}}async function Ot({id:e,invalidating:t,url:n,params:r,route:i,preload:a}){if(H?.id===e)return lt.delete(H.token),H.promise;let{errors:o,layouts:s,leaf:u}=i,d=[...s,u];o.forEach(e=>e?.().catch(h)),d.forEach(e=>e?.[1]().catch(h));let f=G.url?e!==Pt(G.url):!1,p=G.route?i.id!==G.route.id:!1,m=Et(G.url,n),ee=!1,g=d.map(async(e,t)=>{if(!e)return;let a=G.branch[t];return e[1]===a?.loader&&!wt(ee,p,f,m,a.universal?.uses,r)?a:(ee=!0,St({loader:e[1],url:n,params:r,route:i,parent:async()=>{let e={};for(let n=0;n<t;n+=1)Object.assign(e,(await g[n])?.data);return e},server_data_node:Tt(e[0]?{type:`skip`}:null,e[0]?a?.server:void 0)}))});for(let e of g)e.catch(h);let _=[];for(let e=0;e<d.length;e+=1)if(d[e])try{_.push(await g[e])}catch(t){if(t instanceof l)return{type:`redirect`,location:t.location};if(a&&lt.has(a))return Dt({error:await $(t,{params:r,url:n,route:{id:i.id}}),url:n,params:r,route:i});let s=Fe(t),u;if(t instanceof c)u=t.body;else{if(await F.updated.check())return await Je(),await I(n);u=await $(t,{params:r,url:n,route:{id:i.id}})}let d=await kt(e,_,o);return d?xt({url:n,params:r,branch:_.slice(0,d.idx).concat(d.node),errors:o,status:s,error:u,route:i}):await It(n,{id:i.id},u,s)}else _.push(void 0);return xt({url:n,params:r,branch:_,errors:o,status:200,error:null,route:i,form:t?void 0:null})}async function kt(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)--r;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function At({status:e,error:t,url:n,route:r}){let i={};try{return xt({url:n,params:i,branch:[await St({loader:Xe,url:n,params:i,route:r,parent:()=>Promise.resolve({}),server_data_node:Tt(null)}),{node:await L(),loader:L,universal:null,server:null,data:null}],status:e,error:t,errors:[],route:null})}catch(t){if(t instanceof l){await _t(new URL(t.location,location.href),{},0);return}let a=await z.get_error_template(),o=await $(t,{url:n,params:i,route:r}),s=a({status:e,message:String(o?.message??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}),c=new DOMParser().parseFromString(s,`text/html`);throw document.documentElement.replaceChild(document.adoptNode(c.head),document.head),document.documentElement.replaceChild(document.adoptNode(c.body),document.body),t}}async function jt(e){let t=e.href;if(et.has(t))return et.get(t);let n;try{let r=(async()=>{let t=await z.hooks.reroute({url:new URL(e),fetch:async(t,n)=>Ct(t,n,e).promise})??e;if(typeof t==`string`){let n=new URL(e);z.hash?n.hash=t:n.pathname=t,t=n}return t})();et.set(t,r),n=await r}catch{et.delete(t);return}return n}async function Mt(e,t){if(e&&!je(e,C,z.hash)){let n=await jt(e);if(!n)return;let r=Nt(n);for(let n of Ye){let i=n.exec(r);if(i)return{id:Pt(e),invalidating:t,route:n,params:p(i),url:e}}}}function Nt(e){return f(z.hash?e.hash.replace(/^#/,``).replace(/[?#].+/,``):e.pathname.slice(C.length))||`/`}function Pt(e){return(z.hash?e.hash.replace(/^#/,``):e.pathname)+e.search}function Ft({url:e,type:t,intent:n,delta:r,event:i,scroll:a}){let o=!1,s=Gt(G,n,e,t,a??null);r!==void 0&&(s.navigation.delta=r),i!==void 0&&(s.navigation.event=i);let c={...s.navigation,cancel:()=>{o=!0,s.reject(Error(`navigation cancelled`))}};return K||tt.forEach(e=>e(c)),o?null:s}async function Z({type:e,url:r,popped:i,keepfocus:a,noscroll:o,replace_state:s,state:c={},redirect_count:l=0,nav_token:d={},accept:f=h,block:p=h,event:m}){let ee=X;X=d;let g=await Mt(r,!1),_=e===`enter`?Gt(G,g,r,e):Ft({url:r,type:e,delta:i?.delta,intent:g,scroll:i?.scroll,event:m});if(!_){p(),X===d&&(X=ee);return}let te=J,v=Y;f(),K=!0,it&&_.navigation.type!==`enter`&&F.navigating.set(j.current=_.navigation);let y=g&&await Ot(g);if(!y){if(je(r,C,z.hash))return await I(r,s);y=await It(r,{id:null},await $(new u(404,`Not Found`,`Not found: ${r.pathname}`),{url:r,params:{},route:{id:null}}),404,s)}if(r=g?.url||r,X!==d){_.reject(Error(`navigation aborted`));return}if(!y)return;if(y.type===`redirect`){if(l<20){await Z({type:e,url:new URL(y.location,r),popped:i,keepfocus:a,noscroll:o,replace_state:s,state:c,redirect_count:l+1,nav_token:d}),_.fulfil(void 0);return}if(y=await At({status:500,error:await $(Error(`Redirect loop`),{url:r,params:{},route:{id:null}}),url:r,route:{id:null}}),!y)return}else if(y.props.page.status>=400&&await F.updated.check())return await Je(),await I(r,s);if(pt(),Ke(te),mt(v),y.props.page.url.pathname!==r.pathname&&(r.pathname=y.props.page.url.pathname),c=i?i.state:c,!i){let e=+!s,t={[w]:J+=e,[T]:Y+=e,[be]:c};(s?history.replaceState:history.pushState).call(history,t,``,r),s||qe(J,Y)}let b=g&&H?.id===g.id?H.fork:null;H?.fork&&!b?U():(H=null,Q={element:void 0,href:void 0}),y.props.page.state=c;let x;if(it){let e=(await Promise.all(Array.from(nt,e=>e(_.navigation)))).filter(e=>typeof e==`function`);if(e.length>0){function t(){e.forEach(e=>{W.delete(e)})}e.push(t),e.forEach(e=>{W.add(e)})}let n=_.navigation.to;G={...y.state,nav:{params:n.params,route:n.route,url:n.url}},y.props.page&&(y.props.page.url=r),!a&&document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur();let i=b&&await b;i?x=i.commit():(M=null,ct.$set(y.props),M&&Object.assign(y.props.page,M),Be(y.props.page),x=t?.()),ot=!0}else await bt(y,Ze,!1);let{activeElement:ne}=document;if(await x,await n(),await n(),X!==d){_.reject(Error(`navigation aborted`));return}y.props.page&&M&&Object.assign(y.props.page,M);let S=null;if(at){let e=i?i.scroll:o?D():null;e?scrollTo(e.x,e.y):(S=r.hash&&document.getElementById(Jt(r)))?S.scrollIntoView():scrollTo(0,0)}let re=document.activeElement!==ne&&document.activeElement!==document.body;!a&&!re&&Wt(r,!S),at=!0,K=!1,_.fulfil(void 0),_.navigation.to&&(_.navigation.to.scroll=D()),W.forEach(e=>e(_.navigation)),e===`popstate`&&ht(Y),F.navigating.set(j.current=null)}async function It(e,t,n,r,i){return e.origin===xe&&e.pathname===location.pathname&&!rt?await At({status:r,error:n,url:e,route:t}):await I(e,i)}var Q={element:void 0,href:void 0};function Lt(){let e,t;R.addEventListener(`mousemove`,t=>{let n=t.target;clearTimeout(e),e=setTimeout(()=>{i(n,E.hover)},20)});function n(e){e.defaultPrevented||i(e.composedPath()[0],E.tap)}R.addEventListener(`mousedown`,n),R.addEventListener(`touchstart`,n,{passive:!0});let r=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&(yt(new URL(t.target.href)),r.unobserve(t.target))},{threshold:0});async function i(e,n){let r=Te(e,R),i=r===Q.element&&r?.href===Q.href&&n>=t;if(!r||i)return;let{url:a,external:o,download:s}=Ee(r,C,z.hash);if(o||s)return;let c=De(r),l=a&&Pt(G.url)===Pt(a);if(!(c.reload||l)){if(n<=c.preload_data){Q={element:r,href:r.href},t=E.tap;let e=await Mt(a,!1);if(!e)return;vt(e)}else n<=c.preload_code&&(Q={element:r,href:r.href},t=n,yt(a))}}function a(){r.disconnect();for(let e of R.querySelectorAll(`a`)){let{url:t,external:n,download:i}=Ee(e,C,z.hash);if(n||i)continue;let a=De(e);a.reload||(a.preload_code===E.viewport&&r.observe(e),a.preload_code===E.eager&&yt(t))}}W.add(a),a()}function $(e,t){if(e instanceof c)return e.body;let n=Fe(e),r=Ie(e);return z.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Rt(e,t={}){return e=new URL(Se(e)),e.origin===xe?_t(e,t,0):Promise.reject(Error(`goto: invalid URL`))}function zt(e){if(typeof e==`function`)B.push(e);else{let{href:t}=new URL(e,location.href);B.push(e=>e.href===t)}}function Bt(){history.scrollRestoration=`manual`,addEventListener(`beforeunload`,e=>{let t=!1;if(gt(),!K){let e=Gt(G,void 0,null,`leave`),n={...e.navigation,cancel:()=>{t=!0,e.reject(Error(`navigation cancelled`))}};tt.forEach(e=>e(n))}t?(e.preventDefault(),e.returnValue=``):history.scrollRestoration=`auto`}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&gt()}),navigator.connection?.saveData||Lt(),R.addEventListener(`click`,async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;let n=Te(t.composedPath()[0],R);if(!n)return;let{url:r,external:i,target:a,download:o}=Ee(n,C,z.hash);if(!r)return;if(a===`_parent`||a===`_top`){if(window.parent!==window)return}else if(a&&a!==`_self`)return;let s=De(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&r.protocol!==`https:`&&r.protocol!==`http:`||o)return;let[c,l]=(z.hash?r.hash.replace(/^#/,``):r.href).split(`#`),u=c===m(location);if(i||s.reload&&(!u||!l))Ft({url:r,type:`link`,event:t})?K=!0:t.preventDefault();else{if(l!==void 0&&u){let[,i]=G.url.href.split(`#`);if(i===l){if(t.preventDefault(),l===``||l===`top`&&n.ownerDocument.getElementById(`top`)===null)scrollTo({top:0});else{let e=n.ownerDocument.getElementById(decodeURIComponent(l));e&&(e.scrollIntoView(),e.focus())}return}if(q=!0,Ke(J),e(r),!s.replace_state)return;q=!1}t.preventDefault(),await new Promise(e=>{requestAnimationFrame(()=>{setTimeout(e,0)}),setTimeout(e,100)}),await Z({type:`link`,url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}}),R.addEventListener(`submit`,e=>{if(e.defaultPrevented)return;let t=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if((n?.formTarget||t.target)===`_blank`||(n?.formMethod||t.method)!==`get`)return;let r=new URL(n?.hasAttribute(`formaction`)&&n?.formAction||t.action);if(je(r,C,!1))return;let i=e.target,a=De(i);if(a.reload)return;e.preventDefault(),e.stopPropagation();let o=new FormData(i,n);r.search=new URLSearchParams(o).toString(),Z({type:`form`,url:r,keepfocus:a.keepfocus,noscroll:a.noscroll,replace_state:a.replace_state??r.href===location.href,event:e})}),addEventListener(`popstate`,async t=>{if(!Ut){if(t.state?.[`sveltekit:history`]){let n=t.state[w];if(X={},n===J)return;let r=N[n],i=t.state[`sveltekit:states`]??{},a=new URL(t.state[`sveltekit:pageurl`]??location.href),o=t.state[T],s=G.url?m(location)===m(G.url):!1;if(o===Y&&(ot||s)){i!==A.state&&(A.state=i),e(a),N[J]=D(),r&&scrollTo(r.x,r.y),J=n;return}let c=n-J;await Z({type:`popstate`,url:a,popped:{state:i,scroll:r,delta:c},accept:()=>{J=n,Y=o},block:()=>{history.go(-c)},nav_token:X,event:t})}else q||(e(new URL(location.href)),z.hash&&location.reload())}}),addEventListener(`hashchange`,()=>{q&&(q=!1,history.replaceState({...history.state,[w]:++J,[T]:Y},``,location.href))});for(let e of document.querySelectorAll(`link`))Ge.has(e.rel)&&(e.href=e.href);addEventListener(`pageshow`,e=>{e.persisted&&F.navigating.set(j.current=null)});function e(e){G.url=A.url=e,F.page.set(Kt(A)),F.page.notify()}}async function Vt(e,{status:t=200,error:n,node_ids:r,params:i,route:a,server_route:o,data:s,form:c}){rt=!0;let u=new URL(location.href),d;({params:i={},route:a={id:null}}=await Mt(u,!1)||{}),d=Ye.find(({id:e})=>e===a.id);let f,p=!0;try{let e=r.map(async(t,n)=>{let r=s[n];return r?.uses&&(r.uses=Ht(r.uses)),St({loader:z.nodes[t],url:u,params:i,route:a,parent:async()=>{let t={};for(let r=0;r<n;r+=1)Object.assign(t,(await e[r]).data);return t},server_data_node:Tt(r)})}),o=await Promise.all(e);if(d){let e=d.layouts;for(let t=0;t<e.length;t++)e[t]||o.splice(t,0,void 0)}f=await xt({url:u,params:i,branch:o,status:t,error:n,errors:d?.errors,form:c,route:d??null})}catch(t){if(t instanceof l)return await I(new URL(t.location,location.href));f=await At({status:Fe(t),error:await $(t,{url:u,params:i,route:a}),url:u,route:a}),e.textContent=``,p=!1}f&&(f.props.page&&(f.props.page.state={}),await bt(f,e,p))}function Ht(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}var Ut=!1;function Wt(e,t=!0){let n=document.querySelector(`[autofocus]`);if(n)n.focus();else{let n=Jt(e);if(n&&document.getElementById(n)){let{x:r,y:i}=D();setTimeout(()=>{let a=history.state;Ut=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(a,``,e),t&&scrollTo(r,i),Ut=!1})}else{let e=document.body,t=e.getAttribute(`tabindex`);e.tabIndex=-1,e.focus({preventScroll:!0,focusVisible:!1}),t===null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t)}let r=getSelection();if(r&&r.type!==`None`){let e=[];for(let t=0;t<r.rangeCount;t+=1)e.push(r.getRangeAt(t));setTimeout(()=>{if(r.rangeCount===e.length){for(let t=0;t<r.rangeCount;t+=1){let n=e[t],i=r.getRangeAt(t);if(n.commonAncestorContainer!==i.commonAncestorContainer||n.startContainer!==i.startContainer||n.endContainer!==i.endContainer||n.startOffset!==i.startOffset||n.endOffset!==i.endOffset)return}r.removeAllRanges()}})}}}function Gt(e,t,n,r,i=null){let a,o,s=new Promise((e,t)=>{a=e,o=t});return s.catch(h),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:D()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:i},willUnload:!t,type:r,complete:s},fulfil:a,reject:o}}function Kt(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function qt(e){let t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function Jt(e){let t;if(z.hash){let[,,n]=e.hash.split(`#`,3);t=n??``}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Me as a,A as i,ft as n,me as o,j as r,ge as s,Rt as t};
@@ -1,2 +1,2 @@
1
- import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./DS7XcdHs.js";import{n as o,r as s}from"./DciMwFJ1.js";import{a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./Dzu8v7nB.js";import{PeleError as w,u as ee}from"./BNlziJ_1.js";function T(e,t){let n=new Map;for(let{label:t,value:r}of e.sections){if(r<0)throw new w(`"${t}" has invalid value: ${r}. Negative values are not allowed in pie charts. All slice values must be >= 0.`,`semantic`,{type:`pie`});n.has(t)||n.set(t,r)}return{type:`pie`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
1
+ import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./DlgOmQ_G.js";import{n as o,r as s}from"./DciMwFJ1.js";import{a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./jAC4YCqW.js";import{PeleError as w,u as ee}from"./BArcFmbE.js";function T(e,t){let n=new Map;for(let{label:t,value:r}of e.sections){if(r<0)throw new w(`"${t}" has invalid value: ${r}. Negative values are not allowed in pie charts. All slice values must be >= 0.`,`semantic`,{type:`pie`});n.has(t)||n.set(t,r)}return{type:`pie`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
2
2
  `):void 0,showData:e.showData,sections:n}}function E(e,t){let n=t;for(let t=e.charCodeAt(n);t>=48&&t<=57;t=e.charCodeAt(n))n++;return n}function D(){let e=0,t=0,n=-1;return(r,i)=>{let a=r.charCodeAt(i)===45?i+1:i;if((a<e||a>=t)&&(e=a,t=E(r,a),n=-1,t>a&&r.charCodeAt(t)===46)){let e=E(r,t+1),i=e-t-1;i>0&&r.charCodeAt(e)!==46?n=e:i>1&&(n=e-1)}return t===a?-1:n>=0?n:r.charCodeAt(a)===48?r.charCodeAt(a+1)===46?-1:a+1:r.charCodeAt(t)===46?t-1>a?t-1:-1:t}}var O=[m(`showData`),m(`pie`),{name:`:`,pattern:`:`},{name:`NUMBER_PIE`,pattern:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/y,scanner:D,first:`-0123456789`},c,S,y,g,h,C,b,v,x];function k(e){let t=new p(_(e,O,`pie`),O,`pie`),n={$type:`Pie`,showData:!1,sections:[]},r=()=>{if(t.kind!==-1)for(t.kind!==8&&t.fail(`a line break or the end of input`);t.kind===8;)t.i++};for(;t.kind===8;)t.i++;for(t.expect(1),n.showData=t.accept(0);t.kind!==-1;)switch(t.kind){case 8:t.i++;break;case 4:n.accDescr=l(t.take()),r();break;case 5:n.accTitle=f(t.take()),r();break;case 6:n.title=u(t.take()),r();break;case 7:{let e=d(t.take());t.expect(2);let i=Number(t.expect(3));n.sections.push({$type:`PieSection`,label:e,value:i}),r();break}default:t.fail(`a section, a title, or a line break`)}return n}var A=120,j=12,M=26,N=32,P=28;function F(e,t){return e.pie?.[t]}function I(e,t){return`${a(Math.sin(e)*t)},${a(-Math.cos(e)*t)}`}function te(e,t,n,r){if(t-e>=Math.PI*2-1e-9){let e=(e,t)=>`M0,${a(-e)}A${a(e)},${a(e)} 0 1 ${t} 0,${a(e)}A${a(e)},${a(e)} 0 1 ${t} 0,${a(-e)}Z`;return e(n,1)+(r>0?e(r,0):``)}let i=+(t-e>Math.PI);return r<=0?`M0,0L${I(e,n)}A${a(n)},${a(n)} 0 ${i} 1 ${I(t,n)}Z`:`M${I(e,n)}A${a(n)},${a(n)} 0 ${i} 1 ${I(t,n)}L${I(t,r)}A${a(r)},${a(r)} 0 ${i} 0 ${I(e,r)}Z`}function L(e,t,n){return o(n,A*2,140,(r,i)=>R(e,t,n,r/2,i))}function R(o,c,l,u,d){let f=l.fontSize??16,p=Math.round(f*.875),m=l.measurer??ee(l.fontFamily,l.fontFamilyMono),h=l.padding??8,g=F(c,`textPosition`),_=typeof g==`number`&&g>=0&&g<=1?g:.75,v=F(c,`donutHole`),y=typeof v==`number`&&v>0&&v<=.9?v*u:0,b=String(F(c,`legendPosition`)??`right`),x=d&&(b===`left`||b===`right`)?`bottom`:b,S=[...o.sections],C=0;for(let[,e]of S)C+=e;let w=S.map(([e,t])=>i(o.showData?`${e} [${t}]`:e,!1,m,p,4e3)),T=0;for(let e of w)T=Math.max(T,e.width);T+=w.length>0?j+8:0;let E=w.length*M,D=i(o.title,!1,m,f,s(l),1),O=D.height>0?D.height+16:0,k=S.map(([,e])=>{let t=C>0?e/C:0;return t*100>=1&&(t*100).toFixed(0)!==`0`?t:0}),A=k.map(e=>e===0||e>=.5?!1:2*u*_*Math.sin(e*Math.PI)<m.width((e*100).toFixed(0)+`%`,p,0)+6),I=A.includes(!0)?P:0,L=x===`left`||x===`right`||x===`center`?x:``,R=x===`top`||x===`bottom`,z=(u+I)*2,B=z,V=z;L===`left`||L===`right`?(B+=T>0?N+T:0,V=Math.max(V,E)):R&&(B=Math.max(B,T),V+=E>0?20+E:0),B=Math.max(B,D.width);let H=h+(L===`left`?T+N+z/2:L===`right`?z/2:B/2),U=h+O,W=U+(x===`top`?E+20+z/2:R?z/2:V/2),G=``,K=``,q=``,J=0,Y=u+P/2,ne=[],re=(e,t,n)=>ne.every(r=>Math.abs(e-r.x)>=(n+r.width)/2+2||Math.abs(t-r.y)>=p+2);S.forEach(([e],r)=>{let i=k[r];if(i===0)return;let o=J+i*Math.PI*2;G+=`<path class="pele-slice" data-id="${n(e)}" d="${te(J,o,u,y)}" fill="${t(r)}"/>`;let s=(J+o)/2,c=(i*100).toFixed(0)+`%`;if(A[r]){let e=m.width(c,p,0),t=s;for(let n=0;n<360&&!re(Math.sin(t)*Y,-Math.cos(t)*Y,e);n++)t+=2/Y;let n=Math.sin(t)*Y,r=-Math.cos(t)*Y;ne.push({x:n,y:r,width:e}),q+=`<text x="${a(n)}" y="${a(r+p*.35)}">${c}</text>`}else{let e=u*_;K+=`<text x="${a(Math.sin(s)*e)}" y="${a(-Math.cos(s)*e+p*.35)}">${c}</text>`}J=o}),G===``&&(G=`<circle class="pele-slice" r="${u}" fill="none" stroke="var(--_b)"/>`);let X=``,Z,Q;L===`right`?(Z=H+z/2+N,Q=U+(V-E)/2):L===`left`?(Z=h,Q=U+(V-E)/2):L===`center`?(Z=H-T/2,Q=W-E/2):(Z=h+(B-T)/2,Q=x===`top`?U:U+z+20),w.forEach((e,i)=>{let o=Q+i*M+M/2;X+=`<g class="pele-legend-item" data-id="${n(S[i][0])}"><rect x="${a(Z)}" y="${a(o-j/2)}" width="${j}" height="${j}" rx="2" fill="${t(i)}"/>`+r(e,Z+j+8+e.width/2,o,``)+`</g>`});let $=Math.ceil(B+2*h),ie=Math.ceil(V+O+2*h),ae=r(D,$/2,h+D.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g class="pele-slices" transform="translate(${a(H)},${a(W)})" stroke="var(--_bg)" stroke-width="1" stroke-linejoin="round">${G}</g>`+(K?`<g class="pele-slice-labels" transform="translate(${a(H)},${a(W)})" font-size="${p}" text-anchor="middle" fill="var(--_bg)">${K}</g>`:``)+(q?`<g class="pele-slice-labels" transform="translate(${a(H)},${a(W)})" font-size="${p}" text-anchor="middle">${q}</g>`:``)+(X?`<g class="pele-legend" font-size="${p}">${X}</g>`:``);return{svg:e(`pie`,$,ie,f,l,o,ae),width:$,height:ie,links:[]}}var z={type:`pie`,parse:(e,t,n)=>T(k(e),n),render:L};export{z as pie};
@@ -1,3 +1,3 @@
1
- import{_ as e,a as t,b as n,c as r,d as i,i as a,m as o,o as s,p as c,r as l,s as u,t as d,u as f,v as p,x as m,y as h}from"./DS7XcdHs.js";import{a as g,t as _}from"./DciMwFJ1.js";import{i as v,l as y}from"./DK9wjWIk.js";import{t as b}from"./CdD6waB-.js";import{a as x,r as S}from"./DrPF-vh8.js";import{t as C}from"./BZmnMkFw.js";import{n as w,r as ee}from"./DQJRaTNz.js";import{i as te,n as ne,r as T,t as re}from"./Bx_Vz2qr.js";import{d as ie,g as E,h as D,s as O,u as ae,y as k}from"./BNlziJ_1.js";function A(e){return e===`markdown`||e===`string`||e===`text`?e:`markdown`}var oe=class{type=`er`;direction=`TB`;entities=new Map;relationships=[];classes=new Map;subgraphs=[];title;accTitle;accDescr;subgraphLookup=new Map;claimed=new Set;addEntity(e,t=``){let n=this.entities.get(e);return n===void 0?(n={id:`entity-${e}-${this.entities.size}`,label:e,alias:t,attributes:[],cssClasses:`default`,cssStyles:[]},this.entities.set(e,n)):!n.alias&&t&&(n.alias=t),n}addAttributes(e,t){let n=this.addEntity(e);for(let e=t.length-1;e>=0;e--){let r=t[e];r.keys??=[],r.comment??=``,n.attributes.push(r)}}addRelationship(e,t,n,r){let i=this.subgraphLookup.has(e)?e:this.addEntity(e).id,a=this.subgraphLookup.has(n)?n:this.addEntity(n).id;this.relationships.push({entityA:i,roleA:t,entityB:a,relSpec:r})}setDirection(e){this.direction=e}addCssStyles(e,t){if(t)for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssStyles.push(n);let r=this.subgraphLookup.get(n);if(r)for(let e of t)r.cssStyles.push(e)}}addClass(e,t){for(let n of e){let e=this.classes.get(n);if(e===void 0&&(e={id:n,styles:[],textStyles:[]},this.classes.set(n,e)),t)for(let n of t)n.includes(`color`)&&e.textStyles.push(n.replace(`fill`,`bgFill`)),e.styles.push(n)}}setClass(e,t){for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssClasses+=` `+n;let r=this.subgraphLookup.get(n);if(r)for(let e of t)r.classes.push(e)}}addSubGraph(e,t,n){let r=e.text.trim(),i=new Set,a=[],o;for(let e of t.flat()){if(typeof e!=`string`){e?.stmt===`dir`&&(o=e.value);continue}let t=e.trim();t===``||i.has(t)||(i.add(t),this.claimed.has(e)||a.push(e))}for(let e of a)this.claimed.add(e);let s={id:r,nodes:a,title:(n.text||``).trim(),classes:[],cssStyles:[],dir:o,labelType:A(n.type)};return this.subgraphs.push(s),this.subgraphLookup.set(r,s),r}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
1
+ import{_ as e,a as t,b as n,c as r,d as i,i as a,m as o,o as s,p as c,r as l,s as u,t as d,u as f,v as p,x as m,y as h}from"./DlgOmQ_G.js";import{a as g,t as _}from"./DciMwFJ1.js";import{i as v,l as y}from"./BF3mdiSX.js";import{t as b}from"./T3u7Skc8.js";import{a as x,r as S}from"./-oRvYXNk.js";import{t as C}from"./BZmnMkFw.js";import{n as w,r as ee}from"./CXc9Iibq.js";import{i as te,n as ne,r as T,t as re}from"./CMe14KUo.js";import{d as ie,g as E,h as D,s as O,u as ae,y as k}from"./BArcFmbE.js";function A(e){return e===`markdown`||e===`string`||e===`text`?e:`markdown`}var oe=class{type=`er`;direction=`TB`;entities=new Map;relationships=[];classes=new Map;subgraphs=[];title;accTitle;accDescr;subgraphLookup=new Map;claimed=new Set;addEntity(e,t=``){let n=this.entities.get(e);return n===void 0?(n={id:`entity-${e}-${this.entities.size}`,label:e,alias:t,attributes:[],cssClasses:`default`,cssStyles:[]},this.entities.set(e,n)):!n.alias&&t&&(n.alias=t),n}addAttributes(e,t){let n=this.addEntity(e);for(let e=t.length-1;e>=0;e--){let r=t[e];r.keys??=[],r.comment??=``,n.attributes.push(r)}}addRelationship(e,t,n,r){let i=this.subgraphLookup.has(e)?e:this.addEntity(e).id,a=this.subgraphLookup.has(n)?n:this.addEntity(n).id;this.relationships.push({entityA:i,roleA:t,entityB:a,relSpec:r})}setDirection(e){this.direction=e}addCssStyles(e,t){if(t)for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssStyles.push(n);let r=this.subgraphLookup.get(n);if(r)for(let e of t)r.cssStyles.push(e)}}addClass(e,t){for(let n of e){let e=this.classes.get(n);if(e===void 0&&(e={id:n,styles:[],textStyles:[]},this.classes.set(n,e)),t)for(let n of t)n.includes(`color`)&&e.textStyles.push(n.replace(`fill`,`bgFill`)),e.styles.push(n)}}setClass(e,t){for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssClasses+=` `+n;let r=this.subgraphLookup.get(n);if(r)for(let e of t)r.classes.push(e)}}addSubGraph(e,t,n){let r=e.text.trim(),i=new Set,a=[],o;for(let e of t.flat()){if(typeof e!=`string`){e?.stmt===`dir`&&(o=e.value);continue}let t=e.trim();t===``||i.has(t)||(i.add(t),this.claimed.has(e)||a.push(e))}for(let e of a)this.claimed.add(e);let s={id:r,nodes:a,title:(n.text||``).trim(),classes:[],cssStyles:[],dir:o,labelType:A(n.type)};return this.subgraphs.push(s),this.subgraphLookup.set(r,s),r}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
2
2
  `)}},j=`$end.INVALID.ER_DIAGRAM.EOF.NEWLINE.COLON.STYLE_SEPARATOR.BLOCK_START.BLOCK_STOP.SQS.SQE.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.END.SUBGRAPH.direction_tb.direction_bt.direction_rl.direction_lr.CLASSDEF.UNICODE_TEXT.STYLE_TEXT.COMMA.CLASS.STYLE.SEMI.NUM.BRKT.ENTITY_NAME.DECIMAL_NUM.ENTITY_ONE.ATTRIBUTE_WORD.ATTRIBUTE_KEY.COMMENT.ZERO_OR_ONE.ZERO_OR_MORE.ONE_OR_MORE.ONLY_ONE.MD_PARENT.NON_IDENTIFYING.IDENTIFYING.WORD.CHAR`.split(`.`),M=1,N=2,P=4,F=8,I=new Uint8Array(128);for(let e=0;e<128;e++){let t=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95,n=t&&(e<48||e>57);t&&(I[e]|=M|N|F),n&&(I[e]|=P)}for(let e of`-*`)I[e.charCodeAt(0)]|=M|N|F;I[46]|=M|F,I[42]|=P;for(let e of`[](),`)I[e.charCodeAt(0)]|=F;var L=/accTitle\s*:\s*/iy,R=/accDescr\s*:\s*/iy,z=/accDescr\s*\{\s*/iy,se=[/.*direction\s+TB[^\n]*/iy,/.*direction\s+BT[^\n]*/iy,/.*direction\s+RL[^\n]*/iy,/.*direction\s+LR[^\n]*/iy],B=/direction/gi,V=/[\n\r\u2028\u2029]/g;function H(e,t){return e<128?(I[e]&t)!==0:e>=192||e===181}function U(e){let t=e.length,n=[],r=[],i=[],a=0,o=0,s=-2,c=0,l=-1,u=-2,d=-1,f=-1,p=-1,m=(t,a,s)=>{n.push(t),r.push(e.slice(a,s)),i.push(a),o=s},h=(t,n)=>(t.lastIndex=n,t.test(e)?t.lastIndex:-1),g=t=>{for(let n=0;n<t.length;n++){let r=t.charCodeAt(n),i=e.charCodeAt(o+n);if(i!==r&&(r<97||r>122||(i|32)!==r))return!1}return!0},_=t=>g(t)&&!E(e.charCodeAt(o+t.length)),v=t=>{let n=e.charCodeAt(t);return n>=65&&n<=90?n+32:n},y=n=>(V.lastIndex=n,V.test(e)?V.lastIndex-1:t),b=t=>{for(;k(e.charCodeAt(t));)t++;return t},x=()=>{if(s===-1||s<o&&(B.lastIndex=o,s=B.test(e)?B.lastIndex-9:-1,s===-1)||o<c||(l<o&&(l=y(o)),s>=l))return!1;for(let e=0;e<4;e++){let t=h(se[e],o);if(t>=0)return m(18+e,o,t),!0}return c=l,!1},S=()=>{let t=e.indexOf(`"`,o+1);if(t===-1){m(45,o,o+1);return}let n=t>o+1;for(let r=o+1;n&&r<t;r++){let t=e.charCodeAt(r);(t===37||t===92||t===13||t===10||t===11||t===8)&&(n=!1)}m(n?31:44,o,t+1)},C=t=>{let n=e.charCodeAt(o+1);if(n===43&&(t===49||t===48)){m(t===49?39:38,o,o+2);return}let r=b(o+1);if(e.charCodeAt(r)===46&&k(e.charCodeAt(r+1)))m(32,o,b(r+2));else{if(t===49){if(D(n)){let t=o+2;for(;D(e.charCodeAt(t));)t++;let n=e.charCodeAt(t);if(E(n)||n===34||n===39){m(40,o,o+1);return}}else if(n===45||n===46){let t=e.charCodeAt(o+2);if(t===45||t===46){m(40,o,o+1);return}}if(!E(n)){m(33,o,o+1);return}}m(29,o,r)}},w=t=>{let n=e.charCodeAt(o+1);switch(t){case 101:if(_(`erdiagram`))m(2,o,o+9);else if(_(`end`)){let t=o+3;for(;D(e.charCodeAt(t));)t++;m(16,o,t)}else return!1;return!0;case 115:if(_(`style`))a=6,m(27,o,o+5);else if(_(`subgraph`))m(17,o,o+8);else return!1;return!0;case 99:if(_(`classdef`))a=6,m(22,o,o+8);else if(_(`class`))m(26,o,o+5);else return!1;return!0;case 111:if(_(`one or zero`))m(37,o,o+11);else if(_(`one or more`)||_(`one or many`))m(39,o,o+11);else if(_(`one`))m(40,o,o+3);else if(_(`only one`))m(40,o,o+8);else if(n===124)m(37,o,o+2);else if(n===123)m(38,o,o+2);else if(_(`optionally to`))m(42,o,o+13);else return!1;return!0;case 122:if(_(`zero or one`))m(37,o,o+11);else if(_(`zero or more`)||_(`zero or many`))m(38,o,o+12);else return!1;return!0;case 109:if(g(`many(0)`))m(38,o,o+7);else if(g(`many(1)`))m(39,o,o+7);else if(_(`many`))m(38,o,o+4);else return!1;return!0;case 116:return _(`to`)?(m(43,o,o+2),!0):!1;case 117:return n!==46&&n!==45&&n!==124?!1:(m(41,o,o+1),!0);case 124:if(v(o+1)===111&&!E(e.charCodeAt(o+2)))m(37,o,o+2);else if(n===124)m(40,o,o+2);else if(n===123)m(39,o,o+2);else return!1;return!0;case 125:if(v(o+1)===111&&!E(e.charCodeAt(o+2)))m(38,o,o+2);else if(n===124)m(39,o,o+2);else return!1;return!0;case 46:return n!==46&&n!==45?!1:(m(42,o,o+2),!0);case 45:if(n===45)m(43,o,o+2);else if(n===46)m(42,o,o+2);else return!1;return!0}return!1},ee=t=>{let n;if((t===97||t===65)&&g(`acc`)){if((n=h(L,o))>=0){a=3,m(11,o,n);return}if((n=h(R,o))>=0){a=4,m(13,o,n);return}if((n=h(z,o))>=0){a=5,o=n;return}}if(!x()){switch(t){case 32:case 9:case 13:n=o+1;for(let t=e.charCodeAt(n);t===32||t===9||t===13;t=e.charCodeAt(n))n++;o=n;return;case 10:for(n=o+1;e.charCodeAt(n)===10;)n++;m(4,o,n);return;case 34:S();return;case 123:a=1,m(7,o,o+1);return;case 35:m(30,o,o+1);return;case 44:m(25,o,o+1);return;case 58:e.charCodeAt(o+1)===58&&e.charCodeAt(o+2)===58?m(6,o,o+3):m(5,o,o+1);return;case 91:m(9,o,o+1);return;case 93:m(10,o,o+1);return}if(k(t)){C(t);return}if(!w(t>=65&&t<=90?t+32:t)){if(t>=128||(I[t]&M)!==0){n=o+1;for(let t=e.charCodeAt(n);t>=128||(I[t]&M)!==0;t=e.charCodeAt(n))n++;m(23,o,n);return}m(45,o,o+1)}}},te=()=>{if(u===-1||u<o&&(u=e.indexOf(`~`,o),u===-1))return!1;if(p<o){let n=o;for(;n<t&&!D(e.charCodeAt(n));)n++;p=n}if(u>=p||(d<o&&(d=y(o),f=e.lastIndexOf(`~`,d-1)),f<=u))return!1;let n=f+1;for(;n<t&&!D(e.charCodeAt(n));)n++;return m(34,o,n),!0},ne=n=>{if(D(n)){for(o++;D(e.charCodeAt(o));)o++;return}let r=n|32;if((r===112||r===102||r===117)&&(e.charCodeAt(o+1)|32)==107&&!E(e.charCodeAt(o+2)))m(35,o,o+2);else if(!te()){if(H(n,P)){let n=o+1;for(;n<t&&H(e.charCodeAt(n),F);)n++;m(34,o,n);return}if(n===96){a=2,o++;return}if(n===34){let t=e.indexOf(`"`,o+1);if(t!==-1){m(36,o,t+1);return}}else if(n===125){a=0,m(8,o,o+1);return}m(45,o,o+1)}};for(;o<t;){let s=e.charCodeAt(o),c;switch(a){case 0:ee(s);break;case 1:ne(s);break;case 2:s===96?(a=1,o++):(c=e.indexOf("`",o),m(34,o,c===-1?t:c));break;case 3:case 4:c=e.indexOf(`
3
3
  `,o),m(a===3?12:14,o,c===-1?t:c),a=0;break;case 5:s===125?(a=0,o++):(c=e.indexOf(`}`,o),m(15,o,c===-1?t:c));break;case 6:if(s===10){for(c=o+1;e.charCodeAt(c)===10;)c++;a=0,m(4,o,c)}else if(D(s))for(o++;D(e.charCodeAt(o));)o++;else if(s===58)m(5,o,o+1);else if(s===44)m(25,o,o+1);else if(s===35)m(30,o,o+1);else if(s===59)m(28,o,o+1);else if(s>=128||(I[s]&N)!==0){c=o+1;for(let t=e.charCodeAt(c);t>=128||(I[t]&N)!==0;t=e.charCodeAt(c))c++;m(24,o,c)}else return n.push(1),r.push(``),i.push(o),{types:n,texts:r,starts:i}}}let T=a===0?3:a===3?12:a===4?14:a===5?15:-1;return T!==-1&&(n.push(T),r.push(``),i.push(t)),n.push(0),r.push(``),i.push(t),{types:n,texts:r,starts:i}}var W=new Map([[37,`ZERO_OR_ONE`],[38,`ZERO_OR_MORE`],[39,`ONE_OR_MORE`],[40,`ONLY_ONE`],[41,`MD_PARENT`]]),ce=[`TB`,`BT`,`RL`,`LR`],G=`'UNICODE_TEXT', 'NUM', 'ENTITY_NAME', 'DECIMAL_NUM', 'ENTITY_ONE'`,le=`'ZERO_OR_ONE', 'ZERO_OR_MORE', 'ONE_OR_MORE', 'ONLY_ONE', 'MD_PARENT'`,K=`'EOF', 'NEWLINE', 'title', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'SUBGRAPH', 'direction_tb', 'direction_bt', 'direction_rl', 'direction_lr', 'CLASSDEF', 'CLASS', 'STYLE', `+G;function q(e,t){let{types:n,texts:r,starts:i}=U(e),a=0,o=t=>{let o=n[a];throw o===1?O(`er`,e,i[a],``,!0):O(`er`,e,i[a],`Expecting ${t}, got '${o===45?r[a]:j[o]}'`)},s=e=>(n[a]!==e&&o(`'${j[e]}'`),r[a++]),c=()=>{let e=n[a];e!==4&&e!==28&&e!==3&&o(`'EOF', 'NEWLINE', 'SEMI'`),a++},l=e=>e===23||e===31||e===29||e===32||e===33,u=()=>{let e=n[a];l(e)||o(G);let t=r[a++];return e===31?t.slice(1,-1):t},d=()=>{let e=[];for(;;){let t=n[a];if(t!==23&&t!==24&&o(`'UNICODE_TEXT', 'STYLE_TEXT'`),e.push(r[a++]),n[a]!==25)return e;a++}},f=e=>e===24||e===29||e===5||e===30,p=()=>{let e=[];for(;;){f(n[a])||o(`'STYLE_TEXT', 'COLON', 'NUM', 'BRKT'`);let t=r[a++];for(;f(n[a]);)t+=r[a++];if(e.push(t),n[a]!==25)return e;a++}},m=()=>{let e=W.get(n[a++]),t=n[a];t!==43&&t!==42&&o(`'NON_IDENTIFYING', 'IDENTIFYING'`);let r=t===43?`IDENTIFYING`:`NON_IDENTIFYING`;a++;let i=W.get(n[a]);return i===void 0?o(le):(a++,{cardA:i,relType:r,cardB:e})},h=()=>{let e=n[a];e!==44&&e!==31&&e!==23&&o(`'UNICODE_TEXT', 'ENTITY_NAME', 'WORD'`);let t=r[a++];return e===23?t:t.slice(1,-1)},g=e=>n[a]===45&&r[a]===e,_=()=>{let e=[];do{let t=s(34);g(`?`)&&(t+=r[a++]),n[a]!==34&&o(t.endsWith(`?`)?`'ATTRIBUTE_WORD'`:`'ATTRIBUTE_WORD', '?'`);let i={type:t,name:r[a++]};if(n[a]===35){let e=[r[a++]];for(;g(`,`);)a++,e.push(s(35));i.keys=e}n[a]===36&&(i.comment=r[a++].slice(1,-1)),e.push(i)}while(n[a]!==8);return e.reverse()},v=()=>{if(n[a]!==7)return;if(a++,n[a]===8){a++;return}let e=_();return a++,e},y=()=>{let e=u(),r=n[a];if(r===9){a++;let r=u();s(10);let i;n[a]===6&&(a++,i=d());let o=v();return t.addEntity(e,r),o&&t.addAttributes(e,o),i&&t.setClass([e],i),[e]}let i;if(r===6&&(a++,i=d(),r=n[a]),W.has(r)){let r=m(),o=u(),c;n[a]===6&&(a++,c=d()),s(5);let l=h();return t.addEntity(e),t.addEntity(o),t.addRelationship(e,l,o,r),i&&t.setClass([e],i),c&&t.setClass([o],c),[e,o]}let o=v();return t.addEntity(e),o&&t.addAttributes(e,o),i&&t.setClass([e],i),[e]};s(2);let b=[{id:``,title:``,list:[]}],x=b[0],S=!1;for(;;){let e=n[a];switch(e){case 4:a++;break;case 3:a++,S&&o(`'END', ${K}`);return;case 16:{S||o(K),a++;let e=t.addSubGraph({text:x.id},x.list,{text:x.title});b.pop(),x=b[b.length-1],S=b.length>1,S&&x.list.push(e);break}case 17:{a++;let e=u(),t=e;if(n[a]===9){for(a++,t=u();l(n[a]);)t+=` `+u();s(10)}c(),x={id:e,title:t,list:[]},b.push(x),S=!0;break}case 11:{a++;let e=s(12).trim();t.setAccTitle(e),S&&x.list.push(e);break}case 13:{a++;let e=s(14).trim();t.setAccDescription(e),S&&x.list.push(e);break}case 15:{let e=r[a++].trim();t.setAccDescription(e),S&&x.list.push(e);break}case 18:case 19:case 20:case 21:{a++;let n=ce[e-18];S?x.list.push({stmt:`dir`,value:n}):t.setDirection(n);break}case 22:{let e=r[a++],n=d(),i=p();c(),t.addClass(n,i),S&&x.list.push(e);break}case 26:{let e=r[a++],n=d();t.setClass(n,d()),S&&x.list.push(e);break}case 27:{let e=r[a++],n=d(),i=p();c(),t.addCssStyles(n,i),S&&x.list.push(e);break}default:{l(e)||o(S?`'END', ${K}`:K);let t=y();if(S)for(let e of t)x.list.push(e)}}}}var ue=[];function de(e){let t=[],n=[],r=e.subgraphs,i=t=>{let n=[];for(let r of t){let t=e.classes.get(r);if(t!==void 0){for(let e of t.styles)n.push(e.trim());for(let e of t.textStyles)n.push(e.trim())}}return n},a=new Map,o=new Set;for(let e=r.length-1;e>=0;e--){let t=r[e];o.add(t.id);for(let e of t.nodes)a.set(e,t.id)}for(let e=r.length-1;e>=0;e--){let n=r[e];t.push({id:n.id,label:n.title,alias:``,attributes:ue,isGroup:!0,parentId:a.get(n.id),cssStyles:n.cssStyles,cssCompiledStyles:i(n.classes),cssClasses:n.classes.join(` `),dir:n.dir,labelType:n.labelType})}let s=new Map;for(let[n,r]of e.entities)o.has(n)?s.set(r.id,n):t.push({id:r.id,label:r.label,alias:r.alias,attributes:r.attributes,isGroup:!1,parentId:a.get(n),cssStyles:r.cssStyles,cssCompiledStyles:i(r.cssClasses.split(` `)),cssClasses:r.cssClasses,dir:void 0,labelType:`markdown`});return e.relationships.forEach((e,t)=>{n.push({id:`id_${e.entityA}_${e.entityB}_${t}`,start:s.get(e.entityA)??e.entityA,end:s.get(e.entityB)??e.entityB,label:e.roleA,arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:e.relSpec.relType===`IDENTIFYING`?`solid`:`dashed`})}),{nodes:t,edges:n}}var J=18,fe=5,pe=6,me=10,he=3.5;function Y(e,t,n,r,i){let a=(e,a)=>m(t-r*e-i*a)+`,`+m(n-i*e+r*a),o=e=>`M${a(e,-fe)}L${a(e,fe)}`,s=`M${a(0,-pe)}L${a(me,0)}L${a(0,pe)}`,c=e=>`<circle class="pele-marker" cx="${m(t-r*e)}" cy="${m(n-i*e)}" r="${he}" fill="var(--_bg)"/>`,l=e=>`<path class="pele-marker" d="${e}"/>`;switch(e){case`only_one`:return l(o(6)+o(10));case`zero_or_one`:return l(o(6))+c(13.5);case`one_or_more`:return l(s+o(me+3.5));case`zero_or_more`:return l(s)+c(me+he+.5);case`md_parent`:return`<path class="pele-marker" d="M${a(0,0)}L${a(6,4)}L${a(12,0)}L${a(6,-4)}Z" fill="var(--_bg)"/>`}return``}var ge=48,_e=20,ve=64,X=20,Z=28,ye=38,be=96,xe=18,Se=12,Ce=9,we=12,Te=16,Ee=9,De=260,Oe=1e6,ke=[],Ae=18,je=14,Me=` fill="var(--_s)" stroke="var(--_b)"`;function Ne(e,t,n){let r=e.er?.[t];return typeof r==`number`&&r>0?Math.min(r,2e3):n}function Q(e,n,i,l,u){let f=e.lines;if(f.length===0)return``;let g=f.length===1&&f[0].length===1?f[0][0]:void 0;if(g&&g.icon===void 0&&g.math===void 0&&g.style===0)return`<text${l} x="${m(n)}" y="${m(i)}">${t(g.text)}</text>`;let _=r(e),v=e.size*.35,y=i-v-e.lineHeight/2,b=``,x=``;for(let r=0;r<f.length;r++){let d=f[r],g=y+c(e,r);if(p(d)){x+=s(h(e,r),n+e.widths[r]/2,g,l,u);continue}i=g+v;let S=!1;for(let e of d)e.icon!==void 0&&(S=!0);let C=n,w=!1;for(let n of d){if(n.icon!==void 0){let t=e.size*1.1;x+=`<svg class="pele-icon" data-icon="${a(n.icon)}" x="${m(C)}" y="${m(i-e.size*.35-t/2)}" width="${m(t)}" height="${m(t)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${u?.(n.icon)??``}</svg>`}else if(n.text!==``){let e=S||!w?` x="${m(C)}" y="${m(i)}"`:``;b+=`<tspan${e}${o(n.style&~_)}>${t(n.text)}</tspan>`,w=!0}C+=n.width}}return`<text${d(l,_)} xml:space="preserve">${b}</text>${x}`}function $(e){let t=C(e);return t===e?e:t.replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Pe(e,t,n){return g(e.direction)?_(n,r=>Fe(e,t,n,r)):Fe(e,t,n,!1)}function Fe(r,o,c,d){let p=de(r),h=c.fontSize??16,g=Math.round(h*.875),_=c.measurer??ae(c.fontFamily,c.fontFamilyMono),C=c.padding??8,E=c.icons,D=new Map,O=[],k=[];p.nodes.forEach((e,t)=>D.set(e.id,t));let A=[],oe=[],j=[],M=new Map,N=[];for(let e of p.edges){let t=D.get(e.start),n=D.get(e.end);if(t===void 0||n===void 0)continue;let r=f(e.label,!0,_,g,200),i;if(t===n){i={label:r,band:0,at:0};let e=M.get(t);e?e.push(i):M.set(t,[i])}N.push(i),j.push(e),oe.push(r),A.push({src:t,dst:n,minlen:1,labelW:r.width>0?r.width+12:0,labelH:r.height>0?r.height+4:0,route:[],labelX:0,labelY:0})}let P=e=>{let t=e;for(let e=0;e<p.nodes.length;e++){let e=p.nodes[t].parentId,n=e===void 0?void 0:D.get(e);if(n===void 0)break;let r=p.nodes[n].dir;if(r)return r===`LR`||r===`RL`;t=n}return r.direction===`LR`||r.direction===`RL`};for(let e=0;e<p.nodes.length;e++){let t=p.nodes[e],n=u(t.cssStyles.length>0?t.cssCompiledStyles.concat(t.cssStyles):t.cssCompiledStyles),r=+!!n.bold|(n.italic?2:0),i=n.fontSize??h,a=n.fontSize??g,o=n.fontSize??Math.round(h*.75),s=t.isGroup?f(t.label,!0,_,i,4e3,r):f(t.alias||t.label,!0,_,i,240,r),c=M.get(e)??ke,l=c.length>0&&!t.isGroup&&P(e),d={node:t,style:n,label:s,w:0,h:0,headH:0,rows:[],cols:[],rowSize:a,keySize:o,below:l},m=0,v=0;for(let e of c)e.band=Math.max(ye,l?e.label.width+12:e.label.height+6),v+=e.band,m=Math.max(m,l?e.label.height:e.label.width);let y=Math.max(be,l?v+8:0),b;if(t.isGroup)b=re(0,0),b.isGroup=!0,b.dir=t.dir?T(t.dir):void 0,b.padX=X,b.padTop=d.label.height>0?d.label.height+16:X,b.padBottom=X,b.minW=Math.max(d.label.width+2*X-12,be);else{let e=Math.max(s.height,Math.round(i*1.5));if(t.attributes.length===0)d.w=Math.max(s.width+2*xe,y),d.h=Math.max(e+2*Se,l?0:v+8);else{let n=Math.round(a*1.5),i=[0,0,0,0];for(let e of t.attributes){let t=[f($(e.type),!0,_,a,Oe,r),f($(e.name),!0,_,a,Oe,r),f(e.keys.join(`, `),!1,_,o,Oe,r),f($(e.comment),!0,_,a,De,r)],s=n;for(let e=0;e<4;e++)t[e].width>i[e]&&(i[e]=t[e].width),t[e].height>s&&(s=t[e].height);d.rows.push({cells:t,h:s+Ee}),d.h+=s+Ee}let c=0,l=0;for(let e of i)e!==0&&(l+=e+(c>0?Te:0),c++);d.w=Math.max(l+2*we,s.width+2*xe,y);let u=c>0?(d.w-l-2*we)/c:0,p=we;for(let e of i)d.cols.push(p),e>0&&(p+=e+u+Te);d.headH=e+2*Ce,d.h+=d.headH}let n=c.length>0?2*(J+Z*.75+10+m):0;b=l?re(d.w,d.h+n):re(d.w+n,d.h)}b.seq=O.length,O.push(d),k.push(b)}p.nodes.forEach((e,t)=>{k[t].parent=e.parentId===void 0?-1:D.get(e.parentId)??-1});let F=te(k,A,d?`TB`:T(r.direction),{nodeSep:Ne(o,`nodeSpacing`,ge),edgeSep:_e,rankSep:Ne(o,`rankSpacing`,ve),portSep:24});Le(A,k,O);let I=F.width;for(let[e,t]of M){let n=k[e];if(!n.isGroup)continue;let r=0;for(let e of t)r=Math.max(r,e.label.width);I=Math.max(I,n.x+n.w/2+J+Z*.75+10+r)}let L=b(r.title,_,h,4e3),R=L.height>0?L.height+12:0,z=Math.max(I,L.width),se=C+(z-I)/2,B=C+R;ne(k,A,se,B);let V=Math.ceil(z+2*C),H=Math.ceil(F.height+R+2*C),U=[],W=new Map,ce=!1;for(let e of k)e.isGroup&&(ce=!0);if(ce)for(let e of A)ee(W,e.route);let G=``,le=``;for(let e=0;e<O.length;e++){let r=O[e],o=k[e],u=r.node,d=n(u.cssClasses.replace(/^default\s?/,``));if(o.isGroup){r.w=o.w,r.h=o.h;let e=o.x-o.w/2,t=o.y-o.h/2,n=w(o,r.label.width,W,X);G+=`<g class="pele-cluster${d}" data-id="${a(u.id)}"><rect x="${m(e)}" y="${m(t)}" width="${m(o.w)}" height="${m(o.h)}" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"${i(r.style.shape)}/>`+s(r.label,n,t+8+r.label.height/2,` class="pele-cluster-label" fill="var(--_m)"${r.style.text}`,E)+`</g>`;continue}let f=r.w,p=r.h,h=-f/2,g=-p/2,_=r.style.text,v=`x="${m(h)}" y="${m(g)}" width="${m(f)}" height="${m(p)}"`,y=s(r.label,0,r.rows.length>0?g+r.headH/2:0,` class="pele-label"${_}`,E),b=ie(u.alias||u.label);if(/ internal-link(?: |$)/.test(d+` `)&&y!==``&&c.links!==!1){let e=x(b,c),n=t(b);y=`<a class="internal-link"${e?` href="${n}"${S(c)}`:``} data-href="${n}">${y}</a>`,U.push({id:u.label,href:b,internal:!0})}let C;if(r.rows.length===0)C=`<rect ${v}${i(Me+r.style.shape)}/>`+y;else{let e=Math.round(r.rowSize*1.5),n=r.style.stroke?t(r.style.stroke):`var(--_b)`,a=``,o=``,s=g+r.headH;for(let t=0;t<r.rows.length;t++){let n=r.rows[t];if(t%2==0){let e=`x="${m(h)}" width="${m(f)}"`;t===r.rows.length-1?a+=`<rect ${e} y="${m(s)}" height="${m(n.h)}"${l}/><rect ${e} y="${m(s)}" height="${m(n.h/2)}"/>`:a+=`<rect ${e} y="${m(s)}" height="${m(n.h)}"/>`}let i=s+Ee/2+e/2+r.rowSize*.35,[c,u,d,p]=n.cells;o+=Q(c,h+r.cols[0],i,` class="pele-er-type" fill="var(--_m)"${_}`,E)+Q(u,h+r.cols[1],i,` class="pele-er-name"${_}`,E)+Q(d,h+r.cols[2],i,` class="pele-er-keys" font-size="${r.keySize}" fill="var(--_m)"${_}`,E)+Q(p,h+r.cols[3],i,` class="pele-er-comment" fill="var(--_m)"${_}`,E),s+=n.h}let c=m(g+r.headH);C=`<rect ${v}${i(Me+r.style.shape)}/><g class="pele-er-stripes" fill="var(--_bg)"${r.style.shape.includes(`fill:`)?` opacity="0.6"`:``}>${a}</g><path class="pele-er-divider" d="M${m(h)},${c}H${m(h+f)}" stroke="${n}"/><rect ${v} fill="none" stroke="var(--_b)"${i(r.style.line)}/>`+y+`<g class="pele-er-attributes" font-size="${r.rowSize}">${o}</g>`}le+=`<g class="pele-node pele-entity${d}" data-id="${a(u.label)}" transform="translate(${m(o.x)},${m(o.y)})">${C}</g>`}for(let[e,t]of M){let n=O[e],r=0;for(let e of t)r+=e.band;let i=Math.min(1,Math.max((n.below?n.w:n.h)-8,0)/r),a=-r*i/2;for(let e of t)e.band*=i,e.at=a+e.band/2,a+=e.band}let K=``,q=``;for(let e=0;e<A.length;e++){let t=A[e],n=j[e],r=oe[e],i,o,s,c=N[e];if(c){let e=k[t.src],a=O[t.src],l=Math.max(Math.min(c.band/2-6,13),1),u=J+Z*.75+6;if(a.below){let d=e.x+c.at,f=e.y+a.h/2,p=m(f+J),h=m(f+J+Z);i=`M${m(d-l)},${m(f)}V${p}C${m(d-l)},${h} ${m(d+l)},${h} ${m(d+l)},${p}V${m(f)}`,o=Y(n.arrowTypeStart,d-l,f,0,-1),s=Y(n.arrowTypeEnd,d+l,f,0,-1),t.labelX=d,t.labelY=f+u+r.height/2}else{let d=e.x+a.w/2,f=e.y+c.at,p=m(d+J),h=m(d+J+Z);i=`M${m(d)},${m(f-l)}H${p}C${h},${m(f-l)} ${h},${m(f+l)} ${p},${m(f+l)}H${m(d)}`,o=Y(n.arrowTypeStart,d,f-l,-1,0),s=Y(n.arrowTypeEnd,d,f+l,-1,0),t.labelX=d+u+r.width/2,t.labelY=f}}else{let e=Ie(t.route);if(e.length<6)continue;Re(e,0,O[t.src],k[t.src]),Re(e,e.length-3,O[t.dst],k[t.dst]);let r=Math.abs(e[e.length-3]-e[0]),a=Math.abs(e[e.length-2]-e[1]),c=e.length===6&&(r<.01||a<.01||Math.hypot(r,a)<=3*J)?0:J,l=y(e,void 0,c,c);i=c>0?`M${m(l.sx)},${m(l.sy)}L${l.d.slice(1)}L${m(l.ex)},${m(l.ey)}`:l.d,o=Y(n.arrowTypeStart,l.sx,l.sy,l.sdx,l.sdy),s=Y(n.arrowTypeEnd,l.ex,l.ey,l.edx,l.edy)}let l=n.pattern===`dashed`;if(K+=`<g class="pele-edge pele-er-${l?`non-identifying`:`identifying`}" data-id="${a(n.id)}"><path d="${i}"${l?` stroke-dasharray="4 3"`:``}/>`+o+s+`</g>`,r.width>0){let e=t.labelX,i=t.labelY;q+=v(n.id,r,e,i,``,E)}}return{svg:e(`er`,V,H,h,c,r,s(L,V/2,C+L.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(G?`<g class="pele-clusters">${G}</g>`:``)+(K?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${K}</g>`:``)+(q?`<g class="pele-edge-labels" font-size="${g}">${q}</g>`:``)+`<g class="pele-nodes">${le}</g>`),width:V,height:H,links:U}}function Ie(e){let t=e.slice(0,3);for(let n=3;n<e.length;n+=3){let r=t.length-3,i=i=>Math.abs(t[r+i]-e[n+i])<.01&&Math.abs(e[n+i]-e[n+3+i])<.01;n+3<e.length&&(i(0)||i(1))||t.push(e[n],e[n+1],e[n+2])}return t}function Le(e,t,n){let r=new Map,i=(e,n,i,a)=>{let o=t[e],s=n[i]-o.x,c=n[i+1]-o.y,l;if(Math.abs(Math.abs(c)-o.h/2)<.5)l=c<0?0:2;else if(Math.abs(Math.abs(s)-o.w/2)<.5)l=s<0?3:1;else return;let u=e*4+l,d={route:n,at:i,toward:n[a+(l&1?1:0)]},f=r.get(u);f?f.push(d):r.set(u,[d])};for(let t of e){let e=t.route.length-3;t.src===t.dst||e<3||(i(t.src,t.route,0,3),i(t.dst,t.route,e,e-3))}for(let[e,i]of r){if(i.length<2)continue;let r=e>>2,a=(e&1)==1,o=t[r].isGroup?t[r]:n[r],s=a?o.h:o.w,c=Math.max(Math.min(Ae,(s-2*je)/(i.length-1)),0),l=a?t[r].y:t[r].x;i.sort((e,t)=>e.toward-t.toward);for(let e=0;e<i.length;e++)i[e].route[i[e].at+ +!!a]=l+(e-(i.length-1)/2)*c}}function Re(e,t,n,r){if(r.isGroup)return;let i=e[t]-r.x,a=e[t+1]-r.y;r.w!==n.w&&Math.abs(Math.abs(i)-r.w/2)<.5&&(e[t]-=Math.sign(i)*(r.w-n.w)/2),r.h!==n.h&&Math.abs(Math.abs(a)-r.h/2)<.5&&(e[t+1]-=Math.sign(a)*(r.h-n.h)/2)}var ze={type:`er`,math:!0,parse(e,t,n){let r=new oe;return n&&(r.title=n),q(e,r),r},render:Pe};export{ze as er};
@@ -1,2 +1,2 @@
1
- import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./DS7XcdHs.js";import{n as o,r as s}from"./DciMwFJ1.js";import{a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./Dzu8v7nB.js";import{PeleError as w,u as T}from"./BNlziJ_1.js";var E=32;function D(e){return new w(e,`semantic`,{type:`radar`})}function O(e,t){let n=e.axes.map(e=>({name:e.name,label:e.label??e.name})),r=e.curves.map(e=>{let t;if(e.entries[0].axis===void 0)t=e.entries.map(e=>e.value);else{if(n.length===0)throw D(`Axes must be populated before curves for reference entries`);let r=new Map;for(let t of e.entries)t.axis!==void 0&&!r.has(t.axis.$refText)&&r.set(t.axis.$refText,t.value);t=n.map(e=>{let t=r.get(e.name);if(t===void 0)throw D(`Missing entry for axis `+e.label);return t})}return{name:e.name,label:e.label??e.name,entries:t}}),i={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`};for(let t of e.options)t.name===`showLegend`?i.showLegend=t.value:t.name===`graticule`?i.graticule=t.value:i[t.name]=t.value;return i.ticks>E&&(i.ticks=E),{type:`radar`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
1
+ import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./DlgOmQ_G.js";import{n as o,r as s}from"./DciMwFJ1.js";import{a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./jAC4YCqW.js";import{PeleError as w,u as T}from"./BArcFmbE.js";var E=32;function D(e){return new w(e,`semantic`,{type:`radar`})}function O(e,t){let n=e.axes.map(e=>({name:e.name,label:e.label??e.name})),r=e.curves.map(e=>{let t;if(e.entries[0].axis===void 0)t=e.entries.map(e=>e.value);else{if(n.length===0)throw D(`Axes must be populated before curves for reference entries`);let r=new Map;for(let t of e.entries)t.axis!==void 0&&!r.has(t.axis.$refText)&&r.set(t.axis.$refText,t.value);t=n.map(e=>{let t=r.get(e.name);if(t===void 0)throw D(`Missing entry for axis `+e.label);return t})}return{name:e.name,label:e.label??e.name,entries:t}}),i={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`};for(let t of e.options)t.name===`showLegend`?i.showLegend=t.value:t.name===`graticule`?i.graticule=t.value:i[t.name]=t.value;return i.ticks>E&&(i.ticks=E),{type:`radar`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
2
2
  `):void 0,axes:n,curves:r,options:i}}var k=0,A=0;function j(e,t){let n=t;for(let t=e.charCodeAt(n);t>=48&&t<=57;t=e.charCodeAt(n))n++;return n}function M(e,t){(t<k||t>=A)&&(k=t,A=j(e,t));let n=A;if(n===t)return-1;let r=e.charCodeAt(n)===46;if(r){let t=j(e,n+1),r=t-n-1;if(r>0&&e.charCodeAt(t)!==46)return t;if(r>1)return t-1}return e.charCodeAt(t)===48?t+1:r?n-1>t?n-1:-1:n}var N=c.pattern,P=/[\t ]*accDescr\s*{/y,F=-2;function I(e,t){return P.lastIndex=t,P.test(e)&&(F===-2&&(F=e.lastIndexOf(`}`)),P.lastIndex>F)?-1:(N.lastIndex=t,N.test(e)?N.lastIndex:-1)}var L={name:`ID`,pattern:/[\w]([-\w]*\w)?/y},R=e=>({name:e,pattern:e,longer:[L]}),z=e=>({name:e,pattern:e}),B=[z(`radar-beta:`),{...m(`radar-beta`),longer:[L]},R(`showLegend`),R(`graticule`),R(`curve`),R(`ticks`),R(`axis`),R(`max`),R(`min`),z(`:`),z(`,`),z(`[`),z(`]`),z(`{`),z(`}`),{name:`GRATICULE`,pattern:/circle|polygon/y},{name:`BOOLEAN`,pattern:/true|false/y},{...c,match:I},S,y,{name:`NUMBER`,pattern:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/y,match:M},g,L,h,C,b,v,x];function V(e){return k=A=0,F=-2,_(e,B,`radar`)}function H(e){let t=new p(V(e),B,`radar`),n={$type:`Radar`,axes:[],curves:[],options:[]},r=()=>{for(;t.kind===23;)t.i++},i=()=>{t.kind!==-1&&(t.kind!==23&&t.fail(`a line break or the end of input`),r())},a=()=>{if(!t.accept(11))return;let e=d(t.expect(21));return t.expect(12),e},o=e=>{if(!e)return{$type:`Entry`,value:Number(t.expect(20))};let n={$refText:t.expect(22)};return t.accept(9),{$type:`Entry`,axis:n,value:Number(t.expect(20))}},s=()=>{let e=t.expect(22),n=a(),i={$type:`Curve`,name:e,entries:[]};n!==void 0&&(i.label=n),t.expect(13),r(),t.kind!==20&&t.kind!==22&&t.fail(`a number or an axis name`);let s=t.kind===22;for(i.entries.push(o(s));t.accept(10);)r(),i.entries.push(o(s));return r(),t.expect(14),i},c=()=>{let e={$type:`Axis`,name:t.expect(22)},n=a();return n!==void 0&&(e.label=n),e},m=()=>{let e=t.kind,n=t.take(),r;return r=e===2?t.expect(16)===`true`:e===3?t.expect(15):Number(t.expect(20)),{$type:`Option`,name:n,value:r}},h=()=>t.kind===2||t.kind===5||t.kind===7||t.kind===8||t.kind===3;for(r(),t.accept(0)||(t.expect(1),t.accept(9)),r();t.kind!==-1;)switch(t.kind){case 23:t.i++;break;case 17:n.accDescr=l(t.take()),i();break;case 18:n.accTitle=f(t.take()),i();break;case 19:n.title=u(t.take()),i();break;case 6:t.i++;do n.axes.push(c());while(t.accept(10));break;case 4:t.i++;do n.curves.push(s());while(t.accept(10));break;default:for(h()||t.fail(`an axis, a curve, an option, a title, or a line break`),n.options.push(m());t.accept(10);)h()||t.fail(`an option`),n.options.push(m())}return n}var U=12,W=26,G=24;function K(e,t,n,r,i){let a=e.radar?.[t];return typeof a==`number`&&a>=r?Math.min(a,i):n}function ee(e,t,n,r){let i=Math.min(Math.max(e,t),n),a=r*(i-t);return Number.isFinite(a)?a/(n-t):r*((i-t)/(n-t))}function te(e,t){let n=e.length,r=`M${a(e[0].x)},${a(e[0].y)}`;for(let i=0;i<n;i++){let o=e[(i-1+n)%n],s=e[i],c=e[(i+1)%n],l=e[(i+2)%n];r+=` C${a(s.x+(c.x-o.x)*t)},${a(s.y+(c.y-o.y)*t)} ${a(c.x-(l.x-s.x)*t)},${a(c.y-(l.y-s.y)*t)} ${a(c.x)},${a(c.y)}`}return r+` Z`}function q(e){let t=``;for(let n of e)t+=(t?` `:``)+a(n.x)+`,`+a(n.y);return t}function J(e,t,n){let r=K(t,`width`,320,1,4e3);return o(n,r,160,(i,a)=>Y(e,t,n,i,K(t,`height`,320,1,4e3)*i/r,a))}function Y(o,c,l,u,d,f){let p=l.fontSize??16,m=Math.round(p*.875),h=l.measurer??T(l.fontFamily,l.fontFamilyMono),g=l.padding??8,_=K(c,`axisScaleFactor`,1,0,10),v=K(c,`axisLabelFactor`,1.05,0,10),y=K(c,`curveTension`,.17,0,1),b=Math.min(u,d)/2,{axes:x,curves:S}=o,{ticks:C,graticule:w,min:E}=o.options,D=x.length,O=x.map((e,t)=>{let n=2*Math.PI*t/D-Math.PI/2;return{x:Math.cos(n),y:Math.sin(n)}}),k=o.options.max;if(k===null){k=-1/0;for(let e of S)for(let t of e.entries)t>k&&(k=t)}let A=-u/2-K(c,`marginLeft`,16,0,2e3),j=u/2+K(c,`marginRight`,16,0,2e3),M=-d/2-K(c,`marginTop`,16,0,2e3),N=d/2+K(c,`marginBottom`,16,0,2e3),P=``;for(let e=0;e<C;e++){let t=Math.min(b,b*(e+1)/C);P+=w===`circle`?`<circle r="${a(t)}"/>`:`<polygon points="${q(O.map(e=>({x:e.x*t,y:e.y*t})))}"/>`}let F=``,I=``;O.forEach((e,t)=>{let o=b*_;F+=`M0,0L${a(e.x*o)},${a(e.y*o)}`;let s=i(x[t].label,!1,h,m,4e3),c=b*v+6,l=e.x*c+(e.x>.01?s.width/2:e.x<-.01?-s.width/2:0),u=e.y*c+(e.y>.01?s.height/2:e.y<-.01?-s.height/2:0);I+=`<g class="pele-axis-label" data-id="${n(x[t].name)}">${r(s,l,u,``)}</g>`,A=Math.min(A,l-s.width/2),j=Math.max(j,l+s.width/2),M=Math.min(M,u-s.height/2),N=Math.max(N,u+s.height/2)});let L=``;S.forEach((e,r)=>{if(e.entries.length!==D)return;let i=e.entries.map((e,t)=>{let n=ee(e,E,k,b),r=Number.isFinite(n)?n:0;return{x:O[t].x*r,y:O[t].y*r}}),a=t(r),o=` class="pele-curve" data-id="${n(e.name)}" fill="${a}" stroke="${a}"`;L+=w===`circle`?`<path${o} d="${te(i,y)}"/>`:`<polygon${o} points="${q(i)}"/>`});let R=o.options.showLegend?S.map(e=>i(e.label,!1,h,m,4e3)):[],z=0;for(let e of R)z=Math.max(z,e.width);let B=R.length*W,V=f?-(U+8+z)/2:j+G,H=f?N+G/2:-B/2;R.length>0&&f?(A=Math.min(A,V),j=Math.max(j,-V),N=H+B):R.length>0&&(j=V+U+8+z,M=Math.min(M,-B/2),N=Math.max(N,B/2));let J=``;R.forEach((e,i)=>{let o=H+i*W+W/2,s=t(i);J+=`<g class="pele-legend-item" data-id="${n(S[i].name)}"><rect x="${a(V)}" y="${a(o-U/2)}" width="${U}" height="${U}" rx="2" fill="${s}" fill-opacity="0.4" stroke="${s}"/>`+r(e,V+U+8+e.width/2,o,``)+`</g>`});let Y=i(o.title,!1,h,p,s(l),1),X=Y.height>0?Y.height+8:0,Z=Math.max(j-A,Y.width),Q=Math.ceil(Z+2*g),$=Math.ceil(N-M+X+2*g),ne=`translate(${a(g+(Z-(j-A))/2-A)},${a(g+X-M)})`,re=r(Y,Q/2,g+Y.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g transform="${ne}">`+(P?`<g class="pele-graticule" fill="none" stroke="var(--_a)">${P}</g>`:``)+(F?`<path class="pele-axes" d="${F}" fill="none" stroke="var(--_b)"/>`:``)+(L?`<g class="pele-curves" fill-opacity="0.2" stroke-width="1.5" stroke-linejoin="round">${L}</g>`:``)+(I?`<g class="pele-axis-labels" font-size="${m}">${I}</g>`:``)+(J?`<g class="pele-legend" font-size="${m}">${J}</g>`:``)+`</g>`;return{svg:e(`radar`,Q,$,p,l,o,re),width:Q,height:$,links:[]}}var X={type:`radar`,parse:(e,t,n)=>O(H(e),n),render:J};export{X as radar};
@@ -1,4 +1,4 @@
1
- import{_ as e,a as t,b as n,d as r,i,o as a,p as o,s,u as c,x as l,y as u}from"./DS7XcdHs.js";import{a as d,t as f}from"./DciMwFJ1.js";import{a as p,i as m,l as h,s as g}from"./DK9wjWIk.js";import{t as _}from"./CdD6waB-.js";import{r as v}from"./DQJRaTNz.js";import{i as y,n as b,r as x,t as ee}from"./Bx_Vz2qr.js";import{PeleError as S,a as C,b as w,r as T,u as te,v as E,x as D,y as O}from"./BNlziJ_1.js";var k=`EOF USECASE ACTOR SYSTEM_BOUNDARY END DIRECTION TD TB BT LR RL NOTE FOR JSON CLASS_DEF CLASS STYLE INCLUDE EXTEND TRUE FALSE IDENTIFIER NUMBER AT COMMA COLON HASH_COLOR CSS_IDENTIFIER CSS_ESCAPED_COMMA DASH DOT PERCENT CSS_PUNCTUATION LABEL_PUNCTUATION LABEL_SYMBOL PLAIN_STRING MARKDOWN_STRING UNCLOSED_MARKDOWN_STRING COMMENT NEWLINE ACC_DESCR_BLOCK ACC_TITLE_LINE ACC_DESCR_LINE JSON_DECLARATION_START JSON_OBJECT_LITERAL UNCLOSED_JSON_OBJECT_LITERAL GENERALIZATION DEPENDENCY_ARROW STEREOTYPE_START STEREOTYPE_END STEREOTYPE_TEXT UNCLOSED_STEREOTYPE_TEXT CLASS_SEPARATOR FORWARD_SOLID BACKWARD_SOLID FORWARD_CIRCLE BACKWARD_CIRCLE FORWARD_CROSS BACKWARD_CROSS MARKERLESS_SOLID METADATA_START LBRACE RBRACE LBRACKET RBRACKET LPAREN RPAREN`.split(` `),A=1,j=2,M=new Uint8Array(128);for(let e=48;e<=57;e++)M[e]=A;for(let e=65;e<=90;e++)M[e]=M[e+32]=A;M[95]=A;for(let e of`!#$&*+/=?^|~`)M[e.charCodeAt(0)]=j;var ne=[0,12,5,14,3,9,2,2,2,2,2,4,3,4,8,5,5,7,6,4,5];function N(e){return e<128&&(M[e]&A)!==0}function P(e,t,n){for(let r=0;r<n.length;r++)if((e.charCodeAt(t+r)|32)!==n.charCodeAt(r))return!1;return!0}function re(e,t,n){switch(n){case 97:return e.startsWith(`actor`,t)?2:0;case 115:return e.startsWith(`systemBoundary`,t)?3:e.startsWith(`style`,t)?16:0;case 101:return e.startsWith(`end`,t)?4:P(e,t,`extend`)?18:0;case 69:return P(e,t,`extend`)?18:0;case 100:return e.startsWith(`direction`,t)?5:0;case 84:return e.startsWith(`TD`,t)?6:e.startsWith(`TB`,t)?7:0;case 66:return e.startsWith(`BT`,t)?8:0;case 76:return e.startsWith(`LR`,t)?9:0;case 82:return e.startsWith(`RL`,t)?10:0;case 110:return e.startsWith(`note`,t)?11:0;case 102:return e.startsWith(`for`,t)?12:e.startsWith(`false`,t)?20:0;case 106:return e.startsWith(`json`,t)?13:0;case 99:return e.startsWith(`classDef`,t)?14:e.startsWith(`class`,t)?15:0;case 105:case 73:return P(e,t,`include`)?17:0;case 116:return e.startsWith(`true`,t)?19:0;case 117:return+!!e.startsWith(`usecase-beta`,t);default:return 0}}function F(e,t){[e,t]=C(e,t);let n=1,r=0;for(let i=0;i<t;i++){let a=e.charCodeAt(i);a!==10&&a!==13||(a===13&&i+1<t&&e.charCodeAt(i+1)===10&&i++,n++,r=i+1)}return[n,t-r+1]}function ie(e,t,n){let[r,i]=F(e,t);return`line ${r}, column ${i} [${C(e,t)[1]},${C(e,n)[1]})`}function ae(e,t,n){for(let r=t+1;r<e.length;r++){let t=e.charCodeAt(r);if(t===n)return r+1;if(t===10||t===13)return-1}return-1}function oe(e,t){let n=e.charCodeAt(t);return n!==34&&n!==39||n===34&&e.charCodeAt(t+1)===96||ae(e,t,n)!==-1}function se(e,t,n){let[r,i]=F(e,t),[a,o]=[C(e,t)[1],C(e,t+n)[1]];return new S(`Error lexing usecase diagram: unexpected character: ->${e.charAt(t)}<- at offset: ${a}, skipped ${o-a} characters. at line ${r}, column ${i} [${a},${o})`,`syntax`,{type:`usecase`,line:r,column:i})}function ce(e){let t=[],n=[],r=[],i=e.length,a=0,o=!0,s=!1;for(;a<i;){let c=e.charCodeAt(a);if(c===32||c===9){a++;continue}let l,u=a+1,d=!1;if(c<128&&(M[c]&A)!==0){if(l=0,c===97&&o&&e.startsWith(`acc`,a)){let t=e.startsWith(`Descr`,a+3);if(t||e.startsWith(`Title`,a+3)){let n=a+8;for(;E(e.charCodeAt(n));)n++;let r=e.charCodeAt(n);if(r===58)for(l=t?42:41,u=n+1;u<i&&e.charCodeAt(u)!==10&&e.charCodeAt(u)!==13;)u++;else if(r===123&&t&&!s){let t=e.indexOf(`}`,n+1);t===-1?s=!0:(l=40,u=t+1)}}}else if(c===106&&e.startsWith(`json`,a)&&E(e.charCodeAt(a+4))){let s=a+5;for(;E(e.charCodeAt(s));)s++;let c=s;for(;N(e.charCodeAt(s));)s++;if(s>c){for(;E(e.charCodeAt(s));)s++;if(e.charCodeAt(s)===64){for(s++;E(e.charCodeAt(s));)s++;if(e.charCodeAt(s)===123){t.push(43),n.push(a),r.push(s),a=s;let c=0,l=!1,u=!1,d=s;for(;d<i;d++){let t=e.charCodeAt(d);if(l)u?u=!1:t===92?u=!0:t===34&&(l=!1);else if(t===34)l=!0;else if(t===123)c++;else if(t===125&&--c===0)break}t.push(d<i?44:45),n.push(s),a=d<i?d+1:i,r.push(a),o=!1;continue}}}}if(l===0){for(;u<i&&N(e.charCodeAt(u));)u++;let t=re(e,a,c);if(t!==0)t===1||u-a===ne[t]?(l=t,u=a+ne[t]):l=21;else if((c===111||c===120)&&e.charCodeAt(a+1)===45&&e.charCodeAt(a+2)===45)l=c===111?56:58,u=a+3;else if(O(c)){let t=a+1;for(;O(e.charCodeAt(t));)t++;if(e.charCodeAt(t)===46&&O(e.charCodeAt(t+1))){for(l=22,u=t+2;O(e.charCodeAt(u));)u++;for(;w(e.charCodeAt(u));)u++}else l=21}else for(l=21;e.charCodeAt(u)===45&&N(e.charCodeAt(u+1));)for(l=27,u+=2;N(e.charCodeAt(u));)u++}}else if(c===10)l=39,d=!0;else if(c===13)l=39,d=!0,e.charCodeAt(u)===10&&u++;else if(c===34||c===39){if(c===34&&e.charCodeAt(a+1)===96){let t=e.indexOf('`"',a+2);l=t===-1?37:36,u=t===-1?i:t+2}else if(l=35,u=ae(e,a,c),u===-1){let t=a+1;for(;t<i&&!oe(e,t);)t++;throw se(e,a,t-a)}}else if(c===37){if(o&&e.charCodeAt(u)===37)for(l=38;u<i&&e.charCodeAt(u)!==10&&e.charCodeAt(u)!==13;)u++;else l=31}else if(c===45){if(e.charCodeAt(u)!==45)l=29;else{for(;e.charCodeAt(u)===45;)u++;let t=e.charCodeAt(u),n=u-a===2;n&&t===124&&e.charCodeAt(u+1)===62?(l=46,u+=2):t===62?(l=53,u++):n&&(t===111||t===120)?(l=t===111?55:57,u++):l=59}}else if(c===46){let t=e.charCodeAt(u);if(t===46&&e.charCodeAt(u+1)===62)l=47,u+=2;else if(O(t)){for(l=22;O(e.charCodeAt(u));)u++;for(;w(e.charCodeAt(u));)u++}else l=30}else if(c===60){if(e.charCodeAt(u)===60){if(t.push(48),n.push(a),r.push(a+2),o=!1,a+=2,a>=i)break;if(e.charCodeAt(a)===62&&e.charCodeAt(a+1)===62)l=49,u=a+2;else{let o=a,s=!1;for(;o<i;o++){let t=e.charCodeAt(o);if(t===10||t===13)break;if(t===62&&e.charCodeAt(o+1)===62){s=!0;break}}if(s&&e.slice(a,o).trim()!==``)t.push(50),n.push(a),r.push(o),l=49,a=o,u=o+2;else{for(;o<i&&e.charCodeAt(o)!==10&&e.charCodeAt(o)!==13;)o++;if(o===a){for(;o<i&&(e.charCodeAt(o)===10||e.charCodeAt(o)===13);)o++;throw se(e,a,o-a)}l=51,u=o}}}else if(e.charCodeAt(u)===45&&e.charCodeAt(u+1)===45)for(l=54,u+=2;e.charCodeAt(u)===45;)u++;else l=33}else if(c===58)e.charCodeAt(u)===58&&e.charCodeAt(u+1)===58?(l=52,u+=2):l=25;else if(c===64)e.charCodeAt(u)===123?(l=60,u++):l=23;else if(c===123)l=61;else if(c===125)l=62;else if(c===91)l=63;else if(c===93)l=64;else if(c===40)l=65;else if(c===41)l=66;else if(c===44)l=24;else if(c===35){for(;D(e.charCodeAt(u));)u++;l=u>a+1?26:32}else if(c===92)e.charCodeAt(u)===44?(l=28,u++):l=33;else if(c<127&&c>32)l=(M[c]&j)===0?33:32;else for(l=34;u<i;){let t=e.charCodeAt(u);if(t>=32&&t<127||t===9||t===10||t===13)break;u++}t.push(l),n.push(a),r.push(u),a=u,o=d}for(let e=0;e<3;e++)t.push(0),n.push(i),r.push(i);return{types:t,starts:n,ends:r}}function le(){return{type:`usecase`,actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,direction:`LR`,title:void 0,accTitle:``,accDescr:``,accDescription:``,source:``,headerSpan:[0,0],statements:[]}}function ue(){return{elements:[],boundaries:[],jsons:[],relationships:[],notes:[],metadata:[],classes:[],styles:[],classDefs:[],direction:void 0,accTitle:``,accDescription:``}}function I(e,t){if(t.length===0)return;let n=new Set(e);for(let r of t)n.has(r)||(n.add(r),e.push(r))}function de(e){let t=new Set([`actor`,`usecase`,`boundary`,`edge`]);for(let{key:n,value:r}of e)if(n===`icon`)t.clear(),t.add(`actor`);else if(n===`animate`||n===`animation`)t.clear(),t.add(`edge`);else if(n===`type`)t.clear(),r===`rect`||r===`package`?t.add(`boundary`):(r===`normal`||r===`hollow`||r===`awesome`)&&t.add(`actor`);else if(n===`business`)t.delete(`boundary`),t.delete(`edge`);else return;return t.size===1?[...t][0]:void 0}function fe(e,t,n,r,i){let a=le(),{actors:o,useCases:s,systemBoundaries:c}=a,l=new Map,u=new Map,d=new Map,f=new Map,p=new Map,m=t=>ie(e,t[0],t[1]),h=(t,n)=>{let[r,i]=F(e,n[0]);return new S(t,`semantic`,{type:`usecase`,line:r,column:i})},g=(e,t)=>{throw h(`${e} at ${m(t)}`,t)},_=(e,t,n,r,i)=>{let a=e=>e===void 0?``:` (label "${e}")`;throw h(`${e} at ${m(t)}${a(r)}; previous declaration at ${m(n)}${a(i)}`,t)},v=(e,t,n)=>g(`Metadata property '${n.key}' is invalid for ${t} '${e}'`,n.keySpan),y=(e,t)=>{let n=p.get(e);(n===void 0||t<n)&&p.set(e,t)},b=e=>[...e].sort((e,t)=>(p.get(e.id)??0)-(p.get(t.id)??0)),x=(e,t)=>{l.set(e.id,{kind:t,span:e.span,generated:e.generated,label:e.label.text})},ee=(e,t)=>{let n=l.get(e.id);if(!n)return;let r=e.generated?e.label.text:void 0,i=n.generated?n.label:void 0;n.kind!==t&&_(`ID '${e.id}' is declared as both ${n.kind} and ${t}`,e.span,n.span,r,i),(n.generated||e.generated)&&_(`Generated ID '${e.id}' collides with another declaration`,e.span,n.span,r,i)},C=(e,t,n)=>{let r=l.get(e);r&&_(`ID '${e}' is declared more than once (${r.kind} and ${t})`,n,r.span,void 0,r.generated?r.label:void 0),l.set(e,{kind:t,span:n,generated:!1})},w=(e,t,n)=>{let{key:r,value:i}=t,a=a=>{!n&&a!==void 0&&a!==i&&_(`Actor '${e.id}' has conflicting ${r} metadata`,t.keySpan,e.span)};r===`type`&&(i===`normal`||i===`hollow`||i===`awesome`)?(a(e.actorType),e.actorType=i):r===`icon`&&typeof i==`string`?(a(e.icon),e.icon=i):r===`business`&&typeof i==`boolean`?(a(e.business),e.business=i):v(e.id,`actor`,t)},T=(e,t,n)=>{for(let r of t??[])e.kind===`actor`?w(e,r,n):r.key===`business`&&typeof r.value==`boolean`?(!n&&e.business!==void 0&&e.business!==r.value&&_(`Use case '${e.id}' has conflicting business metadata`,r.keySpan,e.span),e.business=r.value):v(e.id,`usecase`,r)},te=e=>{let t;if(e.kind===`actor`){s.delete(e.id);let n={id:e.id,label:e.label.text,labelType:e.label.type,business:e.business??!1,classes:[...e.classes],type:e.icon?`icon`:e.actorType??`normal`,styles:o.get(e.id)?.styles??[]};e.icon&&(n.icon=e.icon),o.set(e.id,n),t=n}else o.delete(e.id),t={id:e.id,label:e.label.text,labelType:e.label.type,business:e.business??!1,classes:[...e.classes],shape:e.shape??`ellipse`,styles:s.get(e.id)?.styles??[]},s.set(e.id,t);e.stereotype&&(t.stereotype=e.stereotype),e.parent?.id&&(t.parentId=e.parent.id)},E=e=>{ee(e,e.kind);let t=e.parent?.id?e.parent:void 0,n=u.get(e.id);if(n)(n.label.text!==e.label.text||n.label.type!==e.label.type)&&_(`ID '${e.id}' has conflicting labels`,e.span,n.span),e.shape&&n.shape&&e.shape!==n.shape&&_(`Use case '${e.id}' has conflicting shapes`,e.span,n.span),t&&n.parent?.id&&t.id!==n.parent.id&&_(`Element '${e.id}' belongs to more than one system boundary`,t.span,n.parent.span),e.stereotype&&n.stereotype&&e.stereotype!==n.stereotype&&_(`Element '${e.id}' has conflicting stereotypes`,e.span,n.stereotypeSpan??n.span),n.shape??=e.shape,n.parent??=e.parent,n.stereotype??=e.stereotype,n.stereotypeSpan??=e.stereotype?e.span:void 0,I(n.classes,e.classes),T(n,e.metadata,!1);else{let n={kind:e.kind,id:e.id,label:e.label,span:e.span,generated:e.generated,classes:[...e.classes],parent:t,shape:e.shape,stereotype:e.stereotype,stereotypeSpan:e.stereotype?e.span:void 0};T(n,e.metadata,!1),u.set(e.id,n),x(e,e.kind)}},D=e=>{ee(e,`boundary`);let t=d.get(e.id);t?((t.label.text!==e.label.text||t.label.type!==e.label.type)&&_(`Boundary '${e.id}' has conflicting titles`,e.span,t.span),I(t.classes,e.classes)):(d.set(e.id,{...e,classes:[...e.classes],members:[]}),x(e,`boundary`))},O=e=>{e.classed&&!e.declares&&g(`Relationship endpoint '${e.id}' uses ::: without declaring the node`,e.span);let t=l.get(e.id);return t?t.kind:(u.set(e.id,{...e,kind:`usecase`,shape:`ellipse`,classes:[]}),x(e,`usecase`),y(e.id,e.span[0]),`usecase`)},k=(e,t)=>{let n=l.get(e)?.kind;return(n===`actor`?o.get(e):n===`usecase`?s.get(e):n===`boundary`?c.get(e):n===`json`?a.jsonNodes.get(e):f.get(e))??g(`Class/style target '${e}' is unresolved or anonymous`,t)},A=[];for(let{source:e,target:n}of t.relationships)y(e.id,e.span[0]),y(n.id,n.span[0]);for(let e of t.elements)y(e.id,e.span[0]),A.push({offset:e.span[0],run:()=>E(e)});for(let e of t.boundaries)y(e.id,e.span[0]),A.push({offset:e.span[0],run:()=>D(e)});for(let e of t.jsons)y(e.id,e.span[0]),A.push({offset:e.span[0],run:()=>C(e.id,`json`,e.span)});for(let{id:e,idSpan:n}of t.relationships)e&&n&&A.push({offset:n[0],run:()=>C(e,`edge`,n)});A.sort((e,t)=>e.offset-t.offset);for(let e of A)e.run();for(let e of b(u.values()))te(e);for(let e of b(d.values()))c.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,type:`rect`,members:[],classes:[],styles:[]});for(let e of b(t.jsons))a.jsonNodes.set(e.id,{id:e.id,value:e.value,propertyOrder:e.propertyOrder,classes:[...e.classes],styles:[]});let j=0;for(let e of t.relationships){let{source:t,target:n,type:r}=e,i=O(t),o=O(n),s=e=>e===`actor`||e===`usecase`||e===`json`;s(i)||_(`Relationship source '${t.id}' cannot be ${i}`,t.span,l.get(t.id).span),s(o)||_(`Relationship target '${n.id}' cannot be ${o}`,n.span,l.get(n.id).span),(r===`include`||r===`extend`)&&(i!==`usecase`||o!==`usecase`)&&g(`${r} relationship requires use-case endpoints`,e.span),r===`generalization`&&(i===`json`||i!==o)&&g(`Generalization requires actor-to-actor or use-case-to-use-case endpoints`,e.span),r===`association`&&(i===`json`||o===`json`)&&e.arrowType>2&&g(`JSON relationship '${t.id}' to '${n.id}' permits only point, reversed-point, or markerless solid association`,e.span);let c=e.id??`edge-${j++}`,u={id:c,explicitId:!!e.id,source:t.id,target:n.id,type:r,arrowType:e.arrowType,minlen:e.minlen,classes:[],styles:[],animate:!1};e.label&&(u.label=e.label.text,u.labelType=e.label.type),a.relationships.push(u),f.set(c,u)}let M=new Map(o),ne=new Map(s);o.clear(),s.clear();for(let e of b(u.values())){let t=M.get(e.id),n=ne.get(e.id);t?o.set(e.id,t):n?s.set(e.id,n):te(e)}for(let{target:e,span:n,properties:r,statement:i}of t.metadata){let t=l.get(e);if(!t){let t=de(r);return g(`Metadata target '${e}' is unresolved${t?` (metadata implies ${t})`:``}`,n)}let a=t.kind;a===`actor`||a===`usecase`?T(u.get(e),r,!0):a===`edge`&&(i.kind=`edgeMetadata`,i.edges=[{id:e,span:i.span,idSpan:n,metadata:i.metadata}],delete i.nodes);let o=d.get(e),s=f.get(e);for(let t of a===`actor`||a===`usecase`?[]:r){let{key:n,value:r}=t;a===`boundary`&&o&&n===`type`&&(r===`rect`||r===`package`)?o.type=r:a===`edge`&&s&&n===`animate`&&typeof r==`boolean`?s.animate=r:a===`edge`&&s&&n===`animation`&&(r===`fast`||r===`slow`)?(s.animation=r,s.animate=!0):v(e,a,t)}}for(let e of a.relationships)e.animation&&(e.animate=!0);for(let e of u.values())e.kind===`actor`?(e.icon&&e.actorType&&e.actorType!==`normal`&&g(`Actor '${e.id}' cannot combine icon with type '${e.actorType}'`,e.span),e.business&&(e.icon||e.actorType===`awesome`)&&g(`Business actor '${e.id}' must use normal or hollow geometry`,e.span)):e.shape===`rect`&&e.business&&g(`Rectangular use case '${e.id}' cannot be a business use case`,e.span),te(e);for(let e of[...t.elements].sort((e,t)=>e.span[0]-t.span[0])){if(!e.parent?.id)continue;let t=d.get(e.parent.id).members;t.includes(e.id)||t.push(e.id)}for(let e of d.values()){let t=c.get(e.id);t.type=e.type??`rect`,t.members=e.members,t.classes=[...e.classes]}let N=0;for(let e of t.notes){let t=l.get(e.target);if(!t)return g(`Note target '${e.target}' is unresolved`,e.span);t.kind!==`actor`&&t.kind!==`usecase`&&_(`Note target '${e.target}' must be an actor or use case, not ${t.kind}`,e.span,t.span);let n=`note-${N++}`;a.notes.set(n,{id:n,target:e.target,label:e.label.text,labelType:e.label.type})}for(let e of t.classDefs)for(let t of e.ids)a.classDefs.set(t,{id:t,styles:[...e.styles]});for(let e of t.classes)for(let t of e.targets)I(k(t.id,t.span).classes,e.classes);for(let e of t.styles)k(e.target,e.span).styles.push(...e.styles);return a.direction=t.direction??a.direction,a.title=i,a.accTitle=t.accTitle,a.accDescription=t.accDescription,a.accDescr=t.accDescription.replace(/\n\s+/g,`
1
+ import{_ as e,a as t,b as n,d as r,i,o as a,p as o,s,u as c,x as l,y as u}from"./DlgOmQ_G.js";import{a as d,t as f}from"./DciMwFJ1.js";import{a as p,i as m,l as h,s as g}from"./BF3mdiSX.js";import{t as _}from"./T3u7Skc8.js";import{r as v}from"./CXc9Iibq.js";import{i as y,n as b,r as x,t as ee}from"./CMe14KUo.js";import{PeleError as S,a as C,b as w,r as T,u as te,v as E,x as D,y as O}from"./BArcFmbE.js";var k=`EOF USECASE ACTOR SYSTEM_BOUNDARY END DIRECTION TD TB BT LR RL NOTE FOR JSON CLASS_DEF CLASS STYLE INCLUDE EXTEND TRUE FALSE IDENTIFIER NUMBER AT COMMA COLON HASH_COLOR CSS_IDENTIFIER CSS_ESCAPED_COMMA DASH DOT PERCENT CSS_PUNCTUATION LABEL_PUNCTUATION LABEL_SYMBOL PLAIN_STRING MARKDOWN_STRING UNCLOSED_MARKDOWN_STRING COMMENT NEWLINE ACC_DESCR_BLOCK ACC_TITLE_LINE ACC_DESCR_LINE JSON_DECLARATION_START JSON_OBJECT_LITERAL UNCLOSED_JSON_OBJECT_LITERAL GENERALIZATION DEPENDENCY_ARROW STEREOTYPE_START STEREOTYPE_END STEREOTYPE_TEXT UNCLOSED_STEREOTYPE_TEXT CLASS_SEPARATOR FORWARD_SOLID BACKWARD_SOLID FORWARD_CIRCLE BACKWARD_CIRCLE FORWARD_CROSS BACKWARD_CROSS MARKERLESS_SOLID METADATA_START LBRACE RBRACE LBRACKET RBRACKET LPAREN RPAREN`.split(` `),A=1,j=2,M=new Uint8Array(128);for(let e=48;e<=57;e++)M[e]=A;for(let e=65;e<=90;e++)M[e]=M[e+32]=A;M[95]=A;for(let e of`!#$&*+/=?^|~`)M[e.charCodeAt(0)]=j;var ne=[0,12,5,14,3,9,2,2,2,2,2,4,3,4,8,5,5,7,6,4,5];function N(e){return e<128&&(M[e]&A)!==0}function P(e,t,n){for(let r=0;r<n.length;r++)if((e.charCodeAt(t+r)|32)!==n.charCodeAt(r))return!1;return!0}function re(e,t,n){switch(n){case 97:return e.startsWith(`actor`,t)?2:0;case 115:return e.startsWith(`systemBoundary`,t)?3:e.startsWith(`style`,t)?16:0;case 101:return e.startsWith(`end`,t)?4:P(e,t,`extend`)?18:0;case 69:return P(e,t,`extend`)?18:0;case 100:return e.startsWith(`direction`,t)?5:0;case 84:return e.startsWith(`TD`,t)?6:e.startsWith(`TB`,t)?7:0;case 66:return e.startsWith(`BT`,t)?8:0;case 76:return e.startsWith(`LR`,t)?9:0;case 82:return e.startsWith(`RL`,t)?10:0;case 110:return e.startsWith(`note`,t)?11:0;case 102:return e.startsWith(`for`,t)?12:e.startsWith(`false`,t)?20:0;case 106:return e.startsWith(`json`,t)?13:0;case 99:return e.startsWith(`classDef`,t)?14:e.startsWith(`class`,t)?15:0;case 105:case 73:return P(e,t,`include`)?17:0;case 116:return e.startsWith(`true`,t)?19:0;case 117:return+!!e.startsWith(`usecase-beta`,t);default:return 0}}function F(e,t){[e,t]=C(e,t);let n=1,r=0;for(let i=0;i<t;i++){let a=e.charCodeAt(i);a!==10&&a!==13||(a===13&&i+1<t&&e.charCodeAt(i+1)===10&&i++,n++,r=i+1)}return[n,t-r+1]}function ie(e,t,n){let[r,i]=F(e,t);return`line ${r}, column ${i} [${C(e,t)[1]},${C(e,n)[1]})`}function ae(e,t,n){for(let r=t+1;r<e.length;r++){let t=e.charCodeAt(r);if(t===n)return r+1;if(t===10||t===13)return-1}return-1}function oe(e,t){let n=e.charCodeAt(t);return n!==34&&n!==39||n===34&&e.charCodeAt(t+1)===96||ae(e,t,n)!==-1}function se(e,t,n){let[r,i]=F(e,t),[a,o]=[C(e,t)[1],C(e,t+n)[1]];return new S(`Error lexing usecase diagram: unexpected character: ->${e.charAt(t)}<- at offset: ${a}, skipped ${o-a} characters. at line ${r}, column ${i} [${a},${o})`,`syntax`,{type:`usecase`,line:r,column:i})}function ce(e){let t=[],n=[],r=[],i=e.length,a=0,o=!0,s=!1;for(;a<i;){let c=e.charCodeAt(a);if(c===32||c===9){a++;continue}let l,u=a+1,d=!1;if(c<128&&(M[c]&A)!==0){if(l=0,c===97&&o&&e.startsWith(`acc`,a)){let t=e.startsWith(`Descr`,a+3);if(t||e.startsWith(`Title`,a+3)){let n=a+8;for(;E(e.charCodeAt(n));)n++;let r=e.charCodeAt(n);if(r===58)for(l=t?42:41,u=n+1;u<i&&e.charCodeAt(u)!==10&&e.charCodeAt(u)!==13;)u++;else if(r===123&&t&&!s){let t=e.indexOf(`}`,n+1);t===-1?s=!0:(l=40,u=t+1)}}}else if(c===106&&e.startsWith(`json`,a)&&E(e.charCodeAt(a+4))){let s=a+5;for(;E(e.charCodeAt(s));)s++;let c=s;for(;N(e.charCodeAt(s));)s++;if(s>c){for(;E(e.charCodeAt(s));)s++;if(e.charCodeAt(s)===64){for(s++;E(e.charCodeAt(s));)s++;if(e.charCodeAt(s)===123){t.push(43),n.push(a),r.push(s),a=s;let c=0,l=!1,u=!1,d=s;for(;d<i;d++){let t=e.charCodeAt(d);if(l)u?u=!1:t===92?u=!0:t===34&&(l=!1);else if(t===34)l=!0;else if(t===123)c++;else if(t===125&&--c===0)break}t.push(d<i?44:45),n.push(s),a=d<i?d+1:i,r.push(a),o=!1;continue}}}}if(l===0){for(;u<i&&N(e.charCodeAt(u));)u++;let t=re(e,a,c);if(t!==0)t===1||u-a===ne[t]?(l=t,u=a+ne[t]):l=21;else if((c===111||c===120)&&e.charCodeAt(a+1)===45&&e.charCodeAt(a+2)===45)l=c===111?56:58,u=a+3;else if(O(c)){let t=a+1;for(;O(e.charCodeAt(t));)t++;if(e.charCodeAt(t)===46&&O(e.charCodeAt(t+1))){for(l=22,u=t+2;O(e.charCodeAt(u));)u++;for(;w(e.charCodeAt(u));)u++}else l=21}else for(l=21;e.charCodeAt(u)===45&&N(e.charCodeAt(u+1));)for(l=27,u+=2;N(e.charCodeAt(u));)u++}}else if(c===10)l=39,d=!0;else if(c===13)l=39,d=!0,e.charCodeAt(u)===10&&u++;else if(c===34||c===39){if(c===34&&e.charCodeAt(a+1)===96){let t=e.indexOf('`"',a+2);l=t===-1?37:36,u=t===-1?i:t+2}else if(l=35,u=ae(e,a,c),u===-1){let t=a+1;for(;t<i&&!oe(e,t);)t++;throw se(e,a,t-a)}}else if(c===37){if(o&&e.charCodeAt(u)===37)for(l=38;u<i&&e.charCodeAt(u)!==10&&e.charCodeAt(u)!==13;)u++;else l=31}else if(c===45){if(e.charCodeAt(u)!==45)l=29;else{for(;e.charCodeAt(u)===45;)u++;let t=e.charCodeAt(u),n=u-a===2;n&&t===124&&e.charCodeAt(u+1)===62?(l=46,u+=2):t===62?(l=53,u++):n&&(t===111||t===120)?(l=t===111?55:57,u++):l=59}}else if(c===46){let t=e.charCodeAt(u);if(t===46&&e.charCodeAt(u+1)===62)l=47,u+=2;else if(O(t)){for(l=22;O(e.charCodeAt(u));)u++;for(;w(e.charCodeAt(u));)u++}else l=30}else if(c===60){if(e.charCodeAt(u)===60){if(t.push(48),n.push(a),r.push(a+2),o=!1,a+=2,a>=i)break;if(e.charCodeAt(a)===62&&e.charCodeAt(a+1)===62)l=49,u=a+2;else{let o=a,s=!1;for(;o<i;o++){let t=e.charCodeAt(o);if(t===10||t===13)break;if(t===62&&e.charCodeAt(o+1)===62){s=!0;break}}if(s&&e.slice(a,o).trim()!==``)t.push(50),n.push(a),r.push(o),l=49,a=o,u=o+2;else{for(;o<i&&e.charCodeAt(o)!==10&&e.charCodeAt(o)!==13;)o++;if(o===a){for(;o<i&&(e.charCodeAt(o)===10||e.charCodeAt(o)===13);)o++;throw se(e,a,o-a)}l=51,u=o}}}else if(e.charCodeAt(u)===45&&e.charCodeAt(u+1)===45)for(l=54,u+=2;e.charCodeAt(u)===45;)u++;else l=33}else if(c===58)e.charCodeAt(u)===58&&e.charCodeAt(u+1)===58?(l=52,u+=2):l=25;else if(c===64)e.charCodeAt(u)===123?(l=60,u++):l=23;else if(c===123)l=61;else if(c===125)l=62;else if(c===91)l=63;else if(c===93)l=64;else if(c===40)l=65;else if(c===41)l=66;else if(c===44)l=24;else if(c===35){for(;D(e.charCodeAt(u));)u++;l=u>a+1?26:32}else if(c===92)e.charCodeAt(u)===44?(l=28,u++):l=33;else if(c<127&&c>32)l=(M[c]&j)===0?33:32;else for(l=34;u<i;){let t=e.charCodeAt(u);if(t>=32&&t<127||t===9||t===10||t===13)break;u++}t.push(l),n.push(a),r.push(u),a=u,o=d}for(let e=0;e<3;e++)t.push(0),n.push(i),r.push(i);return{types:t,starts:n,ends:r}}function le(){return{type:`usecase`,actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,direction:`LR`,title:void 0,accTitle:``,accDescr:``,accDescription:``,source:``,headerSpan:[0,0],statements:[]}}function ue(){return{elements:[],boundaries:[],jsons:[],relationships:[],notes:[],metadata:[],classes:[],styles:[],classDefs:[],direction:void 0,accTitle:``,accDescription:``}}function I(e,t){if(t.length===0)return;let n=new Set(e);for(let r of t)n.has(r)||(n.add(r),e.push(r))}function de(e){let t=new Set([`actor`,`usecase`,`boundary`,`edge`]);for(let{key:n,value:r}of e)if(n===`icon`)t.clear(),t.add(`actor`);else if(n===`animate`||n===`animation`)t.clear(),t.add(`edge`);else if(n===`type`)t.clear(),r===`rect`||r===`package`?t.add(`boundary`):(r===`normal`||r===`hollow`||r===`awesome`)&&t.add(`actor`);else if(n===`business`)t.delete(`boundary`),t.delete(`edge`);else return;return t.size===1?[...t][0]:void 0}function fe(e,t,n,r,i){let a=le(),{actors:o,useCases:s,systemBoundaries:c}=a,l=new Map,u=new Map,d=new Map,f=new Map,p=new Map,m=t=>ie(e,t[0],t[1]),h=(t,n)=>{let[r,i]=F(e,n[0]);return new S(t,`semantic`,{type:`usecase`,line:r,column:i})},g=(e,t)=>{throw h(`${e} at ${m(t)}`,t)},_=(e,t,n,r,i)=>{let a=e=>e===void 0?``:` (label "${e}")`;throw h(`${e} at ${m(t)}${a(r)}; previous declaration at ${m(n)}${a(i)}`,t)},v=(e,t,n)=>g(`Metadata property '${n.key}' is invalid for ${t} '${e}'`,n.keySpan),y=(e,t)=>{let n=p.get(e);(n===void 0||t<n)&&p.set(e,t)},b=e=>[...e].sort((e,t)=>(p.get(e.id)??0)-(p.get(t.id)??0)),x=(e,t)=>{l.set(e.id,{kind:t,span:e.span,generated:e.generated,label:e.label.text})},ee=(e,t)=>{let n=l.get(e.id);if(!n)return;let r=e.generated?e.label.text:void 0,i=n.generated?n.label:void 0;n.kind!==t&&_(`ID '${e.id}' is declared as both ${n.kind} and ${t}`,e.span,n.span,r,i),(n.generated||e.generated)&&_(`Generated ID '${e.id}' collides with another declaration`,e.span,n.span,r,i)},C=(e,t,n)=>{let r=l.get(e);r&&_(`ID '${e}' is declared more than once (${r.kind} and ${t})`,n,r.span,void 0,r.generated?r.label:void 0),l.set(e,{kind:t,span:n,generated:!1})},w=(e,t,n)=>{let{key:r,value:i}=t,a=a=>{!n&&a!==void 0&&a!==i&&_(`Actor '${e.id}' has conflicting ${r} metadata`,t.keySpan,e.span)};r===`type`&&(i===`normal`||i===`hollow`||i===`awesome`)?(a(e.actorType),e.actorType=i):r===`icon`&&typeof i==`string`?(a(e.icon),e.icon=i):r===`business`&&typeof i==`boolean`?(a(e.business),e.business=i):v(e.id,`actor`,t)},T=(e,t,n)=>{for(let r of t??[])e.kind===`actor`?w(e,r,n):r.key===`business`&&typeof r.value==`boolean`?(!n&&e.business!==void 0&&e.business!==r.value&&_(`Use case '${e.id}' has conflicting business metadata`,r.keySpan,e.span),e.business=r.value):v(e.id,`usecase`,r)},te=e=>{let t;if(e.kind===`actor`){s.delete(e.id);let n={id:e.id,label:e.label.text,labelType:e.label.type,business:e.business??!1,classes:[...e.classes],type:e.icon?`icon`:e.actorType??`normal`,styles:o.get(e.id)?.styles??[]};e.icon&&(n.icon=e.icon),o.set(e.id,n),t=n}else o.delete(e.id),t={id:e.id,label:e.label.text,labelType:e.label.type,business:e.business??!1,classes:[...e.classes],shape:e.shape??`ellipse`,styles:s.get(e.id)?.styles??[]},s.set(e.id,t);e.stereotype&&(t.stereotype=e.stereotype),e.parent?.id&&(t.parentId=e.parent.id)},E=e=>{ee(e,e.kind);let t=e.parent?.id?e.parent:void 0,n=u.get(e.id);if(n)(n.label.text!==e.label.text||n.label.type!==e.label.type)&&_(`ID '${e.id}' has conflicting labels`,e.span,n.span),e.shape&&n.shape&&e.shape!==n.shape&&_(`Use case '${e.id}' has conflicting shapes`,e.span,n.span),t&&n.parent?.id&&t.id!==n.parent.id&&_(`Element '${e.id}' belongs to more than one system boundary`,t.span,n.parent.span),e.stereotype&&n.stereotype&&e.stereotype!==n.stereotype&&_(`Element '${e.id}' has conflicting stereotypes`,e.span,n.stereotypeSpan??n.span),n.shape??=e.shape,n.parent??=e.parent,n.stereotype??=e.stereotype,n.stereotypeSpan??=e.stereotype?e.span:void 0,I(n.classes,e.classes),T(n,e.metadata,!1);else{let n={kind:e.kind,id:e.id,label:e.label,span:e.span,generated:e.generated,classes:[...e.classes],parent:t,shape:e.shape,stereotype:e.stereotype,stereotypeSpan:e.stereotype?e.span:void 0};T(n,e.metadata,!1),u.set(e.id,n),x(e,e.kind)}},D=e=>{ee(e,`boundary`);let t=d.get(e.id);t?((t.label.text!==e.label.text||t.label.type!==e.label.type)&&_(`Boundary '${e.id}' has conflicting titles`,e.span,t.span),I(t.classes,e.classes)):(d.set(e.id,{...e,classes:[...e.classes],members:[]}),x(e,`boundary`))},O=e=>{e.classed&&!e.declares&&g(`Relationship endpoint '${e.id}' uses ::: without declaring the node`,e.span);let t=l.get(e.id);return t?t.kind:(u.set(e.id,{...e,kind:`usecase`,shape:`ellipse`,classes:[]}),x(e,`usecase`),y(e.id,e.span[0]),`usecase`)},k=(e,t)=>{let n=l.get(e)?.kind;return(n===`actor`?o.get(e):n===`usecase`?s.get(e):n===`boundary`?c.get(e):n===`json`?a.jsonNodes.get(e):f.get(e))??g(`Class/style target '${e}' is unresolved or anonymous`,t)},A=[];for(let{source:e,target:n}of t.relationships)y(e.id,e.span[0]),y(n.id,n.span[0]);for(let e of t.elements)y(e.id,e.span[0]),A.push({offset:e.span[0],run:()=>E(e)});for(let e of t.boundaries)y(e.id,e.span[0]),A.push({offset:e.span[0],run:()=>D(e)});for(let e of t.jsons)y(e.id,e.span[0]),A.push({offset:e.span[0],run:()=>C(e.id,`json`,e.span)});for(let{id:e,idSpan:n}of t.relationships)e&&n&&A.push({offset:n[0],run:()=>C(e,`edge`,n)});A.sort((e,t)=>e.offset-t.offset);for(let e of A)e.run();for(let e of b(u.values()))te(e);for(let e of b(d.values()))c.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,type:`rect`,members:[],classes:[],styles:[]});for(let e of b(t.jsons))a.jsonNodes.set(e.id,{id:e.id,value:e.value,propertyOrder:e.propertyOrder,classes:[...e.classes],styles:[]});let j=0;for(let e of t.relationships){let{source:t,target:n,type:r}=e,i=O(t),o=O(n),s=e=>e===`actor`||e===`usecase`||e===`json`;s(i)||_(`Relationship source '${t.id}' cannot be ${i}`,t.span,l.get(t.id).span),s(o)||_(`Relationship target '${n.id}' cannot be ${o}`,n.span,l.get(n.id).span),(r===`include`||r===`extend`)&&(i!==`usecase`||o!==`usecase`)&&g(`${r} relationship requires use-case endpoints`,e.span),r===`generalization`&&(i===`json`||i!==o)&&g(`Generalization requires actor-to-actor or use-case-to-use-case endpoints`,e.span),r===`association`&&(i===`json`||o===`json`)&&e.arrowType>2&&g(`JSON relationship '${t.id}' to '${n.id}' permits only point, reversed-point, or markerless solid association`,e.span);let c=e.id??`edge-${j++}`,u={id:c,explicitId:!!e.id,source:t.id,target:n.id,type:r,arrowType:e.arrowType,minlen:e.minlen,classes:[],styles:[],animate:!1};e.label&&(u.label=e.label.text,u.labelType=e.label.type),a.relationships.push(u),f.set(c,u)}let M=new Map(o),ne=new Map(s);o.clear(),s.clear();for(let e of b(u.values())){let t=M.get(e.id),n=ne.get(e.id);t?o.set(e.id,t):n?s.set(e.id,n):te(e)}for(let{target:e,span:n,properties:r,statement:i}of t.metadata){let t=l.get(e);if(!t){let t=de(r);return g(`Metadata target '${e}' is unresolved${t?` (metadata implies ${t})`:``}`,n)}let a=t.kind;a===`actor`||a===`usecase`?T(u.get(e),r,!0):a===`edge`&&(i.kind=`edgeMetadata`,i.edges=[{id:e,span:i.span,idSpan:n,metadata:i.metadata}],delete i.nodes);let o=d.get(e),s=f.get(e);for(let t of a===`actor`||a===`usecase`?[]:r){let{key:n,value:r}=t;a===`boundary`&&o&&n===`type`&&(r===`rect`||r===`package`)?o.type=r:a===`edge`&&s&&n===`animate`&&typeof r==`boolean`?s.animate=r:a===`edge`&&s&&n===`animation`&&(r===`fast`||r===`slow`)?(s.animation=r,s.animate=!0):v(e,a,t)}}for(let e of a.relationships)e.animation&&(e.animate=!0);for(let e of u.values())e.kind===`actor`?(e.icon&&e.actorType&&e.actorType!==`normal`&&g(`Actor '${e.id}' cannot combine icon with type '${e.actorType}'`,e.span),e.business&&(e.icon||e.actorType===`awesome`)&&g(`Business actor '${e.id}' must use normal or hollow geometry`,e.span)):e.shape===`rect`&&e.business&&g(`Rectangular use case '${e.id}' cannot be a business use case`,e.span),te(e);for(let e of[...t.elements].sort((e,t)=>e.span[0]-t.span[0])){if(!e.parent?.id)continue;let t=d.get(e.parent.id).members;t.includes(e.id)||t.push(e.id)}for(let e of d.values()){let t=c.get(e.id);t.type=e.type??`rect`,t.members=e.members,t.classes=[...e.classes]}let N=0;for(let e of t.notes){let t=l.get(e.target);if(!t)return g(`Note target '${e.target}' is unresolved`,e.span);t.kind!==`actor`&&t.kind!==`usecase`&&_(`Note target '${e.target}' must be an actor or use case, not ${t.kind}`,e.span,t.span);let n=`note-${N++}`;a.notes.set(n,{id:n,target:e.target,label:e.label.text,labelType:e.label.type})}for(let e of t.classDefs)for(let t of e.ids)a.classDefs.set(t,{id:t,styles:[...e.styles]});for(let e of t.classes)for(let t of e.targets)I(k(t.id,t.span).classes,e.classes);for(let e of t.styles)k(e.target,e.span).styles.push(...e.styles);return a.direction=t.direction??a.direction,a.title=i,a.accTitle=t.accTitle,a.accDescription=t.accDescription,a.accDescr=t.accDescription.replace(/\n\s+/g,`
2
2
  `),a.source=e,a.headerSpan=n,a.statements=r,a}var L=class extends Error{constructor(e){super(`Invalid JSON token`),this.offset=e}offset};function pe(e){let t=new Map,n=[],r=[],i=e.length,a=0,o=``,s=0,c=()=>{for(;a<i;){let t=e.charCodeAt(a);if(t!==32&&t!==9&&t!==10&&t!==13)return;a++}},l=t=>{a++;let n=``;for(;a<i;){let r=a,i=e[a++];if(i===`"`)return n;if(i.charCodeAt(0)<32)throw new L(r);if(i!==`\\`){t&&(n+=i);continue}let o=a,s=e[a++],c;if(s===`"`||s===`\\`||s===`/`)c=s;else if(s===`b`)c=`\b`;else if(s===`f`)c=`\f`;else if(s===`n`)c=`
3
3
  `;else if(s===`r`)c=`\r`;else if(s===`t`)c=` `;else if(s===`u`){let t=e.slice(a,a+4);if(!/^[\dA-Fa-f]{4}$/.test(t))throw new L(a);c=String.fromCharCode(parseInt(t,16)),a+=4}else throw new L(o);t&&(n+=c)}throw new L(a)},u=t=>{for(let n=0;n<t.length;n++)if(e[a+n]!==t[n])throw new L(a+n);a+=t.length},d=()=>{if(e.charCodeAt(a)===45&&a++,e.charCodeAt(a)===48)a++;else if(O(e.charCodeAt(a)))for(;O(e.charCodeAt(a));)a++;else throw new L(a);if(e.charCodeAt(a)===46){if(a++,!O(e.charCodeAt(a)))throw new L(a);for(;O(e.charCodeAt(a));)a++}if((e.charCodeAt(a)|32)==101){if(a++,(e.charCodeAt(a)===43||e.charCodeAt(a)===45)&&a++,!O(e.charCodeAt(a)))throw new L(a);for(;O(e.charCodeAt(a));)a++}};for(c();;)if(s===0){c();let i=e.charCodeAt(a);if(s=2,i===123){a++;let i=[];t.set(o,i),n.push(o),c(),e.charCodeAt(a)===125?a++:(r.push({object:!0,pointer:o,keys:i,ranges:new Map,key:``,from:0,index:0}),s=1)}else if(i===91)a++,c(),e.charCodeAt(a)===93?a++:(r.push({object:!1,pointer:o,keys:[],ranges:new Map,key:``,from:0,index:0}),o+=`/0`,s=0);else if(i===34)l(!1);else if(i===116)u(`true`);else if(i===102)u(`false`);else if(i===110)u(`null`);else if(i===45||O(i))d();else throw new L(a)}else if(s===1){let i=r[r.length-1];if(e.charCodeAt(a)!==34)throw new L(a);let u=l(!0),d=i.ranges.get(u);if(d===void 0)i.keys.push(u);else for(let e=d[0];e<d[1];e++)t.delete(n[e]);if(i.key=u,i.from=n.length,c(),e.charCodeAt(a)!==58)throw new L(a);a++,o=`${i.pointer}/${u.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`)}`,s=0}else{let t=r[r.length-1];if(t===void 0)break;t.object?t.ranges.set(t.key,[t.from,n.length]):t.index++,c();let i=e.charCodeAt(a);if(i===(t.object?125:93))a++,r.pop();else{if(i!==44)throw new L(a);a++,c(),o=`${t.pointer}/${t.index}`,s=+!!t.object}}if(c(),a!==i)throw new L(a);return t}function me(e,t,n,r){let i=Math.min(Math.max(t,0),e.length);for(let t=0;t<i;t++){let i=e.charCodeAt(t);i===13?(n++,r=1):i===10?(t===0||e.charCodeAt(t-1)!==13)&&(n++,r=1):r++}return[n,r]}function he(e,t,n,r){let i=/\bposition (\d+)\b/.exec(e);if(i)return me(t,parseInt(i[1],10),n,r);let a=/\bline (\d+) column (\d+)\b/.exec(e);if(a){let e=parseInt(a[1],10),t=parseInt(a[2],10);return[n+e-1,e===1?r+t-1:t]}if(/unexpected end|end of json input/i.test(e))return me(t,t.length,n,r)}function ge(e,t,n){return new S(`${e} (line ${t}, column ${n})`,`syntax`,{type:`usecase`,line:t,column:n})}function _e(e,t){let n;try{n=JSON.parse(e)}catch(n){let r=n instanceof Error?n.message:String(n),i=T(e);if(i!==e)try{JSON.parse(i)}catch(e){e instanceof Error&&(r=e.message)}let[a,o]=t(),s=he(r,i,a,o);if(!s){let e=0;try{pe(i)}catch(t){t instanceof L&&(e=t.offset)}s=me(i,e,a,o)}throw ge(`Invalid JSON: ${r}`,s[0],s[1])}if(typeof n!=`object`||!n||Array.isArray(n)){let[e,n]=t();throw ge(`JSON value must have an object root`,e,n)}return{value:n,propertyOrder:pe(e)}}var ve=1,ye=2,be=4,xe=8,Se=16,Ce=32,we=64,Te=`DEPENDENCY_ARROW|GENERALIZATION|FORWARD_SOLID|BACKWARD_SOLID|MARKERLESS_SOLID|FORWARD_CIRCLE|BACKWARD_CIRCLE|FORWARD_CROSS|BACKWARD_CROSS`,Ee=`IDENTIFIER|PLAIN_STRING|MARKDOWN_STRING`,De=`PLAIN_STRING|MARKDOWN_STRING|LABEL_TEXT`,Oe=`ACC_TITLE_LINE|ACC_DESCR_LINE|ACC_DESCR_BLOCK|DIRECTION|ACTOR|SYSTEM_BOUNDARY|NOTE|JSON_DECLARATION_START|CLASS_DEF|CLASS|STYLE`,ke=`WORD|PLAIN_STRING|NUMBER|HASH_COLOR|CSS_IDENTIFIER|CSS_ESCAPED_COMMA|DASH|DOT|PERCENT|CSS_PUNCTUATION|COLON|LPAREN|RPAREN|LBRACKET|RBRACKET|LBRACE|RBRACE|AT|MARKERLESS_SOLID`,R=new Uint8Array(67);function z(e,t){for(let n of e.split(`|`))if(n===`WORD`)for(let e=1;e<=21;e++)R[e]|=t;else R[k.indexOf(n)]|=t}z(`NEWLINE|COMMENT|${Oe}|${Ee}`,ve),z(`IDENTIFIER|${Te}`,ye),z(ke,be),z(`STEREOTYPE_START|CLASS_SEPARATOR|IDENTIFIER|${Te}|NEWLINE|EOF`,xe),z(`NEWLINE|COMMENT|ACTOR|${Ee}`,Se),z(`FORWARD_SOLID|MARKERLESS_SOLID|FORWARD_CIRCLE|FORWARD_CROSS`,Ce),z(`NEWLINE|IDENTIFIER|PLAIN_STRING|RBRACE`,we);var Ae=new Set([`allowmixing`,`newpage`,`package`,`rectangle`,`skinparam`]),B=``,V=[],H=[],U=[],W=0,je=0,G,Me,Ne=[],Pe=0,Fe=0;function K(e){return B.slice(H[e],U[e])}function q(e){return[H[e],U[e]]}function Ie(e){let[t,n]=F(B,H[W]);throw new S(`Error parsing usecase diagram: ${e} at ${ie(B,H[W],U[W])}`,`syntax`,{type:`usecase`,line:t,column:n})}function Le(e){Ie(`Expecting token of type --> ${e} <-- but found --> '${K(W)}' <--`)}function J(e){return V[W]!==e&&Le(k[e]),W++}function Y(e){Ie(`Expecting: one of these possible Token sequences:
4
4
  ${e.split(`|`).map((e,t)=>` ${t+1}. [${e}]`).join(`
@@ -1,4 +1,4 @@
1
- import{_ as e,a as t,g as n,i as r,o as i,r as a,s as o,u as s,x as c}from"./DS7XcdHs.js";import{i as l}from"./DciMwFJ1.js";import{i as u,t as d}from"./DrPF-vh8.js";import{PeleError as f,h as p,s as m,u as ee}from"./BNlziJ_1.js";var h=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],g=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function _(e){return!Number.isNaN(e.getTime())}function v(e,t){let n=String(e);return n.length>=t?n:`0`.repeat(t-n.length)+n}function te(e){let t=[`th`,`st`,`nd`,`rd`],n=e%100;return e+(t[(n-20)%10]||t[n]||t[0])}function y(e){let t=-Math.round(e.getTimezoneOffset()/15)*15;return t===0?0:t}function b(e){let t=y(e),n=Math.abs(t);return(t>=0?`+`:`-`)+v(Math.floor(n/60),2)+`:`+v(n%60,2)}function x(e){return e.getDay()||7}function S(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function ne(e){let t=new Date(e.getFullYear(),e.getMonth()+1,0);return t.setHours(23,59,59,999),t.getDate()}function re(e,t){let n=new Date(e);return n.setDate(1),t(n),n.setDate(Math.min(e.getDate(),ne(n))),n}function ie(e,t,n){switch(n){case`M`:return re(e,n=>n.setMonth(e.getMonth()+t));case`y`:return re(e,n=>n.setFullYear(e.getFullYear()+t));case`d`:return S(e,Math.round(t));case`w`:return S(e,Math.round(7*t));case`h`:return new Date(e.getTime()+t*36e5);case`m`:return new Date(e.getTime()+t*6e4);case`s`:return new Date(e.getTime()+t*1e3);default:return new Date(e.getTime()+t)}}function ae(e){return S(e,4-x(e))}function oe(e){let t=ae(e),n=new Date(t.getFullYear(),0,1),r=x(n),i=S(n,4-r+(r>4?7:0)),a=(y(i)-y(t))*6e4,o=(t.getTime()-i.getTime()-a)/6048e5;return(o<0?Math.ceil(o)||0:Math.floor(o))+1}var se=/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,ce=/\[([^\]]+)]|YYYY|YY|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,C=`YYYY-MM-DDTHH:mm:ssZ`;function le(e,t){if(!_(e))return`Invalid Date`;let n=t||C;if(n===`YYYY-MM-DD`)return w(e);let r=!1,i=n.replace(se,t=>{switch(t){case`Q`:return String(Math.ceil((e.getMonth()+1)/3));case`Do`:return`[`+te(e.getDate())+`]`;case`GGGG`:return String(ae(e).getFullYear());case`W`:return String(oe(e));case`WW`:return v(oe(e),2);case`k`:return String(e.getHours()||24);case`kk`:return v(e.getHours()||24,2);case`X`:return String(Math.floor(e.getTime()/1e3));case`x`:return String(e.getTime());case`gggg`:case`wo`:case`w`:case`ww`:case`z`:case`zzz`:return r=!0,t;default:return t}});if(r)return;let a=e.getHours();return i.replace(ce,(t,n)=>{if(n)return n;switch(t){case`YY`:return String(e.getFullYear()).slice(-2);case`YYYY`:return v(e.getFullYear(),4);case`M`:return String(e.getMonth()+1);case`MM`:return v(e.getMonth()+1,2);case`MMM`:return h[e.getMonth()].slice(0,3);case`MMMM`:return h[e.getMonth()];case`D`:return String(e.getDate());case`DD`:return v(e.getDate(),2);case`d`:return String(e.getDay());case`dd`:return g[e.getDay()].slice(0,2);case`ddd`:return g[e.getDay()].slice(0,3);case`dddd`:return g[e.getDay()];case`H`:return String(a);case`HH`:return v(a,2);case`h`:return String(a%12||12);case`hh`:return v(a%12||12,2);case`a`:return a<12?`am`:`pm`;case`A`:return a<12?`AM`:`PM`;case`m`:return String(e.getMinutes());case`mm`:return v(e.getMinutes(),2);case`s`:return String(e.getSeconds());case`ss`:return v(e.getSeconds(),2);case`SSS`:return v(e.getMilliseconds(),3);case`Z`:return b(e);default:return b(e).replace(`:`,``)}})}function w(e){let t=e.getFullYear(),n=e.getMonth()+1,r=e.getDate();return(t>=1e3&&t<=9999?t:v(t,4))+(n<10?`-0`:`-`)+n+(r<10?`-0`:`-`)+r}var ue=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,T=/\[[^\]]+]/g,E=/\d/,D=/\d\d/,O=/\d{3}/,de=/\d{4}/,k=/\d\d?/,A=/[+-]?\d+/,fe=/[+-]\d\d:?(\d\d)?|Z/,j=/\d*[^-_:/,()\s\d]+/;function M(e){return(t,n)=>(t[e]=+n,!0)}var N=(e,t)=>{if(t===`Z`)return e.offset=0,!0;let n=t.match(/([+-]|\d\d)/g),r=n[1]*60+(+n[2]||0);return e.offset=r===0?0:n[0]===`+`?-r:r,!0};function pe(e){return(t,n)=>{let r=e.indexOf(n)+1;return r<1?!1:(t.month=r%12||r,!0)}}var me=new Map([[`A`,{re:j,read:(e,t)=>(e.afternoon=t===`PM`,!0)}],[`a`,{re:j,read:(e,t)=>(e.afternoon=t===`pm`,!0)}],[`Q`,{re:E,read:(e,t)=>(e.month=(t-1)*3+1,!0)}],[`S`,{re:E,read:(e,t)=>(e.milliseconds=t*100,!0)}],[`SS`,{re:D,read:(e,t)=>(e.milliseconds=t*10,!0)}],[`SSS`,{re:O,read:(e,t)=>(e.milliseconds=+t,!0)}],[`s`,{re:k,read:M(`seconds`)}],[`ss`,{re:k,read:M(`seconds`)}],[`m`,{re:k,read:M(`minutes`)}],[`mm`,{re:k,read:M(`minutes`)}],[`H`,{re:k,read:M(`hours`)}],[`h`,{re:k,read:M(`hours`)}],[`HH`,{re:k,read:M(`hours`)}],[`hh`,{re:k,read:M(`hours`)}],[`D`,{re:k,read:M(`day`)}],[`DD`,{re:D,read:M(`day`)}],[`Do`,{re:j,read:(e,t)=>{let n=t.match(/\d+/);if(!n)return!1;e.day=+n[0],e.dayGiven=!0;for(let n=1;n<=31;n++)te(n)===t&&(e.day=n);return!0}}],[`w`,{re:k,read:M(`week`)}],[`ww`,{re:D,read:M(`week`)}],[`M`,{re:k,read:M(`month`)}],[`MM`,{re:D,read:M(`month`)}],[`MMM`,{re:j,read:pe(h.map(e=>e.slice(0,3)))}],[`MMMM`,{re:j,read:pe(h)}],[`Y`,{re:A,read:M(`year`)}],[`YY`,{re:D,read:(e,t)=>(e.year=+t+(+t>68?1900:2e3),!0)}],[`YYYY`,{re:de,read:M(`year`)}],[`Z`,{re:fe,read:N}],[`ZZ`,{re:fe,read:N}]]),P,F=null;function he(e){if(e===P)return F;if(P=e,F=null,/[Ll]/.test(e.replace(T,``)))return null;let t=e.match(ue);return t?(F=t.map(e=>me.get(e)??e.replace(/^\[|\]$/g,``)),F):null}function I(e,t,n){if(t===`x`||t===`X`)return new Date((t===`X`?1e3:1)*Number(e));let r=he(t);if(!r)return;let i={},a=e,o=0;for(let e of r){if(typeof e==`string`){o+=e.length;continue}let t=e.re.exec(a.slice(o));if(!t||!e.read(i,t[0]))return;a=a.replace(t[0],``)}i.afternoon!==void 0&&i.hours!==void 0&&(i.afternoon?i.hours<12&&(i.hours+=12):i.hours===12&&(i.hours=0));let s=i.dayGiven||i.day?i.day:!i.year&&!i.month?n.getDate():1,c=i.year||n.getFullYear(),l=0;i.year&&!i.month||(l=i.month>0?i.month-1:n.getMonth());let u=i.hours||0,d=i.minutes||0,f=i.seconds||0,p=i.milliseconds||0;if(i.offset!==void 0)return new Date(Date.UTC(c,l,s,u,d,f,p+i.offset*6e4));if(!i.week)return new Date(c,l,s,u,d,f,p)}function L(e,t,n){let r=I(e,t,n);return r&&_(r)&&le(r,t)===e?r:void 0}var ge=/^[YMDHhmsSZXx\-/.:, T]*$/,_e=/^\s*(active|done|crit|milestone|vert)\s*$/,ve=/^after\s+([\d\w- ]+)/,R=/^until\s+([\d\w- ]+)/,z=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/,ye=/[\s,]+/,B=/^\d+$/,be=new Set(g.map(e=>e.toLowerCase())),V=4e8,xe=400,Se=200,Ce=400;function we(e){let t=e===void 0?NaN:+e;return Number.isFinite(t)?t:Date.now()}function Te(e){let t=z.exec(e.trim());return t?[Number.parseFloat(t[1]),t[2]]:[NaN,`ms`]}function Ee(e,t){let n=new Set(e);for(let e of t.toLowerCase().split(ye))e!==``&&n.add(e);return[...n]}var De=class{type=`gantt`;title;accTitle;accDescr;dateFormat=``;axisFormat=``;tickInterval;todayMarker=``;includes=[];excludes=[];inclusiveEndDates=!1;topAxis=!1;displayMode=``;weekday;weekend=`saturday`;sections=[];links=new Map;tasks=[];byId=new Map;currentSection=``;taskCount=0;lastOrder=0;lastTaskId;options;now=0;work=0;includeSet=new Set;excludeSet=new Set;excludedDays=[];datedTokens=!1;constructor(e={}){this.options=e}setDateFormat(e){this.dateFormat=e}enableInclusiveEndDates(){this.inclusiveEndDates=!0}TopAxis(){this.topAxis=!0}setAxisFormat(e){this.axisFormat=e}setTickInterval(e){this.tickInterval=e}setTodayMarker(e){this.todayMarker=e}setIncludes(e){this.includes=Ee(this.includes,e)}setExcludes(e){this.excludes=Ee(this.excludes,e)}setWeekday(e){this.weekday=e}setWeekend(e){this.weekend=e}setDiagramTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
1
+ import{_ as e,a as t,g as n,i as r,o as i,r as a,s as o,u as s,x as c}from"./DlgOmQ_G.js";import{i as l}from"./DciMwFJ1.js";import{i as u,t as d}from"./-oRvYXNk.js";import{PeleError as f,h as p,s as m,u as ee}from"./BArcFmbE.js";var h=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],g=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function _(e){return!Number.isNaN(e.getTime())}function v(e,t){let n=String(e);return n.length>=t?n:`0`.repeat(t-n.length)+n}function te(e){let t=[`th`,`st`,`nd`,`rd`],n=e%100;return e+(t[(n-20)%10]||t[n]||t[0])}function y(e){let t=-Math.round(e.getTimezoneOffset()/15)*15;return t===0?0:t}function b(e){let t=y(e),n=Math.abs(t);return(t>=0?`+`:`-`)+v(Math.floor(n/60),2)+`:`+v(n%60,2)}function x(e){return e.getDay()||7}function S(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function ne(e){let t=new Date(e.getFullYear(),e.getMonth()+1,0);return t.setHours(23,59,59,999),t.getDate()}function re(e,t){let n=new Date(e);return n.setDate(1),t(n),n.setDate(Math.min(e.getDate(),ne(n))),n}function ie(e,t,n){switch(n){case`M`:return re(e,n=>n.setMonth(e.getMonth()+t));case`y`:return re(e,n=>n.setFullYear(e.getFullYear()+t));case`d`:return S(e,Math.round(t));case`w`:return S(e,Math.round(7*t));case`h`:return new Date(e.getTime()+t*36e5);case`m`:return new Date(e.getTime()+t*6e4);case`s`:return new Date(e.getTime()+t*1e3);default:return new Date(e.getTime()+t)}}function ae(e){return S(e,4-x(e))}function oe(e){let t=ae(e),n=new Date(t.getFullYear(),0,1),r=x(n),i=S(n,4-r+(r>4?7:0)),a=(y(i)-y(t))*6e4,o=(t.getTime()-i.getTime()-a)/6048e5;return(o<0?Math.ceil(o)||0:Math.floor(o))+1}var se=/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,ce=/\[([^\]]+)]|YYYY|YY|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,C=`YYYY-MM-DDTHH:mm:ssZ`;function le(e,t){if(!_(e))return`Invalid Date`;let n=t||C;if(n===`YYYY-MM-DD`)return w(e);let r=!1,i=n.replace(se,t=>{switch(t){case`Q`:return String(Math.ceil((e.getMonth()+1)/3));case`Do`:return`[`+te(e.getDate())+`]`;case`GGGG`:return String(ae(e).getFullYear());case`W`:return String(oe(e));case`WW`:return v(oe(e),2);case`k`:return String(e.getHours()||24);case`kk`:return v(e.getHours()||24,2);case`X`:return String(Math.floor(e.getTime()/1e3));case`x`:return String(e.getTime());case`gggg`:case`wo`:case`w`:case`ww`:case`z`:case`zzz`:return r=!0,t;default:return t}});if(r)return;let a=e.getHours();return i.replace(ce,(t,n)=>{if(n)return n;switch(t){case`YY`:return String(e.getFullYear()).slice(-2);case`YYYY`:return v(e.getFullYear(),4);case`M`:return String(e.getMonth()+1);case`MM`:return v(e.getMonth()+1,2);case`MMM`:return h[e.getMonth()].slice(0,3);case`MMMM`:return h[e.getMonth()];case`D`:return String(e.getDate());case`DD`:return v(e.getDate(),2);case`d`:return String(e.getDay());case`dd`:return g[e.getDay()].slice(0,2);case`ddd`:return g[e.getDay()].slice(0,3);case`dddd`:return g[e.getDay()];case`H`:return String(a);case`HH`:return v(a,2);case`h`:return String(a%12||12);case`hh`:return v(a%12||12,2);case`a`:return a<12?`am`:`pm`;case`A`:return a<12?`AM`:`PM`;case`m`:return String(e.getMinutes());case`mm`:return v(e.getMinutes(),2);case`s`:return String(e.getSeconds());case`ss`:return v(e.getSeconds(),2);case`SSS`:return v(e.getMilliseconds(),3);case`Z`:return b(e);default:return b(e).replace(`:`,``)}})}function w(e){let t=e.getFullYear(),n=e.getMonth()+1,r=e.getDate();return(t>=1e3&&t<=9999?t:v(t,4))+(n<10?`-0`:`-`)+n+(r<10?`-0`:`-`)+r}var ue=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,T=/\[[^\]]+]/g,E=/\d/,D=/\d\d/,O=/\d{3}/,de=/\d{4}/,k=/\d\d?/,A=/[+-]?\d+/,fe=/[+-]\d\d:?(\d\d)?|Z/,j=/\d*[^-_:/,()\s\d]+/;function M(e){return(t,n)=>(t[e]=+n,!0)}var N=(e,t)=>{if(t===`Z`)return e.offset=0,!0;let n=t.match(/([+-]|\d\d)/g),r=n[1]*60+(+n[2]||0);return e.offset=r===0?0:n[0]===`+`?-r:r,!0};function pe(e){return(t,n)=>{let r=e.indexOf(n)+1;return r<1?!1:(t.month=r%12||r,!0)}}var me=new Map([[`A`,{re:j,read:(e,t)=>(e.afternoon=t===`PM`,!0)}],[`a`,{re:j,read:(e,t)=>(e.afternoon=t===`pm`,!0)}],[`Q`,{re:E,read:(e,t)=>(e.month=(t-1)*3+1,!0)}],[`S`,{re:E,read:(e,t)=>(e.milliseconds=t*100,!0)}],[`SS`,{re:D,read:(e,t)=>(e.milliseconds=t*10,!0)}],[`SSS`,{re:O,read:(e,t)=>(e.milliseconds=+t,!0)}],[`s`,{re:k,read:M(`seconds`)}],[`ss`,{re:k,read:M(`seconds`)}],[`m`,{re:k,read:M(`minutes`)}],[`mm`,{re:k,read:M(`minutes`)}],[`H`,{re:k,read:M(`hours`)}],[`h`,{re:k,read:M(`hours`)}],[`HH`,{re:k,read:M(`hours`)}],[`hh`,{re:k,read:M(`hours`)}],[`D`,{re:k,read:M(`day`)}],[`DD`,{re:D,read:M(`day`)}],[`Do`,{re:j,read:(e,t)=>{let n=t.match(/\d+/);if(!n)return!1;e.day=+n[0],e.dayGiven=!0;for(let n=1;n<=31;n++)te(n)===t&&(e.day=n);return!0}}],[`w`,{re:k,read:M(`week`)}],[`ww`,{re:D,read:M(`week`)}],[`M`,{re:k,read:M(`month`)}],[`MM`,{re:D,read:M(`month`)}],[`MMM`,{re:j,read:pe(h.map(e=>e.slice(0,3)))}],[`MMMM`,{re:j,read:pe(h)}],[`Y`,{re:A,read:M(`year`)}],[`YY`,{re:D,read:(e,t)=>(e.year=+t+(+t>68?1900:2e3),!0)}],[`YYYY`,{re:de,read:M(`year`)}],[`Z`,{re:fe,read:N}],[`ZZ`,{re:fe,read:N}]]),P,F=null;function he(e){if(e===P)return F;if(P=e,F=null,/[Ll]/.test(e.replace(T,``)))return null;let t=e.match(ue);return t?(F=t.map(e=>me.get(e)??e.replace(/^\[|\]$/g,``)),F):null}function I(e,t,n){if(t===`x`||t===`X`)return new Date((t===`X`?1e3:1)*Number(e));let r=he(t);if(!r)return;let i={},a=e,o=0;for(let e of r){if(typeof e==`string`){o+=e.length;continue}let t=e.re.exec(a.slice(o));if(!t||!e.read(i,t[0]))return;a=a.replace(t[0],``)}i.afternoon!==void 0&&i.hours!==void 0&&(i.afternoon?i.hours<12&&(i.hours+=12):i.hours===12&&(i.hours=0));let s=i.dayGiven||i.day?i.day:!i.year&&!i.month?n.getDate():1,c=i.year||n.getFullYear(),l=0;i.year&&!i.month||(l=i.month>0?i.month-1:n.getMonth());let u=i.hours||0,d=i.minutes||0,f=i.seconds||0,p=i.milliseconds||0;if(i.offset!==void 0)return new Date(Date.UTC(c,l,s,u,d,f,p+i.offset*6e4));if(!i.week)return new Date(c,l,s,u,d,f,p)}function L(e,t,n){let r=I(e,t,n);return r&&_(r)&&le(r,t)===e?r:void 0}var ge=/^[YMDHhmsSZXx\-/.:, T]*$/,_e=/^\s*(active|done|crit|milestone|vert)\s*$/,ve=/^after\s+([\d\w- ]+)/,R=/^until\s+([\d\w- ]+)/,z=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/,ye=/[\s,]+/,B=/^\d+$/,be=new Set(g.map(e=>e.toLowerCase())),V=4e8,xe=400,Se=200,Ce=400;function we(e){let t=e===void 0?NaN:+e;return Number.isFinite(t)?t:Date.now()}function Te(e){let t=z.exec(e.trim());return t?[Number.parseFloat(t[1]),t[2]]:[NaN,`ms`]}function Ee(e,t){let n=new Set(e);for(let e of t.toLowerCase().split(ye))e!==``&&n.add(e);return[...n]}var De=class{type=`gantt`;title;accTitle;accDescr;dateFormat=``;axisFormat=``;tickInterval;todayMarker=``;includes=[];excludes=[];inclusiveEndDates=!1;topAxis=!1;displayMode=``;weekday;weekend=`saturday`;sections=[];links=new Map;tasks=[];byId=new Map;currentSection=``;taskCount=0;lastOrder=0;lastTaskId;options;now=0;work=0;includeSet=new Set;excludeSet=new Set;excludedDays=[];datedTokens=!1;constructor(e={}){this.options=e}setDateFormat(e){this.dateFormat=e}enableInclusiveEndDates(){this.inclusiveEndDates=!0}TopAxis(){this.topAxis=!0}setAxisFormat(e){this.axisFormat=e}setTickInterval(e){this.tickInterval=e}setTodayMarker(e){this.todayMarker=e}setIncludes(e){this.includes=Ee(this.includes,e)}setExcludes(e){this.excludes=Ee(this.excludes,e)}setWeekday(e){this.weekday=e}setWeekend(e){this.weekend=e}setDiagramTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
2
2
  `)}addSection(e){this.currentSection=e,this.sections.push(e)}addTask(e,t){let n=(t.startsWith(`:`)?t.slice(1):t).split(`,`),r={id:``,task:e,section:this.currentSection,startTime:void 0,endTime:void 0,renderEndTime:null,manualEndTime:!1,processed:!1,active:!1,done:!1,crit:!1,milestone:!1,vert:!1,order:-1,classes:[],prevTaskId:this.lastTaskId,raw:{data:t,start:void 0,end:``}},i;for(;n.length>0&&(i=_e.exec(n[0]))!==null;)r[i[1]]=!0,n.shift();if(n.length===0)throw new f(`Task "${e.trim()}" needs a duration or an end date.`,`semantic`,{type:`gantt`});if(n.length>3)throw new f(`Task "${e.trim()}" has too many fields. A task takes an id, a start, and an end or duration.`,`semantic`,{type:`gantt`});for(let e=0;e<n.length;e++)n[e]=n[e].trim();n.length===3?r.id=n[0]:(this.taskCount++,r.id=`task`+this.taskCount),n.length>1&&(r.raw.start=n[n.length-2]),r.raw.end=n[n.length-1],r.vert||(r.order=this.lastOrder++),this.tasks.push(r),this.lastTaskId=r.id,this.byId.set(r.id,r)}setLink(e,t){let n=u(t);for(let t of e.split(`,`))this.byId.has(t)&&this.links.set(t,n);this.setClass(e,`clickable`)}setClickEvent(e,t,n){this.setClass(e,`clickable`)}setClass(e,t){for(let n of e.split(`,`))this.byId.get(n)?.classes.push(t)}getTasks(e){this.now=we(e),this.work=0,this.includeSet=new Set(this.includes),this.excludeSet=new Set(this.excludes);let t=this.weekend===`friday`?5:this.weekend===`saturday`?6:NaN,n=this.excludeSet.has(`weekends`);this.excludedDays=g.map((e,r)=>{let i=r||7;return n&&(i===t||i===t+1)||this.excludeSet.has(e.toLowerCase())}),this.datedTokens=this.includes.length>0||!ge.test(this.dateFormat.trim());for(let e of this.excludes)e!==`weekends`&&!be.has(e)&&(this.datedTokens=!0);for(let e of this.tasks)e.startTime=e.endTime=void 0,e.renderEndTime=null,e.processed=e.manualEndTime=!1;let r=this.compileTasks();for(let e=0;!r&&e<10;e++)r=this.compileTasks();return this.tasks}isInvalidDate(e){let t=this.excludedDays[e.getDay()];if(!this.datedTokens)return t;let n=this.dateFormat.trim(),r=w(e),i=r;this.spend(Se),n!==`YYYY-MM-DD`&&(this.spend(Ce+n.length*8),i=le(e,n));let a=e=>e.has(r)||i!==void 0&&e.has(i);return a(this.includeSet)?!1:t||a(this.excludeSet)}spend(e){if(this.work+=e,this.work>V)throw new f(`The gantt chart takes too much work to schedule.`,`limit`,{type:`gantt`})}parse(e,t){return this.spend((t.length+1)*(e.length+1)),L(e,t,new Date(this.now))}today(){let e=new Date(this.now);return e.setHours(0,0,0,0),e}warn(e){this.options.warn&&this.options.warn(e())}compileTasks(){let e=!0;for(let t of this.tasks)this.compileTask(t),e&&=t.processed;return e}compileTask(e){let t=e.raw.start;if(t===void 0){let t=e.prevTaskId===void 0?void 0:this.byId.get(e.prevTaskId);e.startTime=t?t.endTime:this.today()}else{let n=this.getStartDate(t);n&&(e.startTime=n)}e.startTime&&(e.endTime=this.getEndDate(e.startTime,e.raw.end),e.endTime&&(e.processed=!0,e.manualEndTime=this.parse(e.raw.end,`YYYY-MM-DD`)!==void 0,this.checkTaskDates(e)))}references(e,t){let n=[],r;for(let e of t.split(` `)){if(e===``)continue;let t=this.byId.get(e);t?n.push(t):(r??=[]).push(e)}if(r){let t=r;this.warn(()=>`Gantt: "${e}" refers to task ids that do not exist: ${t.join(`, `)}.`)}return n}getStartDate(e){let t=e.trim(),n=this.dateFormat.trim();if((n===`x`||n===`X`)&&B.test(t))return this.checked(new Date(Number(t)),t);let r=ve.exec(t);if(r!==null){let e=this.references(`after`,r[1]),t;for(let n of e)(!t||n.endTime>t.endTime)&&(t=n);return t?t.endTime:this.today()}let i=this.parse(t,n);if(i)return i;let a=new Date(t);if(!_(a)||a.getFullYear()<-1e4||a.getFullYear()>1e4)throw new f(`Invalid date:`+t,`semantic`,{type:`gantt`});return a}checked(e,t){if(!_(e))throw new f(`Invalid date:`+t,`semantic`,{type:`gantt`});return e}getEndDate(e,t){let n=t.trim(),r=R.exec(n);if(r!==null){let e=this.references(`until`,r[1]),t;for(let n of e)(!t||n.startTime<t.startTime)&&(t=n);return t?t.startTime:this.today()}let i=this.dateFormat.trim(),a=this.parse(n,i);if(a)return this.inclusiveEndDates?S(a,1):a;let[o,s]=Te(n);if(Number.isNaN(o))return this.warn(()=>`Gantt: "${n}" is neither a date in the "${i}" format nor a duration such as "3d", so the task gets no duration.`),new Date(e);let c=ie(e,o,s);return _(c)?c:new Date(e)}checkTaskDates(e){if(this.excludes.length===0||e.manualEndTime)return;let t=S(e.startTime,1),n=new Date(e.endTime),r=+S(n,1e4),i=!1,a=null;for(;+t<=+n;){if(this.spend(xe),i||(a=+n),i=this.isInvalidDate(t),i&&(n.setDate(n.getDate()+1),+n>r))throw new f("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.",`semantic`,{type:`gantt`});t.setDate(t.getDate()+1)}e.endTime=n,e.renderEndTime=a===null?null:new Date(a)}},Oe=`$end.INVALID.open_directive.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.NL.href.callbackname.callbackargs.click.gantt.dateFormat.inclusiveEndDates.topAxis.axisFormat.tickInterval.includes.excludes.todayMarker.weekday_monday.weekday_tuesday.weekday_wednesday.weekday_thursday.weekday_friday.weekday_saturday.weekday_sunday.weekend_friday.weekend_saturday.date.title.accDescription.section.taskTxt.taskData.:.EOF`.split(`.`),ke=/accTitle\s*:\s*/iy,Ae=/accDescr\s*:\s*/iy,je=/accDescr\s*\{\s*/iy,Me=/href\s+"/iy,Ne=/call\s+/iy,Pe=/click\s+/iy,H=/\(\s*\)/y,Fe=/weekday\s+(monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/iy,Ie=[`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`,`sunday`],U=/weekend\s+(?:(friday)|saturday)\b/iy,Le=/\d\d\d\d-\d\d-\d\d\b/y,Re=/title[^\S\r\n]*(?=[\r\n]|$)/iy,ze=new Map([[97,[[/axisFormat\s[^#\n;]+/iy,17],[/accDescription\s[^#\n;]+/iy,33]]],[103,[[/gantt\b/iy,13]]],[100,[[/dateFormat\s[^#\n;]+/iy,14]]],[105,[[/inclusiveEndDates\b/iy,15],[/includes\s[^#\n;]+/iy,19]]],[116,[[/topAxis\b/iy,16],[/tickInterval\s[^#\n;]+/iy,18],[/todayMarker\s[^\n;]+/iy,21],[/title[^\S\r\n][^\n]+/iy,32]]],[101,[[/excludes\s[^#\n;]+/iy,20]]],[115,[[/section\s[^\n]+/iy,34]]]]);function Be(e){let t=e.length,n=[],r=[],i=[],a=0,o=0,s=(t,a,s)=>{n.push(t),r.push(e.slice(a,s)),i.push(a),o=s},c=t=>(t.lastIndex=o,t.test(e)?t.lastIndex:-1),l=(n,r)=>{let i=e.indexOf(n,r);return i===-1?t:i},u=t=>{let n;switch(t|32){case 97:if((n=c(ke))>=0)return a=1,s(3,o,n),!0;if((n=c(Ae))>=0)return a=2,s(5,o,n),!0;if((n=c(je))>=0)return a=3,o=n,!0;break;case 104:if((n=c(Me))>=0)return a=4,o=n,!0;break;case 99:if((n=c(Ne))>=0)return a=5,o=n,!0;if((n=c(Pe))>=0)return a=7,o=n,!0;break;case 116:if((n=c(Re))>=0)return o=n,!0;break;case 119:{Fe.lastIndex=o;let t=Fe.exec(e);if(t)return s(22+Ie.indexOf(t[1].toLowerCase()),o,Fe.lastIndex),!0;if(U.lastIndex=o,t=U.exec(e),t)return s(t[1]===void 0?30:29,o,U.lastIndex),!0;break}}let r=ze.get(t|32);if(r){for(let[e,t]of r)if((n=c(e))>=0)return s(t,o,n),!0}return!1};for(;;){if(o>=t){let e=38;switch(a){case 1:e=4;break;case 2:e=6;break;case 3:e=7;break;case 4:e=9;break;case 5:e=10;break;case 6:e=11;break;case 7:e=12}s(e,t,t);break}let d=e.charCodeAt(o);switch(a){case 0:{let a=e.charCodeAt(o+1);if(d===37){if(a!==37){let t=l(`
3
3
  `,o+1);for(;e.charCodeAt(t)===10;)t++;o=t}else{if(e.charCodeAt(o+2)===123)return s(2,o,o+3),s(1,o,o),{types:n,texts:r,starts:i};o=l(`
4
4
  `,o+2)}}else if(d===10){let t=o+1;for(;e.charCodeAt(t)===10;)t++;s(8,o,t)}else if(p(d))for(o++;o<t&&p(e.charCodeAt(o));)o++;else{if(u(d))break;if(d>=48&&d<=57&&c(Le)>=0)s(31,o,o+10);else if(d!==58){let n=o+1;for(;n<t;){let t=e.charCodeAt(n);if(t===58||t===10)break;n++}s(35,o,n)}else{let n=o+1;for(;n<t;){let t=e.charCodeAt(n);if(t===35||t===10||t===59)break;n++}s(n>o+1?36:37,o,n)}}break}case 1:case 2:{let e=a===1?4:6;a=0,s(e,o,l(`
@@ -1 +1 @@
1
- import{E as e,F as t,J as n,M as r,Q as i,T as a,V as o,at as s,f as c,i as l,it as u,lt as d,mt as f,nt as p,q as m,rt as h,ut as g,v as _}from"./CxEu-Di8.js";import"./xihTtKlq.js";function v(e){let t=e*9301+49297;return()=>((t=t*16807%2147483647)-1)/2147483646}var y=[`F[+F][-F]F`,`FF[+F][-F]F`,`F[+F][-F][F]`,`F[++F][--F]F`,`F[+F][-F]F[+F][-F]`,`F[+FF][-FF]F`,`FF[+F][-F][++F][--F]`,`F[+F[+F][-F]][-F[+F][-F]]F`],b=[3,4,5,6,6,6,7,8,8];function x(e){let t=v(e+1),n=b[Math.floor(t()*b.length)],r=y[Math.floor(t()*y.length)],i=180/n*(t()<.5?1:2)*(n<=4&&t()<.5?.5:1),a=r.length>14?2:t()<.55?3:2,o=`F`;for(let e=0;e<a;e++)o=o.replace(/F/g,r);let s=[],c=[],l=0,u=0,d=0,f=0,p=0;for(let e of o)if(e===`F`){let e=l+Math.cos(d*Math.PI/180),t=u+Math.sin(d*Math.PI/180);s.push([l,u,e,t,f]),l=e,u=t,f++,p=Math.max(p,Math.hypot(l,u))}else e===`+`?d+=i:e===`-`?d-=i:e===`[`?c.push([l,u,d,f]):e===`]`&&([l,u,d,f]=c.pop());return{n,segs:s,scale:21/Math.max(p,1),steps:Math.max(...s.map(e=>e[4]))+1,width:Math.min(1.4,Math.max(.6,30/s.length*n/6+.55))}}var S=Array.from({length:100},(e,t)=>x(t*7919+13));function C(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0)%S.length}function w(e){let t=[];for(let n=0;n<e.n;n++){let r=(n*360/e.n-90)*Math.PI/180,i=Math.cos(r),a=Math.sin(r),o=(t,n)=>[(t*i-n*a)*e.scale,(t*a+n*i)*e.scale];for(let[n,r,i,a,s]of e.segs){let[c,l]=o(n,r),[u,d]=o(i,a);t.push({x1:+c.toFixed(2),y1:+l.toFixed(2),x2:+u.toFixed(2),y2:+d.toFixed(2),out:s/e.steps})}}return t}var T=t(`<line class="svelte-45eg1y"></line>`),E=t(`<svg viewBox="-24 -24 48 48"><g></g></svg>`);function D(t,p){g(p,!0);let v=l(p,`size`,3,44),y=l(p,`growing`,3,!1),b=l(p,`label`,3,``),x=s(()=>S[C(p.id)]),D=s(()=>v()>=40?1:.45),O=s(()=>w(o(x)).filter(e=>e.out<o(D)).sort((e,t)=>e.out-t.out)),k=s(()=>{let e=Math.max(...o(O).map(e=>Math.hypot(e.x2,e.y2)));return e>0?21/e:1}),A=s(()=>v()>=40?.75+o(x).width*.3:1.1),j=u(1);n(()=>{if(!y()||matchMedia(`(prefers-reduced-motion: reduce)`).matches){h(j,1);return}let e=performance.now(),t=0,n=r=>{let i=Math.floor((r-e)/1e3*24)*1e3/24%2200;h(j,Math.min(1,i/1100),!0),t=requestAnimationFrame(n)};return t=requestAnimationFrame(n),()=>cancelAnimationFrame(t)});let M=s(()=>o(j)>=1?o(O).length:o(O).findIndex(e=>e.out/o(D)>o(j))+1||o(O).length);var N=E();let P;var F=i(N);a(F,21,()=>o(O).slice(0,o(M)),e,(e,t)=>{var n=T();m(()=>{c(n,`x1`,o(t).x1),c(n,`y1`,o(t).y1),c(n,`x2`,o(t).x2),c(n,`y2`,o(t).y2)}),r(e,n)}),f(F),f(N),m(()=>{P=_(N,0,`crystal svelte-45eg1y`,null,P,{growing:y()}),c(N,`width`,v()),c(N,`height`,v()),c(N,`role`,b()?`img`:void 0),c(N,`aria-label`,b()||void 0),c(N,`aria-hidden`,b()?void 0:`true`),c(F,`transform`,`scale(${o(k)??``})`),c(F,`stroke-width`,o(A))}),r(t,N),d()}var O=new class{#e=u(p(typeof document>`u`?``:document.documentElement.dataset.ground??``));get chosen(){return o(this.#e)}set chosen(e){h(this.#e,e,!0)}choose(e){this.chosen=e,e?document.documentElement.dataset.ground=e:delete document.documentElement.dataset.ground;try{e?localStorage.setItem(`isorite.ground`,e):localStorage.removeItem(`isorite.ground`)}catch{}}},k=[[``,`the system's`],[`lapis`,`lapis`],[`quartz`,`quartz`]],A=new class{#e=u(p(typeof document>`u`?``:document.documentElement.dataset.code??``));get chosen(){return o(this.#e)}set chosen(e){h(this.#e,e,!0)}choose(e){this.chosen=e,e?document.documentElement.dataset.code=e:delete document.documentElement.dataset.code;try{e?localStorage.setItem(`isorite.code`,e):localStorage.removeItem(`isorite.code`)}catch{}}},j=[[``,`in colour`],[`ink`,`in ink`]];export{D as a,O as i,k as n,A as r,j as t};
1
+ import{$ as e,D as t,E as n,H as r,I as i,J as a,N as o,Y as s,at as c,dt as l,f as u,ht as d,i as f,it as p,ot as m,rt as h,ut as g,y as _}from"./Cz6kYWmu.js";import"./xihTtKlq.js";function v(e){let t=e*9301+49297;return()=>((t=t*16807%2147483647)-1)/2147483646}var y=[`F[+F][-F]F`,`FF[+F][-F]F`,`F[+F][-F][F]`,`F[++F][--F]F`,`F[+F][-F]F[+F][-F]`,`F[+FF][-FF]F`,`FF[+F][-F][++F][--F]`,`F[+F[+F][-F]][-F[+F][-F]]F`],b=[3,4,5,6,6,6,7,8,8];function x(e){let t=v(e+1),n=b[Math.floor(t()*b.length)],r=y[Math.floor(t()*y.length)],i=180/n*(t()<.5?1:2)*(n<=4&&t()<.5?.5:1),a=r.length>14?2:t()<.55?3:2,o=`F`;for(let e=0;e<a;e++)o=o.replace(/F/g,r);let s=[],c=[],l=0,u=0,d=0,f=0,p=0;for(let e of o)if(e===`F`){let e=l+Math.cos(d*Math.PI/180),t=u+Math.sin(d*Math.PI/180);s.push([l,u,e,t,f]),l=e,u=t,f++,p=Math.max(p,Math.hypot(l,u))}else e===`+`?d+=i:e===`-`?d-=i:e===`[`?c.push([l,u,d,f]):e===`]`&&([l,u,d,f]=c.pop());return{n,segs:s,scale:21/Math.max(p,1),steps:Math.max(...s.map(e=>e[4]))+1,width:Math.min(1.4,Math.max(.6,30/s.length*n/6+.55))}}var S=Array.from({length:100},(e,t)=>x(t*7919+13));function C(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0)%S.length}function w(e){let t=[];for(let n=0;n<e.n;n++){let r=(n*360/e.n-90)*Math.PI/180,i=Math.cos(r),a=Math.sin(r),o=(t,n)=>[(t*i-n*a)*e.scale,(t*a+n*i)*e.scale];for(let[n,r,i,a,s]of e.segs){let[c,l]=o(n,r),[u,d]=o(i,a);t.push({x1:+c.toFixed(2),y1:+l.toFixed(2),x2:+u.toFixed(2),y2:+d.toFixed(2),out:s/e.steps})}}return t}var T=i(`<line class="svelte-45eg1y"></line>`),E=i(`<svg viewBox="-24 -24 48 48"><g></g></svg>`);function D(i,h){l(h,!0);let v=f(h,`size`,3,44),y=f(h,`growing`,3,!1),b=f(h,`label`,3,``),x=m(()=>S[C(h.id)]),D=m(()=>v()>=40?1:.45),O=m(()=>w(r(x)).filter(e=>e.out<r(D)).sort((e,t)=>e.out-t.out)),k=m(()=>{let e=Math.max(...r(O).map(e=>Math.hypot(e.x2,e.y2)));return e>0?21/e:1}),A=m(()=>v()>=40?.75+r(x).width*.3:1.1),j=c(1);s(()=>{if(!y()||matchMedia(`(prefers-reduced-motion: reduce)`).matches){p(j,1);return}let e=performance.now(),t=0,n=r=>{let i=Math.floor((r-e)/1e3*24)*1e3/24%2200;p(j,Math.min(1,i/1100),!0),t=requestAnimationFrame(n)};return t=requestAnimationFrame(n),()=>cancelAnimationFrame(t)});let M=m(()=>r(j)>=1?r(O).length:r(O).findIndex(e=>e.out/r(D)>r(j))+1||r(O).length);var N=E();let P;var F=e(N);n(F,21,()=>r(O).slice(0,r(M)),t,(e,t)=>{var n=T();a(()=>{u(n,`x1`,r(t).x1),u(n,`y1`,r(t).y1),u(n,`x2`,r(t).x2),u(n,`y2`,r(t).y2)}),o(e,n)}),d(F),d(N),a(()=>{P=_(N,0,`crystal svelte-45eg1y`,null,P,{growing:y()}),u(N,`width`,v()),u(N,`height`,v()),u(N,`role`,b()?`img`:void 0),u(N,`aria-label`,b()||void 0),u(N,`aria-hidden`,b()?void 0:`true`),u(F,`transform`,`scale(${r(k)??``})`),u(F,`stroke-width`,r(A))}),o(i,N),g()}var O=new class{#e=c(h(typeof document>`u`?``:document.documentElement.dataset.ground??``));get chosen(){return r(this.#e)}set chosen(e){p(this.#e,e,!0)}choose(e){this.chosen=e,e?document.documentElement.dataset.ground=e:delete document.documentElement.dataset.ground;try{e?localStorage.setItem(`isorite.ground`,e):localStorage.removeItem(`isorite.ground`)}catch{}}},k=[[``,`the system's`],[`lapis`,`lapis`],[`quartz`,`quartz`]],A=new class{#e=c(h(typeof document>`u`?``:document.documentElement.dataset.code??``));get chosen(){return r(this.#e)}set chosen(e){p(this.#e,e,!0)}choose(e){this.chosen=e,e?document.documentElement.dataset.code=e:delete document.documentElement.dataset.code;try{e?localStorage.setItem(`isorite.code`,e):localStorage.removeItem(`isorite.code`)}catch{}}},j=[[``,`in colour`],[`ink`,`in ink`]];export{D as a,O as i,k as n,A as r,j as t};
@@ -1,2 +1,2 @@
1
- import{_ as e,f as t,i as n,o as r,s as i,u as a,x as o}from"./DS7XcdHs.js";import{PeleError as s,g as c,h as l,s as u,u as d,x as f,y as p}from"./BNlziJ_1.js";function m(e){let t=e.trim();return t.length>=2&&t.startsWith(`"`)&&t.endsWith(`"`)?t.slice(1,-1):t}function h(e){return e.map(m).sort()}var g=class{type=`venn`;title;subsets=[];textNodes=[];styles=[];known=new Set;current;indent=!1;setDiagramTitle(e){this.title=e}addSubsetData(e,t,n){let r=h(e);this.current=r,r.length===1&&this.known.add(r[0]),this.subsets.push({sets:r,size:n??10/e.length**2,label:t?m(t):void 0})}addTextData(e,t,n){this.textNodes.push({sets:h(e),id:m(t),label:n?m(n):void 0})}addStyleData(e,t){let n=new Map;for(let[e,r]of t)n.set(e,r&&m(r));this.styles.push({targets:h(e),styles:n})}validateUnionIdentifiers(e){let t=e.map(m).filter(e=>!this.known.has(e));if(t.length>0)throw new s(`unknown set identifier: ${t.join(`, `)}`,`semantic`,{type:`venn`})}getCurrentSets(){return this.current}getIndentMode(){return this.indent}setIndentMode(e){this.indent=e}},_=[`$end`,`INVALID`,`EOF`,`NEWLINE`,`VENN`,`TITLE`,`SET`,`UNION`,`TEXT`,`INDENT_TEXT`,`STYLE`,`BRACKET_LABEL`,`NUMERIC`,`HEXCOLOR`,`RGBCOLOR`,`RGBACOLOR`,`IDENTIFIER`,`STRING`,`COMMA`,`COLON`],v=[[`venn-beta`,4],[`set`,6],[`union`,7],[`text`,8],[`style`,10]],y=class{constructor(e,t){this.src=e,this.host=t}src;host;text=``;start=0;at=0;lineStart=!1;ended=!1;word(e,t){let n=this.src;for(let r=0;r<t.length;r++){let i=n.charCodeAt(e+r),a=t.charCodeAt(r);if(i!==a&&(i+32!==a||i<65||i>90))return!1}return!0}keyword(e,t){return this.word(e,t)&&!c(this.src.charCodeAt(e+t.length))}color(e,t){let n=this.src,r=e+1;for(let e=0;e<t;e++){for(;l(n.charCodeAt(r));)r++;let i=r;for(;p(n.charCodeAt(r))||n.charCodeAt(r)===46;)r++;if(r===i)return-1;for(;l(n.charCodeAt(r));)r++;if(n.charCodeAt(r)!==(e===t-1?41:44))return-1;r++}return r}afterLineFeed(e){let t=e-1;for(;this.src.charCodeAt(t)===32||this.src.charCodeAt(t)===9;)t--;return this.src.charCodeAt(t)===10}lineEnd(e){let t=this.src.indexOf(`
1
+ import{_ as e,f as t,i as n,o as r,s as i,u as a,x as o}from"./DlgOmQ_G.js";import{PeleError as s,g as c,h as l,s as u,u as d,x as f,y as p}from"./BArcFmbE.js";function m(e){let t=e.trim();return t.length>=2&&t.startsWith(`"`)&&t.endsWith(`"`)?t.slice(1,-1):t}function h(e){return e.map(m).sort()}var g=class{type=`venn`;title;subsets=[];textNodes=[];styles=[];known=new Set;current;indent=!1;setDiagramTitle(e){this.title=e}addSubsetData(e,t,n){let r=h(e);this.current=r,r.length===1&&this.known.add(r[0]),this.subsets.push({sets:r,size:n??10/e.length**2,label:t?m(t):void 0})}addTextData(e,t,n){this.textNodes.push({sets:h(e),id:m(t),label:n?m(n):void 0})}addStyleData(e,t){let n=new Map;for(let[e,r]of t)n.set(e,r&&m(r));this.styles.push({targets:h(e),styles:n})}validateUnionIdentifiers(e){let t=e.map(m).filter(e=>!this.known.has(e));if(t.length>0)throw new s(`unknown set identifier: ${t.join(`, `)}`,`semantic`,{type:`venn`})}getCurrentSets(){return this.current}getIndentMode(){return this.indent}setIndentMode(e){this.indent=e}},_=[`$end`,`INVALID`,`EOF`,`NEWLINE`,`VENN`,`TITLE`,`SET`,`UNION`,`TEXT`,`INDENT_TEXT`,`STYLE`,`BRACKET_LABEL`,`NUMERIC`,`HEXCOLOR`,`RGBCOLOR`,`RGBACOLOR`,`IDENTIFIER`,`STRING`,`COMMA`,`COLON`],v=[[`venn-beta`,4],[`set`,6],[`union`,7],[`text`,8],[`style`,10]],y=class{constructor(e,t){this.src=e,this.host=t}src;host;text=``;start=0;at=0;lineStart=!1;ended=!1;word(e,t){let n=this.src;for(let r=0;r<t.length;r++){let i=n.charCodeAt(e+r),a=t.charCodeAt(r);if(i!==a&&(i+32!==a||i<65||i>90))return!1}return!0}keyword(e,t){return this.word(e,t)&&!c(this.src.charCodeAt(e+t.length))}color(e,t){let n=this.src,r=e+1;for(let e=0;e<t;e++){for(;l(n.charCodeAt(r));)r++;let i=r;for(;p(n.charCodeAt(r))||n.charCodeAt(r)===46;)r++;if(r===i)return-1;for(;l(n.charCodeAt(r));)r++;if(n.charCodeAt(r)!==(e===t-1?41:44))return-1;r++}return r}afterLineFeed(e){let t=e-1;for(;this.src.charCodeAt(t)===32||this.src.charCodeAt(t)===9;)t--;return this.src.charCodeAt(t)===10}lineEnd(e){let t=this.src.indexOf(`
2
2
  `,e);return t===-1?this.src.length:t}next(){let e=this.src,t=e.length;for(;;){let n=this.at;if(this.start=n,this.text=``,n>=t)return this.ended?0:(this.ended=!0,2);let r=e.charCodeAt(n);if(r===37&&e.charCodeAt(n+1)===37&&e.charCodeAt(n+2)!==123)this.at=this.lineEnd(n+2);else if(this.lineStart&&this.word(n,`title`)&&this.afterLineFeed(n)&&e.slice(n+5,this.lineEnd(n+5)).trim()===``){let t=this.lineEnd(n+5);for(;e.charCodeAt(t)===10||e.charCodeAt(t)===13;)t++;this.at=t}else{if(this.lineStart){if(r===32||r===9){let t=n+1;for(;e.charCodeAt(t)===32||e.charCodeAt(t)===9;)t++;if(this.at=t,this.keyword(t,`text`)&&this.host.getIndentMode())return this.at=t+4,this.lineStart=!1,this.text=e.slice(n,t),9;continue}r!==10&&r!==13&&(this.host.setIndentMode(!1),this.lineStart=!1)}if(r===10||r===13){for(n++;e.charCodeAt(n)===10||e.charCodeAt(n)===13;)n++;return this.lineStart=!0,this.token(3,n)}if(r===37&&e.charCodeAt(n+1)===37)this.at=this.lineEnd(n);else if(r===32||r===9){for(n++;e.charCodeAt(n)===32||e.charCodeAt(n)===9;)n++;this.at=n}else{if((r|32)>=97&&(r|32)<=122||r===95){let r=e.charCodeAt(n+5);if(this.word(n,`title`)&&l(r)&&r!==10&&r!==13){let r=n+6;for(;r<t;){let t=e.charCodeAt(r);if(t===35||t===10||t===59)break;r++}if(r>n+6)return this.token(5,r)}for(let[e,t]of v)if(this.keyword(n,e))return this.token(t,n+e.length);if(this.word(n,`rgb`)){let t=(e.charCodeAt(n+3)|32)==97,r=n+(t?4:3),i=e.charCodeAt(r)===40?this.color(r,t?4:3):-1;if(i!==-1)return this.token(t?15:14,i)}for(n++;c(e.charCodeAt(n))||e.charCodeAt(n)===45;)n++;return this.token(16,n)}if(r===91){if(e.charCodeAt(n+1)===34){let t=e.indexOf(`"`,n+2);return t===-1||e.charCodeAt(t+1)!==93?1:(this.at=t+2,this.text=e.slice(n+2,t),11)}let r=n+1;for(;r<t&&e.charCodeAt(r)!==93&&e.charCodeAt(r)!==34;)r++;return r===n+1||e.charCodeAt(r)!==93?1:(this.at=r+1,this.text=e.slice(n+1,r).trim(),11)}if(p(r)||r===46||r===43||r===45){(r===43||r===45)&&n++;let t=n;for(;p(e.charCodeAt(n));)n++;if(n>t){if(e.charCodeAt(n)===46&&p(e.charCodeAt(n+1)))for(n+=2;p(e.charCodeAt(n));)n++}else if(e.charCodeAt(n)===46&&p(e.charCodeAt(n+1)))for(n+=2;p(e.charCodeAt(n));)n++;else return 1;return this.token(12,n)}if(r===35){let t=n+1;for(;t<n+9&&f(e.charCodeAt(t));)t++;return t>=n+4?this.token(13,t):1}if(r===34){let t=e.indexOf(`"`,n+1);return t===-1?1:this.token(17,t+1)}return r===44?this.token(18,n+1):r===58?this.token(19,n+1):1}}}}token(e,t){return this.text=this.src.slice(this.at,t),this.at=t,e}},b=`'EOF', 'NEWLINE', 'TITLE', 'SET', 'UNION', 'TEXT', 'INDENT_TEXT', 'STYLE'`,x=`'NUMERIC', 'IDENTIFIER', 'STRING', 'HEXCOLOR', 'RGBCOLOR', 'RGBACOLOR'`;function S(e,t){let n=new y(e,t),r=-1,i=()=>r===-1?r=n.next():r,a=t=>{throw i()===1?u(`venn`,e,n.start,``,!0):u(`venn`,e,n.start,`Expecting ${t}, got '${_[r]}'`)},o=()=>(r=-1,n.text),c=e=>(i()!==e&&a(`'${_[e]}'`),o()),l=()=>(i()!==16&&r!==17&&a(`'IDENTIFIER', 'STRING'`),o()),d=()=>{let e=[l()];for(;i()===18;)o(),e.push(l());return e},f=(e,n)=>{let r=i()===11?o():void 0,a;if(i()===19&&(o(),a=parseFloat(c(12))),n){if(e.length<2)throw new s(`union requires multiple identifiers`,`semantic`,{type:`venn`});t.validateUnionIdentifiers(e)}t.addSubsetData(e,r,a),t.setIndentMode(!0)},p=e=>{let n=i();n!==16&&n!==17&&n!==12&&a(`'NUMERIC', 'IDENTIFIER', 'STRING'`);let r=o(),s=n!==12&&i()===11?o():void 0;t.addTextData(e(),r,s)},m=()=>{let e=d(),n=[];for(;;){let e=c(16);c(19);let t;if(i()===17)t=o();else{let e=[];for(;i()===16||r>=12&&r<=15;)e.push(o());e.length===0&&a(x),t=e.join(` `)}if(n.push([e,t]),i()!==18)break;o()}t.addStyleData(e,n)};for(;i()===3;)o();for(c(4);;){let e=i();if(e===2)return;if((e<3||e>10||e===4)&&a(b),o(),e===5)t.setDiagramTitle(n.text.slice(6));else if(e===6)f([l()],!1);else if(e===7)f(d(),!0);else if(e===8){let e=d();p(()=>e)}else e===9?p(()=>{let e=t.getCurrentSets();if(!e)throw new s(`text requires set`,`semantic`,{type:`venn`});return e}):e===10&&m()}}var C=Math.PI*2;function w(e){let t=new Set,n=new Map;for(let r of e)t.add(JSON.stringify([...r.sets].sort())),r.sets.length===1&&n.set(r.sets[0],r.size);let r=[];for(let i of e){if(i.sets.length<3)continue;let e=[...i.sets].sort();for(let i=0;i<e.length-1;i++)for(let a=i+1;a<e.length;a++){let o=[e[i],e[a]],s=JSON.stringify(o);if(t.has(s))continue;t.add(s);let c=n.get(o[0]),l=n.get(o[1]);r.push({sets:o,size:c!==void 0&&l!==void 0?Math.min(c,l)/4:2.5,label:``})}}return r.length>0?[...e,...r]:e}function T(e,t,n){if(n>=e+t)return 0;let r=Math.min(e,t);if(n<=Math.abs(e-t))return Math.PI*r*r;let i=e*e*Math.acos((n*n+e*e-t*t)/(2*n*e)),a=t*t*Math.acos((n*n+t*t-e*e)/(2*n*t)),o=.5*Math.sqrt(Math.max((-n+e+t)*(n+e-t)*(n-e+t)*(n+e+t),0));return i+a-o}function E(e,t,n){let r=Math.abs(e-t),i=e+t;if(!(n>0))return i;if(n>=Math.PI*Math.min(e,t)**2)return r;for(let a=0;a<48;a++){let a=(r+i)/2;T(e,t,a)>n?r=a:i=a}return(r+i)/2}function D(e,t,n,r,i,a){let o=1/0;for(let n of t){let t=e[n],s=r-t.x,c=i-t.y,l=t.r-Math.sqrt(s*s+c*c);if(l<o){if(l<a)return l;o=l}}for(let t of n){let n=e[t],s=r-n.x,c=i-n.y,l=Math.sqrt(s*s+c*c)-n.r;if(l<o){if(l<a)return l;o=l}}return o}function O(e,t,n){let r=0,i=0,a=e[t[0]];for(let n of t){let o=e[n];r+=o.x/t.length,i+=o.y/t.length,o.r<a.r&&(a=o)}let o=a.r,s=r,c=i,l=D(e,t,n,s,c,-1/0),u=0,d=(a,d)=>{let f=D(e,t,n,a,d,l-o*1e-9);if(!(f>l-o*1e-9))return!1;let p=Math.hypot(a-r,d-i);return f>l+o*1e-9||p<u-o*1e-9?(l=f,u=p,s=a,c=d,!0):!1};for(let e=-10;e<=10;e++)for(let t=-10;t<=10;t++)t*t+e*e<=100&&d(a.x+t*o/10,a.y+e*o/10);let f=o/10;for(let e=0;e<40&&f>o*1e-6;e++){let e=!1;for(let t=0;t<8;t++){let n=t*C/8;d(s+Math.cos(n)*f,c+Math.sin(n)*f)&&(e=!0)}e||(f/=2)}return{x:s,y:c,margin:l}}function k(e){let t=new Map;for(let n of e)for(let e of n.sets)t.has(e)||t.set(e,10);for(let n of e)n.sets.length===1&&t.set(n.sets[0],n.size);let n=new Map,r=[],i=0;for(let e of t.values())Number.isFinite(e)&&e>i&&(i=e);i===0&&(i=10);let a=Math.sqrt(i/Math.PI);for(let[e,i]of t){n.set(e,r.length);let t=Number.isFinite(i)&&i>0?Math.sqrt(i/Math.PI):0;r.push({id:e,x:0,y:0,r:Math.max(t,a*.3)})}let o=r.length;if(o<2)return r;let s=new Map;for(let t of w(e)){if(t.sets.length!==2)continue;let e=n.get(t.sets[0]),r=n.get(t.sets[1]);e!==r&&s.set(Math.min(e,r)*o+Math.max(e,r),t.size)}let c=new Map;for(let[e,t]of s)c.set(e,E(r[Math.floor(e/o)].r,r[e%o].r,t));let l=a*.15,u=(e,t)=>c.get(e*o+t)??r[e].r+r[t].r+l;if(o===2)return r[1].x=u(0,1),r;if(o===3){let t=u(0,1),n=u(0,2),i=u(1,2),o=e.some(e=>new Set(e.sets).size===3);for(let e=0;e<40;e++){let e=t>0?(t*t+n*n-i*i)/(2*t):0;if(r[1].x=t,r[2].x=Math.max(-n,Math.min(n,e)),r[2].y=Math.sqrt(Math.max(n*n-e*e,0)),!o||O(r,[0,1,2],[]).margin>a*.12)break;t*=.94,n*=.94,i*=.94}return r}let d=0;for(let e of r)d+=2*e.r+l;let f=Math.min(300,Math.floor(3e6/(o*o)));if(o<=64){let e=d/C;r.forEach((t,n)=>{let r=n*C/o-Math.PI/2;t.x=Math.cos(r)*e,t.y=Math.sin(r)*e})}else{let e=Math.ceil(Math.sqrt(o)),t=2*a+l;r.forEach((n,r)=>{n.x=r%e*t,n.y=Math.floor(r/e)*t})}let p=new Float64Array(o),m=new Float64Array(o),h=new Int32Array(o);for(let e=0;e<f;e++){p.fill(0),m.fill(0),h.fill(0);for(let e=0;e<o;e++)for(let t=e+1;t<o;t++){let n=c.get(e*o+t),i=r[e].r+r[t].r+l,a=r[t].x-r[e].x,s=r[t].y-r[e].y,u=Math.hypot(a,s);if(n===void 0&&u>=i)continue;u<1e-9&&(a=Math.cos(e+t),s=Math.sin(e+t),u=1);let d=(u-(n??i))/2/u;p[e]+=a*d,m[e]+=s*d,p[t]-=a*d,m[t]-=s*d,h[e]++,h[t]++}for(let e=0;e<o;e++)h[e]!==0&&(r[e].x+=p[e]/h[e],r[e].y+=m[e]/h[e])}return r}function A(e,t){let n=e=>`M${t(e.x-e.r)},${t(e.y)}A${t(e.r)},${t(e.r)} 0 1 1 ${t(e.x+e.r)},${t(e.y)}A${t(e.r)},${t(e.r)} 0 1 1 ${t(e.x-e.r)},${t(e.y)}Z`;if(e.length===1)return n(e[0]);let r=(t,n,r,i)=>{for(let a of e)if(a!==r&&a!==i&&Math.hypot(t-a.x,n-a.y)>a.r*(1+1e-9))return!1;return!0},i=[];for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let a=e[t],o=e[n],s=Math.hypot(o.x-a.x,o.y-a.y);if(s>=a.r+o.r||s<=Math.abs(a.r-o.r)||s===0)continue;let c=(a.r*a.r-o.r*o.r+s*s)/(2*s),l=Math.sqrt(Math.max(a.r*a.r-c*c,0)),u=a.x+(o.x-a.x)*c/s,d=a.y+(o.y-a.y)*c/s;for(let e of[1,-1]){let t=u+e*l*(o.y-a.y)/s,n=d-e*l*(o.x-a.x)/s;r(t,n,a,o)&&i.push({x:t,y:n,a,b:o})}}if(i.length<2){let t=e[0];for(let n of e)n.r<t.r&&(t=n);for(let n of e)if(n!==t&&Math.hypot(n.x-t.x,n.y-t.y)+t.r>n.r*(1+1e-9))return``;return n(t)}let a=0,o=0;for(let e of i)a+=e.x/i.length,o+=e.y/i.length;i.sort((e,t)=>Math.atan2(e.y-o,e.x-a)-Math.atan2(t.y-o,t.x-a));let s=``;for(let e=0;e<i.length;e++){let n=i[e],r=i[(e+1)%i.length];e===0&&(s=`M${t(n.x)},${t(n.y)}`);let a,o=0,c=1/0;for(let e of[n.a,n.b]){if(e!==r.a&&e!==r.b)continue;let t=Math.atan2(n.y-e.y,n.x-e.x),i=Math.atan2(r.y-e.y,r.x-e.x)-t;i<=0&&(i+=C);let s=e.x+e.r*Math.cos(t+i/2),l=e.y+e.r*Math.sin(t+i/2),u=Math.hypot(s-(n.x+r.x)/2,l-(n.y+r.y)/2);u<c&&(c=u,a=e,o=+(i>Math.PI))}s+=a===void 0?`L${t(r.x)},${t(r.y)}`:`A${t(a.r)},${t(a.r)} 0 ${o} 1 ${t(r.x)},${t(r.y)}`}return s+`Z`}var j=100,M=1.6,N=i([]);function P(e){return e.length===1?e[0]:JSON.stringify(e)}function F(s,c,l){let u=l.fontSize??16,f=Math.round(u*.875),p=Math.round(u*.8125),h=l.measurer??d(l.fontFamily,l.fontFamilyMono),g=l.padding??8,_=k(s.subsets),v=new Map;_.forEach((e,t)=>v.set(e.id,t));let y=new Map;for(let{targets:e,styles:t}of s.styles){let n=P(e),r=y.get(n);r||y.set(n,r=new Map);for(let[e,n]of t)r.set(e,n)}let b=e=>{let t=y.get(e);if(!t)return N;let n=[];for(let[e,r]of t)n.push(`${e}:${r}`);return i(n)},x=_.map(()=>[]);for(let e=0;e<_.length;e++)for(let t=e+1;t<_.length;t++)Math.hypot(_[e].x-_[t].x,_[e].y-_[t].y)<_[e].r+_[t].r&&(x[e].push(t),x[t].push(e));let S=new Map;for(let e of s.subsets)S.set(P(e.sets),e);let C=new Map;for(let[e,t]of S){let n=[...new Set(t.sets)],r=n.map(e=>v.get(e)),i=new Set(r),o=r[0];for(let e of r)_[e].r<_[o].r&&(o=e);let s=b(e),c=t.label??(t.sets.length===1?t.sets[0]:void 0),l=+!!s.bold|(s.italic?2:0),d=O(_,r,x[o].filter(e=>!i.has(e)));d.margin<_[o].r*.2&&(d=O(_,r,[]));let p={sets:n,inside:r,spot:d,lines:[],style:s};if(c){let e=n.length===1?u:f;p.lines.push({id:void 0,raw:c,size:e,base:l,label:a(c,!1,h,e,4e3,l)})}C.set(e,p)}for(let e of s.textNodes){let t=e.label??e.id;C.get(P(e.sets))?.lines.push({id:e.id,raw:t,size:p,base:0,label:a(t,!1,h,p,4e3)})}let w=0;for(let e of _)e.r>w&&(w=e.r);let T=w>0?j/w:1,E=1;for(let e of C.values()){if(e.spot.margin<=0)continue;let t=0,n=0;for(let r of e.lines)t=Math.max(t,r.label.width),n+=r.label.height;let r=Math.hypot(t,n)/2+4;E=Math.max(E,Math.min(r/(e.spot.margin*T),M))}T*=E;for(let e of C.values()){let t=Math.max(e.spot.margin*T*1.8,72);for(let n of e.lines)n.label.width>t&&(n.label=a(n.raw,!1,h,n.size,t,n.base))}let D=1/0,F=1/0,I=-1/0,L=-1/0;for(let e of _)D=Math.min(D,(e.x-e.r)*T),F=Math.min(F,(e.y-e.r)*T),I=Math.max(I,(e.x+e.r)*T),L=Math.max(L,(e.y+e.r)*T);for(let e of C.values()){let t=0,n=0;for(let r of e.lines)t=Math.max(t,r.label.width),n+=r.label.height;D=Math.min(D,e.spot.x*T-t/2),I=Math.max(I,e.spot.x*T+t/2),F=Math.min(F,e.spot.y*T-n/2),L=Math.max(L,e.spot.y*T+n/2)}_.length===0&&(D=F=I=L=0);let R=a(s.title&&m(s.title),!1,h,u,4e3,1),z=R.height>0?R.height+12:0,B=Math.max(I-D,R.width),V=g+(B-(I-D))/2-D,H=g+z-F,U=Math.ceil(B+2*g),W=Math.ceil(L-F+z+2*g),G=_.map(e=>({id:e.id,x:e.x*T+V,y:e.y*T+H,r:e.r*T})),K=``;G.forEach((e,r)=>{let i=t(r),a=C.get(e.id)?.style??N;K+=`<circle class="pele-venn-set" data-id="${n(e.id)}" cx="${o(e.x)}" cy="${o(e.y)}" r="${o(e.r)}" fill="${i}" fill-opacity="0.2" stroke="${i}"${a.shape}/>`});let q=``,J=``;for(let e of C.values()){let t=n(e.sets.join(`|`));if(e.sets.length>1&&e.style.shape!==``){let n=A(e.inside.map(e=>G[e]),o);n!==``&&(q+=`<path class="pele-venn-overlap" data-id="${t}" d="${n}" fill="none"${e.style.shape}/>`)}let i=0;for(let t of e.lines)i+=t.label.height;if(i===0)continue;let a=e.spot.x*T+V,s=e.spot.y*T+H-i/2,c=``;for(let t of e.lines){let i=t.id===void 0?` class="pele-label"${t.size===u?``:` font-size="${t.size}"`}${e.style.text}`:` class="pele-venn-text" data-id="${n(t.id)}" font-size="${p}" fill="var(--_m)"${b(t.id).text}`;c+=r(t.label,a,s+t.label.height/2,i),s+=t.label.height}J+=`<g class="pele-venn-region" data-id="${t}">${c}</g>`}return{svg:e(`venn`,U,W,u,l,{},r(R,U/2,g+R.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g class="pele-venn-sets">${K}</g>`+(q?`<g class="pele-venn-overlaps">${q}</g>`:``)+(J?`<g class="pele-venn-labels">${J}</g>`:``)),width:U,height:W,links:[]}}var I={type:`venn`,parse(e,t,n){let r=new g;return n&&(r.title=n),S(e,r),r},render:F};export{I as venn};
@@ -1,4 +1,4 @@
1
- import{d as e,f as t,m as n,p as r}from"./BNlziJ_1.js";var i=/[&<>"\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ud800-\udfff\ufffe\uffff]/u,a=/[&<>"]|[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ud800-\udfff\ufffe\uffff]+/gu,o={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`},s=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ud800-\udfff\ufffe\uffff]/u;function c(e){return i.test(e)?e.replace(a,e=>o[e]??``):e}function l(t){return c(e(t))}var u=[];for(let e=0;e<100;e++)u.push(e===0?``:e%10==0?`.`+e/10:`.`+(e<10?`0`+e:e));function d(e){let t=Math.round(e*100);if(t===0)return`0`;if(t>0){if(t<1e11){let e=Math.floor(t/100);return e+u[t-e*100]}}else if(t>-1e11){let e=-t,n=Math.floor(e/100);return`-`+n+u[e-n*100]}return String(t/100)}function f(e,t,n,r,i){let a=e.lines;if(a.length===0)return``;let o=e.lineHeight,s=e.heights,u=e.size*.35,f=n-e.height/2,p=a.length===1&&a[0].length===1?a[0][0]:void 0;if(p&&p.icon===void 0&&p.math===void 0&&p.style===0)return`<text${r} x="${d(t)}" y="${d(f+o/2+u)}" text-anchor="middle">${c(p.text)}</text>`;let m=T(e),h=r,g;r=E(r,m);let _=``,b=``;for(let n=0;n<a.length;n++){let r=a[n],p=s?s[n]:o,x=f+p/2,S=x+u,C=!1;for(let e of r)(e.icon!==void 0||e.math)&&(C=!0);if(C){let a=t-e.widths[n]/2;for(let t of r){if(t.math){let n=`x="${d(a)}" y="${d(x-t.math.height/2)}" width="${d(t.math.width)}" height="${d(t.math.height)}"`;g??=v(h),b+=g.halo===void 0?y(t.math,n,e.size,g.attrs):`<rect ${n} rx="2" fill="${g.halo}"/>`}else if(t.icon!==void 0){let n=e.size*1.1,r=i?.(t.icon)??``;b+=`<svg class="pele-icon" data-icon="${l(t.icon)}" x="${d(a)}" y="${d(x-n/2)}" width="${d(n)}" height="${d(n)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${r}</svg>`}else t.text!==``&&(_+=`<tspan x="${d(a)}" y="${d(S)}" text-anchor="start"${w(t.style&~m)}>${c(t.text)}</tspan>`);a+=t.width}}else{for(let e=0;e<r.length;e++){let n=r[e],i=e===0?` x="${d(t)}" y="${d(S)}"`:``;_+=`<tspan${i}${w(n.style&~m)}>${c(n.text)}</tspan>`}r.length===0&&(_+=`<tspan x="${d(t)}" y="${d(S)}"> </tspan>`)}f+=p}return`<text${r} text-anchor="middle" xml:space="preserve">${_}</text>${b}`}var p=/ fill="([^"]*)"/,m=/ stroke="([^"]*)"/,h=/ style="([^"]*)"/,g=/(?:^|;)\s*fill:([^;]*)/,_=/(?:^|;)\s*opacity:([^;]*)/;function v(e){let t=h.exec(e)?.[1]??``,n=(g.exec(t)?.[1]??p.exec(e)?.[1]??``).trim();if(n===`none`)return{attrs:``,halo:m.exec(e)?.[1]??`none`};let r=_.exec(t)?.[1].trim();return{attrs:(n===``?``:` color="${n}"`)+(r?` opacity="${r}"`:``)}}function y(e,t,n,r){return`svg`in e?`<svg class="pele-math" ${t} overflow="visible"${r}>${e.svg}</svg>`:`<foreignObject class="pele-math" ${t} overflow="visible"${r}><div xmlns="http://www.w3.org/1999/xhtml" style="display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:${d(n)}px;line-height:normal;white-space:nowrap">${e.html}</div></foreignObject>`}var b=` font-weight="var(--_w)"`,x=` font-style="italic"`,S=` text-decoration="underline"`,C=` font-family="var(--_fm)"`,ee=` baseline-shift="sub" font-size="smaller"`,te=` baseline-shift="super" font-size="smaller"`;function w(e){return(e&1?b:``)+(e&2?x:``)+(e&4?C:``)+(e&32?S:``)+(e&8?ee:e&16?te:``)}function T(e){let t=7,n=!1;for(let r of e.lines)for(let e of r)e.icon!==void 0||e.text===``||(t&=e.style,n=!0);return n?t:0}function E(e,t){return e+(t&1&&!e.includes(` font-weight="`)?b:``)+(t&2&&!e.includes(` font-style="`)?x:``)+(t&4&&!e.includes(` font-family="`)?C:``)}var ne=1.5,D=1.3,re=/<br\s*\/?>|\\n|\n/gi,O=/<\/?([a-zA-Z][\w-]*)(?:\s[^<>]*)?\/?>/y,k=/(fa[bklrs]?):fa-([\w-]+)/g,A=/[<\\\n*_]|fa[bklrs]?:fa-/,j=new Map([[`b`,1],[`strong`,1],[`i`,2],[`em`,2],[`cite`,2],[`dfn`,2],[`var`,2],[`code`,4],[`kbd`,4],[`samp`,4],[`tt`,4],[`sub`,8],[`sup`,16],[`u`,32],[`ins`,32]]),ie=24,ae=new Set(`a abbr address article aside audio b bdi bdo big blockquote body br button caption center cite code col colgroup data dd del details dfn dialog div dl dt em embed fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 head header hr html i iframe img input ins kbd label legend li link main map mark meta meter nav noscript object ol optgroup option output p picture pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr`.split(` `)),M=`\\u2e80-\\u9fff\\uf900-\\ufaff\\uff00-\\uff60`,N=`、。,.:;!?)]}」』】〕〉》〙〗ー…‥・ゝゞぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮ,.:;!?)\\]}`,oe=`([{「『【〔〈《〘〖([{`,se=RegExp(`[${M}]`),P=`\\u200b\\u00ad`,ce=RegExp(`[${P}]`),le=RegExp(`\\s*(?:[${oe}]*[${M}][${N}]*|[^\\s${M}${P}]+[${P}]*[${N}]*|[${P}]+)\\s*|\\s+`,`g`),F=57344,I=6400,L=/\$\$(.+?)\$\$/g,R=/[\ue000-\uf8ff]/,z=/([\ue000-\uf8ff])/,B,V={lines:[],widths:[],width:0,height:0,size:0,lineHeight:0};function H(e){let t=e.split(`
1
+ import{d as e,f as t,m as n,p as r}from"./BArcFmbE.js";var i=/[&<>"\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ud800-\udfff\ufffe\uffff]/u,a=/[&<>"]|[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ud800-\udfff\ufffe\uffff]+/gu,o={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`},s=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ud800-\udfff\ufffe\uffff]/u;function c(e){return i.test(e)?e.replace(a,e=>o[e]??``):e}function l(t){return c(e(t))}var u=[];for(let e=0;e<100;e++)u.push(e===0?``:e%10==0?`.`+e/10:`.`+(e<10?`0`+e:e));function d(e){let t=Math.round(e*100);if(t===0)return`0`;if(t>0){if(t<1e11){let e=Math.floor(t/100);return e+u[t-e*100]}}else if(t>-1e11){let e=-t,n=Math.floor(e/100);return`-`+n+u[e-n*100]}return String(t/100)}function f(e,t,n,r,i){let a=e.lines;if(a.length===0)return``;let o=e.lineHeight,s=e.heights,u=e.size*.35,f=n-e.height/2,p=a.length===1&&a[0].length===1?a[0][0]:void 0;if(p&&p.icon===void 0&&p.math===void 0&&p.style===0)return`<text${r} x="${d(t)}" y="${d(f+o/2+u)}" text-anchor="middle">${c(p.text)}</text>`;let m=T(e),h=r,g;r=E(r,m);let _=``,b=``;for(let n=0;n<a.length;n++){let r=a[n],p=s?s[n]:o,x=f+p/2,S=x+u,C=!1;for(let e of r)(e.icon!==void 0||e.math)&&(C=!0);if(C){let a=t-e.widths[n]/2;for(let t of r){if(t.math){let n=`x="${d(a)}" y="${d(x-t.math.height/2)}" width="${d(t.math.width)}" height="${d(t.math.height)}"`;g??=v(h),b+=g.halo===void 0?y(t.math,n,e.size,g.attrs):`<rect ${n} rx="2" fill="${g.halo}"/>`}else if(t.icon!==void 0){let n=e.size*1.1,r=i?.(t.icon)??``;b+=`<svg class="pele-icon" data-icon="${l(t.icon)}" x="${d(a)}" y="${d(x-n/2)}" width="${d(n)}" height="${d(n)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${r}</svg>`}else t.text!==``&&(_+=`<tspan x="${d(a)}" y="${d(S)}" text-anchor="start"${w(t.style&~m)}>${c(t.text)}</tspan>`);a+=t.width}}else{for(let e=0;e<r.length;e++){let n=r[e],i=e===0?` x="${d(t)}" y="${d(S)}"`:``;_+=`<tspan${i}${w(n.style&~m)}>${c(n.text)}</tspan>`}r.length===0&&(_+=`<tspan x="${d(t)}" y="${d(S)}"> </tspan>`)}f+=p}return`<text${r} text-anchor="middle" xml:space="preserve">${_}</text>${b}`}var p=/ fill="([^"]*)"/,m=/ stroke="([^"]*)"/,h=/ style="([^"]*)"/,g=/(?:^|;)\s*fill:([^;]*)/,_=/(?:^|;)\s*opacity:([^;]*)/;function v(e){let t=h.exec(e)?.[1]??``,n=(g.exec(t)?.[1]??p.exec(e)?.[1]??``).trim();if(n===`none`)return{attrs:``,halo:m.exec(e)?.[1]??`none`};let r=_.exec(t)?.[1].trim();return{attrs:(n===``?``:` color="${n}"`)+(r?` opacity="${r}"`:``)}}function y(e,t,n,r){return`svg`in e?`<svg class="pele-math" ${t} overflow="visible"${r}>${e.svg}</svg>`:`<foreignObject class="pele-math" ${t} overflow="visible"${r}><div xmlns="http://www.w3.org/1999/xhtml" style="display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:${d(n)}px;line-height:normal;white-space:nowrap">${e.html}</div></foreignObject>`}var b=` font-weight="var(--_w)"`,x=` font-style="italic"`,S=` text-decoration="underline"`,C=` font-family="var(--_fm)"`,ee=` baseline-shift="sub" font-size="smaller"`,te=` baseline-shift="super" font-size="smaller"`;function w(e){return(e&1?b:``)+(e&2?x:``)+(e&4?C:``)+(e&32?S:``)+(e&8?ee:e&16?te:``)}function T(e){let t=7,n=!1;for(let r of e.lines)for(let e of r)e.icon!==void 0||e.text===``||(t&=e.style,n=!0);return n?t:0}function E(e,t){return e+(t&1&&!e.includes(` font-weight="`)?b:``)+(t&2&&!e.includes(` font-style="`)?x:``)+(t&4&&!e.includes(` font-family="`)?C:``)}var ne=1.5,D=1.3,re=/<br\s*\/?>|\\n|\n/gi,O=/<\/?([a-zA-Z][\w-]*)(?:\s[^<>]*)?\/?>/y,k=/(fa[bklrs]?):fa-([\w-]+)/g,A=/[<\\\n*_]|fa[bklrs]?:fa-/,j=new Map([[`b`,1],[`strong`,1],[`i`,2],[`em`,2],[`cite`,2],[`dfn`,2],[`var`,2],[`code`,4],[`kbd`,4],[`samp`,4],[`tt`,4],[`sub`,8],[`sup`,16],[`u`,32],[`ins`,32]]),ie=24,ae=new Set(`a abbr address article aside audio b bdi bdo big blockquote body br button caption center cite code col colgroup data dd del details dfn dialog div dl dt em embed fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 head header hr html i iframe img input ins kbd label legend li link main map mark meta meter nav noscript object ol optgroup option output p picture pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr`.split(` `)),M=`\\u2e80-\\u9fff\\uf900-\\ufaff\\uff00-\\uff60`,N=`、。,.:;!?)]}」』】〕〉》〙〗ー…‥・ゝゞぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮ,.:;!?)\\]}`,oe=`([{「『【〔〈《〘〖([{`,se=RegExp(`[${M}]`),P=`\\u200b\\u00ad`,ce=RegExp(`[${P}]`),le=RegExp(`\\s*(?:[${oe}]*[${M}][${N}]*|[^\\s${M}${P}]+[${P}]*[${N}]*|[${P}]+)\\s*|\\s+`,`g`),F=57344,I=6400,L=/\$\$(.+?)\$\$/g,R=/[\ue000-\uf8ff]/,z=/([\ue000-\uf8ff])/,B,V={lines:[],widths:[],width:0,height:0,size:0,lineHeight:0};function H(e){let t=e.split(`
2
2
  `),n=1/0;for(let e of t){if(e.trim()===``)continue;let t=e.length-e.trimStart().length;t<n&&(n=t)}return n===1/0||n===0?e:t.map(e=>e.slice(Math.min(n,e.length-e.trimStart().length))).join(`
3
3
  `)}function U(e){return e!==void 0&&e.icon===void 0&&e.math===void 0}function W(e,t,n){if(t!==``){if(B!==void 0&&R.test(t)){let r=B,i=t.split(z);for(let t=0;t<i.length;t++){if(t%2==0){i[t]!==``&&G(e,i[t],n);continue}let a=i[t].charCodeAt(0)-F,o=r.math[a];o?e.push({text:``,style:n,math:o,width:o.width}):G(e,`$$${r.tex[a]}$$`,n)}return}G(e,t,n)}}function G(t,n,r){let i=e(n),a=t[t.length-1];U(a)&&a.style===r?a.text+=i:t.push({text:i,style:r,width:0})}function ue(e,n,r){if(!n.includes(`:fa-`)){W(e,n,r);return}let i=0;k.lastIndex=0;let a;for(;(a=k.exec(n))!==null;){let o=`${a[1]}:fa-${a[2]}`;if(W(e,n.slice(i,a.index),r),i=a.index+a[0].length,t(o)!==``)e.push({text:``,style:r,icon:o,width:0});else if(n[i]===` `)i++;else if(i===n.length){let t=e[e.length-1];U(t)&&(t.text=t.text.trimEnd())}}W(e,n.slice(i),r)}function de(e,t,n,r,i){let a=i.style,o=0,s=``,c=0,l=t.length,u=()=>{ue(e,s,a|(i.shifts[i.shifts.length-1]??0)),s=``};for(;c<l;){let e=t[c];if(e===`<`){O.lastIndex=c;let e=O.exec(t);if(e&&e.index===c){let n=e[1].toLowerCase(),o=t[c+1]===`/`,s=j.get(n)??0;if(s&ie){u();let e=i.shifts.lastIndexOf(s);o?e!==-1&&i.shifts.splice(e,1):i.shifts.push(s)}else s&&(u(),i.style=o?i.style&~s|r&s:i.style|s,a=o?a&~s|r&s:a|s);if(s||ae.has(n)){c+=e[0].length;continue}}}else if(n&&(e===`*`||e===`_`)){let n=t[c+1]===e,i=n?1:2,s=n?2:1,d=(o&i)===0,f=c>0?t[c-1]:` `,p=c+s<l?t[c+s]:` `,m=d&&p.trim()!==``&&t.indexOf(n?e+e:e,c+s)!==-1,h=!d&&f.trim()!==``,g=e===`_`&&/\w/.test(f)&&/\w/.test(p);if((m||h)&&!g){u(),o=m?o|i:o&~i,a=m?a|i:a&~i|r&i,c+=s;continue}}s+=e,c++}u()}function fe(e,t,n){let r=0;for(let i of e)i.width=i.icon===void 0?i.math?i.math.width:t.width(i.text,n,i.style):n*1.25,r+=i.width;return r}function K(e,t,n,r,i,a){let o=[],s=0,c=(e=!1)=>{let r=o[o.length-1];if(U(r)){let i=r.text.trimEnd();if(e&&r.text.endsWith(`­`)&&(i=i.slice(0,-1)+`-`),i!==r.text){r.text=i;let e=t.width(i,n,r.style);s+=e-r.width,r.width=e}}i.push(o),a.push(s),o=[],s=0};for(let i of e){if(i.icon!==void 0||i.math){let e=i.math?i.math.width:n*1.25;s>0&&s+e>r&&c(),o.push({...i,width:e}),s+=e;continue}let a=i.text.match(le)??[],l=i.text.includes(`­`),u=l?a.length:0,d=new Float64Array(u),f=new Float64Array(u+1);for(let r=u-1;r>=0;r--){let o=a[r].endsWith(`­`),s=a[r].trimEnd();d[r]=t.width(o?s.slice(0,-1):s,n,i.style),f[r]=o?r===u-1?i===e[e.length-1]?d[r]:1/0:d[r]+f[r+1]:d[r]}for(let e=0;e<a.length;e++){let u=a[e],p=l?d[e]:t.width(u.trimEnd(),n,i.style),m=!l||!u.endsWith(`­`)?s+p<=r:s+t.width(u.slice(0,-1)+`-`,n,i.style)<=r||s+f[e]<=r;s>0&&!m&&(c(u.trimStart()===u),u=u.trimStart());let h=o[o.length-1];if(U(h)&&h.style===i.style){if(h.text+=u,p>0||u.trimEnd()!==u){let e=h.width;h.width=t.width(h.text,n,h.style),s+=h.width-e}}else{let e=t.width(u,n,i.style);o.push({text:u,style:i.style,width:e}),s+=e}}}(o.length>0||i.length===0)&&c()}function pe(t,i,a,o,s,c=0){if(t===void 0||t===``)return V;let l=Math.round(o*ne);if(r()&&t.includes(`$$`)&&!R.test(t)){let r={tex:[],math:[]},u=t.replace(L,(e,t)=>r.tex.length===I?e:(r.tex.push(t),String.fromCharCode(F+r.tex.length-1)));if(r.tex.length>0){for(let t of r.tex)r.math.push(n(e(t),o));return q(u,i,a,o,s,c,l,r)}}if(!A.test(t)&&!t.includes(`&`)&&!t.includes(`fl`)){let e=t.trim(),n=a.width(e,o,c);if(n<=s||!(e.includes(` `)||se.test(e)||ce.test(e)))return{lines:[[{text:e,style:c,width:n}]],widths:[n],width:n,height:l,size:o,lineHeight:l};let r=[],i=[];K([{text:e,style:c,width:n}],a,o,s,r,i);let u=0;for(let e of i)e>u&&(u=e);let d=r.length>1?Math.round(o*D):l;return{lines:r,widths:i,width:u,height:r.length*d,size:o,lineHeight:d}}return q(t,i,a,o,s,c,l)}function q(e,t,n,r,i,a,o,s){let c=B;B=s;try{let c=me(e,t,n,r,i,a,o);return s?J(c):c}finally{B=c}}function me(e,t,n,r,i,a,o){let s=t?H(e.replace(/\r\n?/g,`
4
4
  `)).trim():e.trim(),c=[],l=[],u=0,d={style:a,shifts:[]};for(let e of s.split(re)){let o=[];de(o,e.trim(),t,a,d);let s=fe(o,n,r);s>i?K(o,n,r,i,c,l):(c.push(o),l.push(s))}for(let e of l)e>u&&(u=e);let f=c.length>1?Math.round(r*D):o;return{lines:c,widths:l,width:u,height:c.length*f,size:r,lineHeight:f}}function J(e){let t;for(let n=0;n<e.lines.length;n++){let r=e.lineHeight;for(let t of e.lines[n])t.math&&(r=Math.max(r,Math.ceil(t.math.height+e.size/4)));r!==e.lineHeight&&t===void 0&&(t=e.lines.map(()=>e.lineHeight)),t&&(t[n]=r)}if(t===void 0)return e.heights===void 0?e:{...e,heights:void 0,height:e.lines.length*e.lineHeight};let n=0;for(let e of t)n+=e;return{...e,heights:t,height:n}}function he(e){for(let t of e)if(t.math)return!0;return!1}function ge(e,t){let n=e.heights;if(!n)return(t+.5)*e.lineHeight;let r=0;for(let e=0;e<t;e++)r+=n[e];return r+n[t]/2}function _e(e,t){let n=e.widths[t],r=e.heights?e.heights[t]:e.lineHeight,i={lines:[e.lines[t]],widths:[n],width:n,height:r,size:e.size,lineHeight:e.lineHeight};return r!==e.lineHeight&&(i.heights=[r]),i}var ve=`--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg)`,ye=`var(--_fm)`,be=`var(--pele-radius,4px)`,Y=` style="rx:var(--_r)"`;function xe(e){let t=e.indexOf(` style="`);return t<0?e+Y:`${e.slice(0,t+8)}rx:var(--_r);${e.slice(t+8)}`}var Se=`var(--pele-critical,#e45756)`,X=String.raw`(?:"[^"'\\\n<>{}();:@]*"|'[^"'\\\n<>{}();:@]*'|[\p{L}\p{N}_-][\p{L}\p{N}_ .-]*)`,Ce=new RegExp(String.raw`^\s*${X}(?:\s*,\s*${X})*\s*$`,`u`);function Z(e,t){return e&&Ce.test(e)?e:t}function we(e,t,n){return`;--_fm:var(--pele-font-mono,${Z(n,`monospace`)});font:${e}px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,${Z(t,`sans-serif`)})`}var Te=new Set([`fill`,`fill-opacity`,`stroke`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`,`stroke-linecap`,`stroke-linejoin`,`stroke-opacity`,`opacity`,`rx`,`ry`]),Ee=new Set([`color`,`font-size`,`font-family`,`font-weight`,`font-style`,`text-decoration`,`letter-spacing`,`word-spacing`,`opacity`]),De=/url\s*\(|expression\s*\(|javascript:|[<>{};\\]|@import|image-set|\/\*/i,Q={shape:``,line:``,text:``,stroke:void 0,bold:!1,italic:!1,fontSize:void 0};function $(e){if(e.length===0)return Q;let t=new Map,n=new Map;for(let r of e){let e=r.indexOf(`:`);if(e<=0)continue;let i=r.slice(0,e).trim().toLowerCase(),a=r.slice(e+1).replace(/!important/gi,``).trim();a===``||De.test(a)||s.test(a)||(Te.has(i)&&t.set(i,a),Ee.has(i)&&n.set(i===`color`?`fill`:i,a))}if(t.size===0&&n.size===0)return Q;let r=``,i=``;for(let[e,n]of t)r+=`${e}:${n};`,e!==`fill`&&e!==`fill-opacity`&&(i+=`${e}:${n};`);let a=``;for(let[e,t]of n)a+=`${e}:${t};`;let o=n.get(`font-weight`),l=n.get(`font-size`),u=l&&/^[\d.]+(px)?$/.test(l)?parseFloat(l):void 0;return{shape:r?` style="${c(r)}"`:``,line:i?` style="${c(i)}"`:``,text:a?` style="${c(a)}"`:``,stroke:t.get(`stroke`),bold:o===`bold`||o===`bolder`||Number(o)>=600,italic:n.get(`font-style`)===`italic`,fontSize:u!==void 0&&u>0&&u<=200?u:void 0}}var Oe=/[^\w-]+/g;function ke(e){let t=e.replace(Oe,` `).trim();return t===``?``:` `+t}var Ae=[`#4c78a8`,`#f58518`,`#54a24b`,`#e45756`,`#72b7b2`,`#eeca3b`,`#b279a2`,`#9d755d`];function je(e){let t=(e%8+8)%8;return`var(--pele-series-${t+1},${Ae[t]})`}var Me=[[`tw`,`title`],[`hw`,`heading`],[`w`,`bold`]],Ne=/var\(--_(r|tw|hw|w)\)/g;function Pe(e,t,n,r,i,a,o){let s=c(i.idPrefix??`pele`),u=``,d=``;a.accTitle&&(u+=`<title id="${s}-title">${l(a.accTitle)}</title>`,d+=` aria-labelledby="${s}-title"`),a.accDescr&&(u+=`<desc id="${s}-desc">${l(a.accDescr)}</desc>`,d+=` aria-describedby="${s}-desc"`);let f=i.responsive===!1?``:`max-width:100%;height:auto;`,p=new Set;for(let[,e]of o.matchAll(Ne))if(p.add(e),p.size===4)break;let m=p.has(`r`)?`;--_r:${be}`:``;for(let[e,t]of Me)p.has(e)&&(m+=`;--_${e}:var(--pele-${t}-weight,bold)`);return`<svg xmlns="http://www.w3.org/2000/svg" class="pele pele-${e}" viewBox="0 0 ${t} ${n}" width="${t}" height="${n}" style="${f}${ve}${m}${c(we(r,i.fontFamily,i.fontFamilyMono))}" fill="var(--_fg)" role="graphics-document document" aria-roledescription="${e}"${d}>`+u+o+`</svg>`}export{Pe as _,c as a,ke as b,T as c,xe as d,je as f,Se as g,J as h,l as i,ye as l,w as m,s as n,f as o,ge as p,Y as r,$ as s,E as t,pe as u,he as v,d as x,_e as y};
@@ -1,4 +1,4 @@
1
- import{_ as e,a as t,b as n,c as r,d as i,i as a,m as o,o as s,p as c,s as l,t as u,u as d,v as f,x as p,y as m}from"./DS7XcdHs.js";import{a as h,t as g}from"./DciMwFJ1.js";import{i as _,l as v}from"./DK9wjWIk.js";import{t as y}from"./CdD6waB-.js";import{i as b,r as x,t as ee}from"./Bx_Vz2qr.js";import{PeleError as S,_ as C,g as w,h as T,s as E,u as te}from"./BNlziJ_1.js";var D={REQUIREMENT:`Requirement`,FUNCTIONAL_REQUIREMENT:`Functional Requirement`,INTERFACE_REQUIREMENT:`Interface Requirement`,PERFORMANCE_REQUIREMENT:`Performance Requirement`,PHYSICAL_REQUIREMENT:`Physical Requirement`,DESIGN_CONSTRAINT:`Design Constraint`},O={LOW_RISK:`Low`,MED_RISK:`Medium`,HIGH_RISK:`High`},k={VERIFY_ANALYSIS:`Analysis`,VERIFY_DEMONSTRATION:`Demonstration`,VERIFY_INSPECTION:`Inspection`,VERIFY_TEST:`Test`},A={CONTAINS:`contains`,COPIES:`copies`,DERIVES:`derives`,SATISFIES:`satisfies`,VERIFIES:`verifies`,REFINES:`refines`,TRACES:`traces`},j=1e6,M=class{type=`requirement`;direction=`TB`;requirements=new Map;elements=new Map;relations=[];classes=new Map;title;accTitle;accDescr;newId=``;newText=``;newRisk=``;newVerifyMethod=``;newElementType=``;newDocRef=``;styleCopies=0;copy(e,t){if(this.styleCopies+=t.length,this.styleCopies>j)throw new S(`Requirement diagram applies too many style declarations.`,`limit`,{type:`requirement`});for(let n of t)e.push(n)}setDirection(e){this.direction=e}addRequirement(e,t){let n=this.requirements.get(e);return n===void 0&&(n={name:e,type:t,requirementId:this.newId,text:this.newText,risk:this.newRisk,verifyMethod:this.newVerifyMethod,cssStyles:[],classes:[`default`]},this.requirements.set(e,n)),this.newId=this.newText=this.newRisk=this.newVerifyMethod=``,n}setNewReqId(e){this.newId=e}setNewReqText(e){this.newText=e}setNewReqRisk(e){this.newRisk=e}setNewReqVerifyMethod(e){this.newVerifyMethod=e}addElement(e){let t=this.elements.get(e);return t===void 0&&(t={name:e,type:this.newElementType,docRef:this.newDocRef,cssStyles:[],classes:[`default`]},this.elements.set(e,t)),this.newElementType=this.newDocRef=``,t}setNewElementType(e){this.newElementType=e}setNewElementDocRef(e){this.newDocRef=e}addRelationship(e,t,n){this.relations.push({type:e,src:t,dst:n})}node(e){return this.requirements.get(e)??this.elements.get(e)}setCssStyle(e,t){for(let n of e){let e=this.node(n);if(!t||!e)return;for(let n of t)this.copy(e.cssStyles,n.includes(`,`)?n.split(`,`):[n])}}setClass(e,t){for(let n of e){let e=this.node(n);if(e)for(let n of t){e.classes.push(n);let t=this.classes.get(n)?.styles;t&&this.copy(e.cssStyles,t)}}}defineClass(e,t){for(let n of e){let e=this.classes.get(n);e===void 0&&(e={id:n,styles:[],textStyles:[]},this.classes.set(n,e));for(let n of t)n.includes(`color`)&&e.textStyles.push(n.replace(`fill`,`bgFill`)),e.styles.push(n);let r=t.flatMap(e=>e.split(`,`));for(let e of this.requirements.values())e.classes.includes(n)&&this.copy(e.cssStyles,r);for(let e of this.elements.values())e.classes.includes(n)&&this.copy(e.cssStyles,r)}}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
1
+ import{_ as e,a as t,b as n,c as r,d as i,i as a,m as o,o as s,p as c,s as l,t as u,u as d,v as f,x as p,y as m}from"./DlgOmQ_G.js";import{a as h,t as g}from"./DciMwFJ1.js";import{i as _,l as v}from"./BF3mdiSX.js";import{t as y}from"./T3u7Skc8.js";import{i as b,r as x,t as ee}from"./CMe14KUo.js";import{PeleError as S,_ as C,g as w,h as T,s as E,u as te}from"./BArcFmbE.js";var D={REQUIREMENT:`Requirement`,FUNCTIONAL_REQUIREMENT:`Functional Requirement`,INTERFACE_REQUIREMENT:`Interface Requirement`,PERFORMANCE_REQUIREMENT:`Performance Requirement`,PHYSICAL_REQUIREMENT:`Physical Requirement`,DESIGN_CONSTRAINT:`Design Constraint`},O={LOW_RISK:`Low`,MED_RISK:`Medium`,HIGH_RISK:`High`},k={VERIFY_ANALYSIS:`Analysis`,VERIFY_DEMONSTRATION:`Demonstration`,VERIFY_INSPECTION:`Inspection`,VERIFY_TEST:`Test`},A={CONTAINS:`contains`,COPIES:`copies`,DERIVES:`derives`,SATISFIES:`satisfies`,VERIFIES:`verifies`,REFINES:`refines`,TRACES:`traces`},j=1e6,M=class{type=`requirement`;direction=`TB`;requirements=new Map;elements=new Map;relations=[];classes=new Map;title;accTitle;accDescr;newId=``;newText=``;newRisk=``;newVerifyMethod=``;newElementType=``;newDocRef=``;styleCopies=0;copy(e,t){if(this.styleCopies+=t.length,this.styleCopies>j)throw new S(`Requirement diagram applies too many style declarations.`,`limit`,{type:`requirement`});for(let n of t)e.push(n)}setDirection(e){this.direction=e}addRequirement(e,t){let n=this.requirements.get(e);return n===void 0&&(n={name:e,type:t,requirementId:this.newId,text:this.newText,risk:this.newRisk,verifyMethod:this.newVerifyMethod,cssStyles:[],classes:[`default`]},this.requirements.set(e,n)),this.newId=this.newText=this.newRisk=this.newVerifyMethod=``,n}setNewReqId(e){this.newId=e}setNewReqText(e){this.newText=e}setNewReqRisk(e){this.newRisk=e}setNewReqVerifyMethod(e){this.newVerifyMethod=e}addElement(e){let t=this.elements.get(e);return t===void 0&&(t={name:e,type:this.newElementType,docRef:this.newDocRef,cssStyles:[],classes:[`default`]},this.elements.set(e,t)),this.newElementType=this.newDocRef=``,t}setNewElementType(e){this.newElementType=e}setNewElementDocRef(e){this.newDocRef=e}addRelationship(e,t,n){this.relations.push({type:e,src:t,dst:n})}node(e){return this.requirements.get(e)??this.elements.get(e)}setCssStyle(e,t){for(let n of e){let e=this.node(n);if(!t||!e)return;for(let n of t)this.copy(e.cssStyles,n.includes(`,`)?n.split(`,`):[n])}}setClass(e,t){for(let n of e){let e=this.node(n);if(e)for(let n of t){e.classes.push(n);let t=this.classes.get(n)?.styles;t&&this.copy(e.cssStyles,t)}}}defineClass(e,t){for(let n of e){let e=this.classes.get(n);e===void 0&&(e={id:n,styles:[],textStyles:[]},this.classes.set(n,e));for(let n of t)n.includes(`color`)&&e.textStyles.push(n.replace(`fill`,`bgFill`)),e.styles.push(n);let r=t.flatMap(e=>e.split(`,`));for(let e of this.requirements.values())e.classes.includes(n)&&this.copy(e.cssStyles,r);for(let e of this.elements.values())e.classes.includes(n)&&this.copy(e.cssStyles,r)}}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
2
2
  `)}},N=`$end.INVALID.title.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.direction_tb.direction_bt.direction_rl.direction_lr.NEWLINE.EOF.RD.STRUCT_START.STRUCT_STOP.STYLE_SEPARATOR.COLONSEP.ID.TEXT.RISK.VERIFYMTHD.REQUIREMENT.FUNCTIONAL_REQUIREMENT.INTERFACE_REQUIREMENT.PERFORMANCE_REQUIREMENT.PHYSICAL_REQUIREMENT.DESIGN_CONSTRAINT.LOW_RISK.MED_RISK.HIGH_RISK.VERIFY_ANALYSIS.VERIFY_DEMONSTRATION.VERIFY_INSPECTION.VERIFY_TEST.ELEMENT.CONTAINS.COPIES.DERIVES.SATISFIES.VERIFIES.REFINES.TRACES.TYPE.DOCREF.STYLE.CLASSDEF.CLASS.ALPHA.COLON.SEMICOLON.PERCENT.MINUS.BRKT.END_ARROW_L.END_ARROW_R.LINE.qString.unqString.COMMA`.split(`.`),P=new Map([[`requirementdiagram`,14],[`id`,19],[`text`,20],[`risk`,21],[`verifymethod`,22],[`requirement`,23],[`functionalrequirement`,24],[`interfacerequirement`,25],[`performancerequirement`,26],[`physicalrequirement`,27],[`designconstraint`,28],[`low`,29],[`medium`,30],[`high`,31],[`analysis`,32],[`demonstration`,33],[`inspection`,34],[`test`,35],[`element`,36],[`contains`,37],[`copies`,38],[`derives`,39],[`satisfies`,40],[`verifies`,41],[`refines`,42],[`traces`,43],[`type`,44],[`docref`,45],[`style`,46],[`classdef`,47],[`class`,48]]),F=/accTitle\s*:\s*/iy,I=/accDescr\s*:\s*/iy,L=/accDescr\s*\{\s*/iy,R=/direction\s+(?:(TB)|(BT)|(RL)|LR)/gi,z=/[\n\r\u2028\u2029]/g,B=22,V=new Uint8Array(128);for(let e of`:,\r
3
3
  {<>-=`)V[e.charCodeAt(0)]=1;function ne(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,c=[[],[],[],[]],l=[[],[],[],[]],u=[0,0,0,0],d=!1,f=-1;R.lastIndex=0;for(let t=R.exec(e);t!==null;t=R.exec(e)){let e=t[1]===void 0?t[2]===void 0?t[3]===void 0?3:2:1:0;c[e].push(t.index),l[e].push(R.lastIndex),d=!0}let p=(t,a,o)=>{n.push(t),r.push(e.slice(a,o)),i.push(a),s=o},m=e=>{a.push(o),o=e},h=()=>{a.length>0&&(o=a.pop())},g=(t,n)=>(t.lastIndex=n,t.test(e)?t.lastIndex:-1),_=n=>{let r=e.indexOf(`
4
4
  `,n);return r===-1?t:r},v=()=>{if(f<s){z.lastIndex=s,f=z.test(e)?z.lastIndex-1:t;for(let e=0;e<4;e++){let t=c[e],n=u[e];for(;n<t.length&&t[n]<=f;)n++;u[e]=n}}for(let e=0;e<4;e++){let t=u[e]-1;if(t>=0&&c[e][t]>=s)return p(8+e,s,_(l[e][t])),!0}return!1},y=a=>{let o=a|32;if(o===116&&e.slice(s+1,s+5).toLowerCase()===`itle`&&T(e.charCodeAt(s+5))){let n=s+6;for(;n<t;){let t=e.charCodeAt(n);if(t===35||t===10||t===59)break;n++}if(n>s+6)return p(2,s,n),!0}if(o===97&&(e.charCodeAt(s+1)|32)==99&&(e.charCodeAt(s+2)|32)==99){let e;if((e=g(F,s))>=0)return m(3),p(3,s,e),!0;if((e=g(I,s))>=0)return m(4),p(5,s,e),!0;if((e=g(L,s))>=0)return m(5),s=e,!0}if(d&&!C(a)&&v())return!0;if(a===10||a===13&&e.charCodeAt(s+1)===10){let n=s;for(;n<t;){let t=e.charCodeAt(n);if(t===10)n++;else if(t===13&&e.charCodeAt(n+1)===10)n+=2;else break}return p(12,s,n),!0}if(T(a)){for(s++;s<t&&T(e.charCodeAt(s));)s++;return!0}if(a===35||a===37)return s=_(s),!0;if(w(a)){let a=s+1;for(;a<t&&w(e.charCodeAt(a));)a++;if(a-s<=B){let t=P.get(e.slice(s,a).toLowerCase());if(t!==void 0)return(t===46||t===47||t===48)&&m(2),p(t,s,a),!0}for(;a<t;){let t=e.charCodeAt(a);if(t<128&&V[t]===1)break;a++}return n.push(59),r.push(e.slice(s,a).trim()),i.push(s),s=a,!0}switch(a){case 123:return p(15,s,s+1),!0;case 125:return p(16,s,s+1),!0;case 58:return e.charCodeAt(s+1)===58&&e.charCodeAt(s+2)===58?p(17,s,s+3):p(18,s,s+1),!0;case 60:return e.charCodeAt(s+1)===45&&(p(55,s,s+2),!0);case 45:return e.charCodeAt(s+1)===62?p(56,s,s+2):p(57,s,s+1),!0;case 34:return m(1),s++,!0;case 44:return p(60,s,s+1),!0}return!1},b=n=>{if(w(n)){let n=s+1;for(;n<t&&w(e.charCodeAt(n));)n++;return p(49,s,n),!0}switch(n){case 58:return p(50,s,s+1),!0;case 59:return p(51,s,s+1),!0;case 37:return p(52,s,s+1),!0;case 45:return p(53,s,s+1),!0;case 35:return p(54,s,s+1),!0;case 32:return s++,!0;case 34:return m(1),s++,!0;case 10:return h(),s++,!0;case 44:return p(60,s,s+1),!0}return!1};for(;s<t;){let a=e.charCodeAt(s),c=!0;switch(o){case 0:c=y(a);break;case 2:c=b(a);break;case 1:if(a===34)h(),s++;else{let n=e.indexOf(`"`,s);p(58,s,n===-1?t:n)}break;case 3:h(),p(4,s,_(s));break;case 4:h(),p(6,s,_(s));break;case 5:if(a===125)h(),s++;else{let n=e.indexOf(`}`,s);p(7,s,n===-1?t:n)}}if(!c)return n.push(1),r.push(``),i.push(s),{types:n,texts:r,starts:i}}let x=o===0?13:o===1?58:o===3?4:o===4?6:o===5?7:-1;return x!==-1&&p(x,t,t),p(0,t,t),{types:n,texts:r,starts:i}}var re=[D.REQUIREMENT,D.FUNCTIONAL_REQUIREMENT,D.INTERFACE_REQUIREMENT,D.PERFORMANCE_REQUIREMENT,D.PHYSICAL_REQUIREMENT,D.DESIGN_CONSTRAINT,O.LOW_RISK,O.MED_RISK,O.HIGH_RISK,k.VERIFY_ANALYSIS,k.VERIFY_DEMONSTRATION,k.VERIFY_INSPECTION,k.VERIFY_TEST,``,A.CONTAINS,A.COPIES,A.DERIVES,A.SATISFIES,A.VERIFIES,A.REFINES,A.TRACES];function H(e){return e===49||e===50||e===54||e===53||e===51}function ie(e,t){let{types:n,texts:r,starts:i}=ne(e),a=0,o=[],s=[],c=(t,r=t,...o)=>{let s=n[a];if(s===1)throw E(`requirement`,e,i[a],``,!0);for(let e=r;e>=t;e--)o.unshift(e);let c=o.map(e=>`'${N[e]}'`).join(`, `);throw E(`requirement`,e,i[a],`Expecting ${c}, got '${N[s]}'`)},l=e=>(n[a]!==e&&c(e),r[a++]),u=(e,t)=>{let r=n[a];return(r<e||r>t)&&c(e,t),a++,re[r-23]},d=()=>{let e=n[a];return e!==59&&e!==58&&c(58,59),r[a++]},f=()=>{let e=n[a];if(e===3)a++,t.setAccTitle(l(4).trim());else if(e===5)a++,t.setAccDescription(l(6).trim());else if(e===7)t.setAccDescription(r[a++].trim());else return!1;return!0},p=()=>{let e=[];for(;;){let t=n[a];if(t!==49&&t!==59&&t!==58&&c(58,59,49),e.push(r[a++]),n[a]!==60)return e;a++}},m=()=>{let e=[];for(;;){H(n[a])||c(49,51,53,54);let t=r[a++];for(;H(n[a]);)t+=r[a++];if(e.push(t),n[a]!==60)return e;a++}},h=()=>{let e;return n[a]===17?(a++,e=p(),l(15)):n[a]===15?a++:c(15,15,17),l(12),e},g=e=>{for(o.length=0,s.length=0;;){let t=n[a];if(t===16){a++;break}t===12?a++:((e?t<19||t>22:t!==44&&t!==45)&&(e&&c(19,22,12,16),c(44,45,12,16)),a++,l(18),s.push(t===21?u(29,31):t===22?u(32,35):d()),o.push(t),l(12))}for(let e=o.length-1;e>=0;e--){let n=s[e];switch(o[e]){case 19:t.setNewReqId(n);break;case 20:t.setNewReqText(n);break;case 21:t.setNewReqRisk(n);break;case 22:t.setNewReqVerifyMethod(n);break;case 44:t.setNewElementType(n);break;default:t.setNewElementDocRef(n)}}};for(;f();)n[a]===12&&a++;for(n[a]!==14&&c(14,14,3,5,7),a++,l(12);;){let e=n[a];if(e===13)return;if(e===12)a++;else{if(f())continue;if(e>=8&&e<=11)a++,t.setDirection(e===8?`TB`:e===9?`BT`:e===10?`RL`:`LR`);else if(e>=23&&e<=28){let e=u(23,28),n=d(),r=h();g(!0),t.addRequirement(n,e),r&&t.setClass([n],r)}else if(e===36){a++;let e=d(),n=h();g(!1),t.addElement(e),n&&t.setClass([e],n)}else if(e===46){a++;let e=p();t.setCssStyle(e,m())}else if(e===47){a++;let e=p();t.defineClass(e,m())}else if(e===48){a++;let e=p();t.setClass(e,p())}else if(e===59||e===58){let e=r[a++],i=n[a];if(i===17)a++,t.setClass([e],p());else if(i===55||i===57){a++;let n=u(37,43);l(i===57?56:57);let r=d();i===57?t.addRelationship(n,e,r):t.addRelationship(n,r,e)}else c(17,17,55,57)}else c(12,13,3,5,7,8,9,10,11,23,24,25,26,27,28,36,47,48,46,59,58)}}}function ae(e){let t=[];for(let n of e.requirements.values())t.push({id:n.name,requirement:n,element:void 0,cssStyles:n.cssStyles,cssClasses:n.classes.join(` `)});for(let n of e.elements.values())t.push({id:n.name,requirement:void 0,element:n,cssStyles:n.cssStyles,cssClasses:n.classes.join(` `)});let n=t=>e.requirements.has(t)||e.elements.has(t)?t:void 0;return{nodes:t,edges:e.relations.map((e,t)=>({id:`${e.src}-${e.dst}-${t}`,start:n(e.src),end:n(e.dst),type:e.type,contains:e.type===A.CONTAINS})),direction:e.direction}}var oe=40,se=16,ce=56,U=14,W=10,G=2,K=12,le=120,ue=280,de=240,q=26,J=6,Y=9,X=4.5,fe=28,pe=14;function Z(e,t,n){if(t===0||e.lines.length===0)return e;let r=0,i=[],a=e.lines.map(a=>{let o=0,s=a.map(r=>{let i=r.style|t,a=r.icon!==void 0||r.math?r.width:n.width(r.text,e.size,i);return o+=a,{...r,style:i,width:a}});return i.push(o),o>r&&(r=o),s});return{...e,lines:a,widths:i,width:r}}function Q(e,n,i,a){let l=r(e),d=``,h=``;for(let r=0;r<e.lines.length;r++){let u=e.lines[r],g=i+c(e,r);if(f(u)){h+=s(m(e,r),n+e.widths[r]/2,g,a);continue}let _=g+e.size*.35,v=!0;for(let e of u)e.icon!==void 0||e.text===``||(d+=`<tspan${v?` x="${p(n)}" y="${p(_)}"`:``}${o(e.style&~l)}>${t(e.text)}</tspan>`,v=!1)}return(d===``?``:`<text${u(a,l)} text-anchor="start" xml:space="preserve">${d}</text>`)+h}function me(e,t,n,r){let i=J,a=e-n*i,o=t-r*i;return`<circle class="pele-marker" cx="${p(a)}" cy="${p(o)}" r="${i}"/><path class="pele-marker" d="M${p(a-n*i)},${p(o-r*i)}L${p(a+n*i)},${p(o+r*i)}M${p(a+r*i)},${p(o-n*i)}L${p(a-r*i)},${p(o+n*i)}"/>`}function he(e,t,n,r){let i=e-n*Y,a=t-r*Y;return`<path class="pele-marker" d="M${p(i-r*X)},${p(a+n*X)}L${p(e)},${p(t)}L${p(i+r*X)},${p(a-n*X)}" stroke-linejoin="round"/>`}function ge(e,t,n){let r=new Map;for(let n of t){let t=n.route;if(!(n.src===n.dst||t.length<6))for(let i of[0,t.length-3]){let a=i===0?n.src:n.dst,o=e[a],s=t[i]-o.x,c=t[i+1]-o.y,l=i===0?3:i-3,u;if(Math.abs(Math.abs(c)-o.h/2)<.5)u=c<0?0:2;else if(Math.abs(Math.abs(s)-o.w/2)<.5)u=s<0?3:1;else continue;let d=a*4+u,f={route:t,at:i,toward:t[u%2==0?l:l+1]},p=r.get(d);p?p.push(f):r.set(d,[f])}}for(let[t,i]of r){if(i.length<2)continue;let r=t>>2,a=t%2==1,o=(a?n[r].h:n[r].w)-2*pe,s=Math.max(0,Math.min(fe,o/(i.length-1)));i.sort((e,t)=>e.toward-t.toward);for(let t=0;t<i.length;t++){let n=(t-(i.length-1)/2)*s;a?i[t].route[i[t].at+1]=e[r].y+n:i[t].route[i[t].at]=e[r].x+n}}}function _e(e,t,n){return h(e.direction)?g(n,r=>$(e,t,n,r)):$(e,t,n,!1)}function $(t,r,o,c){let u=ae(t),f=o.fontSize??16,m=Math.round(f*.875),h=o.measurer??te(o.fontFamily,o.fontFamilyMono),g=o.padding??8,S=new Map,C=[],w=[];for(let e of u.nodes){let t=l(e.cssStyles),n=+!!t.bold|(t.italic?2:0),r=t.fontSize??f,i=t.fontSize??m,a=e.requirement,o=e.element,s=Z(d(`«${a?a.type:`Element`}»`,!1,h,i,4e3),n,h),c=Z(d(e.id,!0,h,r,ue),n|1,h),u=a?[[`ID`,a.requirementId],[`Text`,a.text],[`Risk`,a.risk],[`Verification`,a.verifyMethod]]:[[`Type`,o.type],[`Doc Ref`,o.docRef]],p=[],g=0,_=0,v=0;for(let[e,t]of u){if(!t)continue;let r=Z(d(e,!1,h,i,4e3),n,h),a=Z(d(t,!0,h,i,de),n,h),o=Math.max(r.height,a.height);p.push({key:r,value:a,height:o}),g=Math.max(g,r.width),_=Math.max(_,a.width),v+=o+G}p.length>0&&(v+=2*W-G);let y=2*W+s.height+c.height,b=Math.max(le,Math.max(s.width,c.width)+2*U,p.length>0?g+K+_+2*U:0);S.has(e.id)||S.set(e.id,C.length);let x=ee(b,y+v);x.seq=C.length,C.push({node:e,style:t,kind:s,name:c,rows:p,keyWidth:g,headHeight:y,w:b,h:y+v}),w.push(x)}let T=c?`TB`:x(u.direction),E=T===`LR`||T===`RL`,D=[],O=[],k=[];for(let e of u.edges){let t=e.start===void 0?void 0:S.get(e.start),n=e.end===void 0?void 0:S.get(e.end);if(t===void 0||n===void 0)continue;let r=d(`«${e.type}»`,!1,h,m,4e3);t===n&&(E?w[t].h+=2*(q+r.height+8):w[t].w+=2*(q+r.width+12)),k.push(e),O.push(r),D.push({src:t,dst:n,minlen:1,labelW:r.width+12,labelH:r.height+4,route:[],labelX:0,labelY:0})}let A=b(w,D,T,{nodeSep:oe,edgeSep:se,rankSep:ce,portSep:20});ge(w,D,C);let j=y(t.title,h,f,4e3),M=j.height>0?j.height+12:0,N=Math.max(A.width,j.width),P=g+(N-A.width)/2,F=g+M,I=Math.ceil(N+2*g),L=Math.ceil(A.height+M+2*g),R=``;for(let e=0;e<C.length;e++){let t=C[e],{w:r,h:o,style:c}=t,l=-r/2,u=-o/2,d=`<rect x="${p(l)}" y="${p(u)}" width="${p(r)}" height="${p(o)}" fill="var(--_s)" stroke="var(--_b)"${i(c.shape)}/>`+s(t.kind,0,u+W+t.kind.height/2,` class="pele-stereotype" font-size="${t.kind.size}" fill="var(--_m)"${c.text}`)+s(t.name,0,u+W+t.kind.height+t.name.height/2,` class="pele-label" font-size="${t.name.size}" font-weight="var(--_hw)"${c.text}`);if(t.rows.length>0){let e=u+t.headHeight;d+=`<path class="pele-divider" d="M${p(l)},${p(e)}H${p(-l)}" stroke="var(--_b)"${c.line}/>`;let n=e+W,r=``;for(let e of t.rows)r+=Q(e.key,l+U,n,` class="pele-field" fill="var(--_m)"${c.text}`)+Q(e.value,l+U+t.keyWidth+K,n,` class="pele-value"${c.text}`),n+=e.height+G;d+=`<g class="pele-fields" font-size="${t.rows[0].key.size}">${r}</g>`}R+=`<g class="pele-node ${t.node.requirement?`pele-requirement`:`pele-element`}${n(t.node.cssClasses.replace(/^default\s?/,``))}" data-id="${a(t.node.id)}" transform="translate(${p(w[e].x+P)},${p(w[e].y+F)})">${d}</g>`}let z=``,B=``,V=new Map;for(let e=0;e<D.length;e++){let t=D[e],n=k[e],r=O[e],i=n.contains?2*J:0,o,s=t.labelX+P,c=t.labelY+F;if(t.src===t.dst){let e=C[t.src],n=w[t.src].x+P,r=w[t.src].y+F,a=V.get(t.src)??0;V.set(t.src,a+1);let l=(E?e.w:e.h)/2,u=Math.min(l-4,12+a*6),d=q+a*8,f=(t,i)=>E?`${p(n+i)},${p(r+e.h/2+t)}`:`${p(n+e.w/2+t)},${p(r+i)}`,m=d/.75;o={d:`M${f(i,-u)}C${f(m,-u)} ${f(m,u)} ${f(0,u)}`,sx:E?n-u:n+e.w/2,sy:E?r+e.h/2:r-u,sdx:E?0:-1,sdy:E?-1:0,ex:E?n+u:n+e.w/2,ey:E?r+e.h/2:r+u,edx:E?0:-1,edy:E?-1:0},E?(s=n,c=r+e.h/2+d+4+t.labelH/2):(s=n+e.w/2+d+4+t.labelW/2,c=r)}else{let e=t.route.slice();for(let t=0;t<e.length;t+=3)e[t]+=P,e[t+1]+=F;o=v(e,void 0,i,0)}z+=`<g class="pele-edge pele-relationship-${n.contains?`contains`:`arrow`}" data-id="${a(n.id)}"><path d="${o.d}"${n.contains?``:` stroke-dasharray="5 4"`}/>`+(n.contains?me(o.sx,o.sy,o.sdx,o.sdy):he(o.ex,o.ey,o.edx,o.edy))+`</g>`,B+=_(n.id,r,s,c,``)}return{svg:e(`requirement`,I,L,f,o,t,s(j,I/2,g+j.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(z?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${z}</g>`:``)+(B?`<g class="pele-edge-labels" font-size="${m}" fill="var(--_m)">${B}</g>`:``)+`<g class="pele-nodes">${R}</g>`),width:I,height:L,links:[]}}var ve={type:`requirement`,math:!0,parse(e,t,n){let r=new M;return n&&(r.title=n),ie(e,r),r},render:_e};export{ve as requirement};