@opentig/cli 0.2.0 → 0.2.1

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 (115) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/chunks/{cli-Bi6ET5UT.mjs → cli-B6JTojx_.mjs} +1 -1
  3. package/dist/client/assets/App-Dfm5F199.js +74 -0
  4. package/dist/client/assets/CreatePullRequestDialog-CAeykZ72.js +2 -0
  5. package/dist/client/assets/{DiffWorkspace-RDG_Y70N.js → DiffWorkspace-BRicWHvw.js} +13 -13
  6. package/dist/client/assets/{EditableFileViewer-CsbifqBO.js → EditableFileViewer-DWeSDnZn.js} +1 -1
  7. package/dist/client/assets/{File-CHjvYpb2.js → File-D65shwRR.js} +1 -1
  8. package/dist/client/assets/FilesView-EfoU7sF-.js +1 -0
  9. package/dist/client/assets/GitHubAvatar-C8R3iNoM.js +1 -0
  10. package/dist/client/assets/HistoryView-C6T2dsBC.js +1 -0
  11. package/dist/client/assets/{HtmlFileViewer-h8ULU8Gy.js → HtmlFileViewer-JXLHTNPm.js} +1 -1
  12. package/dist/client/assets/{IconEdit-Cg8S2wqW.js → IconEdit-3fgBTCQ4.js} +1 -1
  13. package/dist/client/assets/{IconFolderSymlink-BZSLX1ez.js → IconFolderSymlink-C4ydD1eS.js} +1 -1
  14. package/dist/client/assets/{ImageFileViewer-Cjw58ckv.js → ImageFileViewer-YH2xhkkk.js} +1 -1
  15. package/dist/client/assets/LocalRefsDialog--1NiYKYj.js +1 -0
  16. package/dist/client/assets/{MarkdownFileViewer-kLiduag6.js → MarkdownFileViewer-BsB8WkIH.js} +2 -2
  17. package/dist/client/assets/PairingPage-DXRyAYHn.js +1 -0
  18. package/dist/client/assets/{PierreDiffViewer-eAcugmoF.js → PierreDiffViewer-DoV3V0IW.js} +1 -1
  19. package/dist/client/assets/{PierreEditBoundary-DlGd1pqO.js → PierreEditBoundary-BnYZbHfi.js} +1 -1
  20. package/dist/client/assets/{PierreWorkerPool-Col4k7qz.js → PierreWorkerPool-Cg9zdxiI.js} +1 -1
  21. package/dist/client/assets/PullRequestDiff-D6QG5Anx.js +1 -0
  22. package/dist/client/assets/PullRequestViewer-jC3LVmiO.js +2 -0
  23. package/dist/client/assets/PullRequestsView-GStKxG7k.js +1 -0
  24. package/dist/client/assets/{QuickOpenDialog-BFDDZVCL.js → QuickOpenDialog-HvslpGQl.js} +1 -1
  25. package/dist/client/assets/{RepositoryProjectsDialog-CvB8KcFp.js → RepositoryProjectsDialog-Biqv5GO_.js} +1 -1
  26. package/dist/client/assets/SearchView-D5XB6wdu.js +1 -0
  27. package/dist/client/assets/SettingsDialog-DWAunOQB.js +72 -0
  28. package/dist/client/assets/{Viewer-o1hDU33O.js → Viewer-Gfy3Ejyo.js} +3 -3
  29. package/dist/client/assets/{abnfDiagram-N423BO3Z-BvrnK_R-.js → abnfDiagram-N423BO3Z-DdAfHevw.js} +1 -1
  30. package/dist/client/assets/{arc-DLa3_7ua.js → arc-C43uoeEi.js} +1 -1
  31. package/dist/client/assets/{architectureDiagram-T3A2C74G-BexwhnyX.js → architectureDiagram-T3A2C74G-C7q0hhRO.js} +1 -1
  32. package/dist/client/assets/{blockDiagram-VBNYF7ZC-CoOttUUo.js → blockDiagram-VBNYF7ZC-C1x9Iap4.js} +1 -1
  33. package/dist/client/assets/{c4Diagram-5PPSVZJV-Bgp6ppUh.js → c4Diagram-5PPSVZJV-BmKaVW6q.js} +1 -1
  34. package/dist/client/assets/channel-Diwpee6E.js +1 -0
  35. package/dist/client/assets/checkbox-XfIUFPxh.js +1 -0
  36. package/dist/client/assets/{chunk-2GRJ4B5K-C_kzp38w.js → chunk-2GRJ4B5K-kzy_H3BQ.js} +1 -1
  37. package/dist/client/assets/{chunk-2Q5K7J3B-CysYnRkJ.js → chunk-2Q5K7J3B-BMj-FT4X.js} +1 -1
  38. package/dist/client/assets/{chunk-5RXB4S5H-oMS6x_ag.js → chunk-5RXB4S5H-DmPGiCCb.js} +1 -1
  39. package/dist/client/assets/{chunk-5VM5RSS4-C5-dW5wf.js → chunk-5VM5RSS4-DYFL8__L.js} +1 -1
  40. package/dist/client/assets/{chunk-6Q2QTUOP-DxahInnA.js → chunk-6Q2QTUOP-CI98oVdT.js} +1 -1
  41. package/dist/client/assets/{chunk-GF5L2VYU-D7V-3eRg.js → chunk-GF5L2VYU-D9JiiMlX.js} +1 -1
  42. package/dist/client/assets/{chunk-JWPE2WC7-BrLmjbVP.js → chunk-JWPE2WC7-D0THYpZl.js} +1 -1
  43. package/dist/client/assets/{chunk-KBJHAD2P-CyOvijwM.js → chunk-KBJHAD2P-Z1tJfyAr.js} +1 -1
  44. package/dist/client/assets/{chunk-RYQCIY6F-BvEjVjQs.js → chunk-RYQCIY6F-31aS4cD3.js} +1 -1
  45. package/dist/client/assets/{chunk-XXDRQBXY-C_IY9A64.js → chunk-XXDRQBXY-ClWDHmEp.js} +1 -1
  46. package/dist/client/assets/classDiagram-JCYQIIEL-BDuo9kiS.js +1 -0
  47. package/dist/client/assets/classDiagram-v2-OCEON4UE-BDuo9kiS.js +1 -0
  48. package/dist/client/assets/{cose-bilkent-JH36ORCC-Cu7qZi7h.js → cose-bilkent-JH36ORCC-Btg2MYLh.js} +1 -1
  49. package/dist/client/assets/{cynefin-VYW2F7L2-B4M1t9lL.js → cynefin-VYW2F7L2-Cbh4Pk6j.js} +1 -1
  50. package/dist/client/assets/{cynefinDiagram-MW4NZA55-CAosOLmT.js → cynefinDiagram-MW4NZA55-BBqorl0u.js} +1 -1
  51. package/dist/client/assets/{dagre-VZM6K2ZE-q354V538.js → dagre-VZM6K2ZE-DugEItZ0.js} +1 -1
  52. package/dist/client/assets/{diagram-7IWD3JNH-C_CzkBPt.js → diagram-7IWD3JNH-Biu7dmH8.js} +1 -1
  53. package/dist/client/assets/{diagram-B4RE2ZJO-VvvYHE9c.js → diagram-B4RE2ZJO-UDm4DXFS.js} +1 -1
  54. package/dist/client/assets/{diagram-LBJQPF4R-D8vRQwb5.js → diagram-LBJQPF4R-Bcku4gb-.js} +1 -1
  55. package/dist/client/assets/{diagram-Q27KOJAE-Bul4aDKg.js → diagram-Q27KOJAE-DFRjglV-.js} +1 -1
  56. package/dist/client/assets/{diagram-UB23O5K3-DNadEE58.js → diagram-UB23O5K3-CgfMWtd0.js} +1 -1
  57. package/dist/client/assets/{ebnfDiagram-BXEA7PRR-Bf-68MMZ.js → ebnfDiagram-BXEA7PRR-CZzYOqs0.js} +1 -1
  58. package/dist/client/assets/{erDiagram-JOGREHBK-CJ-jHFsf.js → erDiagram-JOGREHBK-Cdlbxgs6.js} +1 -1
  59. package/dist/client/assets/{flowDiagram-UKHOOZJN-DMOdinBU.js → flowDiagram-UKHOOZJN-BgImDwpP.js} +1 -1
  60. package/dist/client/assets/{ganttDiagram-PKOTCBZU-DzezS3Zy.js → ganttDiagram-PKOTCBZU-SFhtiyL4.js} +1 -1
  61. package/dist/client/assets/{gitGraphDiagram-DS77QQ5N-Dftpvns8.js → gitGraphDiagram-DS77QQ5N-Bkm5ueys.js} +1 -1
  62. package/dist/client/assets/{index-DAUK3rnz.js → index-B5RC4THs.js} +4 -4
  63. package/dist/client/assets/index-Dc9xVluy.css +1 -0
  64. package/dist/client/assets/{infoDiagram-6WML65LV-DmgUBq17.js → infoDiagram-6WML65LV-pCYc-VX2.js} +1 -1
  65. package/dist/client/assets/{ishikawaDiagram-WSZJBQD7-CL0PQhpQ.js → ishikawaDiagram-WSZJBQD7-BtNbG3Y6.js} +1 -1
  66. package/dist/client/assets/{journeyDiagram-NVQOT4AX-Ck4pQx_A.js → journeyDiagram-NVQOT4AX-CPW2qT3y.js} +1 -1
  67. package/dist/client/assets/{kanban-definition-27J2QSJJ-DuRZxBql.js → kanban-definition-27J2QSJJ-wD6JXQFs.js} +1 -1
  68. package/dist/client/assets/{linear-C2JDCaz4.js → linear-sj8MOkmS.js} +1 -1
  69. package/dist/client/assets/{mermaid.core-9dt2ugQA.js → mermaid.core-CGJtfmwb.js} +4 -4
  70. package/dist/client/assets/{mindmap-definition-FAOFIHXS-vy0fdDF0.js → mindmap-definition-FAOFIHXS-BQwLHBVs.js} +1 -1
  71. package/dist/client/assets/{pegDiagram-VL7TDLO6-DjVJy-Gm.js → pegDiagram-VL7TDLO6-DtDsb-Z8.js} +1 -1
  72. package/dist/client/assets/{pieDiagram-7S7Q4E2Y-ATbd_8vw.js → pieDiagram-7S7Q4E2Y-B3WhqNuS.js} +1 -1
  73. package/dist/client/assets/{quadrantDiagram-CIZ2JOQS-C8o6ofcl.js → quadrantDiagram-CIZ2JOQS-CPi38pp_.js} +1 -1
  74. package/dist/client/assets/{railroadDiagram-AXF67PYL-Qvij9Ubo.js → railroadDiagram-AXF67PYL-Btac44Ux.js} +1 -1
  75. package/dist/client/assets/{render-markdown-BtCybfvQ.js → render-markdown-hAIWRfn0.js} +6 -6
  76. package/dist/client/assets/{requirementDiagram-LRYGKXZP-yLfrba2h.js → requirementDiagram-LRYGKXZP-CHJgDNdg.js} +1 -1
  77. package/dist/client/assets/{sankeyDiagram-W5VNT64P-BTXRtTyG.js → sankeyDiagram-W5VNT64P-OYJHfmtd.js} +1 -1
  78. package/dist/client/assets/{sequenceDiagram-SI44F4Z6-BN1CCZIX.js → sequenceDiagram-SI44F4Z6-9ypa9W08.js} +1 -1
  79. package/dist/client/assets/{sizeCapture-X5ZJPWSS-BfXjBBYo.js → sizeCapture-X5ZJPWSS-5ZDUTERI.js} +1 -1
  80. package/dist/client/assets/{stateDiagram-OKZ733FA-DMAWiBsP.js → stateDiagram-OKZ733FA-nGHE1hN7.js} +1 -1
  81. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-CkCpE1Yu.js +1 -0
  82. package/dist/client/assets/{swimlanes-SLNWSIFB-BD20m5cw.js → swimlanes-SLNWSIFB-BZFv9Zp8.js} +2 -2
  83. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-Dxlb7bju.js +8 -0
  84. package/dist/client/assets/tanstack-CcfAJoQ7.js +1 -0
  85. package/dist/client/assets/{timeline-definition-Z64GVDOM-gtc0-AHB.js → timeline-definition-Z64GVDOM-pUIcaCIE.js} +1 -1
  86. package/dist/client/assets/{vennDiagram-T6HMQDX7-Cdr4AXTp.js → vennDiagram-T6HMQDX7-D6dEIJmP.js} +1 -1
  87. package/dist/client/assets/{viewer-tabs-D-T0xQaq.js → viewer-tabs-BjG3oKQ9.js} +1 -1
  88. package/dist/client/assets/{wardleyDiagram-T6FBY63Y-BcU4vxO8.js → wardleyDiagram-T6FBY63Y-DZ8ro_-y.js} +1 -1
  89. package/dist/client/assets/{xychartDiagram-ELKLHX3M-B3Zuadj8.js → xychartDiagram-ELKLHX3M-WJ2Zfmlk.js} +1 -1
  90. package/dist/client/index.html +3 -3
  91. package/dist/dev.mjs +2 -2
  92. package/dist/manifest.json +2 -2
  93. package/dist/server.mjs +1616 -473
  94. package/dist/utility.mjs +11 -5
  95. package/package.json +1 -1
  96. package/dist/client/assets/App-BXZLGT86.js +0 -74
  97. package/dist/client/assets/CreatePullRequestDialog-DFonMYEx.js +0 -2
  98. package/dist/client/assets/FilesView-Dl8QFbFA.js +0 -1
  99. package/dist/client/assets/GitHubAvatar-CnBaloV0.js +0 -1
  100. package/dist/client/assets/HistoryView-BgCZU2JO.js +0 -1
  101. package/dist/client/assets/LocalRefsDialog-DNgrd7Qp.js +0 -1
  102. package/dist/client/assets/PairingPage-C97sv-8s.js +0 -1
  103. package/dist/client/assets/PullRequestDiff-DhKTXyIF.js +0 -1
  104. package/dist/client/assets/PullRequestViewer-BgI8HFMe.js +0 -2
  105. package/dist/client/assets/PullRequestsView-PYWLy8We.js +0 -1
  106. package/dist/client/assets/SearchView-BwF_MsxK.js +0 -1
  107. package/dist/client/assets/SettingsDialog-DIcLmXSE.js +0 -9
  108. package/dist/client/assets/channel-1k1AYpyV.js +0 -1
  109. package/dist/client/assets/checkbox-BRH0ZNIC.js +0 -1
  110. package/dist/client/assets/classDiagram-JCYQIIEL-ChyNFpay.js +0 -1
  111. package/dist/client/assets/classDiagram-v2-OCEON4UE-ChyNFpay.js +0 -1
  112. package/dist/client/assets/index-BfA4tAc1.css +0 -1
  113. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-D_ofZeaa.js +0 -1
  114. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-CF9m5JSB.js +0 -8
  115. package/dist/client/assets/tanstack-B0Sf7wNU.js +0 -1
@@ -0,0 +1,8 @@
1
+ import{c as r,s as e}from"./flowDiagram-UKHOOZJN-BgImDwpP.js";import{_ as o}from"./mermaid.core-CGJtfmwb.js";import"./chunk-5VM5RSS4-DYFL8__L.js";import"./chunk-XXDRQBXY-ClWDHmEp.js";import"./chunk-KBJHAD2P-Z1tJfyAr.js";import"./chunk-2GRJ4B5K-kzy_H3BQ.js";import"./render-markdown-hAIWRfn0.js";import"./App-Dfm5F199.js";import"./index-B5RC4THs.js";import"./react-rd22PHbN.js";import"./tanstack-CcfAJoQ7.js";import"./base-ui-CJ8ZIx3d.js";import"./one-light-CoLDteqg.js";import"./index-BgLrS_2D.js";import"./channel-Diwpee6E.js";var m=o(t=>`${e(t)}
2
+ .swimlane.cluster rect {
3
+ stroke: ${t.clusterBorder} !important;
4
+ }
5
+ [data-look="neo"].cluster rect {
6
+ filter: none;
7
+ }
8
+ `,"getStyles"),a=m,S=r({defaultLayout:"swimlane",styles:a});export{S as diagram};
@@ -0,0 +1 @@
1
+ import{r as M,j as Ht,a as Nt,R as qt}from"./react-rd22PHbN.js";import{w as Kt}from"./base-ui-CJ8ZIx3d.js";var B=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ut=class extends B{#e;#t;#s;constructor(){super(),this.#s=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Ie=new Ut,Wt={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Gt=class{#e=Wt;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},L=new Gt;function $t(e){setTimeout(e,0)}var Bt=typeof window>"u"||"Deno"in globalThis;function E(){}function Jt(e,t){return typeof e=="function"?e(t):e}function pe(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ye(e,t){return Math.max(e+(t||0)-Date.now(),0)}function z(e,t){return typeof e=="function"?e(t):e}function A(e,t){return typeof e=="function"?e(t):e}function Te(e,t){const{type:s="all",exact:n,fetchStatus:i,predicate:r,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==Fe(o,t.options))return!1}else if(!N(t.queryKey,o))return!1}if(s!=="all"){const l=t.isActive();if(s==="active"&&!l||s==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||r&&!r(t))}function je(e,t){const{exact:s,status:n,predicate:i,mutationKey:r}=e;if(r){if(!t.options.mutationKey)return!1;if(s){if(G(t.options.mutationKey)!==G(r))return!1}else if(!N(t.options.mutationKey,r))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Fe(e,t){return(t?.queryKeyHashFn||G)(e)}function G(e){return JSON.stringify(e,(t,s)=>ye(s)?Object.keys(s).sort().reduce((n,i)=>(n[i]=s[i],n),{}):s)}function N(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!N(e[n],t[n]))return!1;return!0}const s=Object.keys(t);for(const n of s)if(!N(e[n],t[n]))return!1;return!0}return!1}var Xt=Object.prototype.hasOwnProperty;function et(e,t,s=0){if(e===t)return e;if(s>500)return t;const n=ze(e)&&ze(t);if(!n&&!(ye(e)&&ye(t)))return t;const r=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,l=n?new Array(a):{};let u=0;for(let c=0;c<a;c++){const f=n?c:o[c],h=e[f],d=t[f];if(h===d){l[f]=h,(n?c<r:Xt.call(e,f))&&u++;continue}if(h===null||d===null||typeof h!="object"||typeof d!="object"){l[f]=d;continue}const g=et(h,d,s+1);l[f]=g,g===h&&u++}return r===a&&u===r?e:l}function me(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function ze(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ye(e){if(!ke(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!ke(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ke(e){return Object.prototype.toString.call(e)==="[object Object]"}function Zt(e){return new Promise(t=>{L.setTimeout(t,e)})}function ve(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?et(e,t):t}function Xi(e){return e}function Yt(e,t,s=0){const n=[...e,t];return s&&n.length>s?n.slice(1):n}function es(e,t,s=0){const n=[t,...e];return s&&n.length>s?n.slice(0,-1):n}var Pe=Symbol();function tt(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Pe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function st(e,t){return typeof e=="function"?e(...t):!!e}function ts(e,t,s){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),n||(n=!0,i.aborted?s():i.addEventListener("abort",s,{once:!0})),i)}),e}var $=(()=>{let e=()=>Bt;return{isServer(){return e()},setIsServer(t){e=t}}})();function Se(){let e,t;const s=new Promise((i,r)=>{e=i,t=r});s.status="pending",s.catch(()=>{});function n(i){Object.assign(s,i),delete s.resolve,delete s.reject}return s.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},s.reject=i=>{n({status:"rejected",reason:i}),t(i)},s}var ss=$t;function ns(){let e=[],t=0,s=a=>{a()},n=a=>{a()},i=ss;const r=a=>{t?e.push(a):i(()=>{s(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{n(()=>{a.forEach(l=>{s(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{r(()=>{a(...l)})},schedule:r,setNotifyFunction:a=>{s=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{i=a}}}var x=ns(),is=class extends B{#e=!0;#t;#s;constructor(){super(),this.#s=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#e}},te=new is;function rs(e){return Math.min(1e3*2**e,3e4)}function nt(e){return(e??"online")==="online"?te.isOnline():!0}var be=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function it(e){let t=!1,s=0,n;const i=Se(),r=()=>i.status!=="pending",o=p=>{if(!r()){const S=new be(p);h(S),e.onCancel?.(S)}},a=()=>{t=!0},l=()=>{t=!1},u=()=>Ie.isFocused()&&(e.networkMode==="always"||te.isOnline())&&e.canRun(),c=()=>nt(e.networkMode)&&e.canRun(),f=p=>{r()||(n?.(),i.resolve(p))},h=p=>{r()||(n?.(),i.reject(p))},d=()=>new Promise(p=>{n=S=>{(r()||u())&&p(S)},e.onPause?.()}).then(()=>{n=void 0,r()||e.onContinue?.()}),g=()=>{if(r())return;let p;const S=s===0?e.initialPromise:void 0;try{p=S??e.fn()}catch(y){p=Promise.reject(y)}Promise.resolve(p).then(f).catch(y=>{if(r())return;const m=e.retry??($.isServer()?0:3),b=e.retryDelay??rs,_=typeof b=="function"?b(s,y):b,w=m===!0||typeof m=="number"&&s<m||typeof m=="function"&&m(s,y);if(t||!w){h(y);return}s++,e.onFail?.(s,y),Zt(_).then(()=>u()?void 0:d()).then(()=>{t?h(y):g()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(n?.(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?g():d().then(g),i)}}var rt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pe(this.gcTime)&&(this.#e=L.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(L.clearTimeout(this.#e),this.#e=void 0)}};function os(e){return{onFetch:(t,s)=>{const n=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,r=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let c=!1;const f=g=>{ts(g,()=>t.signal,()=>c=!0)},h=tt(t.options,t.fetchOptions),d=async(g,p,S)=>{if(c)return Promise.reject(t.signal.reason);if(p==null&&g.pages.length)return Promise.resolve(g);const m=(()=>{const R={client:t.client,queryKey:t.queryKey,pageParam:p,direction:S?"backward":"forward",meta:t.options.meta};return f(R),R})(),b=await h(m),{maxPages:_}=t.options,w=S?es:Yt;return{pages:w(g.pages,b,_),pageParams:w(g.pageParams,p,_)}};if(i&&r.length){const g=i==="backward",p=g?ot:we,S={pages:r,pageParams:o},y=p(n,S);a=await d(S,y,g)}else{const g=e??r.length;do{const p=l===0?o[0]??n.initialPageParam:we(n,a);if(l>0&&p==null)break;a=await d(a,p),l++}while(l<g)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=u}}}function we(e,{pages:t,pageParams:s}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,s[n],s):void 0}function ot(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}function as(e,t){return t?we(e,t)!=null:!1}function ls(e,t){return!t||!e.getPreviousPageParam?!1:ot(e,t)!=null}var us=class extends rt{#e;#t;#s;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Ve(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Ve(this.options);t.data!==void 0&&(this.setState(Le(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=ve(this.state.data,e,this.options);return this.#l({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(E).catch(E):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>A(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Pe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>z(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Ye(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#c()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(u=>u.options.queryFn);l&&this.setOptions(l.options)}const s=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},i=()=>{const l=tt(this.options,t),c=(()=>{const f={client:this.#r,queryKey:this.queryKey,meta:this.meta};return n(f),f})();return this.#o=!1,this.options.persister?this.options.persister(l,c,this):l(c)},o=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return n(l),l})();(this.#e==="infinite"?os(this.options.pages):this.options.behavior)?.onFetch(o,this),this.#s=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#l({type:"fetch",meta:o.fetchOptions?.meta}),this.#i=it({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:l=>{l instanceof be&&l.revert&&this.setState({...this.#s,fetchStatus:"idle"}),s.abort()},onFail:(l,u)=>{this.#l({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const l=await this.#i.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#n.config.onSuccess?.(l,this),this.#n.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof be){if(l.silent)return this.#i.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#l({type:"error",error:l}),this.#n.config.onError?.(l,this),this.#n.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#l(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...at(s.data,this.options),fetchMeta:e.meta??null};case"success":const n={...s,...Le(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#s=e.manual?n:void 0,n;case"error":const i=e.error;return{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),x.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function at(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nt(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Le(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ve(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,n=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var lt=class extends B{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=Se(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#s=void 0;#n=void 0;#r;#i;#a;#o;#c;#l;#g;#h;#f;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Qe(this.#t,this.options)?this.#d():this.updateResult(),this.#S())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _e(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _e(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof A(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),t._defaulted&&!me(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&He(this.#t,s,this.options,t)&&this.#d(),this.updateResult(),n&&(this.#t!==s||A(this.options.enabled,this.#t)!==A(t.enabled,this.#t)||z(this.options.staleTime,this.#t)!==z(t.staleTime,this.#t))&&this.#m();const i=this.#y();n&&(this.#t!==s||A(this.options.enabled,this.#t)!==A(t.enabled,this.#t)||i!==this.#u)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),s=this.createResult(t,e);return hs(this,s)&&(this.#n=s,this.#i=this.options,this.#r=this.#t.state),s}getCurrentResult(){return this.#n}trackResult(e,t){return new Proxy(e,{get:(s,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#d(e){this.#_();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(E)),t}#m(){this.#b();const e=z(this.options.staleTime,this.#t);if($.isServer()||this.#n.isStale||!pe(e))return;const s=Ye(this.#n.dataUpdatedAt,e)+1;this.#h=L.setTimeout(()=>{this.#n.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#u=e,!($.isServer()||A(this.options.enabled,this.#t)===!1||!pe(this.#u)||this.#u===0)&&(this.#f=L.setInterval(()=>{(this.options.refetchIntervalInBackground||Ie.isFocused())&&this.#d()},this.#u))}#S(){this.#m(),this.#v(this.#y())}#b(){this.#h!==void 0&&(L.clearTimeout(this.#h),this.#h=void 0)}#w(){this.#f!==void 0&&(L.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const s=this.#t,n=this.options,i=this.#n,r=this.#r,o=this.#i,l=e!==s?e.state:this.#s,{state:u}=e;let c={...u},f=!1,h;if(t._optimisticResults){const C=this.hasListeners(),I=!C&&Qe(e,t),O=C&&He(e,s,t,n);(I||O)&&(c={...c,...at(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:g,status:p}=c;h=c.data;let S=!1;if(t.placeholderData!==void 0&&h===void 0&&p==="pending"){let C;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(C=i.data,S=!0):C=typeof t.placeholderData=="function"?t.placeholderData(this.#g?.state.data,this.#g):t.placeholderData,C!==void 0&&(p="success",h=ve(i?.data,C,t),f=!0)}if(t.select&&h!==void 0&&!S)if(i&&h===r?.data&&t.select===this.#c)h=this.#l;else try{this.#c=t.select,h=t.select(h),h=ve(i?.data,h,t),this.#l=h,this.#o=null}catch(C){this.#o=C}this.#o&&(d=this.#o,h=this.#l,g=Date.now(),p="error");const y=c.fetchStatus==="fetching",m=p==="pending",b=p==="error",_=m&&y,w=h!==void 0,v={status:p,fetchStatus:c.fetchStatus,isPending:m,isSuccess:p==="success",isError:b,isInitialLoading:_,isLoading:_,data:h,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:g,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:y,isRefetching:y&&!m,isLoadingError:b&&!w,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&w,isStale:Ee(e,t),refetch:this.refetch,promise:this.#a,isEnabled:A(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const C=v.data!==void 0,I=v.status==="error"&&!C,O=P=>{I?P.reject(v.error):C&&P.resolve(v.data)},F=()=>{const P=this.#a=v.promise=Se();O(P)},D=this.#a;switch(D.status){case"pending":e.queryHash===s.queryHash&&O(D);break;case"fulfilled":(I||v.data!==D.value)&&F();break;case"rejected":(!I||v.error!==D.reason)&&F();break}}return v}updateResult(){const e=this.#n,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#i=this.options,this.#r.data!==void 0&&(this.#g=this.#t),me(t,e))return;this.#n=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,i=typeof n=="function"?n():n;if(i==="all"||!i&&!this.#p.size)return!0;const r=new Set(i??this.#p);return this.options.throwOnError&&r.add("error"),Object.keys(this.#n).some(o=>{const a=o;return this.#n[a]!==e[a]&&r.has(a)})};this.#C({listeners:s()})}#_(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#s=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#S()}#C(e){x.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function cs(e,t){return A(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&A(t.retryOnMount,e)===!1)}function Qe(e,t){return cs(e,t)||e.state.data!==void 0&&_e(e,t,t.refetchOnMount)}function _e(e,t,s){if(A(t.enabled,e)!==!1&&z(t.staleTime,e)!=="static"){const n=typeof s=="function"?s(e):s;return n==="always"||n!==!1&&Ee(e,t)}return!1}function He(e,t,s,n){return(e!==t||A(n.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Ee(e,s)}function Ee(e,t){return A(t.enabled,e)!==!1&&e.isStaleByTime(z(t.staleTime,e))}function hs(e,t){return!me(e.getCurrentResult(),t)}var fs=class extends lt{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,n=super.createResult(e,t),{isFetching:i,isRefetching:r,isError:o,isRefetchError:a}=n,l=s.fetchMeta?.fetchMore?.direction,u=o&&l==="forward",c=i&&l==="forward",f=o&&l==="backward",h=i&&l==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:as(t,s.data),hasPreviousPage:ls(t,s.data),isFetchNextPageError:u,isFetchingNextPage:c,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:a&&!u&&!f,isRefetching:r&&!c&&!h}}},ds=class extends rt{#e;#t;#s;#n;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#s=e.mutationCache,this.#t=[],this.state=e.state||gs(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=it({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#r({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const n=this.state.status==="pending",i=!this.#n.canStart();try{if(n)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#s.config.onMutate&&await this.#s.config.onMutate(e,this,s);const o=await this.options.onMutate?.(e,s);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:i})}const r=await this.#n.start();return await this.#s.config.onSuccess?.(r,e,this.state.context,this,s),await this.options.onSuccess?.(r,e,this.state.context,s),await this.#s.config.onSettled?.(r,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(r,null,e,this.state.context,s),this.#r({type:"success",data:r}),r}catch(r){try{await this.#s.config.onError?.(r,e,this.state.context,this,s)}catch(o){Promise.reject(o)}try{await this.options.onError?.(r,e,this.state.context,s)}catch(o){Promise.reject(o)}try{await this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,s)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,r,e,this.state.context,s)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#r(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),x.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}};function gs(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ps=class extends B{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#s=0}#e;#t;#s;build(e,t,s){const n=new ds({client:e,mutationCache:this,mutationId:++this.#s,options:e.defaultMutationOptions(t),state:s});return this.add(n),n}add(e){this.#e.add(e);const t=X(e);if(typeof t=="string"){const s=this.#t.get(t);s?s.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=X(e);if(typeof t=="string"){const s=this.#t.get(t);if(s)if(s.length>1){const n=s.indexOf(e);n!==-1&&s.splice(n,1)}else s[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=X(e);if(typeof t=="string"){const n=this.#t.get(t)?.find(i=>i.state.status==="pending");return!n||n===e}else return!0}runNext(e){const t=X(e);return typeof t=="string"?this.#t.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){x.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(s=>je(t,s))}findAll(e={}){return this.getAll().filter(t=>je(e,t))}notify(e){x.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return x.batch(()=>Promise.all(e.map(t=>t.continue().catch(E))))}};function X(e){return e.options.scope?.id}var ms=class extends B{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){const n=t.queryKey,i=t.queryHash??Fe(n,t);let r=this.get(i);return r||(r=new us({client:e,queryKey:n,queryHash:i,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(n)}),this.add(r)),r}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){x.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>Te(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>Te(e,s)):t}notify(e){x.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){x.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){x.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Zi=class{#e;#t;#s;#n;#r;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new ms,this.#t=e.mutationCache||new ps,this.#s=e.defaultOptions||{},this.#n=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Ie.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=te.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=this.#e.build(this,t),n=s.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(z(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:s})=>{const n=s.data;return[t,n]})}setQueryData(e,t,s){const n=this.defaultQueryOptions({queryKey:e}),r=this.#e.get(n.queryHash)?.state.data,o=Jt(t,r);if(o!==void 0)return this.#e.build(this,n).setData(o,{...s,manual:!0})}setQueriesData(e,t,s){return x.batch(()=>this.#e.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;x.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#e;return x.batch(()=>(s.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},n=x.batch(()=>this.#e.findAll(e).map(i=>i.cancel(s)));return Promise.all(n).then(E).catch(E)}invalidateQueries(e,t={}){return x.batch(()=>(this.#e.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},n=x.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let r=i.fetch(void 0,s);return s.throwOnError||(r=r.catch(E)),i.state.fetchStatus==="paused"?Promise.resolve():r}));return Promise.all(n).then(E)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#e.build(this,t);return s.isStaleByTime(z(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(E).catch(E)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(E).catch(E)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return te.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(e){this.#s=e}setQueryDefaults(e,t){this.#n.set(G(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()],s={};return t.forEach(n=>{N(e,n.queryKey)&&Object.assign(s,n.defaultOptions)}),s}setMutationDefaults(e,t){this.#r.set(G(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],s={};return t.forEach(n=>{N(e,n.mutationKey)&&Object.assign(s,n.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#s.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fe(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Pe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#s.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},ut=M.createContext(void 0),ys=e=>{const t=M.useContext(ut);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Yi=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),Ht.jsx(ut.Provider,{value:e,children:t})),ct=M.createContext(!1),vs=()=>M.useContext(ct);ct.Provider;function Ss(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bs=M.createContext(Ss()),ws=()=>M.useContext(bs),_s=(e,t,s)=>{const n=s?.state.error&&typeof e.throwOnError=="function"?st(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Cs=e=>{M.useEffect(()=>{e.clearReset()},[e])},Rs=({result:e,errorResetBoundary:t,throwOnError:s,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||st(s,[e.error,n])),Ms=e=>{if(e.suspense){const s=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>s(n(...i)):s(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Os=(e,t)=>e.isLoading&&e.isFetching&&!t,xs=(e,t)=>e?.suspense&&t.isPending,Ne=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function ht(e,t,s){const n=vs(),i=ws(),r=ys(),o=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const a=r.getQueryCache().get(o.queryHash),l=e.subscribed!==!1;o._optimisticResults=n?"isRestoring":l?"optimistic":void 0,Ms(o),_s(o,i,a),Cs(i);const u=!r.getQueryCache().get(o.queryHash),[c]=M.useState(()=>new t(r,o)),f=c.getOptimisticResult(o),h=!n&&l;if(M.useSyncExternalStore(M.useCallback(d=>{const g=h?c.subscribe(x.batchCalls(d)):E;return c.updateResult(),g},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),M.useEffect(()=>{c.setOptions(o)},[o,c]),xs(o,f))throw Ne(o,c,i);if(Rs({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw f.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!$.isServer()&&Os(f,n)&&(u?Ne(o,c,i):a?.promise)?.catch(E).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?f:c.trackResult(f)}function er(e,t){return ht(e,lt)}function tr(e,t){return ht(e,fs)}function Is(e,t,s){const n=new Array(e);return new Proxy(n,{get(i,r,o){if(typeof r=="string"){const a=r.charCodeAt(0);if(a>=48&&a<=57){const l=+r;if(Number.isInteger(l)&&l>=0&&l<e){let u=i[l];if(!u){const c=t[l*2];u=i[l]={index:l,key:s(l),start:c,size:t[l*2+1],end:c+t[l*2+1],lane:0}}return u}}if(r==="length")return e}return Reflect.get(i,r,o)}})}function H(e,t,s){let n=s.initialDeps??[],i,r=!0;function o(){const a=e();return(a.length!==n.length||a.some((u,c)=>n[c]!==u))&&(n=a,i=t(...a),s?.onChange&&!(r&&s.skipInitialOnChange)&&s.onChange(i),r=!1),i}return o.updateDeps=a=>{n=a},o}function qe(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Fs=(e,t)=>Math.abs(e-t)<1.01,Ps=(e,t,s)=>{let n;return function(...i){e.clearTimeout(n),n=e.setTimeout(()=>t.apply(this,i),s)}};let U;const de=()=>{if(U!==void 0)return U;if(typeof navigator>"u")return U=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return U=!0;const e=navigator.maxTouchPoints;return U=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Ke=e=>{const{offsetWidth:t,offsetHeight:s}=e;return{width:t,height:s}},Es=e=>e,As=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,i=new Array(n);for(let r=0;r<n;r++)i[r]=t+r;return i},Ds=(e,t)=>{const s=e.scrollElement;if(!s)return;const n=e.targetWindow;if(!n)return;const i=o=>{const{width:a,height:l}=o;t({width:Math.round(a),height:Math.round(l)})};if(i(Ke(s)),!n.ResizeObserver)return()=>{};const r=new n.ResizeObserver(o=>{const a=()=>{const l=o[0];if(l?.borderBoxSize){const u=l.borderBoxSize[0];if(u){i({width:u.inlineSize,height:u.blockSize});return}}i(Ke(s))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return r.observe(s,{box:"border-box"}),()=>{r.unobserve(s)}},se={passive:!0},Ts=typeof window>"u"?!0:"onscrollend"in window,js=(e,t,s)=>{const n=e.scrollElement;if(!n)return;const i=e.targetWindow;if(!i)return;const r=e.options.useScrollendEvent&&Ts;let o=0;const a=r?null:Ps(i,()=>t(o,!1),e.options.isScrollingResetDelay),l=f=>()=>{o=s(n),a?.(),t(o,f)},u=l(!0),c=l(!1);return n.addEventListener("scroll",u,se),r&&n.addEventListener("scrollend",c,se),()=>{n.removeEventListener("scroll",u),r&&n.removeEventListener("scrollend",c)}},zs=(e,t)=>js(e,t,s=>{const{horizontal:n,isRtl:i}=e.options;return n?s.scrollLeft*(i&&-1||1):s.scrollTop}),ks=(e,t,s)=>{if(s.options.useCachedMeasurements){const n=s.indexFromElement(e),i=s.options.getItemKey(n);return s.itemSizeCache.get(i)??s.options.estimateSize(n)}if(t?.borderBoxSize){const n=t.borderBoxSize[0];if(n)return Math.round(n[s.options.horizontal?"inlineSize":"blockSize"])}if(!t){const n=s.indexFromElement(e),i=s.options.getItemKey(n),r=s.itemSizeCache.get(i);if(r!==void 0)return r}return e[s.options.horizontal?"offsetWidth":"offsetHeight"]},Ls=(e,{adjustments:t=0,behavior:s},n)=>{var i,r;(r=(i=n.scrollElement)==null?void 0:i.scrollTo)==null||r.call(i,{[n.options.horizontal?"left":"top"]:e+t,behavior:s})},Vs=Ls;class Qs{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var s,n,i;return((i=(n=(s=this.targetWindow)==null?void 0:s.performance)==null?void 0:n.now)==null?void 0:i.call(n))??Date.now()},this.observer=(()=>{let s=null;const n=()=>s||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:s=new this.targetWindow.ResizeObserver(i=>{i.forEach(r=>{const o=()=>{const a=r.target,l=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[u,c]of this.elementsCache)if(c===a){this.elementsCache.delete(u);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(a,r,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var i;(i=n())==null||i.disconnect(),s=null},observe:i=>{var r;return(r=n())==null?void 0:r.observe(i,{box:"border-box"})},unobserve:i=>{var r;return(r=n())==null?void 0:r.unobserve(i)}}})(),this.range=null,this.setOptions=s=>{var n,i;const r={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Es,rangeExtractor:As,onChange:()=>{},measureElement:ks,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const h in s){const d=s[h];d!==void 0&&(r[h]=d)}const o=this.options;let a=null,l=null,u=!1;if(o!==void 0&&o.enabled&&r.enabled&&r.anchorTo==="end"&&this.scrollElement!==null){const h=o.count,d=r.count,g=this.getMeasurements(),p=h>0?((n=g[0])==null?void 0:n.key)??o.getItemKey(0):null,S=h>0?((i=g[h-1])==null?void 0:i.key)??o.getItemKey(h-1):null;if(d!==h||h>0&&d>0&&(r.getItemKey(0)!==p||r.getItemKey(d-1)!==S)){u=!0;const b=h>0?this.getVirtualItemForOffset(this.getScrollOffset())??g[0]:null;b&&(a=[b.key,this.getScrollOffset()-b.start]);const _=r.followOnAppend===!0?"auto":r.followOnAppend||null;_&&d>h&&this.isAtEnd(o.scrollEndThreshold)&&(h===0||r.getItemKey(d-1)!==S)&&(l=_)}}this.options=r,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=!1,f=0;if(a&&this.scrollOffset!==null){const[h,d]=a,g=this.getMeasurements(),{count:p,getItemKey:S}=this.options;let y=0;for(;y<p&&S(y)!==h;)y++;if(y<p){const m=g[y];if(m){const b=Math.max(0,m.start+d);b!==this.scrollOffset&&(f=b-this.scrollOffset,this.scrollOffset=b,c=!0)}}}(c||l)&&(this.pendingScrollAnchor=[c?a[0]:null,c?a[1]:0,l,f])},this.notify=s=>{var n,i;(i=(n=this.options).onChange)==null||i.call(n,this,s)},this.maybeNotify=H(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),s=>{this.notify(s)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(s=>s()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var s;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}if(this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((s=this.scrollElement)==null?void 0:s.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,o)=>{if(o&&this._intendedScrollOffset===null&&r===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(r-this._intendedScrollOffset)<1.5&&(r=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const a=this.getScrollOffset();this.scrollDirection=o?a===r?this.scrollDirection:a<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=o,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const r=this.scrollElement,o=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!de()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};r.addEventListener("touchstart",o,se),r.addEventListener("touchend",a,se),this.unsubs.push(()=>{r.removeEventListener("touchstart",o),r.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const i=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,i&&this.scrollElement&&this.options.enabled){const[r,o,a,l]=i;r!==null&&!a&&(de()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const s=this.getScrollOffset(),n=this.getMaxScrollOffset();if(s<0||s>n)return;if(this._iosDeferredAdjustment<0&&s>=n-1){this._iosDeferredAdjustment=0;return}const i=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(s,{adjustments:this.scrollAdjustments+=i,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=H(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(s,n,i,r,o,a,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:s,paddingStart:n,scrollMargin:i,getItemKey:r,enabled:o,lanes:a,laneAssignmentMode:l,gap:u}),{key:!1}),this.getMeasurements=H(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:s,paddingStart:n,scrollMargin:i,getItemKey:r,enabled:o,lanes:a,laneAssignmentMode:l,gap:u},c)=>{const f=this.itemSizeCache;if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>s)for(const y of this.laneAssignments.keys())y>=s&&this.laneAssignments.delete(y);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(y=>{this.itemSizeCache.set(y.key,y.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===s&&(this.lanesSettling=!1),a===1){const y=s*2;let m=this._flatMeasurements;if(!m||m.length<y){const w=new Float64Array(y);m&&h>0&&w.set(m.subarray(0,h*2)),m=w,this._flatMeasurements=m}let b;if(h===0)b=n+i;else{const w=h-1;b=m[w*2]+m[w*2+1]+u}for(let w=h;w<s;w++){const R=r(w),v=f.get(R),C=typeof v=="number"?v:this.options.estimateSize(w);m[w*2]=b,m[w*2+1]=C,b+=C+u}const _=Is(s,m,r);return this.measurementsCache=_,_}const d=this.measurementsCache.slice(0,h),g=new Array(a).fill(void 0),p=new Float64Array(a);let S=0;for(let y=0;y<h;y++){const m=d[y];m&&(g[m.lane]===void 0&&S++,g[m.lane]=y,p[m.lane]=m.end)}for(let y=h;y<s;y++){const m=r(y),b=this.laneAssignments.get(y);let _,w;const R=l==="estimate"||f.has(m);if(b!==void 0&&this.options.lanes>1){_=b;const O=g[_],F=O!==void 0?d[O]:void 0;w=F?F.end+u:n+i}else if(S===a){let O=0,F=p[0],D=g[0];for(let P=1;P<a;P++){const fe=p[P];(fe<F||fe===F&&g[P]<D)&&(O=P,F=fe,D=g[P])}_=O,w=F+u,R&&this.laneAssignments.set(y,_)}else _=y%this.options.lanes,w=n+i,R&&this.laneAssignments.set(y,_);const v=f.get(m),C=typeof v=="number"?v:this.options.estimateSize(y),I=w+C;d[y]={index:y,start:w,size:C,end:I,key:m,lane:_},g[_]===void 0&&S++,g[_]=y,p[_]=I}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=H(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(s,n,i,r)=>s.length===0||n===0?(this.range=null,null):(this.range=Ns(s,n,i,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=H(()=>{let s=null,n=null;const i=this.calculateRange();return i&&(s=i.startIndex,n=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,s,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,s,n]},(s,n,i,r,o)=>r===null||o===null?[]:s({startIndex:r,endIndex:o,overscan:n,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=s=>{const n=this.options.indexAttribute,i=s.getAttribute(n);return i?parseInt(i,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=s=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const i=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(i!==void 0&&this.range){const r=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,i-r),a=Math.min(this.options.count-1,i+r);return s>=o&&s<=a}return!0},this.measureElement=s=>{if(!s){this.elementsCache.forEach((o,a)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(a))});return}const n=this.indexFromElement(s),i=this.options.getItemKey(n),r=this.elementsCache.get(i);r!==s&&(r&&this.observer.unobserve(r),this.observer.observe(s),this.elementsCache.set(i,s)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(s,void 0,this))},this.resizeItem=(s,n)=>{var i,r;if(s<0||s>=this.options.count)return;let o,a,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(s),a=u[s*2],o=u[s*2+1];else{const h=this.measurementsCache[s];if(!h)return;l=h.key,a=h.start,o=h.size}const c=this.itemSizeCache.get(l)??o,f=n-c;if(f!==0){const h=this.options.anchorTo==="end"&&((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,d=h?this.getTotalSize():0,g=this.getScrollOffset()+this.scrollAdjustments,S=!this.itemSizeCache.has(l)?a<g:a+c<=g&&this.scrollDirection!=="backward",y=((r=this.scrollState)==null?void 0:r.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[s]??{index:s,key:l,start:a,size:o,end:a+o,lane:0},f,this):S);(this.pendingMin===null||s<this.pendingMin)&&(this.pendingMin=s),this.itemSizeCache.set(l,n),this.itemSizeCacheVersion++,h?this.applyScrollAdjustment(this.getTotalSize()-d):y&&this.applyScrollAdjustment(f),this.notify(!1)}},this.getVirtualItems=H(()=>[this.getVirtualIndexes(),this.getMeasurements()],(s,n)=>{const i=[];for(let r=0,o=s.length;r<o;r++){const a=s[r],l=n[a];i.push(l)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=s=>{const n=this.getMeasurements();if(n.length===0)return;const i=this._flatMeasurements,r=this.options.lanes===1&&i!=null,o=ft(0,n.length-1,r?a=>i[a*2]:a=>qe(n[a]).start,s);return qe(n[o])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const s=this.scrollElement.document.documentElement;return this.options.horizontal?s.scrollWidth-this.scrollElement.innerWidth:s.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(s=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=s,this.getOffsetForAlignment=(s,n,i=0)=>{if(!this.scrollElement)return 0;const r=this.getSize(),o=this.getScrollOffset();n==="auto"&&(n=s>=o+r?"end":"start"),n==="center"?s+=(i-r)/2:n==="end"&&(s-=r);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,s),0)},this.getOffsetForIndex=(s,n="auto")=>{s=Math.max(0,Math.min(s,this.options.count-1));const i=this.getSize(),r=this.getScrollOffset(),o=this.measurementsCache[s];if(!o)return;if(n==="auto")if(o.end>=r+i-this.options.scrollPaddingEnd)n="end";else if(o.start<=r+this.options.scrollPaddingStart)n="start";else return[r,n];if(n==="end"&&s===this.options.count-1)return[this.getMaxScrollOffset(),n];const a=n==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,o.size),n]},this.scrollToOffset=(s,{align:n="start",behavior:i="auto"}={})=>{this._iosDeferredAdjustment=0;const r=this.getOffsetForAlignment(s,n),o=this.now();this.scrollState={index:null,align:n,behavior:i,startedAt:o,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(s,{align:n="auto",behavior:i="auto"}={})=>{this._iosDeferredAdjustment=0,s=Math.max(0,Math.min(s,this.options.count-1));const r=this.getOffsetForIndex(s,n);if(!r)return;const[o,a]=r,l=this.now();this.scrollState={index:s,align:a,behavior:i,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(s,{behavior:n="auto"}={})=>{const i=this.getScrollOffset()+s,r=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:r,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:s="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:s});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:s})},this.getTotalSize=()=>{var s;const n=this.getMeasurements();let i;if(n.length===0)i=this.options.paddingStart;else if(this.options.lanes===1){const r=n.length-1,o=this._flatMeasurements;o!=null?i=o[r*2]+o[r*2+1]:i=((s=n[r])==null?void 0:s.end)??0}else{const r=Array(this.options.lanes).fill(null);let o=n.length-1;for(;o>=0&&r.some(a=>a===null);){const a=n[o];r[a.lane]===null&&(r[a.lane]=a.end),o--}i=Math.max(...r.filter(a=>a!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const s=[];if(this.itemSizeCache.size===0)return s;const n=this.getMeasurements();for(const i of n)i&&this.itemSizeCache.has(i.key)&&s.push({index:i.index,key:i.key,start:i.start,size:i.size,end:i.end,lane:i.lane});return s},this._scrollToOffset=(s,{adjustments:n,behavior:i})=>{this._intendedScrollOffset=s+(n??0),this.options.scrollToFn(s,{behavior:i,adjustments:n},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,s){t!==0&&(de()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=t:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:s}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=n?n[0]:this.scrollState.lastTargetOffset,r=1,o=i!==this.scrollState.lastTargetOffset;if(!o&&Fs(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=r){this.getScrollOffset()!==i&&this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,o){const a=this.getSize()||600,l=Math.abs(i-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>a;this.scrollState.lastTargetOffset=i,u||(this.scrollState.behavior="auto"),this._scrollToOffset(i,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const ft=(e,t,s,n)=>{for(;e<=t;){const i=(e+t)/2|0,r=s(i);if(r<n)e=i+1;else if(r>n)t=i-1;else return i}return e>0?e-1:0};function Hs(e,t,s){let n=0;for(;n<=t;){const i=(n+t)/2|0,r=e[i*2];if(r<s)n=i+1;else if(r>s)t=i-1;else return i}return n>0?n-1:0}function Ns(e,t,s,n,i){const r=e.length-1;if(e.length<=n)return{startIndex:0,endIndex:r};if(n===1&&i!==null){const u=Hs(i,r,s);let c=u;const f=s+t;for(;c<r&&i[c*2]+i[c*2+1]<f;)c++;return{startIndex:u,endIndex:c}}let a=ft(0,r,u=>e[u].start,s),l=a;if(n===1)for(;l<r&&e[l].end<s+t;)l++;else if(n>1){const u=Array(n).fill(0);for(;l<r&&u.some(f=>f<s+t);){const f=e[l];u[f.lane]=f.end,l++}const c=Array(n).fill(s+t);for(;a>=0&&c.some(f=>f>=s);){const f=e[a];c[f.lane]=f.start,a--}a=Math.max(0,a-a%n),l=Math.min(r,l+(n-1-l%n))}return{startIndex:a,endIndex:l}}const ge=typeof document<"u"?M.useLayoutEffect:M.useEffect;function qs({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:s="transform",...n}){const i=M.useReducer(c=>c+1,0)[1],r=M.useRef({enabled:t,mode:s,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});r.current.enabled=t,r.current.mode=s;const o=c=>{const f=r.current;if(!f.enabled||!f.container)return;const h=c.getTotalSize();if(h!==f.lastSize){f.lastSize=h;const d=c.options.horizontal?"width":"height";f.container.style[d]=`${h}px`}},a=c=>{const f=r.current;if(!f.enabled||!f.container)return;o(c);const h=!!c.options.horizontal,d=f.mode==="transform",g=h?"left":"top",p=c.options.scrollMargin,S=c.getVirtualItems();for(const y of S){const m=y.start-p,b=c.elementsCache.get(y.key);b&&f.lastPositions.get(b)!==m&&(f.lastPositions.set(b,m),d?b.style.transform=h?`translate3d(${m}px, 0, 0)`:`translate3d(0, ${m}px, 0)`:b.style[g]=`${m}px`)}},l={...n,onChange:(c,f)=>{var h;const d=r.current;let g=!0;if(d.enabled){a(c);const p=c.range,S=d.prevRange;g=!S||S.isScrolling!==c.isScrolling||S.startIndex!==p?.startIndex||S.endIndex!==p?.endIndex,g&&(d.prevRange=p?{startIndex:p.startIndex,endIndex:p.endIndex,isScrolling:c.isScrolling}:null)}g&&(e&&f?Nt.flushSync(i):i()),(h=n.onChange)==null||h.call(n,c,f)}},[u]=M.useState(()=>{const c=new Qs(l);return Object.assign(c,{containerRef:f=>{const h=r.current;if(h.container=f,h.lastSize=null,f&&h.enabled){const d=c.getTotalSize();h.lastSize=d;const g=c.options.horizontal?"width":"height";f.style[g]=`${d}px`}}})});return u.setOptions(l),ge(()=>u._didMount(),[]),ge(()=>(o(u),u._willUpdate())),ge(()=>{a(u)}),u}function sr(e){return qs({observeElementRect:Ds,observeElementOffset:zs,scrollToFn:Vs,...e})}function Ks(e){return Us(e)||typeof e=="function"||Ws(e)}function Us(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Ws(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Z(e,t){return e==null?null:Ks(e)?qt.createElement(e,t):e}function Gs(e){if("cell"in e&&e.cell){const t=e.cell,s=t.column.columnDef,n=t,i=s;return n.getIsAggregated?.()?Z(i.aggregatedCell??s.cell,t.getContext()):n.getIsPlaceholder?.()?null:Z(s.cell,t.getContext())}return"header"in e&&e.header?Z(e.header.column.columnDef.header,e.header.getContext()):"footer"in e&&e.footer?Z(e.footer.column.columnDef.footer,e.footer.getContext()):null}function $s({update:e,notify:t,unwatched:s}){return{link:n,unlink:i,propagate:r,checkDirty:o,shallowPropagate:a};function n(u,c,f){const h=c.depsTail;if(h!==void 0&&h.dep===u)return;const d=h!==void 0?h.nextDep:c.deps;if(d!==void 0&&d.dep===u){d.version=f,c.depsTail=d;return}const g=u.subsTail;if(g!==void 0&&g.version===f&&g.sub===c)return;const p=c.depsTail=u.subsTail={version:f,dep:u,sub:c,prevDep:h,nextDep:d,prevSub:g,nextSub:void 0};d!==void 0&&(d.prevDep=p),h!==void 0?h.nextDep=p:c.deps=p,g!==void 0?g.nextSub=p:u.subs=p}function i(u,c=u.sub){const f=u.dep,h=u.prevDep,d=u.nextDep,g=u.nextSub,p=u.prevSub;return d!==void 0?d.prevDep=h:c.depsTail=h,h!==void 0?h.nextDep=d:c.deps=d,g!==void 0?g.prevSub=p:f.subsTail=p,p!==void 0?p.nextSub=g:(f.subs=g)===void 0&&s(f),d}function r(u){let c=u.nextSub,f;e:do{const h=u.sub;let d=h.flags;if(d&60?d&12?d&4?!(d&48)&&l(u,h)?(h.flags=d|40,d&=1):d=0:h.flags=d&-9|32:d=0:h.flags=d|32,d&2&&t(h),d&1){const g=h.subs;if(g!==void 0){const p=(u=g).nextSub;p!==void 0&&(f={value:c,prev:f},c=p);continue}}if((u=c)!==void 0){c=u.nextSub;continue}for(;f!==void 0;)if(u=f.value,f=f.prev,u!==void 0){c=u.nextSub;continue e}break}while(!0)}function o(u,c){let f,h=0,d=!1;e:do{const g=u.dep,p=g.flags;if(c.flags&16)d=!0;else if((p&17)===17){if(e(g)){const S=g.subs;S.nextSub!==void 0&&a(S),d=!0}}else if((p&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(f={value:u,prev:f}),u=g.deps,c=g,++h;continue}if(!d){const S=u.nextDep;if(S!==void 0){u=S;continue}}for(;h--;){const S=c.subs,y=S.nextSub!==void 0;if(y?(u=f.value,f=f.prev):u=S,d){if(e(c)){y&&a(S),c=u.sub;continue}d=!1}else c.flags&=-33;c=u.sub;const m=u.nextDep;if(m!==void 0){u=m;continue e}}return d}while(!0)}function a(u){do{const c=u.sub,f=c.flags;(f&48)===32&&(c.flags=f|16,(f&6)===2&&t(c))}while((u=u.nextSub)!==void 0)}function l(u,c){let f=c.depsTail;for(;f!==void 0;){if(f===u)return!0;f=f.prevDep}return!1}}function Bs(e,t,s){const n=typeof e=="object",i=n?e:void 0;return{next:(n?e.next:e)?.bind(i),error:(n?e.error:t)?.bind(i),complete:(n?e.complete:s)?.bind(i)}}const Ce=[];let ee=0;const{link:Ue,unlink:Js,propagate:Xs,checkDirty:dt,shallowPropagate:We}=$s({update(e){return e._update()},notify(e){Ce[Re++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ne(e))}});let Y=0,Re=0,T,Me=0;function Zs(e){try{++Me,e()}finally{--Me||gt()}}function ne(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=Js(s,e)}function gt(){if(!(Me>0)){for(;Y<Re;){const e=Ce[Y];Ce[Y++]=void 0,e.notify()}Y=0,Re=0}}function Ys(e,t){const s=typeof e=="function",n=e,i={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?0:1,get(){return T!==void 0&&Ue(i,T,ee),i._snapshot},subscribe(r){const o=Bs(r),a={current:!1},l=en(()=>{i.get(),a.current?o.next?.(i._snapshot):a.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(r){const o=T,a=t?.compare??Object.is;if(s)T=i,++ee,i.depsTail=void 0;else if(r===void 0)return!1;s&&(i.flags=5);try{const l=i._snapshot,u=typeof r=="function"?r(l):r===void 0&&s?n(l):r;return l===void 0||!a(l,u)?(i._snapshot=u,!0):!1}finally{T=o,s&&(i.flags&=-5),ne(i)}}};return s?(i.flags=17,i.get=function(){const r=i.flags;if(r&16||r&32&&dt(i.deps,i)){if(i._update()){const o=i.subs;o!==void 0&&We(o)}}else r&32&&(i.flags=r&-33);return T!==void 0&&Ue(i,T,ee),i._snapshot}):i.set=function(r){if(i._update(r)){const o=i.subs;o!==void 0&&(Xs(o),We(o),gt())}},i}function en(e){const t=()=>{const n=T;T=s,++ee,s.depsTail=void 0,s.flags=6;try{return e()}finally{T=n,s.flags&=-5,ne(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){const n=this.flags;n&16||n&32&&dt(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,ne(this)}};return t(),s}function W(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,i]of e)if(!t.has(n)||!Object.is(i,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const s=Ge(e);if(s.length!==Ge(t).length)return!1;for(let n=0;n<s.length;n++)if(!Object.prototype.hasOwnProperty.call(t,s[n])||!Object.is(e[s[n]],t[s[n]]))return!1;return!0}function Ge(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function tn(e,t){return e===t}function pt(e,t=n=>n,s){const n=s?.compare??tn,i=M.useCallback(o=>{const{unsubscribe:a}=e.subscribe(o);return a},[e]),r=M.useCallback(()=>e.get(),[e]);return Kt.useSyncExternalStoreWithSelector(i,r,r,t,n)}function sn(e){const t=pt(e.source,e.selector,{compare:W});return typeof e.children=="function"?e.children(t):e.children}function nn(e){const t=e;return Object.defineProperty(e,"state",{get(){return e.get()}}),"set"in e&&(t.setState=e.set.bind(e)),t}function rn(e){const{createAtom:t,batch:s}=e,n=t(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:()=>{throw new Error("Feature not supported in current reactivity implementation")},unmount:()=>{throw new Error("Feature not supported in current reactivity implementation")},schedule:e.schedule??(i=>queueMicrotask(i)),batch:s,untrack:i=>i(),createReadonlyAtom:(i,r)=>{const o=r?.compare??Object.is;let a=!1,l;const u=()=>{const f=i();return(!a||!o(l,f))&&(l=f,a=!0),l},c=t(()=>(n.get(),u()),{compare:o});return{get:u,subscribe:c.subscribe.bind(c)}},createWritableAtom:(i,r)=>t(i,{compare:r?.compare}),commit:()=>{n.set(i=>i+1)}}}function on(e,t=Object.is){let s=!1,n;return{get:e.get,markCommitted:i=>{n=i,s=!0},subscribe:i=>e.subscribe(r=>{(!s||!t(n,r))&&i(r)})}}function an(){return rn({createAtom:Ys,batch:Zs})}function oe(e,t){return typeof e=="function"?e(t):e}function V(e){if(Array.isArray(e))return e.map(V);if(e&&typeof e=="object"){const t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;const s=t===null?k():{},n=Object.keys(e);for(let i=0;i<n.length;i++){const r=n[i];Object.defineProperty(s,r,{configurable:!0,enumerable:!0,value:V(e[r]),writable:!0})}return s}return e}function ln(e,t){const s=Object.keys(t),n=e;for(let i=0;i<s.length;i++){const r=s[i];!r.startsWith("_memo_")&&r!=="_cellsCache"&&(n[r]=t[r])}return e}function k(){return Object.create(null)}function ae(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function un(e,t){return s=>{(t.options.atoms?.[e]??t.baseAtoms[e]).set(n=>oe(s,n))}}function $e(e){if(typeof e!="object"||e===null)return!1;if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Be(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}const cn=3;function hn(e,t){return mt(e,t,cn)}function mt(e,t,s){if(Object.is(e,t))return!0;if(s<=0||!$e(e)||!$e(t)||(Array.isArray(e)||Array.isArray(t))&&(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length))return!1;const n=Be(e),i=Be(t);if(n.length!==i.length)return!1;const r=e,o=t;for(let a=0;a<n.length;a++){const l=n[a];if(!Object.prototype.propertyIsEnumerable.call(t,l)||!mt(r[l],o[l],s-1))return!1}return!0}function le(e,t,s,n=hn){const i=`on${t.charAt(0).toUpperCase()}${t.slice(1)}Change`,r=e.options[i];r&&r(o=>{const a=oe(s,o);return n(o,a)?o:a})}function fn(e){return e instanceof Function}function dn(e,t){const s=[],n=i=>{i.forEach(r=>{s.push(r);const o=t(r);o.length&&n(o)})};return n(e),s}const gn=({fn:e,memoDeps:t,onAfterCompare:s,onAfterUpdate:n,onBeforeCompare:i,onBeforeUpdate:r})=>{let o=[],a;return u=>{i?.();const c=t?.(u);let f=!c||c.length!==o?.length;if(!f&&c){for(let h=0;h<c.length;h++)if(c[h]!==o[h]){f=!0;break}}return s?.(f),f&&(o=c,r?.(),a=e(...c??[]),n?.(a)),a}};function yt(e){let t=!1;return()=>{if(!t){t=!0;return}e()}}function ue({feature:e,fnName:t,objectId:s,onAfterUpdate:n,table:i,...r}){const o=()=>{if(!n)return;const{schedule:l,untrack:u}=i._reactivity;l(()=>u(()=>n()))};return gn({...r,...{onAfterUpdate:()=>{o()}}})}function vt(e,t="_"){const[s,n]=e.split(t);return{fnKey:n,fnName:`${s}.${n}`,parentName:s}}function q(e,t,s){for(const[n,{fn:i,memoDeps:r}]of Object.entries(s)){const{fnKey:o,fnName:a}=vt(n);t[o]=r?ue({memoDeps:r,fn:i,fnName:a,table:t,feature:e}):i}}function J(e,t,s,n){for(const[i,{fn:r,memoDeps:o}]of Object.entries(n)){const{fnKey:a,fnName:l}=vt(i);if(o){const u=`_memo_${a}`;t[a]=function(...c){if(!this[u]){const f=this;this[u]=ue({memoDeps:h=>o(f,h),fn:(...h)=>r(f,...h),fnName:l,objectId:f.id,table:s,feature:e})}return this[u](...c)}}else t[a]=function(...u){return r(this,...u)}}}function j(e,t,s,...n){return e[t]?.(...n)??s(e,...n)}function pn(e){return e.row.getValue(e.column.id)}function mn(e){return e.getValue()??e.table.options.renderFallbackValue}function yn(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}const vn={assignCellPrototype:(e,t)=>{J("coreCellsFeature",e,t,{cell_getValue:{fn:s=>pn(s)},cell_renderValue:{fn:s=>mn(s)},cell_getContext:{fn:s=>yn(s),memoDeps:s=>[s]}})}};function Sn(e){if(!e._headerPrototype){e._headerPrototype={table:e};const t=Object.values(e._features);for(let s=0;s<t.length;s++)t[s].assignHeaderPrototype?.(e._headerPrototype,e)}return e._headerPrototype}function St(e,t,s){const n=Sn(e),i=Object.create(n);i.colSpan=0,i.column=t,i.depth=s.depth,i.headerGroup=null,i.id=s.id??t.id,i.index=s.index,i.isPlaceholder=!!s.isPlaceholder,i.placeholderId=s.placeholderId,i.rowSpan=0,i.subHeaders=[];const r=e._headerInstanceInitFns;for(let o=0;o<r.length;o++)r[o](i);return i}function bn(){return{start:[],end:[]}}function Q(e){const t=e.table.atoms.columnVisibility?.get();if(!t)return!0;const s=e.columns;return s.length?s.some(n=>j(n,"getIsVisible",Q)):(ae(t,e.id)?t[e.id]:void 0)??!0}function wn(e){return e.getAllLeafColumns().filter(t=>j(t,"getIsVisible",Q))}function bt(e,t=1){let s=t;for(let n=0;n<e.length;n++){const i=e[n];j(i,"getIsVisible",Q)&&i.columns.length&&(s=Math.max(s,bt(i.columns,t+1)))}return s}function _n(e,t){return String(t)}function Cn(e,t,s,n){let i=e??"";return t&&(i=i?`${i}_${t}`:String(t)),s&&(i=i?`${i}_${s}`:s),n&&(i=i?`${i}_${n}`:n),i}function Rn(e,t){let s=0;for(let n=0;n<e.length;n++)e[n].column===t&&s++;return s}function wt(e,t,s,n,i,r){const o={depth:t,id:_n(n,t),headers:[]},a=[];for(let l=0;l<e.length;l++){if(!(l in e))continue;const u=e[l],c=a[a.length-1],f=u.column.depth===o.depth;let h,d=!1;if(f&&u.column.parent?h=u.column.parent:(h=u.column,d=!0),c&&c.column===h)c.subHeaders.push(u);else{const g=St(s,h,{id:Cn(n,t,h.id,u.id),isPlaceholder:d,placeholderId:d?String(Rn(a,h)):void 0,depth:t,index:a.length});g.subHeaders.push(u),a.push(g)}o.headers.push(u),u.headerGroup=o}for(let l=0;l<r.length;l++)r[l](o);i.push(o),t>0&&wt(a,t-1,s,n,i,r)}function _t(e){for(let t=0;t<e.length;t++){const s=e[t];if(!j(s.column,"getIsVisible",Q))continue;let n=0;if(s.subHeaders.length){_t(s.subHeaders);for(let i=0;i<s.subHeaders.length;i++){const r=s.subHeaders[i];j(r.column,"getIsVisible",Q)&&(n+=r.colSpan)}}else n=1;if(s.colSpan=n,s.isPlaceholder&&s.subHeaders.length===1&&s.subHeaders[0].column===s.column){let i=1,r=s.subHeaders[0];for(;r;)r.rowSpan=0,i++,r=r.subHeaders.length===1&&r.subHeaders[0].column===s.column?r.subHeaders[0]:void 0;s.rowSpan=i}else s.rowSpan=1}}function Je(e,t,s,n){const i=bt(e),r=[],o=s._headerGroupInstanceInitFns,a=new Array(t.length);for(let l=0;l<t.length;l++)l in t&&(a[l]=St(s,t[l],{depth:i,index:l}));return wt(a,i-1,s,n,r,o),r.reverse(),_t(r[0]?.headers??[]),r}function Mn(e){if(!e._columnPrototype){e._columnPrototype={table:e};const t=Object.values(e._features);for(let s=0;s<t.length;s++)t[s].assignColumnPrototype?.(e._columnPrototype,e)}return e._columnPrototype}function On(e,t,s,n){const i={...e.getDefaultColumnDef(),...t},r=i.accessorKey,o=r===void 0?void 0:String(r),a=i.id??o?.replaceAll(".","_")??(typeof i.header=="string"?i.header:void 0);let l;if(i.accessorFn)l=i.accessorFn;else if(r!==void 0)if(typeof r=="string"&&r.includes(".")){const h=r.split(".");l=d=>{let g=d;for(let p=0;p<h.length;p++){const S=h[p];g=g?.[S]}return g}}else l=h=>h[i.accessorKey];if(!a)throw new Error;const u=Mn(e),c=Object.create(u);c.accessorFn=l,c.columnDef=i,c.columns=[],c.depth=s,c.id=`${String(a)}`,c.parent=n;const f=e._columnInstanceInitFns;for(let h=0;h<f.length;h++)f[h](c);return c}function Ct(e){const t=e.atoms.columnOrder?.get();return s=>{let n=[];if(!t?.length)n=s;else{const i=new Map;for(let r=0;r<s.length;r++){const o=s[r];i.set(o.id,o)}for(let r=0;r<t.length;r++){const o=t[r],a=i.get(o);a&&(n.push(a),i.delete(o))}for(let r=0;r<s.length;r++){const o=s[r];i.has(o.id)&&n.push(o)}}return xn(e,n)}}function xn(e,t){const s=e.atoms.grouping?.get()??[],{groupedColumnMode:n}=e.options;if(!s.length||!n)return t;const i=t.filter(a=>!s.includes(a.id));if(n==="remove")return i;const r=new Map;for(let a=0;a<t.length;a++){const l=t[a];r.set(l.id,l)}const o=[];for(let a=0;a<s.length;a++){const l=r.get(s[a]);l&&o.push(l)}return[...o,...i]}function In(e){return[e,...e.columns.flatMap(t=>t.getFlatColumns())]}function Fn(e){if(e.columns.length){const t=e.columns.flatMap(s=>s.getLeafColumns());return j(e.table,"getOrderColumns",Ct)(t)}return[e]}function Pn(e){return{header:t=>{const s=t.header.column.columnDef;return s.accessorKey?s.accessorKey:s.accessorFn?s.id:null},cell:t=>t.renderValue()?.toString?.()??null,...Object.values(e._features).reduce((t,s)=>Object.assign(t,s.getDefaultColumnDef?.()),{}),...e.options.defaultColumn}}function Rt(e,t,s,n=0){const i=new Array(t.length);for(let r=0;r<t.length;r++){if(!(r in t))continue;const o=t[r],a=On(e,o,n,s),l=o;a.columns=l.columns?Rt(e,l.columns,a,n+1):[],i[r]=a}return i}function En(e){return Rt(e,e.options.columns)}function An(e){return e.getAllColumns().flatMap(t=>t.getFlatColumns())}function Dn(e){const t=k(),s=e.getAllFlatColumns();for(let n=0;n<s.length;n++){const i=s[n];t[i.id]=i}return t}function Tn(e){const t=e.getAllColumns().flatMap(s=>s.getLeafColumns());return j(e,"getOrderColumns",Ct)(t)}function jn(e){const t=k(),s=e.getAllLeafColumns();for(let n=0;n<s.length;n++){const i=s[n];t[i.id]=i}return t}function zn(e,t){return e.getAllFlatColumnsById()[t]}const kn={assignColumnPrototype:(e,t)=>{J("coreColumnsFeature",e,t,{column_getFlatColumns:{fn:s=>In(s),memoDeps:s=>[s.table.options.columns]},column_getLeafColumns:{fn:s=>Fn(s),memoDeps:s=>[s.table.atoms.columnOrder?.get(),s.table.atoms.grouping?.get(),s.table.options.columns,s.table.options.groupedColumnMode]}})},constructTableAPIs:e=>{q("coreColumnsFeature",e,{table_getDefaultColumnDef:{fn:()=>Pn(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>En(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>An(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>Dn(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>Tn(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getAllLeafColumnsById:{fn:()=>jn(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>zn(e,t)}})}};function Mt(e,t){for(let s=0;s<e.subHeaders.length;s++)Mt(e.subHeaders[s],t);t.push(e)}function Ln(e){const t=[];return Mt(e,t),t}function Vn(e){return{column:e.column,header:e,table:e.column.table}}function Qn(e){const{start:t,end:s}=e.atoms.columnPinning?.get()??bn(),n=e.getAllColumns(),i=j(e,"getVisibleLeafColumns",wn);if(!t.length&&!s.length)return Je(n,i,e);const r=e.getAllLeafColumnsById(),o=[];for(let u=0;u<t.length;u++){const c=r[t[u]];c&&j(c,"getIsVisible",Q)&&o.push(c)}const a=[];for(let u=0;u<s.length;u++){const c=r[s[u]];c&&j(c,"getIsVisible",Q)&&a.push(c)}const l=i.filter(u=>!t.includes(u.id)&&!s.includes(u.id));return Je(n,[...o,...l,...a],e)}function Hn(e){return[...e.getHeaderGroups()].reverse()}function Nn(e){const t=e.getHeaderGroups(),s=[];for(let n=0;n<t.length;n++){const i=t[n].headers;for(let r=0;r<i.length;r++)s.push(i[r])}return s}function qn(e){const t=e.getHeaderGroups()[0]?.headers??[],s=[];for(let n=0;n<t.length;n++){const i=t[n].getLeafHeaders();for(let r=0;r<i.length;r++)s.push(i[r])}return s}const Kn={assignHeaderPrototype:(e,t)=>{J("coreHeadersFeature",e,t,{header_getLeafHeaders:{fn:s=>Ln(s),memoDeps:s=>[s.column.table.options.columns]},header_getContext:{fn:s=>Vn(s),memoDeps:s=>[s.column.table.options.columns]}})},constructTableAPIs:e=>{q("coreHeadersFeature",e,{table_getHeaderGroups:{fn:()=>Qn(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.options.groupedColumnMode]},table_getFooterGroups:{fn:()=>Hn(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>Nn(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>qn(e),memoDeps:()=>[e.getHeaderGroups()]}})}};function Un(e){if(!e._rowPrototype){e._rowPrototype={table:e};const t=Object.values(e._features);for(let s=0;s<t.length;s++)t[s].assignRowPrototype?.(e._rowPrototype,e)}return e._rowPrototype}const Wn=(e,t,s,n,i,r,o)=>{const a=Un(e),l=Object.create(a);l._displayIndexCache=-1,l._uniqueValuesCache=k(),l._valuesCache=k(),l.depth=i,l.id=t,l.index=n,l.original=s,l.parentId=o,l.subRows=[];const u=e._rowInstanceInitFns;for(let c=0;c<u.length;c++)u[c](l);return l},Gn=/([0-9]+)/gm;function K(e){const t=Object.assign((s,n,i)=>{let r=s.getValue(i),o=n.getValue(i);const a=t.resolveDataValue;return a&&(r=a(r),o=a(o)),t.sort(r,o,s,n,i)},e);return t}K({resolveDataValue:e=>ce(e).toLowerCase(),sort:(e,t)=>xt(e,t)});K({resolveDataValue:e=>ce(e),sort:(e,t)=>xt(e,t)});K({resolveDataValue:e=>ce(e).toLowerCase(),sort:(e,t)=>Ae(e,t)});K({resolveDataValue:e=>ce(e),sort:(e,t)=>Ae(e,t)});K({resolveDataValue:e=>$n(e),sort:(e,t)=>e>t?1:e<t?-1:0});const Ot=K({sort:(e,t)=>Ae(e,t)});function Ae(e,t){return e===t?0:e>t?1:-1}function $n(e){return e instanceof Date?e.getTime():e}function ce(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function xt(e,t){let s=0,n=0;const i=e.length,r=t.length;for(;s<i&&n<r;){const o=ie(e.charCodeAt(s)),a=ie(t.charCodeAt(n)),l=Oe(e,s,o),u=Oe(t,n,a);if(!o&&!a){const f=Bn(e,s,l,t,n,u);if(f)return f;s=l,n=u;continue}if(o!==a)return o?1:-1;const c=Jn(e,s,l,t,n,u);if(c)return c;s=l,n=u}return Ze(e,s)-Ze(t,n)}function ie(e){return e>=48&&e<=57}function Oe(e,t,s){let n=t+1;for(;n<e.length&&ie(e.charCodeAt(n))===s;)n++;return n}function Bn(e,t,s,n,i,r){const o=s-t,a=r-i,l=o<a?o:a;for(let u=0;u<l;u++){const c=e.charCodeAt(t+u),f=n.charCodeAt(i+u);if(c>f)return 1;if(f>c)return-1}return o>a?1:a>o?-1:0}function Jn(e,t,s,n,i,r){let o=t;for(;o<s&&e.charCodeAt(o)===48;)o++;let a=i;for(;a<r&&n.charCodeAt(a)===48;)a++;const l=s-o,u=r-a;if(l===0&&u===0)return 0;if(l<=15&&u<=15){const h=Xe(e,o,s),d=Xe(n,a,r);return h>d?1:d>h?-1:0}const c=parseInt(e.slice(t,s),10),f=parseInt(n.slice(i,r),10);return c>f?1:f>c?-1:0}function Xe(e,t,s){let n=0;for(let i=t;i<s;i++)n=n*10+e.charCodeAt(i)-48;return n}function Ze(e,t){let s=0,n=t;for(;n<e.length;)s++,n=Oe(e,n,ie(e.charCodeAt(n)));return s}function Xn(){return[]}function Zn(e,t){le(e,"cellSelection",V(e.initialState.cellSelection)??Xn())}function Yn(e){e.atoms.cellSelection&&(e.options.autoResetAll??e.options.autoResetCellSelection??!0)&&e._reactivity.schedule(()=>Zn(e))}function ei(e){e.atoms.expanded&&(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding)&&e._reactivity.schedule(()=>ti(e))}function ti(e,t){const s=e.initialState.expanded;le(e,"expanded",s===!0?!0:Object.assign(k(),V(s??{})))}const xe=0;function It(e){if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if((e.atoms.pagination?.get()?.pageIndex??xe)===xe)return;ii(e)}}function si(e,t){le(e,"pagination",t)}function ni(e,t){si(e,s=>{let n=oe(t,s.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return n=Math.max(0,Math.min(n,i)),{...s,pageIndex:n}})}function ii(e,t){ni(e,xe)}function ri(){return[]}function he(e,t){le(e,"sorting",t)}function Ft(e,t){he(e,t?[]:V(e.initialState.sorting??[]))}function oi(e){e.atoms.sorting&&(e.options.autoResetAll??e.options.autoResetSorting??!1)&&Ft(e)}function Pt(e){const t=e.table._rowModelFns.sortFns,s=e.table.getFilteredRowModel().flatRows.slice(0,10);let n,i=!1;for(let r=0;r<s.length;r++){const o=s[r].getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]"){n="datetime";break}if(typeof o=="string"&&(i=!0,o.split(Gn).length>1)){n="alphanumeric";break}}if(!n&&i&&(n="text"),n){let r=t?.[n];if(r||n==="alphanumeric"&&(r=t?.text),r)return r}return Ot}function Et(e){const t=e.table.getFilteredRowModel().flatRows.slice(0,10);for(let s=0;s<t.length;s++){const n=t[s].getValue(e.id);if(n!=null)return typeof n=="string"?"asc":"desc"}return"desc"}function At(e){const t=e.table._rowModelFns.sortFns;return fn(e.columnDef.sortFn)?e.columnDef.sortFn:e.columnDef.sortFn==="auto"?Pt(e):t?.[e.columnDef.sortFn]??Ot}function Dt(e,t,s){const n=jt(e,s&&re(e)),i=typeof t<"u";he(e.table,r=>{const o=r.findIndex(h=>h.id===e.id),a=o===-1?void 0:r[o];let l=[],u;const c=i?t:n==="desc",f=!!(r.length&&re(e)&&s);return f?a?u="toggle":u="add":a?u="toggle":u="replace",u==="toggle"&&(i||n||(u="remove")),u==="add"?(l=[...r,{id:e.id,desc:c}],l.splice(0,l.length-(e.table.options.maxMultiSortColCount??Number.MAX_SAFE_INTEGER))):u==="toggle"?l=f?r.map(h=>h.id===e.id?{...h,desc:c}:h):[{id:e.id,desc:c}]:u==="remove"?l=f?r.filter(h=>h.id!==e.id):[]:l=[{id:e.id,desc:c}],l})}function Tt(e){return e.columnDef.sortDescFirst??e.table.options.sortDescFirst??Et(e)==="desc"?"desc":"asc"}function jt(e,t){const s=Tt(e),n=zt(e);return n?n!==s&&(e.table.options.enableSortingRemoval??!0)&&(!t||(e.table.options.enableMultiRemove??!0))?!1:n==="desc"?"asc":"desc":s}function De(e){return(e.columnDef.enableSorting??!0)&&(e.table.options.enableSorting??!0)&&!!e.accessorFn}function re(e){return e.columnDef.enableMultiSort??e.table.options.enableMultiSort??!!e.accessorFn}function zt(e){const t=e.table.atoms.sorting?.get()?.find(s=>s.id===e.id);return t?t.desc?"desc":"asc":!1}function ai(e){return e.table.atoms.sorting?.get()?.findIndex(t=>t.id===e.id)??-1}function li(e){he(e.table,t=>t.length?t.filter(s=>s.id!==e.id):[])}function ui(e){const t=De(e);return s=>{t&&Dt(e,void 0,re(e)?e.table.options.isMultiSortEvent?.(s):!1)}}function ci(){return e=>ue({feature:"coreRowModelsFeature",table:e,fnName:"table.getCoreRowModel",memoDeps:()=>[e.options.data],fn:()=>hi(e,e.options.data),onAfterUpdate:yt(()=>{ei(e),It(e),oi(e),Yn(e)})})}function kt(e,t,s,n=0,i){const r=[];for(let o=0;o<s.length;o++){const a=s[o],l=Wn(e,e.getRowId(a,o,i),a,o,n,void 0,i?.id);t.flatRows.push(l),t.rowsById[l.id]=l,r.push(l),e.options.getSubRows&&(l.originalSubRows=e.options.getSubRows(a,o),l.originalSubRows?.length&&(l.subRows=kt(e,t,l.originalSubRows,n+1,l)))}return r}function hi(e,t){const s={rows:[],flatRows:[],rowsById:k()};return s.rows=kt(e,s,t),s}function fi(e){return e._rowModels.coreRowModel||(e._rowModels.coreRowModel=e.options.features.coreRowModel?.(e)??ci()(e)),e._rowModels.coreRowModel()}function di(e){return e.getCoreRowModel()}function gi(e){return e._rowModels.filteredRowModel||(e._rowModels.filteredRowModel=e.options.features.filteredRowModel?.(e)),e.options.manualFiltering||!e._rowModels.filteredRowModel?e.getPreFilteredRowModel():e._rowModels.filteredRowModel()}function pi(e){return e.getFilteredRowModel()}function mi(e){return e._rowModels.groupedRowModel||(e._rowModels.groupedRowModel=e.options.features.groupedRowModel?.(e)),e.options.manualGrouping||!e._rowModels.groupedRowModel?e.getPreGroupedRowModel():e._rowModels.groupedRowModel()}function yi(e){return e.getGroupedRowModel()}function vi(e){return e._rowModels.sortedRowModel||(e._rowModels.sortedRowModel=e.options.features.sortedRowModel?.(e)),e.options.manualSorting||!e._rowModels.sortedRowModel?e.getPreSortedRowModel():e._rowModels.sortedRowModel()}function Si(e){return e.getSortedRowModel()}function bi(e){return e._rowModels.expandedRowModel||(e._rowModels.expandedRowModel=e.options.features.expandedRowModel?.(e)),e.options.manualExpanding||!e._rowModels.expandedRowModel?e.getPreExpandedRowModel():e._rowModels.expandedRowModel()}function wi(e){return e.getExpandedRowModel()}function _i(e){return e._rowModels.paginatedRowModel||(e._rowModels.paginatedRowModel=e.options.features.paginatedRowModel?.(e)),e.options.manualPagination||!e._rowModels.paginatedRowModel?e.getPrePaginatedRowModel():e._rowModels.paginatedRowModel()}function Ci(e){return e.getPaginatedRowModel()}const Ri={constructTableAPIs:e=>{q("coreRowModelsFeature",e,{table_getCoreRowModel:{fn:()=>fi(e)},table_getPreFilteredRowModel:{fn:()=>di(e)},table_getFilteredRowModel:{fn:()=>gi(e)},table_getPreGroupedRowModel:{fn:()=>pi(e)},table_getGroupedRowModel:{fn:()=>mi(e)},table_getPreSortedRowModel:{fn:()=>yi(e)},table_getSortedRowModel:{fn:()=>vi(e)},table_getPreExpandedRowModel:{fn:()=>Si(e)},table_getExpandedRowModel:{fn:()=>bi(e)},table_getPrePaginatedRowModel:{fn:()=>wi(e)},table_getPaginatedRowModel:{fn:()=>_i(e)},table_getRowModel:{fn:()=>Ci(e)}})}};function Mi(e){if(!e._cellPrototype){e._cellPrototype={table:e};const t=Object.values(e._features);for(let s=0;s<t.length;s++)t[s].assignCellPrototype?.(e._cellPrototype,e)}return e._cellPrototype}function Oi(e,t,s){const n=Mi(s),i=Object.create(n);i.column=e,i.id=`${t.id}_${e.id}`,i.row=t;const r=s._cellInstanceInitFns;for(let o=0;o<r.length;o++)r[o](i);return i}function xi(e){const t=e.table.getRowsInDisplayOrder(),s=e._displayIndexCache;return t[s]===e?s:-1}function Ii(e){const t=e.getPrePaginatedRowModel().rows;if(e.options.paginateExpandedRows===!1){const s=[],n=i=>{i._displayIndexCache=s.length,s.push(i),i.subRows.length&&i.getIsExpanded?.()&&i.subRows.forEach(n)};return t.forEach(n),s}for(let s=0;s<t.length;s++)t[s]._displayIndexCache=s;return t}function Fi(e,t){if(ae(e._valuesCache,t))return e._valuesCache[t];const s=e.table.getColumn(t);if(s?.accessorFn)return e._valuesCache[t]=s.accessorFn(e.original,e.index),e._valuesCache[t]}function Pi(e,t){if(ae(e._uniqueValuesCache,t))return e._uniqueValuesCache[t];const s=e.table.getColumn(t);if(s?.accessorFn)return s.columnDef.getUniqueValues?(e._uniqueValuesCache[t]=s.columnDef.getUniqueValues(e.original,e.index),e._uniqueValuesCache[t]):(e._uniqueValuesCache[t]=[e.getValue(t)],e._uniqueValuesCache[t])}function Ei(e,t){return e.getValue(t)??e.table.options.renderFallbackValue}function Ai(e){return dn(e.subRows,t=>t.subRows)}function Di(e){const t=e.getCoreRowModel().flatRows;let s=0;for(let n=0;n<t.length;n++)s=Math.max(s,t[n].depth);return s}function Ti(e){if(e.parentId)return e.table.getCoreRowModel().rowsById[e.parentId]??e.table.getRow(e.parentId,!0)}function ji(e){const t=[];let s=e;for(;;){const n=s.getParentRow();if(!n)break;t.push(n),s=n}return t.reverse()}function zi(e){const t=e.table.getAllLeafColumns();let s=e._cellsCache;s||(s=e._cellsCache=new WeakMap);const n=new Array(t.length);for(let i=0;i<t.length;i++){const r=t[i];let o=s.get(r);o||(o=Oi(r,e,e.table),s.set(r,o)),n[i]=o}return n}function ki(e){const t=k(),s=e.getAllCells();for(let n=0;n<s.length;n++){const i=s[n];t[i.column.id]=i}return t}function Li(e,t,s,n){return t.options.getRowId?.(e,s,n)??(n?`${n.id}.${s}`:String(s))}function Vi(e,t,s){let n=(s?e.getPrePaginatedRowModel():e.getRowModel()).rowsById[t];if(!n&&(n=e.getCoreRowModel().rowsById[t],!n))throw new Error;return n}const Qi={assignRowPrototype:(e,t)=>{J("coreRowsFeature",e,t,{row_getDisplayIndex:{fn:s=>xi(s)},row_getAllCellsByColumnId:{fn:s=>ki(s),memoDeps:s=>[s.getAllCells()]},row_getAllCells:{fn:s=>zi(s),memoDeps:s=>[s.table.getAllLeafColumns()]},row_getLeafRows:{fn:s=>Ai(s),memoDeps:s=>[s.subRows]},row_getParentRow:{fn:s=>Ti(s)},row_getParentRows:{fn:s=>ji(s)},row_getUniqueValues:{fn:(s,n)=>Pi(s,n)},row_getValue:{fn:(s,n)=>Fi(s,n)},row_renderValue:{fn:(s,n)=>Ei(s,n)}})},constructTableAPIs:e=>{q("coreRowsFeature",e,{table_getRowsInDisplayOrder:{fn:()=>Ii(e),memoDeps:()=>[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,e.options.paginateExpandedRows===!1?e.atoms.expanded?.get():void 0]},table_getRowId:{fn:(t,s,n)=>Li(t,e,s,n)},table_getRow:{fn:(t,s)=>Vi(e,t,s)},table_getMaxSubRowDepth:{fn:()=>Di(e),memoDeps:()=>[e.getCoreRowModel()]}})}};function Lt(e,t,s=(n,i)=>n===i){const n=t===void 0?e.options.state:t;e._reactivity.batch(()=>{if(n)for(const i in n){const r=e.baseAtoms[i];if(!r)continue;const o=n[i],a=o===void 0?e.initialState[i]:o;s(e._reactivity.untrack(()=>r.get()),a)||r.set(()=>a)}})}function Vt(e,t,s=(n,i)=>n===i){e._reactivity.batch(()=>{Lt(e,t,s),e._reactivity.commit?.()})}function Hi(e){const t=V(e.initialState);e._reactivity.batch(()=>{const n=Object.keys(t);for(let i=0;i<n.length;i++){const r=n[i];e.baseAtoms[r].set(t[r])}});const s=Object.values(e._features);for(let n=0;n<s.length;n++)s[n].resetTableInstanceData?.(e)}function Ni(e,t){const{features:s,atoms:n,initialState:i}=e.options;if(!e.options.mergeOptions)return{...e.options,...t,features:s,atoms:n,initialState:i};const r=e.options.mergeOptions(e.options,t),o={...Object.getOwnPropertyDescriptors(r)};return Object.defineProperties(Object.create(Object.getPrototypeOf(r)),{...o,features:{value:s,enumerable:!0,configurable:!0,writable:!0},atoms:{value:n,enumerable:!0,configurable:!0,writable:!0},initialState:{value:i,enumerable:!0,configurable:!0,writable:!0}})}function Qt(e,t,s){const n=Ni(e,oe(t,e.options));e.optionsStore?e.optionsStore.set(()=>n):e.options=n,s?.syncExternalState!==!1&&Vt(e,n.state??null)}const qi={constructTableAPIs:e=>{q("coreTablesFeature",e,{table_reset:{fn:()=>Hi(e)},table_setOptions:{fn:t=>Qt(e,t)}})}},Ki={coreCellsFeature:vn,coreColumnsFeature:kn,coreHeadersFeature:Kn,coreRowModelsFeature:Ri,coreRowsFeature:Qi,coreTablesFeature:qi};function nr(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},columns:e=>e,display:e=>e,group:e=>e}}function ir(e){return e}function Ui(e,t={}){return Object.values(e).forEach(s=>{t=s.getInitialState?.(t)??t}),V(t)}function Wi(e){const t=e.features.coreReactivityFeature,{aggregationFns:s,columnMeta:n,coreRowModel:i,expandedRowModel:r,facetedMinMaxValues:o,facetedRowModel:a,facetedUniqueValues:l,filterFns:u,filterMeta:c,filteredRowModel:f,groupedRowModel:h,paginatedRowModel:d,sortFns:g,sortedRowModel:p,tableMeta:S,...y}=e.features,m={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...Ki,...y},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:s,filterFns:u,sortFns:g},_rowModels:{},atoms:{},baseAtoms:{}},b=Object.values(m._features),_={...b.reduce((R,v)=>Object.assign(R,v.getDefaultTableOptions?.(m)),{}),...e};if(t.wrapExternalAtoms&&_.atoms)for(const[R,v]of Object.entries(_.atoms)){const C=v,I=t.createWritableAtom(C.get(),{debugName:`externalAtom/${R}`});_.atoms[R]=I;let O=!1;const F=C.subscribe(P=>{O||I.set(P)}),D=I.subscribe(P=>{O=!0,C.set(P),O=!1});t.addSubscription(F),t.addSubscription(D)}t.createOptionsStore?(m.optionsStore=t.createWritableAtom(_,{debugName:"table/optionsStore"}),Object.defineProperty(m,"options",{configurable:!0,enumerable:!0,get(){return m.optionsStore.get()},set(R){m.optionsStore.set(()=>R)}})):m.options=_,m.initialState=Ui(m._features,m.options.initialState);const w=Object.keys(m.initialState);for(let R=0;R<w.length;R++){const v=w[R];m.baseAtoms[v]=t.createWritableAtom(m.initialState[v],{debugName:`table/baseAtoms/${v}`}),m.atoms[v]=t.createReadonlyAtom(()=>{const C=m.options,I=C.atoms?.[v],O=I?I.get():m.baseAtoms[v].get();if(I)return O;const F=C.state;if(F&&ae(F,v)){const D=F[v];return D===void 0?m.initialState[v]:D}return O},{debugName:`table/atoms/${v}`})}Lt(m),m.store=nn(t.createReadonlyAtom(()=>{const R={};for(let v=0;v<w.length;v++){const C=w[v];R[C]=m.atoms[C].get()}return R},{compare:W,debugName:"table/store"}));for(let R=0;R<b.length;R++){const v=b[R];v.initTableInstanceData?.(m),v.initCellInstanceData&&m._cellInstanceInitFns.push(v.initCellInstanceData.bind(v)),v.initColumnInstanceData&&m._columnInstanceInitFns.push(v.initColumnInstanceData.bind(v)),v.initHeaderGroupInstanceData&&m._headerGroupInstanceInitFns.push(v.initHeaderGroupInstanceData.bind(v)),v.initHeaderInstanceData&&m._headerInstanceInitFns.push(v.initHeaderInstanceData.bind(v)),v.initRowInstanceData&&m._rowInstanceInitFns.push(v.initRowInstanceData.bind(v)),v.constructTableAPIs?.(m)}return m}const rr={getInitialState(e){return{sorting:ri(),...e}},getDefaultColumnDef(){return{sortFn:"auto",sortUndefined:1}},getDefaultTableOptions(e){return{autoResetSorting:!1,onSortingChange:un("sorting",e),isMultiSortEvent:t=>t.shiftKey}},assignColumnPrototype(e,t){J("rowSortingFeature",e,t,{column_getAutoSortFn:{fn:s=>Pt(s)},column_getAutoSortDir:{fn:s=>Et(s)},column_getSortFn:{fn:s=>At(s)},column_toggleSorting:{fn:(s,n,i)=>Dt(s,n,i)},column_getFirstSortDir:{fn:s=>Tt(s)},column_getNextSortingOrder:{fn:(s,n)=>jt(s,n)},column_getCanSort:{fn:s=>De(s)},column_getCanMultiSort:{fn:s=>re(s)},column_getIsSorted:{fn:s=>zt(s)},column_getSortIndex:{fn:s=>ai(s)},column_clearSorting:{fn:s=>li(s)},column_getToggleSortingHandler:{fn:s=>ui(s)}})},constructTableAPIs(e){q("rowSortingFeature",e,{table_setSorting:{fn:t=>he(e,t)},table_resetSorting:{fn:t=>Ft(e,t)}})}};function or(){return e=>{const t=e;return ue({feature:"rowSortingFeature",table:t,fnName:"table.getSortedRowModel",memoDeps:()=>[t.atoms.sorting?.get(),t.getPreSortedRowModel()],fn:()=>Gi(t),onAfterUpdate:yt(()=>It(t))})}}function Gi(e){const t=e.getPreSortedRowModel(),s=e.atoms.sorting?.get();if(!t.rows.length||!s?.length)return t;const n=[],i=s.filter(l=>{const u=e.getColumn(l.id);return u?De(u):!1});if(!i.length)return t;const r=[];for(let l=0;l<i.length;l++){const u=i[l],c=e.getColumn(u.id);c&&r.push({id:u.id,desc:u.desc,sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortFn:At(c)})}const o=(l,u)=>{for(let c=0;c<r.length;c++){const f=r[c],h=f.sortUndefined,d=f.desc;let g=0;if(h){const p=l.getValue(f.id),S=u.getValue(f.id),y=p===void 0,m=S===void 0;if(y&&m)continue;if(y||m){if(h==="first")return y?-1:1;if(h==="last")return y?1:-1;g=y?h:-h}}if(g===0&&(g=f.sortFn(l,u,f.id)),g!==0)return d&&(g*=-1),f.invertSorting&&(g*=-1),g}return l.index-u.index},a=l=>{const u=l.slice();u.sort(o);let c=!1;for(let f=0;f<u.length;f++){const h=u[f];h!==l[f]&&(c=!0);const d=n.length;if(n.push(h),h.subRows.length){const g=a(h.subRows);if(g.changed){const p=Object.create(Object.getPrototypeOf(h));ln(p,h),p.subRows=g.rows,u[f]=p,n[d]=p,c=!0}}}return{rows:u,changed:c}};return{rows:a(t.rows).rows,flatRows:n,rowsById:t.rowsById}}const $i=typeof window>"u"?M.useEffect:M.useLayoutEffect;function ar(e,t){const[{table:s,rootSource:n}]=M.useState(()=>{const l=Wi({...e,features:{coreReactivityFeature:an(),...e.features}});return l.Subscribe=(u=>sn({...u,source:u.source??l.store})),l.FlexRender=Gs,{table:l,rootSource:on(l.store,W)}}),i=s;Qt(i,l=>({...l,...e}),{syncExternalState:!1});const r=i.options.state,o=n.get(),a=pt(n,t,{compare:W});return $i(()=>{n.markCommitted(o),Vt(i,r??null,W)}),M.useMemo(()=>({...s,options:e,state:a}),[s,e,a])}export{Zi as Q,sr as a,ys as b,ar as c,nr as d,or as e,tr as f,Yi as g,Xi as k,rr as r,ir as t,er as u};
@@ -1,4 +1,4 @@
1
- import{_ as o,z as pt,a9 as Rt,aa as Ct,ab as Wt,c as gt,l as E,F as Pt,a1 as Bt,ac as ft,d as U,u as Vt,ad as Ft,q as zt}from"./mermaid.core-9dt2ugQA.js";import{d as ot}from"./arc-DLa3_7ua.js";import"./index-DAUK3rnz.js";import"./react-rd22PHbN.js";import"./tanstack-B0Sf7wNU.js";import"./base-ui-CJ8ZIx3d.js";import"./render-markdown-BtCybfvQ.js";import"./App-BXZLGT86.js";import"./one-light-CoLDteqg.js";import"./index-BgLrS_2D.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,R=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var K=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,C={},G,B,X,Z;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";Z=[];for(G in S[$])this.terminals_[G]&&G>W&&Z.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`:
1
+ import{_ as o,z as pt,a9 as Rt,aa as Ct,ab as Wt,c as gt,l as E,F as Pt,a1 as Bt,ac as ft,d as U,u as Vt,ad as Ft,q as zt}from"./mermaid.core-CGJtfmwb.js";import{d as ot}from"./arc-C43uoeEi.js";import"./index-B5RC4THs.js";import"./react-rd22PHbN.js";import"./tanstack-CcfAJoQ7.js";import"./base-ui-CJ8ZIx3d.js";import"./render-markdown-hAIWRfn0.js";import"./App-Dfm5F199.js";import"./one-light-CoLDteqg.js";import"./index-BgLrS_2D.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,R=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var K=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,C={},G,B,X,Z;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";Z=[];for(G in S[$])this.terminals_[G]&&G>W&&Z.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`:
2
2
  `+w.showPosition()+`
3
3
  Expecting `+Z.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:Z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,R=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],C.$=x[x.length-B],C._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},K&&(C._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(C,[v,R,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(C.$),u.push(C._$),X=S[l[l.length-2]][l[l.length-1]],l.push(X);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(s,d){return this.yy=d||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:o(function(s){var d=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{b3 as Wt,s as Kt,g as Ht,p as Yt,o as Xt,a as Zt,b as Jt,_ as w,z as wt,F as Qt,d as ot,ak as $t,a9 as te,aa as ee,ab as ne,e as se,q as ie,B as oe,D as re}from"./mermaid.core-9dt2ugQA.js";import"./index-DAUK3rnz.js";import"./react-rd22PHbN.js";import"./tanstack-B0Sf7wNU.js";import"./base-ui-CJ8ZIx3d.js";import"./render-markdown-BtCybfvQ.js";import"./App-BXZLGT86.js";import"./one-light-CoLDteqg.js";import"./index-BgLrS_2D.js";const It=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(J(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)J(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)J(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);J(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<E&&(E=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Ot(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(I=>{I.size==0&&I.sets.length==1&&D.add(I.sets[0])}),d=d.filter(I=>!I.sets.some(F=>D.has(F)));let k={},C={};if(d.length>0){let I=m(d,{lossFunction:v,distinct:b});l&&(I=Ct(I,r,h)),k=Nt(I,s,e,i,f),C=Lt(k,d,M)}const U={};d.forEach(I=>{I.label&&(U[I.sets]=I.label)});function V(I){if(I.sets in U)return U[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let T=!1;O.selectAll(".venn-area path").each(function(I){const F=this.getAttribute("d");I.sets.length==1&&F&&!b&&(T=!0,R[I.sets[0]]=Me(F))});function A(I){return F=>{const H=I.sets.map(et=>{let Y=R[et],Z=k[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,I=>I.sets),P=G.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(I=>V(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),L.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function K(I){return typeof I.transition=="function"?I.transition("venn").duration(o):I}let z=x;T&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",I=>St(I.sets.map(F=>k[F])),p);const N=z.selectAll("text").filter(I=>I.sets in C).text(I=>V(I)).attr("x",I=>Math.floor(C[I.sets].x)).attr("y",I=>Math.floor(C[I.sets].y));u&&(T?"on"in N?N.on("end",rt(k,V)):N.each("end",rt(k,V)):N.each(rt(k,V)));const j=K(G.exit()).remove();typeof G.transition=="function"&&j.selectAll("path").attrTween("d",A);const X=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:k,textCentres:C,nodes:G,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function ke(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=ke(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=jt(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(`
1
+ import{b3 as Wt,s as Kt,g as Ht,p as Yt,o as Xt,a as Zt,b as Jt,_ as w,z as wt,F as Qt,d as ot,ak as $t,a9 as te,aa as ee,ab as ne,e as se,q as ie,B as oe,D as re}from"./mermaid.core-CGJtfmwb.js";import"./index-B5RC4THs.js";import"./react-rd22PHbN.js";import"./tanstack-CcfAJoQ7.js";import"./base-ui-CJ8ZIx3d.js";import"./render-markdown-hAIWRfn0.js";import"./App-Dfm5F199.js";import"./one-light-CoLDteqg.js";import"./index-BgLrS_2D.js";const It=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(J(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)J(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)J(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);J(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<E&&(E=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Ot(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(I=>{I.size==0&&I.sets.length==1&&D.add(I.sets[0])}),d=d.filter(I=>!I.sets.some(F=>D.has(F)));let k={},C={};if(d.length>0){let I=m(d,{lossFunction:v,distinct:b});l&&(I=Ct(I,r,h)),k=Nt(I,s,e,i,f),C=Lt(k,d,M)}const U={};d.forEach(I=>{I.label&&(U[I.sets]=I.label)});function V(I){if(I.sets in U)return U[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let T=!1;O.selectAll(".venn-area path").each(function(I){const F=this.getAttribute("d");I.sets.length==1&&F&&!b&&(T=!0,R[I.sets[0]]=Me(F))});function A(I){return F=>{const H=I.sets.map(et=>{let Y=R[et],Z=k[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,I=>I.sets),P=G.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(I=>V(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),L.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function K(I){return typeof I.transition=="function"?I.transition("venn").duration(o):I}let z=x;T&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",I=>St(I.sets.map(F=>k[F])),p);const N=z.selectAll("text").filter(I=>I.sets in C).text(I=>V(I)).attr("x",I=>Math.floor(C[I.sets].x)).attr("y",I=>Math.floor(C[I.sets].y));u&&(T?"on"in N?N.on("end",rt(k,V)):N.each("end",rt(k,V)):N.each(rt(k,V)));const j=K(G.exit()).remove();typeof G.transition=="function"&&j.selectAll("path").attrTween("d",A);const X=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:k,textCentres:C,nodes:G,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function ke(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=ke(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=jt(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(`
2
2
  M`,t,n),e.push(`
3
3
  m`,-s,0),e.push(`
4
4
  a`,s,s,0,1,0,s*2,0),e.push(`
@@ -1 +1 @@
1
- import{j as e}from"./react-rd22PHbN.js";import{d as n}from"./index-DAUK3rnz.js";import{T as o,f as l,g as b,h as u,i as c}from"./base-ui-CJ8ZIx3d.js";function f({value:a,onValueChange:s,...r}){return e.jsx(o,{value:a,onValueChange:i=>s(i),...r})}function j({label:a,items:s,className:r,...i}){return e.jsxs(l,{"aria-label":a,activateOnFocus:!0,className:n("viewer-tabs-list",r),...i,children:[e.jsx(b,{className:"viewer-tabs-indicator"}),s.map(t=>e.jsx(u,{value:t.value,children:t.label},t.value))]})}function p({ref:a,...s}){return e.jsx(c,{ref:a,...s})}export{f as V,j as a,p as b};
1
+ import{j as e}from"./react-rd22PHbN.js";import{a as n}from"./index-B5RC4THs.js";import{T as o,f as l,g as b,h as u,i as c}from"./base-ui-CJ8ZIx3d.js";function f({value:a,onValueChange:s,...r}){return e.jsx(o,{value:a,onValueChange:i=>s(i),...r})}function j({label:a,items:s,className:r,...i}){return e.jsxs(l,{"aria-label":a,activateOnFocus:!0,className:n("viewer-tabs-list",r),...i,children:[e.jsx(b,{className:"viewer-tabs-indicator"}),s.map(t=>e.jsx(u,{value:t.value,children:t.label},t.value))]})}function p({ref:a,...s}){return e.jsx(c,{ref:a,...s})}export{f as V,j as a,p as b};
@@ -1,4 +1,4 @@
1
- import{p as Mt}from"./chunk-JWPE2WC7-BrLmjbVP.js";import{s as Nt,g as zt,p as Lt,o as Tt,a as At,b as Xt,_ as u,W as Et,z as Yt,B as J,l as Q,F as It,e as Bt,q as Ft,c as V}from"./mermaid.core-9dt2ugQA.js";import{p as Rt}from"./cynefin-VYW2F7L2-B4M1t9lL.js";import"./index-DAUK3rnz.js";import"./react-rd22PHbN.js";import"./tanstack-B0Sf7wNU.js";import"./base-ui-CJ8ZIx3d.js";import"./render-markdown-BtCybfvQ.js";import"./App-BXZLGT86.js";import"./one-light-CoLDteqg.js";import"./index-BgLrS_2D.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,m)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(m,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,m)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:m}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=m??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,m,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:m,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:Xt,getAccTitle:At,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
1
+ import{p as Mt}from"./chunk-JWPE2WC7-D0THYpZl.js";import{s as Nt,g as zt,p as Lt,o as Tt,a as At,b as Xt,_ as u,W as Et,z as Yt,B as J,l as Q,F as It,e as Bt,q as Ft,c as V}from"./mermaid.core-CGJtfmwb.js";import{p as Rt}from"./cynefin-VYW2F7L2-Cbh4Pk6j.js";import"./index-B5RC4THs.js";import"./react-rd22PHbN.js";import"./tanstack-CcfAJoQ7.js";import"./base-ui-CJ8ZIx3d.js";import"./render-markdown-hAIWRfn0.js";import"./App-Dfm5F199.js";import"./one-light-CoLDteqg.js";import"./index-BgLrS_2D.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,m)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(m,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,m)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:m}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=m??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,m,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:m,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:Xt,getAccTitle:At,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
2
2
  `+o);const a=jt(),d=Ht(),m=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const mt=g.axes.xLabel??"Evolution",wt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(mt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(wt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],w=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,w=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",w).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,w=f/x,P=-l/x,N=i+w*y,W=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,w=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:w}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?m/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?m:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?m/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?m:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(w=>w.text).sort((w,P)=>w.number-P.number),y=[];if(x.forEach((w,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);y.push(N)}),y.length>0){let w=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();w=Math.max(w,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=w+i*2+105,W=x.length*p+i*2+P/2,X=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(X,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
3
3
  M ${n} ${i-l/2}
4
4
  L ${n+p-f} ${i-l/2}
@@ -1,4 +1,4 @@
1
- import{s as xi,g as di,p as Yt,o as fi,a as pi,b as mi,_ as n,l as Nt,F as yi,e as bi,q as Ai,z as kt,i as wi,B as Ht,D as Ci,W as Si,ay as Ri,a6 as Ot}from"./mermaid.core-9dt2ugQA.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as Wt}from"./linear-C2JDCaz4.js";import"./index-DAUK3rnz.js";import"./react-rd22PHbN.js";import"./tanstack-B0Sf7wNU.js";import"./base-ui-CJ8ZIx3d.js";import"./render-markdown-BtCybfvQ.js";import"./App-BXZLGT86.js";import"./one-light-CoLDteqg.js";import"./index-BgLrS_2D.js";import"./defaultLocale-DX6XiGOO.js";function Ti(e,t,i){e=+e,t=+t,i=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+i;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(a);++s<a;)o[s]=e+s*i;return o}function wt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,a=1,o,l,p=!1,d=0,k=0,T=.5;delete e.unknown;function _(){var b=t().length,E=a<s,L=E?a:s,P=E?s:a;o=(P-L)/Math.max(1,b-d+k*2),p&&(o=Math.floor(o)),L+=(P-L-o*(b-d))*T,l=o*(1-d),p&&(L=Math.round(L),l=Math.round(l));var I=Ti(b).map(function(m){return L+o*m});return i(E?I.reverse():I)}return e.domain=function(b){return arguments.length?(t(b),_()):t()},e.range=function(b){return arguments.length?([s,a]=b,s=+s,a=+a,_()):[s,a]},e.rangeRound=function(b){return[s,a]=b,s=+s,a=+a,p=!0,_()},e.bandwidth=function(){return l},e.step=function(){return o},e.round=function(b){return arguments.length?(p=!!b,_()):p},e.padding=function(b){return arguments.length?(d=Math.min(1,k=+b),_()):d},e.paddingInner=function(b){return arguments.length?(d=Math.min(1,b),_()):d},e.paddingOuter=function(b){return arguments.length?(k=+b,_()):k},e.align=function(b){return arguments.length?(T=Math.max(0,Math.min(1,b)),_()):T},e.copy=function(){return wt(t(),[s,a]).round(p).paddingInner(d).paddingOuter(k).align(T)},_i.apply(_(),arguments)}var Ct=(function(){var e=n(function(F,h,u,g){for(u=u||{},g=F.length;g--;u[F[g]]=h);return u},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],a=[1,5],o=[1,6],l=[1,7],p=[1,5,10,12,14,16,18,19,21,23,36,37,38],d=[1,25],k=[1,26],T=[1,28],_=[1,29],b=[1,30],E=[1,31],L=[1,32],P=[1,33],I=[1,34],m=[1,35],D=[1,36],c=[1,37],B=[1,43],W=[1,42],X=[1,47],Y=[1,50],S=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],w=[1,65],V=[26,28],R={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:n(function(h,u,g,x,C,r,rt){var f=r.length-1;switch(C){case 5:x.setOrientation(r[f]);break;case 9:x.setDiagramTitle(r[f].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[f]);break;case 13:x.setLineData(r[f-1],r[f]);break;case 14:x.setBarData({text:"",type:"text"},r[f]);break;case 15:x.setBarData(r[f-1],r[f]);break;case 16:this.$=r[f].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[f].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[f-1];break;case 20:case 30:this.$=[r[f-2],...r[f]];break;case 21:case 31:this.$=[r[f]];break;case 22:this.$={value:Number(r[f-1]),label:r[f]};break;case 23:this.$={value:Number(r[f]),label:""};break;case 24:x.setXAxisTitle(r[f]);break;case 25:x.setXAxisTitle(r[f-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(r[f]);break;case 28:x.setXAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 29:this.$=r[f-1];break;case 32:x.setYAxisTitle(r[f]);break;case 33:x.setYAxisTitle(r[f-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 39:this.$={text:r[f],type:"text"};break;case 40:this.$={text:r[f],type:"text"};break;case 41:this.$={text:r[f],type:"markdown"};break;case 42:this.$=r[f];break;case 43:this.$=r[f-1]+""+r[f];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,36:a,37:o,38:l}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,36:a,37:o,38:l}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:o,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,36]),e(p,[2,37]),e(p,[2,38]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,36:a,37:o,38:l}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,36:a,37:o,38:l}),{11:23,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:39,13:38,24:B,29:W,30:d,31:40,32:41,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:45,15:44,29:X,30:d,35:46,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:49,17:48,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:52,17:51,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(H,[2,39],{41:55,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c}),e(H,[2,40]),e(H,[2,41]),e(A,[2,42]),e(A,[2,44]),e(A,[2,45]),e(A,[2,46]),e(A,[2,47]),e(A,[2,48]),e(A,[2,49]),e(A,[2,50]),e(A,[2,51]),e(A,[2,52]),e(A,[2,53]),e(S,[2,10]),e(S,[2,24],{32:41,31:56,24:B,29:W}),e(S,[2,26]),e(S,[2,27]),{33:[1,57]},{11:59,30:d,34:58,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,11]),e(S,[2,32],{35:60,29:X}),e(S,[2,34]),{33:[1,61]},e(S,[2,12]),{17:62,24:Y},{25:63,27:64,29:w},e(S,[2,14]),{17:66,24:Y},e(S,[2,16]),e(S,[2,17]),e(A,[2,43]),e(S,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(S,[2,33]),{29:[1,70]},e(S,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(V,[2,23],{30:[1,73]}),e(S,[2,15]),e(S,[2,28]),e(S,[2,29]),{11:59,30:d,34:74,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,35]),e(S,[2,19]),{25:75,27:64,29:w},e(V,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:n(function(h,u){if(u.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=u,g}},"parseError"),parse:n(function(h){var u=this,g=[0],x=[],C=[null],r=[],rt=this.table,f="",gt=0,Mt=0,li=2,zt=1,ci=r.slice.call(arguments,1),v=Object.create(this.lexer),$={yy:{}};for(var mt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,mt)&&($.yy[mt]=this.yy[mt]);v.setInput(h,$.yy),$.yy.lexer=v,$.yy.parser=this,typeof v.yylloc>"u"&&(v.yylloc={});var yt=v.yylloc;r.push(yt);var ui=v.options&&v.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(z){g.length=g.length-2*z,C.length=C.length-z,r.length=r.length-z}n(gi,"popStack");function Bt(){var z;return z=x.pop()||v.lex()||zt,typeof z!="number"&&(z instanceof Array&&(x=z,z=x.pop()),z=u.symbols_[z]||z),z}n(Bt,"lex");for(var M,U,O,bt,G={},xt,N,Vt,dt;;){if(U=g[g.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((M===null||typeof M>"u")&&(M=Bt()),O=rt[U]&&rt[U][M]),typeof O>"u"||!O.length||!O[0]){var At="";dt=[];for(xt in rt[U])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");v.showPosition?At="Parse error on line "+(gt+1)+`:
1
+ import{s as xi,g as di,p as Yt,o as fi,a as pi,b as mi,_ as n,l as Nt,F as yi,e as bi,q as Ai,z as kt,i as wi,B as Ht,D as Ci,W as Si,ay as Ri,a6 as Ot}from"./mermaid.core-CGJtfmwb.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as Wt}from"./linear-sj8MOkmS.js";import"./index-B5RC4THs.js";import"./react-rd22PHbN.js";import"./tanstack-CcfAJoQ7.js";import"./base-ui-CJ8ZIx3d.js";import"./render-markdown-hAIWRfn0.js";import"./App-Dfm5F199.js";import"./one-light-CoLDteqg.js";import"./index-BgLrS_2D.js";import"./defaultLocale-DX6XiGOO.js";function Ti(e,t,i){e=+e,t=+t,i=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+i;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(a);++s<a;)o[s]=e+s*i;return o}function wt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,a=1,o,l,p=!1,d=0,k=0,T=.5;delete e.unknown;function _(){var b=t().length,E=a<s,L=E?a:s,P=E?s:a;o=(P-L)/Math.max(1,b-d+k*2),p&&(o=Math.floor(o)),L+=(P-L-o*(b-d))*T,l=o*(1-d),p&&(L=Math.round(L),l=Math.round(l));var I=Ti(b).map(function(m){return L+o*m});return i(E?I.reverse():I)}return e.domain=function(b){return arguments.length?(t(b),_()):t()},e.range=function(b){return arguments.length?([s,a]=b,s=+s,a=+a,_()):[s,a]},e.rangeRound=function(b){return[s,a]=b,s=+s,a=+a,p=!0,_()},e.bandwidth=function(){return l},e.step=function(){return o},e.round=function(b){return arguments.length?(p=!!b,_()):p},e.padding=function(b){return arguments.length?(d=Math.min(1,k=+b),_()):d},e.paddingInner=function(b){return arguments.length?(d=Math.min(1,b),_()):d},e.paddingOuter=function(b){return arguments.length?(k=+b,_()):k},e.align=function(b){return arguments.length?(T=Math.max(0,Math.min(1,b)),_()):T},e.copy=function(){return wt(t(),[s,a]).round(p).paddingInner(d).paddingOuter(k).align(T)},_i.apply(_(),arguments)}var Ct=(function(){var e=n(function(F,h,u,g){for(u=u||{},g=F.length;g--;u[F[g]]=h);return u},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],a=[1,5],o=[1,6],l=[1,7],p=[1,5,10,12,14,16,18,19,21,23,36,37,38],d=[1,25],k=[1,26],T=[1,28],_=[1,29],b=[1,30],E=[1,31],L=[1,32],P=[1,33],I=[1,34],m=[1,35],D=[1,36],c=[1,37],B=[1,43],W=[1,42],X=[1,47],Y=[1,50],S=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],w=[1,65],V=[26,28],R={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:n(function(h,u,g,x,C,r,rt){var f=r.length-1;switch(C){case 5:x.setOrientation(r[f]);break;case 9:x.setDiagramTitle(r[f].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[f]);break;case 13:x.setLineData(r[f-1],r[f]);break;case 14:x.setBarData({text:"",type:"text"},r[f]);break;case 15:x.setBarData(r[f-1],r[f]);break;case 16:this.$=r[f].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[f].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[f-1];break;case 20:case 30:this.$=[r[f-2],...r[f]];break;case 21:case 31:this.$=[r[f]];break;case 22:this.$={value:Number(r[f-1]),label:r[f]};break;case 23:this.$={value:Number(r[f]),label:""};break;case 24:x.setXAxisTitle(r[f]);break;case 25:x.setXAxisTitle(r[f-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(r[f]);break;case 28:x.setXAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 29:this.$=r[f-1];break;case 32:x.setYAxisTitle(r[f]);break;case 33:x.setYAxisTitle(r[f-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 39:this.$={text:r[f],type:"text"};break;case 40:this.$={text:r[f],type:"text"};break;case 41:this.$={text:r[f],type:"markdown"};break;case 42:this.$=r[f];break;case 43:this.$=r[f-1]+""+r[f];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,36:a,37:o,38:l}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,36:a,37:o,38:l}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:o,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,36]),e(p,[2,37]),e(p,[2,38]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,36:a,37:o,38:l}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,36:a,37:o,38:l}),{11:23,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:39,13:38,24:B,29:W,30:d,31:40,32:41,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:45,15:44,29:X,30:d,35:46,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:49,17:48,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:52,17:51,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(H,[2,39],{41:55,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c}),e(H,[2,40]),e(H,[2,41]),e(A,[2,42]),e(A,[2,44]),e(A,[2,45]),e(A,[2,46]),e(A,[2,47]),e(A,[2,48]),e(A,[2,49]),e(A,[2,50]),e(A,[2,51]),e(A,[2,52]),e(A,[2,53]),e(S,[2,10]),e(S,[2,24],{32:41,31:56,24:B,29:W}),e(S,[2,26]),e(S,[2,27]),{33:[1,57]},{11:59,30:d,34:58,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,11]),e(S,[2,32],{35:60,29:X}),e(S,[2,34]),{33:[1,61]},e(S,[2,12]),{17:62,24:Y},{25:63,27:64,29:w},e(S,[2,14]),{17:66,24:Y},e(S,[2,16]),e(S,[2,17]),e(A,[2,43]),e(S,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(S,[2,33]),{29:[1,70]},e(S,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(V,[2,23],{30:[1,73]}),e(S,[2,15]),e(S,[2,28]),e(S,[2,29]),{11:59,30:d,34:74,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,35]),e(S,[2,19]),{25:75,27:64,29:w},e(V,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:n(function(h,u){if(u.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=u,g}},"parseError"),parse:n(function(h){var u=this,g=[0],x=[],C=[null],r=[],rt=this.table,f="",gt=0,Mt=0,li=2,zt=1,ci=r.slice.call(arguments,1),v=Object.create(this.lexer),$={yy:{}};for(var mt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,mt)&&($.yy[mt]=this.yy[mt]);v.setInput(h,$.yy),$.yy.lexer=v,$.yy.parser=this,typeof v.yylloc>"u"&&(v.yylloc={});var yt=v.yylloc;r.push(yt);var ui=v.options&&v.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(z){g.length=g.length-2*z,C.length=C.length-z,r.length=r.length-z}n(gi,"popStack");function Bt(){var z;return z=x.pop()||v.lex()||zt,typeof z!="number"&&(z instanceof Array&&(x=z,z=x.pop()),z=u.symbols_[z]||z),z}n(Bt,"lex");for(var M,U,O,bt,G={},xt,N,Vt,dt;;){if(U=g[g.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((M===null||typeof M>"u")&&(M=Bt()),O=rt[U]&&rt[U][M]),typeof O>"u"||!O.length||!O[0]){var At="";dt=[];for(xt in rt[U])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");v.showPosition?At="Parse error on line "+(gt+1)+`:
2
2
  `+v.showPosition()+`
3
3
  Expecting `+dt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":At="Parse error on line "+(gt+1)+": Unexpected "+(M==zt?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(At,{text:v.match,token:this.terminals_[M]||M,line:v.yylineno,loc:yt,expected:dt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+M);switch(O[0]){case 1:g.push(M),C.push(v.yytext),r.push(v.yylloc),g.push(O[1]),M=null,Mt=v.yyleng,f=v.yytext,gt=v.yylineno,yt=v.yylloc;break;case 2:if(N=this.productions_[O[1]][1],G.$=C[C.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ui&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),bt=this.performAction.apply(G,[f,Mt,gt,$.yy,O[1],C,r].concat(ci)),typeof bt<"u")return bt;N&&(g=g.slice(0,-1*N*2),C=C.slice(0,-1*N),r=r.slice(0,-1*N)),g.push(this.productions_[O[1]][0]),C.push(G.$),r.push(G._$),Vt=rt[g[g.length-2]][g[g.length-1]],g.push(Vt);break;case 3:return!0}}return!0},"parse")},ot=(function(){var F={EOF:1,parseError:n(function(u,g){if(this.yy.parser)this.yy.parser.parseError(u,g);else throw new Error(u)},"parseError"),setInput:n(function(h,u){return this.yy=u||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n(function(h){var u=h.length,g=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var h=this.pastInput(),u=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
@@ -55,11 +55,11 @@
55
55
  <link rel="icon" href="/opentig.ico" sizes="any" />
56
56
  <link rel="icon" href="/opentig.svg" type="image/svg+xml" />
57
57
  <title>OpenTig</title>
58
- <script type="module" crossorigin src="/assets/index-DAUK3rnz.js"></script>
58
+ <script type="module" crossorigin src="/assets/index-B5RC4THs.js"></script>
59
59
  <link rel="modulepreload" crossorigin href="/assets/react-rd22PHbN.js">
60
60
  <link rel="modulepreload" crossorigin href="/assets/base-ui-CJ8ZIx3d.js">
61
- <link rel="modulepreload" crossorigin href="/assets/tanstack-B0Sf7wNU.js">
62
- <link rel="stylesheet" crossorigin href="/assets/index-BfA4tAc1.css">
61
+ <link rel="modulepreload" crossorigin href="/assets/tanstack-CcfAJoQ7.js">
62
+ <link rel="stylesheet" crossorigin href="/assets/index-Dc9xVluy.css">
63
63
  </head>
64
64
  <body>
65
65
  <div id="root">
package/dist/dev.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import process$1 from "node:process";
2
- import { C as CliUsageError, r as runCli } from "./chunks/cli-Bi6ET5UT.mjs";
2
+ import { C as CliUsageError, r as runCli } from "./chunks/cli-B6JTojx_.mjs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
5
  import { mkdirSync, realpathSync, readlinkSync } from "node:fs";
@@ -56,7 +56,7 @@ function prepareDevDirectory(directory, productionDirectory) {
56
56
  }
57
57
  };
58
58
  check(directory);
59
- for (const entry of ["settings.json", "settings.json.bak", "desktop-window.json", "desktop-window.json.bak", "desktop-server.json", "desktop-server.json.bak", "ai-log.jsonl", "problems.jsonl", "runtime.json", "server", "server/admin-token", "server/server-secret", "server/sessions.json", "logs", "logs/server.log", "Network", "Local Storage", "Session Storage", "Cache", "Code Cache"]) {
59
+ for (const entry of ["settings.json", "settings.json.bak", "desktop-window.json", "desktop-window.json.bak", "desktop-server.json", "desktop-server.json.bak", "ai-log.jsonl", "ai-statuses.json", "problems.jsonl", "runtime.json", "server", "server/admin-token", "server/server-secret", "server/sessions.json", "logs", "logs/server.log", "Network", "Local Storage", "Session Storage", "Cache", "Code Cache"]) {
60
60
  check(path.join(directory, entry));
61
61
  }
62
62
  mkdirSync(directory, { recursive: true });