@demoscript/cli 1.1.4 → 1.1.7

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 (165) hide show
  1. package/dist/demo.schema.json +847 -0
  2. package/package.json +2 -12
  3. package/dist/commands/login.d.ts +0 -4
  4. package/dist/commands/login.d.ts.map +0 -1
  5. package/dist/commands/login.js +0 -109
  6. package/dist/commands/login.js.map +0 -1
  7. package/dist/commands/push.d.ts +0 -9
  8. package/dist/commands/push.d.ts.map +0 -1
  9. package/dist/commands/push.js +0 -146
  10. package/dist/commands/push.js.map +0 -1
  11. package/dist/commands/serve.d.ts +0 -9
  12. package/dist/commands/serve.d.ts.map +0 -1
  13. package/dist/commands/serve.js +0 -221
  14. package/dist/commands/serve.js.map +0 -1
  15. package/dist/index.d.ts +0 -3
  16. package/dist/index.d.ts.map +0 -1
  17. package/dist/index.js.map +0 -1
  18. package/dist/lib/config.d.ts +0 -12
  19. package/dist/lib/config.d.ts.map +0 -1
  20. package/dist/lib/config.js +0 -39
  21. package/dist/lib/config.js.map +0 -1
  22. package/dist/lib/executor.d.ts +0 -19
  23. package/dist/lib/executor.d.ts.map +0 -1
  24. package/dist/lib/executor.js +0 -150
  25. package/dist/lib/executor.js.map +0 -1
  26. package/dist/lib/executor.test.d.ts +0 -2
  27. package/dist/lib/executor.test.d.ts.map +0 -1
  28. package/dist/lib/executor.test.js +0 -62
  29. package/dist/lib/executor.test.js.map +0 -1
  30. package/dist/lib/loader.d.ts +0 -10
  31. package/dist/lib/loader.d.ts.map +0 -1
  32. package/dist/lib/loader.js +0 -156
  33. package/dist/lib/loader.js.map +0 -1
  34. package/dist/lib/openapi.d.ts +0 -10
  35. package/dist/lib/openapi.d.ts.map +0 -1
  36. package/dist/lib/openapi.js +0 -9
  37. package/dist/lib/openapi.js.map +0 -1
  38. package/dist/lib/openapi.test.d.ts +0 -2
  39. package/dist/lib/openapi.test.d.ts.map +0 -1
  40. package/dist/lib/openapi.test.js +0 -318
  41. package/dist/lib/openapi.test.js.map +0 -1
  42. package/dist/lib/validator.d.ts +0 -12
  43. package/dist/lib/validator.d.ts.map +0 -1
  44. package/dist/lib/validator.js +0 -58
  45. package/dist/lib/validator.js.map +0 -1
  46. package/dist/server/graphql-proxy.d.ts +0 -3
  47. package/dist/server/graphql-proxy.d.ts.map +0 -1
  48. package/dist/server/graphql-proxy.js +0 -56
  49. package/dist/server/graphql-proxy.js.map +0 -1
  50. package/dist/server/rest-proxy.d.ts +0 -3
  51. package/dist/server/rest-proxy.d.ts.map +0 -1
  52. package/dist/server/rest-proxy.js +0 -41
  53. package/dist/server/rest-proxy.js.map +0 -1
  54. package/dist/server/shell-executor.d.ts +0 -3
  55. package/dist/server/shell-executor.d.ts.map +0 -1
  56. package/dist/server/shell-executor.js +0 -56
  57. package/dist/server/shell-executor.js.map +0 -1
  58. package/dist/types.d.ts +0 -351
  59. package/dist/types.d.ts.map +0 -1
  60. package/dist/types.js +0 -55
  61. package/dist/types.js.map +0 -1
  62. package/dist/ui-dist/dist/assets/_baseUniq.js +0 -2
  63. package/dist/ui-dist/dist/assets/_baseUniq.js.map +0 -1
  64. package/dist/ui-dist/dist/assets/arc.js +0 -2
  65. package/dist/ui-dist/dist/assets/arc.js.map +0 -1
  66. package/dist/ui-dist/dist/assets/architectureDiagram-VXUJARFQ.js +0 -37
  67. package/dist/ui-dist/dist/assets/architectureDiagram-VXUJARFQ.js.map +0 -1
  68. package/dist/ui-dist/dist/assets/blockDiagram-VD42YOAC.js +0 -123
  69. package/dist/ui-dist/dist/assets/blockDiagram-VD42YOAC.js.map +0 -1
  70. package/dist/ui-dist/dist/assets/c4Diagram-YG6GDRKO.js +0 -11
  71. package/dist/ui-dist/dist/assets/c4Diagram-YG6GDRKO.js.map +0 -1
  72. package/dist/ui-dist/dist/assets/channel.js +0 -2
  73. package/dist/ui-dist/dist/assets/channel.js.map +0 -1
  74. package/dist/ui-dist/dist/assets/chunk-4BX2VUAB.js +0 -2
  75. package/dist/ui-dist/dist/assets/chunk-4BX2VUAB.js.map +0 -1
  76. package/dist/ui-dist/dist/assets/chunk-55IACEB6.js +0 -2
  77. package/dist/ui-dist/dist/assets/chunk-55IACEB6.js.map +0 -1
  78. package/dist/ui-dist/dist/assets/chunk-B4BG7PRW.js +0 -166
  79. package/dist/ui-dist/dist/assets/chunk-B4BG7PRW.js.map +0 -1
  80. package/dist/ui-dist/dist/assets/chunk-DI55MBZ5.js +0 -221
  81. package/dist/ui-dist/dist/assets/chunk-DI55MBZ5.js.map +0 -1
  82. package/dist/ui-dist/dist/assets/chunk-FMBD7UC4.js +0 -16
  83. package/dist/ui-dist/dist/assets/chunk-FMBD7UC4.js.map +0 -1
  84. package/dist/ui-dist/dist/assets/chunk-QN33PNHL.js +0 -2
  85. package/dist/ui-dist/dist/assets/chunk-QN33PNHL.js.map +0 -1
  86. package/dist/ui-dist/dist/assets/chunk-QZHKN3VN.js +0 -2
  87. package/dist/ui-dist/dist/assets/chunk-QZHKN3VN.js.map +0 -1
  88. package/dist/ui-dist/dist/assets/chunk-TZMSLE5B.js +0 -2
  89. package/dist/ui-dist/dist/assets/chunk-TZMSLE5B.js.map +0 -1
  90. package/dist/ui-dist/dist/assets/classDiagram-2ON5EDUG.js +0 -2
  91. package/dist/ui-dist/dist/assets/classDiagram-2ON5EDUG.js.map +0 -1
  92. package/dist/ui-dist/dist/assets/classDiagram-v2-WZHVMYZB.js +0 -2
  93. package/dist/ui-dist/dist/assets/classDiagram-v2-WZHVMYZB.js.map +0 -1
  94. package/dist/ui-dist/dist/assets/clone.js +0 -2
  95. package/dist/ui-dist/dist/assets/clone.js.map +0 -1
  96. package/dist/ui-dist/dist/assets/cose-bilkent-S5V4N54A.js +0 -2
  97. package/dist/ui-dist/dist/assets/cose-bilkent-S5V4N54A.js.map +0 -1
  98. package/dist/ui-dist/dist/assets/cytoscape.esm.js +0 -332
  99. package/dist/ui-dist/dist/assets/cytoscape.esm.js.map +0 -1
  100. package/dist/ui-dist/dist/assets/dagre-6UL2VRFP.js +0 -5
  101. package/dist/ui-dist/dist/assets/dagre-6UL2VRFP.js.map +0 -1
  102. package/dist/ui-dist/dist/assets/defaultLocale.js +0 -2
  103. package/dist/ui-dist/dist/assets/defaultLocale.js.map +0 -1
  104. package/dist/ui-dist/dist/assets/diagram-PSM6KHXK.js +0 -25
  105. package/dist/ui-dist/dist/assets/diagram-PSM6KHXK.js.map +0 -1
  106. package/dist/ui-dist/dist/assets/diagram-QEK2KX5R.js +0 -44
  107. package/dist/ui-dist/dist/assets/diagram-QEK2KX5R.js.map +0 -1
  108. package/dist/ui-dist/dist/assets/diagram-S2PKOQOG.js +0 -25
  109. package/dist/ui-dist/dist/assets/diagram-S2PKOQOG.js.map +0 -1
  110. package/dist/ui-dist/dist/assets/erDiagram-Q2GNP2WA.js +0 -61
  111. package/dist/ui-dist/dist/assets/erDiagram-Q2GNP2WA.js.map +0 -1
  112. package/dist/ui-dist/dist/assets/flowDiagram-NV44I4VS.js +0 -163
  113. package/dist/ui-dist/dist/assets/flowDiagram-NV44I4VS.js.map +0 -1
  114. package/dist/ui-dist/dist/assets/ganttDiagram-JELNMOA3.js +0 -268
  115. package/dist/ui-dist/dist/assets/ganttDiagram-JELNMOA3.js.map +0 -1
  116. package/dist/ui-dist/dist/assets/gitGraphDiagram-NY62KEGX.js +0 -66
  117. package/dist/ui-dist/dist/assets/gitGraphDiagram-NY62KEGX.js.map +0 -1
  118. package/dist/ui-dist/dist/assets/graph.js +0 -2
  119. package/dist/ui-dist/dist/assets/graph.js.map +0 -1
  120. package/dist/ui-dist/dist/assets/index.css +0 -1
  121. package/dist/ui-dist/dist/assets/index.js +0 -517
  122. package/dist/ui-dist/dist/assets/index.js.map +0 -1
  123. package/dist/ui-dist/dist/assets/infoDiagram-WHAUD3N6.js +0 -3
  124. package/dist/ui-dist/dist/assets/infoDiagram-WHAUD3N6.js.map +0 -1
  125. package/dist/ui-dist/dist/assets/init.js +0 -2
  126. package/dist/ui-dist/dist/assets/init.js.map +0 -1
  127. package/dist/ui-dist/dist/assets/journeyDiagram-XKPGCS4Q.js +0 -140
  128. package/dist/ui-dist/dist/assets/journeyDiagram-XKPGCS4Q.js.map +0 -1
  129. package/dist/ui-dist/dist/assets/kanban-definition-3W4ZIXB7.js +0 -90
  130. package/dist/ui-dist/dist/assets/kanban-definition-3W4ZIXB7.js.map +0 -1
  131. package/dist/ui-dist/dist/assets/katex.js +0 -262
  132. package/dist/ui-dist/dist/assets/katex.js.map +0 -1
  133. package/dist/ui-dist/dist/assets/layout.js +0 -2
  134. package/dist/ui-dist/dist/assets/layout.js.map +0 -1
  135. package/dist/ui-dist/dist/assets/linear.js +0 -2
  136. package/dist/ui-dist/dist/assets/linear.js.map +0 -1
  137. package/dist/ui-dist/dist/assets/min.js +0 -2
  138. package/dist/ui-dist/dist/assets/min.js.map +0 -1
  139. package/dist/ui-dist/dist/assets/mindmap-definition-VGOIOE7T.js +0 -69
  140. package/dist/ui-dist/dist/assets/mindmap-definition-VGOIOE7T.js.map +0 -1
  141. package/dist/ui-dist/dist/assets/ordinal.js +0 -2
  142. package/dist/ui-dist/dist/assets/ordinal.js.map +0 -1
  143. package/dist/ui-dist/dist/assets/pieDiagram-ADFJNKIX.js +0 -31
  144. package/dist/ui-dist/dist/assets/pieDiagram-ADFJNKIX.js.map +0 -1
  145. package/dist/ui-dist/dist/assets/quadrantDiagram-AYHSOK5B.js +0 -8
  146. package/dist/ui-dist/dist/assets/quadrantDiagram-AYHSOK5B.js.map +0 -1
  147. package/dist/ui-dist/dist/assets/requirementDiagram-UZGBJVZJ.js +0 -65
  148. package/dist/ui-dist/dist/assets/requirementDiagram-UZGBJVZJ.js.map +0 -1
  149. package/dist/ui-dist/dist/assets/sankeyDiagram-TZEHDZUN.js +0 -11
  150. package/dist/ui-dist/dist/assets/sankeyDiagram-TZEHDZUN.js.map +0 -1
  151. package/dist/ui-dist/dist/assets/sequenceDiagram-WL72ISMW.js +0 -146
  152. package/dist/ui-dist/dist/assets/sequenceDiagram-WL72ISMW.js.map +0 -1
  153. package/dist/ui-dist/dist/assets/stateDiagram-FKZM4ZOC.js +0 -2
  154. package/dist/ui-dist/dist/assets/stateDiagram-FKZM4ZOC.js.map +0 -1
  155. package/dist/ui-dist/dist/assets/stateDiagram-v2-4FDKWEC3.js +0 -2
  156. package/dist/ui-dist/dist/assets/stateDiagram-v2-4FDKWEC3.js.map +0 -1
  157. package/dist/ui-dist/dist/assets/timeline-definition-IT6M3QCI.js +0 -62
  158. package/dist/ui-dist/dist/assets/timeline-definition-IT6M3QCI.js.map +0 -1
  159. package/dist/ui-dist/dist/assets/treemap-KMMF4GRG.js +0 -129
  160. package/dist/ui-dist/dist/assets/treemap-KMMF4GRG.js.map +0 -1
  161. package/dist/ui-dist/dist/assets/xychartDiagram-PRI3JC2R.js +0 -8
  162. package/dist/ui-dist/dist/assets/xychartDiagram-PRI3JC2R.js.map +0 -1
  163. package/dist/ui-dist/dist/demo.yaml +0 -120
  164. package/dist/ui-dist/dist/favicon.svg +0 -10
  165. package/dist/ui-dist/dist/index.html +0 -14
@@ -1,517 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-6UL2VRFP.js","assets/graph.js","assets/_baseUniq.js","assets/layout.js","assets/min.js","assets/clone.js","assets/cose-bilkent-S5V4N54A.js","assets/cytoscape.esm.js","assets/c4Diagram-YG6GDRKO.js","assets/chunk-TZMSLE5B.js","assets/flowDiagram-NV44I4VS.js","assets/chunk-FMBD7UC4.js","assets/chunk-55IACEB6.js","assets/chunk-QN33PNHL.js","assets/channel.js","assets/erDiagram-Q2GNP2WA.js","assets/gitGraphDiagram-NY62KEGX.js","assets/chunk-4BX2VUAB.js","assets/chunk-QZHKN3VN.js","assets/treemap-KMMF4GRG.js","assets/ganttDiagram-JELNMOA3.js","assets/linear.js","assets/init.js","assets/defaultLocale.js","assets/infoDiagram-WHAUD3N6.js","assets/pieDiagram-ADFJNKIX.js","assets/arc.js","assets/ordinal.js","assets/quadrantDiagram-AYHSOK5B.js","assets/xychartDiagram-PRI3JC2R.js","assets/requirementDiagram-UZGBJVZJ.js","assets/sequenceDiagram-WL72ISMW.js","assets/classDiagram-2ON5EDUG.js","assets/chunk-B4BG7PRW.js","assets/classDiagram-v2-WZHVMYZB.js","assets/stateDiagram-FKZM4ZOC.js","assets/chunk-DI55MBZ5.js","assets/stateDiagram-v2-4FDKWEC3.js","assets/journeyDiagram-XKPGCS4Q.js","assets/timeline-definition-IT6M3QCI.js","assets/mindmap-definition-VGOIOE7T.js","assets/kanban-definition-3W4ZIXB7.js","assets/sankeyDiagram-TZEHDZUN.js","assets/diagram-S2PKOQOG.js","assets/diagram-QEK2KX5R.js","assets/blockDiagram-VD42YOAC.js","assets/architectureDiagram-VXUJARFQ.js","assets/diagram-PSM6KHXK.js"])))=>i.map(i=>d[i]);
2
- var Y8=Object.defineProperty;var G8=(e,t,r)=>t in e?Y8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var qt=(e,t,r)=>G8(e,typeof t!="symbol"?t+"":t,r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();function gc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xx={exports:{}},Su={};/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var RC;function X8(){if(RC)return Su;RC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,i,a){var s=null;if(a!==void 0&&(s=""+a),i.key!==void 0&&(s=""+i.key),"key"in i){a={};for(var o in i)o!=="key"&&(a[o]=i[o])}else a=i;return i=a.ref,{$$typeof:e,type:n,key:s,ref:i!==void 0?i:null,props:a}}return Su.Fragment=t,Su.jsx=r,Su.jsxs=r,Su}var OC;function Q8(){return OC||(OC=1,Xx.exports=X8()),Xx.exports}var h=Q8(),Qx={exports:{}},it={};/**
11
- * @license React
12
- * react.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var BC;function Z8(){if(BC)return it;BC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function x(D){return D===null||typeof D!="object"?null:(D=m&&D[m]||D["@@iterator"],typeof D=="function"?D:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,k={};function w(D,G,q){this.props=D,this.context=G,this.refs=k,this.updater=q||b}w.prototype.isReactComponent={},w.prototype.setState=function(D,G){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,G,"setState")},w.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function C(){}C.prototype=w.prototype;function T(D,G,q){this.props=D,this.context=G,this.refs=k,this.updater=q||b}var j=T.prototype=new C;j.constructor=T,v(j,w.prototype),j.isPureReactComponent=!0;var L=Array.isArray;function E(){}var M={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function P(D,G,q){var Z=q.ref;return{$$typeof:e,type:D,key:G,ref:Z!==void 0?Z:null,props:q}}function z(D,G){return P(D.type,G,D.props)}function $(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function W(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(q){return G[q]})}var Y=/\/+/g;function B(D,G){return typeof D=="object"&&D!==null&&D.key!=null?W(""+D.key):G.toString(36)}function U(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(E,E):(D.status="pending",D.then(function(G){D.status==="pending"&&(D.status="fulfilled",D.value=G)},function(G){D.status==="pending"&&(D.status="rejected",D.reason=G)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function R(D,G,q,Z,re){var J=typeof D;(J==="undefined"||J==="boolean")&&(D=null);var ie=!1;if(D===null)ie=!0;else switch(J){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(D.$$typeof){case e:case t:ie=!0;break;case f:return ie=D._init,R(ie(D._payload),G,q,Z,re)}}if(ie)return re=re(D),ie=Z===""?"."+B(D,0):Z,L(re)?(q="",ie!=null&&(q=ie.replace(Y,"$&/")+"/"),R(re,G,q,"",function(fe){return fe})):re!=null&&($(re)&&(re=z(re,q+(re.key==null||D&&D.key===re.key?"":(""+re.key).replace(Y,"$&/")+"/")+ie)),G.push(re)),1;ie=0;var ne=Z===""?".":Z+":";if(L(D))for(var oe=0;oe<D.length;oe++)Z=D[oe],J=ne+B(Z,oe),ie+=R(Z,G,q,J,re);else if(oe=x(D),typeof oe=="function")for(D=oe.call(D),oe=0;!(Z=D.next()).done;)Z=Z.value,J=ne+B(Z,oe++),ie+=R(Z,G,q,J,re);else if(J==="object"){if(typeof D.then=="function")return R(U(D),G,q,Z,re);throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ie}function H(D,G,q){if(D==null)return D;var Z=[],re=0;return R(D,Z,"","",function(J){return G.call(q,J,re++)}),Z}function V(D){if(D._status===-1){var G=D._result;G=G(),G.then(function(q){(D._status===0||D._status===-1)&&(D._status=1,D._result=q)},function(q){(D._status===0||D._status===-1)&&(D._status=2,D._result=q)}),D._status===-1&&(D._status=0,D._result=G)}if(D._status===1)return D._result.default;throw D._result}var Q=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},A={map:H,forEach:function(D,G,q){H(D,function(){G.apply(this,arguments)},q)},count:function(D){var G=0;return H(D,function(){G++}),G},toArray:function(D){return H(D,function(G){return G})||[]},only:function(D){if(!$(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return it.Activity=p,it.Children=A,it.Component=w,it.Fragment=r,it.Profiler=i,it.PureComponent=T,it.StrictMode=n,it.Suspense=u,it.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,it.__COMPILER_RUNTIME={__proto__:null,c:function(D){return M.H.useMemoCache(D)}},it.cache=function(D){return function(){return D.apply(null,arguments)}},it.cacheSignal=function(){return null},it.cloneElement=function(D,G,q){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var Z=v({},D.props),re=D.key;if(G!=null)for(J in G.key!==void 0&&(re=""+G.key),G)!I.call(G,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&G.ref===void 0||(Z[J]=G[J]);var J=arguments.length-2;if(J===1)Z.children=q;else if(1<J){for(var ie=Array(J),ne=0;ne<J;ne++)ie[ne]=arguments[ne+2];Z.children=ie}return P(D.type,re,Z)},it.createContext=function(D){return D={$$typeof:s,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:a,_context:D},D},it.createElement=function(D,G,q){var Z,re={},J=null;if(G!=null)for(Z in G.key!==void 0&&(J=""+G.key),G)I.call(G,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(re[Z]=G[Z]);var ie=arguments.length-2;if(ie===1)re.children=q;else if(1<ie){for(var ne=Array(ie),oe=0;oe<ie;oe++)ne[oe]=arguments[oe+2];re.children=ne}if(D&&D.defaultProps)for(Z in ie=D.defaultProps,ie)re[Z]===void 0&&(re[Z]=ie[Z]);return P(D,J,re)},it.createRef=function(){return{current:null}},it.forwardRef=function(D){return{$$typeof:o,render:D}},it.isValidElement=$,it.lazy=function(D){return{$$typeof:f,_payload:{_status:-1,_result:D},_init:V}},it.memo=function(D,G){return{$$typeof:d,type:D,compare:G===void 0?null:G}},it.startTransition=function(D){var G=M.T,q={};M.T=q;try{var Z=D(),re=M.S;re!==null&&re(q,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(E,Q)}catch(J){Q(J)}finally{G!==null&&q.types!==null&&(G.types=q.types),M.T=G}},it.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},it.use=function(D){return M.H.use(D)},it.useActionState=function(D,G,q){return M.H.useActionState(D,G,q)},it.useCallback=function(D,G){return M.H.useCallback(D,G)},it.useContext=function(D){return M.H.useContext(D)},it.useDebugValue=function(){},it.useDeferredValue=function(D,G){return M.H.useDeferredValue(D,G)},it.useEffect=function(D,G){return M.H.useEffect(D,G)},it.useEffectEvent=function(D){return M.H.useEffectEvent(D)},it.useId=function(){return M.H.useId()},it.useImperativeHandle=function(D,G,q){return M.H.useImperativeHandle(D,G,q)},it.useInsertionEffect=function(D,G){return M.H.useInsertionEffect(D,G)},it.useLayoutEffect=function(D,G){return M.H.useLayoutEffect(D,G)},it.useMemo=function(D,G){return M.H.useMemo(D,G)},it.useOptimistic=function(D,G){return M.H.useOptimistic(D,G)},it.useReducer=function(D,G,q){return M.H.useReducer(D,G,q)},it.useRef=function(D){return M.H.useRef(D)},it.useState=function(D){return M.H.useState(D)},it.useSyncExternalStore=function(D,G,q){return M.H.useSyncExternalStore(D,G,q)},it.useTransition=function(){return M.H.useTransition()},it.version="19.2.3",it}var $C;function mc(){return $C||($C=1,Qx.exports=Z8()),Qx.exports}var N=mc();const xn=gc(N);var Zx={exports:{}},Cu={},Kx={exports:{}},Jx={};/**
19
- * @license React
20
- * scheduler.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var zC;function K8(){return zC||(zC=1,(function(e){function t(R,H){var V=R.length;R.push(H);e:for(;0<V;){var Q=V-1>>>1,A=R[Q];if(0<i(A,H))R[Q]=H,R[V]=A,V=Q;else break e}}function r(R){return R.length===0?null:R[0]}function n(R){if(R.length===0)return null;var H=R[0],V=R.pop();if(V!==H){R[0]=V;e:for(var Q=0,A=R.length,D=A>>>1;Q<D;){var G=2*(Q+1)-1,q=R[G],Z=G+1,re=R[Z];if(0>i(q,V))Z<A&&0>i(re,q)?(R[Q]=re,R[Z]=V,Q=Z):(R[Q]=q,R[G]=V,Q=G);else if(Z<A&&0>i(re,V))R[Q]=re,R[Z]=V,Q=Z;else break e}}return H}function i(R,H){var V=R.sortIndex-H.sortIndex;return V!==0?V:R.id-H.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var u=[],d=[],f=1,p=null,m=3,x=!1,b=!1,v=!1,k=!1,w=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function j(R){for(var H=r(d);H!==null;){if(H.callback===null)n(d);else if(H.startTime<=R)n(d),H.sortIndex=H.expirationTime,t(u,H);else break;H=r(d)}}function L(R){if(v=!1,j(R),!b)if(r(u)!==null)b=!0,E||(E=!0,W());else{var H=r(d);H!==null&&U(L,H.startTime-R)}}var E=!1,M=-1,I=5,P=-1;function z(){return k?!0:!(e.unstable_now()-P<I)}function $(){if(k=!1,E){var R=e.unstable_now();P=R;var H=!0;try{e:{b=!1,v&&(v=!1,C(M),M=-1),x=!0;var V=m;try{t:{for(j(R),p=r(u);p!==null&&!(p.expirationTime>R&&z());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,m=p.priorityLevel;var A=Q(p.expirationTime<=R);if(R=e.unstable_now(),typeof A=="function"){p.callback=A,j(R),H=!0;break t}p===r(u)&&n(u),j(R)}else n(u);p=r(u)}if(p!==null)H=!0;else{var D=r(d);D!==null&&U(L,D.startTime-R),H=!1}}break e}finally{p=null,m=V,x=!1}H=void 0}}finally{H?W():E=!1}}}var W;if(typeof T=="function")W=function(){T($)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,B=Y.port2;Y.port1.onmessage=$,W=function(){B.postMessage(null)}}else W=function(){w($,0)};function U(R,H){M=w(function(){R(e.unstable_now())},H)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(R){switch(m){case 1:case 2:case 3:var H=3;break;default:H=m}var V=m;m=H;try{return R()}finally{m=V}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(R,H){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var V=m;m=R;try{return H()}finally{m=V}},e.unstable_scheduleCallback=function(R,H,V){var Q=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?Q+V:Q):V=Q,R){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=V+A,R={id:f++,callback:H,priorityLevel:R,startTime:V,expirationTime:A,sortIndex:-1},V>Q?(R.sortIndex=V,t(d,R),r(u)===null&&R===r(d)&&(v?(C(M),M=-1):v=!0,U(L,V-Q))):(R.sortIndex=A,t(u,R),b||x||(b=!0,E||(E=!0,W()))),R},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(R){var H=m;return function(){var V=m;m=H;try{return R.apply(this,arguments)}finally{m=V}}}})(Jx)),Jx}var IC;function J8(){return IC||(IC=1,Kx.exports=K8()),Kx.exports}var ey={exports:{}},nn={};/**
27
- * @license React
28
- * react-dom.production.js
29
- *
30
- * Copyright (c) Meta Platforms, Inc. and affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var FC;function e$(){if(FC)return nn;FC=1;var e=mc();function t(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)d+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(u,d,f){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:u,containerInfo:d,implementation:f}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,nn.createPortal=function(u,d){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return a(u,d,null,f)},nn.flushSync=function(u){var d=s.T,f=n.p;try{if(s.T=null,n.p=2,u)return u()}finally{s.T=d,n.p=f,n.d.f()}},nn.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,n.d.C(u,d))},nn.prefetchDNS=function(u){typeof u=="string"&&n.d.D(u)},nn.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var f=d.as,p=o(f,d.crossOrigin),m=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;f==="style"?n.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:m,fetchPriority:x}):f==="script"&&n.d.X(u,{crossOrigin:p,integrity:m,fetchPriority:x,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},nn.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var f=o(d.as,d.crossOrigin);n.d.M(u,{crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&n.d.M(u)},nn.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var f=d.as,p=o(f,d.crossOrigin);n.d.L(u,f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},nn.preloadModule=function(u,d){if(typeof u=="string")if(d){var f=o(d.as,d.crossOrigin);n.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else n.d.m(u)},nn.requestFormReset=function(u){n.d.r(u)},nn.unstable_batchedUpdates=function(u,d){return u(d)},nn.useFormState=function(u,d,f){return s.H.useFormState(u,d,f)},nn.useFormStatus=function(){return s.H.useHostTransitionStatus()},nn.version="19.2.3",nn}var PC;function lE(){if(PC)return ey.exports;PC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ey.exports=e$(),ey.exports}/**
35
- * @license React
36
- * react-dom-client.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var HC;function t$(){if(HC)return Cu;HC=1;var e=J8(),t=mc(),r=lE();function n(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)c+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function a(l){var c=l,g=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(g=c.return),l=c.return;while(l)}return c.tag===3?g:null}function s(l){if(l.tag===13){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function o(l){if(l.tag===31){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function u(l){if(a(l)!==l)throw Error(n(188))}function d(l){var c=l.alternate;if(!c){if(c=a(l),c===null)throw Error(n(188));return c!==l?null:l}for(var g=l,y=c;;){var S=g.return;if(S===null)break;var _=S.alternate;if(_===null){if(y=S.return,y!==null){g=y;continue}break}if(S.child===_.child){for(_=S.child;_;){if(_===g)return u(S),l;if(_===y)return u(S),c;_=_.sibling}throw Error(n(188))}if(g.return!==y.return)g=S,y=_;else{for(var F=!1,X=S.child;X;){if(X===g){F=!0,g=S,y=_;break}if(X===y){F=!0,y=S,g=_;break}X=X.sibling}if(!F){for(X=_.child;X;){if(X===g){F=!0,g=_,y=S;break}if(X===y){F=!0,y=_,g=S;break}X=X.sibling}if(!F)throw Error(n(189))}}if(g.alternate!==y)throw Error(n(190))}if(g.tag!==3)throw Error(n(188));return g.stateNode.current===g?l:c}function f(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l;for(l=l.child;l!==null;){if(c=f(l),c!==null)return c;l=l.sibling}return null}var p=Object.assign,m=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),T=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function W(l){return l===null||typeof l!="object"?null:(l=$&&l[$]||l["@@iterator"],typeof l=="function"?l:null)}var Y=Symbol.for("react.client.reference");function B(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Y?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case v:return"Fragment";case w:return"Profiler";case k:return"StrictMode";case L:return"Suspense";case E:return"SuspenseList";case P:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case b:return"Portal";case T:return l.displayName||"Context";case C:return(l._context.displayName||"Context")+".Consumer";case j:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case M:return c=l.displayName||null,c!==null?c:B(l.type)||"Memo";case I:c=l._payload,l=l._init;try{return B(l(c))}catch{}}return null}var U=Array.isArray,R=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},Q=[],A=-1;function D(l){return{current:l}}function G(l){0>A||(l.current=Q[A],Q[A]=null,A--)}function q(l,c){A++,Q[A]=l.current,l.current=c}var Z=D(null),re=D(null),J=D(null),ie=D(null);function ne(l,c){switch(q(J,c),q(re,l),q(Z,null),c.nodeType){case 9:case 11:l=(l=c.documentElement)&&(l=l.namespaceURI)?nC(l):0;break;default:if(l=c.tagName,c=c.namespaceURI)c=nC(c),l=iC(c,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}G(Z),q(Z,l)}function oe(){G(Z),G(re),G(J)}function fe(l){l.memoizedState!==null&&q(ie,l);var c=Z.current,g=iC(c,l.type);c!==g&&(q(re,l),q(Z,g))}function xe(l){re.current===l&&(G(Z),G(re)),ie.current===l&&(G(ie),bu._currentValue=V)}var de,ge;function ke(l){if(de===void 0)try{throw Error()}catch(g){var c=g.stack.trim().match(/\n( *(at )?)/);de=c&&c[1]||"",ge=-1<g.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+de+l+ge}var Te=!1;function Ne(l,c){if(!l||Te)return"";Te=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(c){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(pe){var he=pe}Reflect.construct(l,[],ve)}else{try{ve.call()}catch(pe){he=pe}l.call(ve.prototype)}}else{try{throw Error()}catch(pe){he=pe}(ve=l())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(pe){if(pe&&he&&typeof pe.stack=="string")return[pe.stack,he.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=y.DetermineComponentFrameRoot(),F=_[0],X=_[1];if(F&&X){var K=F.split(`
45
- `),ue=X.split(`
46
- `);for(S=y=0;y<K.length&&!K[y].includes("DetermineComponentFrameRoot");)y++;for(;S<ue.length&&!ue[S].includes("DetermineComponentFrameRoot");)S++;if(y===K.length||S===ue.length)for(y=K.length-1,S=ue.length-1;1<=y&&0<=S&&K[y]!==ue[S];)S--;for(;1<=y&&0<=S;y--,S--)if(K[y]!==ue[S]){if(y!==1||S!==1)do if(y--,S--,0>S||K[y]!==ue[S]){var me=`
47
- `+K[y].replace(" at new "," at ");return l.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",l.displayName)),me}while(1<=y&&0<=S);break}}}finally{Te=!1,Error.prepareStackTrace=g}return(g=l?l.displayName||l.name:"")?ke(g):""}function Ke(l,c){switch(l.tag){case 26:case 27:case 5:return ke(l.type);case 16:return ke("Lazy");case 13:return l.child!==c&&c!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return Ne(l.type,!1);case 11:return Ne(l.type.render,!1);case 1:return Ne(l.type,!0);case 31:return ke("Activity");default:return""}}function ut(l){try{var c="",g=null;do c+=Ke(l,g),g=l,l=l.return;while(l);return c}catch(y){return`
48
- Error generating stack: `+y.message+`
49
- `+y.stack}}var tt=Object.prototype.hasOwnProperty,rt=e.unstable_scheduleCallback,nt=e.unstable_cancelCallback,wt=e.unstable_shouldYield,xt=e.unstable_requestPaint,_e=e.unstable_now,je=e.unstable_getCurrentPriorityLevel,le=e.unstable_ImmediatePriority,be=e.unstable_UserBlockingPriority,Le=e.unstable_NormalPriority,We=e.unstable_LowPriority,at=e.unstable_IdlePriority,Et=e.log,Er=e.unstable_setDisableYieldValue,Wt=null,It=null;function Lt(l){if(typeof Et=="function"&&Er(l),It&&typeof It.setStrictMode=="function")try{It.setStrictMode(Wt,l)}catch{}}var dt=Math.clz32?Math.clz32:As,Kr=Math.log,xr=Math.LN2;function As(l){return l>>>=0,l===0?32:31-(Kr(l)/xr|0)|0}var Hn=256,qn=262144,Xt=4194304;function Bt(l){var c=l&42;if(c!==0)return c;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function lr(l,c,g){var y=l.pendingLanes;if(y===0)return 0;var S=0,_=l.suspendedLanes,F=l.pingedLanes;l=l.warmLanes;var X=y&134217727;return X!==0?(y=X&~_,y!==0?S=Bt(y):(F&=X,F!==0?S=Bt(F):g||(g=X&~l,g!==0&&(S=Bt(g))))):(X=y&~_,X!==0?S=Bt(X):F!==0?S=Bt(F):g||(g=y&~l,g!==0&&(S=Bt(g)))),S===0?0:c!==0&&c!==S&&(c&_)===0&&(_=S&-S,g=c&-c,_>=g||_===32&&(g&4194048)!==0)?c:S}function $r(l,c){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&c)===0}function yt(l,c){switch(l){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qt(){var l=Xt;return Xt<<=1,(Xt&62914560)===0&&(Xt=4194304),l}function zr(l){for(var c=[],g=0;31>g;g++)c.push(l);return c}function Ur(l,c){l.pendingLanes|=c,c!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Zt(l,c,g,y,S,_){var F=l.pendingLanes;l.pendingLanes=g,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=g,l.entangledLanes&=g,l.errorRecoveryDisabledLanes&=g,l.shellSuspendCounter=0;var X=l.entanglements,K=l.expirationTimes,ue=l.hiddenUpdates;for(g=F&~g;0<g;){var me=31-dt(g),ve=1<<me;X[me]=0,K[me]=-1;var he=ue[me];if(he!==null)for(ue[me]=null,me=0;me<he.length;me++){var pe=he[me];pe!==null&&(pe.lane&=-536870913)}g&=~ve}y!==0&&Jr(l,y,0),_!==0&&S===0&&l.tag!==0&&(l.suspendedLanes|=_&~(F&~c))}function Jr(l,c,g){l.pendingLanes|=c,l.suspendedLanes&=~c;var y=31-dt(c);l.entangledLanes|=c,l.entanglements[y]=l.entanglements[y]|1073741824|g&261930}function Ir(l,c){var g=l.entangledLanes|=c;for(l=l.entanglements;g;){var y=31-dt(g),S=1<<y;S&c|l[y]&c&&(l[y]|=c),g&=~S}}function en(l,c){var g=c&-c;return g=(g&42)!==0?1:or(g),(g&(l.suspendedLanes|c))!==0?0:g}function or(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function Nr(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function tn(){var l=H.p;return l!==0?l:(l=window.event,l===void 0?32:EC(l.type))}function Un(l,c){var g=H.p;try{return H.p=l,c()}finally{H.p=g}}var Fr=Math.random().toString(36).slice(2),cr="__reactFiber$"+Fr,Yt="__reactProps$"+Fr,ni="__reactContainer$"+Fr,aa="__reactEvents$"+Fr,Ms="__reactListeners$"+Fr,Ol="__reactHandles$"+Fr,Bl="__reactResources$"+Fr,Be="__reactMarker$"+Fr;function ee(l){delete l[cr],delete l[Yt],delete l[aa],delete l[Ms],delete l[Ol]}function Se(l){var c=l[cr];if(c)return c;for(var g=l.parentNode;g;){if(c=g[ni]||g[cr]){if(g=c.alternate,c.child!==null||g!==null&&g.child!==null)for(l=dC(l);l!==null;){if(g=l[cr])return g;l=dC(l)}return c}l=g,g=l.parentNode}return null}function Me(l){if(l=l[cr]||l[ni]){var c=l.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return l}return null}function Tt(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l.stateNode;throw Error(n(33))}function Kt(l){var c=l[Bl];return c||(c=l[Bl]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function lt(l){l[Be]=!0}var jr=new Set,_n={};function rn(l,c){ii(l,c),ii(l+"Capture",c)}function ii(l,c){for(_n[l]=c,l=0;l<c.length;l++)jr.add(c[l])}var fr=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),$a={},Ls={};function Hg(l){return tt.call(Ls,l)?!0:tt.call($a,l)?!1:fr.test(l)?Ls[l]=!0:($a[l]=!0,!1)}function $l(l,c,g){if(Hg(c))if(g===null)l.removeAttribute(c);else{switch(typeof g){case"undefined":case"function":case"symbol":l.removeAttribute(c);return;case"boolean":var y=c.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){l.removeAttribute(c);return}}l.setAttribute(c,""+g)}}function zl(l,c,g){if(g===null)l.removeAttribute(c);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(c);return}l.setAttribute(c,""+g)}}function bi(l,c,g,y){if(y===null)l.removeAttribute(g);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(g);return}l.setAttributeNS(c,g,""+y)}}function Tn(l){switch(typeof l){case"bigint":case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function Sh(l){var c=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function qg(l,c,g){var y=Object.getOwnPropertyDescriptor(l.constructor.prototype,c);if(!l.hasOwnProperty(c)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var S=y.get,_=y.set;return Object.defineProperty(l,c,{configurable:!0,get:function(){return S.call(this)},set:function(F){g=""+F,_.call(this,F)}}),Object.defineProperty(l,c,{enumerable:y.enumerable}),{getValue:function(){return g},setValue:function(F){g=""+F},stopTracking:function(){l._valueTracker=null,delete l[c]}}}}function za(l){if(!l._valueTracker){var c=Sh(l)?"checked":"value";l._valueTracker=qg(l,c,""+l[c])}}function Ch(l){if(!l)return!1;var c=l._valueTracker;if(!c)return!0;var g=c.getValue(),y="";return l&&(y=Sh(l)?l.checked?"true":"false":l.value),l=y,l!==g?(c.setValue(l),!0):!1}function Ds(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var Ug=/[\n"\\]/g;function En(l){return l.replace(Ug,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Rs(l,c,g,y,S,_,F,X){l.name="",F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?l.type=F:l.removeAttribute("type"),c!=null?F==="number"?(c===0&&l.value===""||l.value!=c)&&(l.value=""+Tn(c)):l.value!==""+Tn(c)&&(l.value=""+Tn(c)):F!=="submit"&&F!=="reset"||l.removeAttribute("value"),c!=null?Oc(l,F,Tn(c)):g!=null?Oc(l,F,Tn(g)):y!=null&&l.removeAttribute("value"),S==null&&_!=null&&(l.defaultChecked=!!_),S!=null&&(l.checked=S&&typeof S!="function"&&typeof S!="symbol"),X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?l.name=""+Tn(X):l.removeAttribute("name")}function _h(l,c,g,y,S,_,F,X){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(l.type=_),c!=null||g!=null){if(!(_!=="submit"&&_!=="reset"||c!=null)){za(l);return}g=g!=null?""+Tn(g):"",c=c!=null?""+Tn(c):g,X||c===l.value||(l.value=c),l.defaultValue=c}y=y??S,y=typeof y!="function"&&typeof y!="symbol"&&!!y,l.checked=X?l.checked:!!y,l.defaultChecked=!!y,F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(l.name=F),za(l)}function Oc(l,c,g){c==="number"&&Ds(l.ownerDocument)===l||l.defaultValue===""+g||(l.defaultValue=""+g)}function sa(l,c,g,y){if(l=l.options,c){c={};for(var S=0;S<g.length;S++)c["$"+g[S]]=!0;for(g=0;g<l.length;g++)S=c.hasOwnProperty("$"+l[g].value),l[g].selected!==S&&(l[g].selected=S),S&&y&&(l[g].defaultSelected=!0)}else{for(g=""+Tn(g),c=null,S=0;S<l.length;S++){if(l[S].value===g){l[S].selected=!0,y&&(l[S].defaultSelected=!0);return}c!==null||l[S].disabled||(c=l[S])}c!==null&&(c.selected=!0)}}function K2(l,c,g){if(c!=null&&(c=""+Tn(c),c!==l.value&&(l.value=c),g==null)){l.defaultValue!==c&&(l.defaultValue=c);return}l.defaultValue=g!=null?""+Tn(g):""}function J2(l,c,g,y){if(c==null){if(y!=null){if(g!=null)throw Error(n(92));if(U(y)){if(1<y.length)throw Error(n(93));y=y[0]}g=y}g==null&&(g=""),c=g}g=Tn(c),l.defaultValue=g,y=l.textContent,y===g&&y!==""&&y!==null&&(l.value=y),za(l)}function Il(l,c){if(c){var g=l.firstChild;if(g&&g===l.lastChild&&g.nodeType===3){g.nodeValue=c;return}}l.textContent=c}var HO=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ew(l,c,g){var y=c.indexOf("--")===0;g==null||typeof g=="boolean"||g===""?y?l.setProperty(c,""):c==="float"?l.cssFloat="":l[c]="":y?l.setProperty(c,g):typeof g!="number"||g===0||HO.has(c)?c==="float"?l.cssFloat=g:l[c]=(""+g).trim():l[c]=g+"px"}function tw(l,c,g){if(c!=null&&typeof c!="object")throw Error(n(62));if(l=l.style,g!=null){for(var y in g)!g.hasOwnProperty(y)||c!=null&&c.hasOwnProperty(y)||(y.indexOf("--")===0?l.setProperty(y,""):y==="float"?l.cssFloat="":l[y]="");for(var S in c)y=c[S],c.hasOwnProperty(S)&&g[S]!==y&&ew(l,S,y)}else for(var _ in c)c.hasOwnProperty(_)&&ew(l,_,c[_])}function Vg(l){if(l.indexOf("-")===-1)return!1;switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var qO=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),UO=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Th(l){return UO.test(""+l)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":l}function la(){}var Wg=null;function Yg(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Fl=null,Pl=null;function rw(l){var c=Me(l);if(c&&(l=c.stateNode)){var g=l[Yt]||null;e:switch(l=c.stateNode,c.type){case"input":if(Rs(l,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name),c=g.name,g.type==="radio"&&c!=null){for(g=l;g.parentNode;)g=g.parentNode;for(g=g.querySelectorAll('input[name="'+En(""+c)+'"][type="radio"]'),c=0;c<g.length;c++){var y=g[c];if(y!==l&&y.form===l.form){var S=y[Yt]||null;if(!S)throw Error(n(90));Rs(y,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(c=0;c<g.length;c++)y=g[c],y.form===l.form&&Ch(y)}break e;case"textarea":K2(l,g.value,g.defaultValue);break e;case"select":c=g.value,c!=null&&sa(l,!!g.multiple,c,!1)}}}var Gg=!1;function nw(l,c,g){if(Gg)return l(c,g);Gg=!0;try{var y=l(c);return y}finally{if(Gg=!1,(Fl!==null||Pl!==null)&&(pf(),Fl&&(c=Fl,l=Pl,Pl=Fl=null,rw(c),l)))for(c=0;c<l.length;c++)rw(l[c])}}function Bc(l,c){var g=l.stateNode;if(g===null)return null;var y=g[Yt]||null;if(y===null)return null;g=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(l=l.type,y=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!y;break e;default:l=!1}if(l)return null;if(g&&typeof g!="function")throw Error(n(231,c,typeof g));return g}var oa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xg=!1;if(oa)try{var $c={};Object.defineProperty($c,"passive",{get:function(){Xg=!0}}),window.addEventListener("test",$c,$c),window.removeEventListener("test",$c,$c)}catch{Xg=!1}var Ia=null,Qg=null,Eh=null;function iw(){if(Eh)return Eh;var l,c=Qg,g=c.length,y,S="value"in Ia?Ia.value:Ia.textContent,_=S.length;for(l=0;l<g&&c[l]===S[l];l++);var F=g-l;for(y=1;y<=F&&c[g-y]===S[_-y];y++);return Eh=S.slice(l,1<y?1-y:void 0)}function Nh(l){var c=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&c===13&&(l=13)):l=c,l===10&&(l=13),32<=l||l===13?l:0}function jh(){return!0}function aw(){return!1}function Nn(l){function c(g,y,S,_,F){this._reactName=g,this._targetInst=S,this.type=y,this.nativeEvent=_,this.target=F,this.currentTarget=null;for(var X in l)l.hasOwnProperty(X)&&(g=l[X],this[X]=g?g(_):_[X]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?jh:aw,this.isPropagationStopped=aw,this}return p(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var g=this.nativeEvent;g&&(g.preventDefault?g.preventDefault():typeof g.returnValue!="unknown"&&(g.returnValue=!1),this.isDefaultPrevented=jh)},stopPropagation:function(){var g=this.nativeEvent;g&&(g.stopPropagation?g.stopPropagation():typeof g.cancelBubble!="unknown"&&(g.cancelBubble=!0),this.isPropagationStopped=jh)},persist:function(){},isPersistent:jh}),c}var Os={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ah=Nn(Os),zc=p({},Os,{view:0,detail:0}),VO=Nn(zc),Zg,Kg,Ic,Mh=p({},zc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:em,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Ic&&(Ic&&l.type==="mousemove"?(Zg=l.screenX-Ic.screenX,Kg=l.screenY-Ic.screenY):Kg=Zg=0,Ic=l),Zg)},movementY:function(l){return"movementY"in l?l.movementY:Kg}}),sw=Nn(Mh),WO=p({},Mh,{dataTransfer:0}),YO=Nn(WO),GO=p({},zc,{relatedTarget:0}),Jg=Nn(GO),XO=p({},Os,{animationName:0,elapsedTime:0,pseudoElement:0}),QO=Nn(XO),ZO=p({},Os,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),KO=Nn(ZO),JO=p({},Os,{data:0}),lw=Nn(JO),eB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tB={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},rB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nB(l){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(l):(l=rB[l])?!!c[l]:!1}function em(){return nB}var iB=p({},zc,{key:function(l){if(l.key){var c=eB[l.key]||l.key;if(c!=="Unidentified")return c}return l.type==="keypress"?(l=Nh(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?tB[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:em,charCode:function(l){return l.type==="keypress"?Nh(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Nh(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),aB=Nn(iB),sB=p({},Mh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ow=Nn(sB),lB=p({},zc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:em}),oB=Nn(lB),cB=p({},Os,{propertyName:0,elapsedTime:0,pseudoElement:0}),uB=Nn(cB),dB=p({},Mh,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),hB=Nn(dB),fB=p({},Os,{newState:0,oldState:0}),pB=Nn(fB),gB=[9,13,27,32],tm=oa&&"CompositionEvent"in window,Fc=null;oa&&"documentMode"in document&&(Fc=document.documentMode);var mB=oa&&"TextEvent"in window&&!Fc,cw=oa&&(!tm||Fc&&8<Fc&&11>=Fc),uw=" ",dw=!1;function hw(l,c){switch(l){case"keyup":return gB.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fw(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Hl=!1;function xB(l,c){switch(l){case"compositionend":return fw(c);case"keypress":return c.which!==32?null:(dw=!0,uw);case"textInput":return l=c.data,l===uw&&dw?null:l;default:return null}}function yB(l,c){if(Hl)return l==="compositionend"||!tm&&hw(l,c)?(l=iw(),Eh=Qg=Ia=null,Hl=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return cw&&c.locale!=="ko"?null:c.data;default:return null}}var bB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function pw(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c==="input"?!!bB[l.type]:c==="textarea"}function gw(l,c,g,y){Fl?Pl?Pl.push(y):Pl=[y]:Fl=y,c=wf(c,"onChange"),0<c.length&&(g=new Ah("onChange","change",null,g,y),l.push({event:g,listeners:c}))}var Pc=null,Hc=null;function vB(l){ZS(l,0)}function Lh(l){var c=Tt(l);if(Ch(c))return l}function mw(l,c){if(l==="change")return c}var xw=!1;if(oa){var rm;if(oa){var nm="oninput"in document;if(!nm){var yw=document.createElement("div");yw.setAttribute("oninput","return;"),nm=typeof yw.oninput=="function"}rm=nm}else rm=!1;xw=rm&&(!document.documentMode||9<document.documentMode)}function bw(){Pc&&(Pc.detachEvent("onpropertychange",vw),Hc=Pc=null)}function vw(l){if(l.propertyName==="value"&&Lh(Hc)){var c=[];gw(c,Hc,l,Yg(l)),nw(vB,c)}}function wB(l,c,g){l==="focusin"?(bw(),Pc=c,Hc=g,Pc.attachEvent("onpropertychange",vw)):l==="focusout"&&bw()}function kB(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Lh(Hc)}function SB(l,c){if(l==="click")return Lh(c)}function CB(l,c){if(l==="input"||l==="change")return Lh(c)}function _B(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var Vn=typeof Object.is=="function"?Object.is:_B;function qc(l,c){if(Vn(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var g=Object.keys(l),y=Object.keys(c);if(g.length!==y.length)return!1;for(y=0;y<g.length;y++){var S=g[y];if(!tt.call(c,S)||!Vn(l[S],c[S]))return!1}return!0}function ww(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function kw(l,c){var g=ww(l);l=0;for(var y;g;){if(g.nodeType===3){if(y=l+g.textContent.length,l<=c&&y>=c)return{node:g,offset:c-l};l=y}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=ww(g)}}function Sw(l,c){return l&&c?l===c?!0:l&&l.nodeType===3?!1:c&&c.nodeType===3?Sw(l,c.parentNode):"contains"in l?l.contains(c):l.compareDocumentPosition?!!(l.compareDocumentPosition(c)&16):!1:!1}function Cw(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var c=Ds(l.document);c instanceof l.HTMLIFrameElement;){try{var g=typeof c.contentWindow.location.href=="string"}catch{g=!1}if(g)l=c.contentWindow;else break;c=Ds(l.document)}return c}function im(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c&&(c==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||c==="textarea"||l.contentEditable==="true")}var TB=oa&&"documentMode"in document&&11>=document.documentMode,ql=null,am=null,Uc=null,sm=!1;function _w(l,c,g){var y=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;sm||ql==null||ql!==Ds(y)||(y=ql,"selectionStart"in y&&im(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Uc&&qc(Uc,y)||(Uc=y,y=wf(am,"onSelect"),0<y.length&&(c=new Ah("onSelect","select",null,c,g),l.push({event:c,listeners:y}),c.target=ql)))}function Bs(l,c){var g={};return g[l.toLowerCase()]=c.toLowerCase(),g["Webkit"+l]="webkit"+c,g["Moz"+l]="moz"+c,g}var Ul={animationend:Bs("Animation","AnimationEnd"),animationiteration:Bs("Animation","AnimationIteration"),animationstart:Bs("Animation","AnimationStart"),transitionrun:Bs("Transition","TransitionRun"),transitionstart:Bs("Transition","TransitionStart"),transitioncancel:Bs("Transition","TransitionCancel"),transitionend:Bs("Transition","TransitionEnd")},lm={},Tw={};oa&&(Tw=document.createElement("div").style,"AnimationEvent"in window||(delete Ul.animationend.animation,delete Ul.animationiteration.animation,delete Ul.animationstart.animation),"TransitionEvent"in window||delete Ul.transitionend.transition);function $s(l){if(lm[l])return lm[l];if(!Ul[l])return l;var c=Ul[l],g;for(g in c)if(c.hasOwnProperty(g)&&g in Tw)return lm[l]=c[g];return l}var Ew=$s("animationend"),Nw=$s("animationiteration"),jw=$s("animationstart"),EB=$s("transitionrun"),NB=$s("transitionstart"),jB=$s("transitioncancel"),Aw=$s("transitionend"),Mw=new Map,om="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");om.push("scrollEnd");function vi(l,c){Mw.set(l,c),rn(c,[l])}var Dh=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},ai=[],Vl=0,cm=0;function Rh(){for(var l=Vl,c=cm=Vl=0;c<l;){var g=ai[c];ai[c++]=null;var y=ai[c];ai[c++]=null;var S=ai[c];ai[c++]=null;var _=ai[c];if(ai[c++]=null,y!==null&&S!==null){var F=y.pending;F===null?S.next=S:(S.next=F.next,F.next=S),y.pending=S}_!==0&&Lw(g,S,_)}}function Oh(l,c,g,y){ai[Vl++]=l,ai[Vl++]=c,ai[Vl++]=g,ai[Vl++]=y,cm|=y,l.lanes|=y,l=l.alternate,l!==null&&(l.lanes|=y)}function um(l,c,g,y){return Oh(l,c,g,y),Bh(l)}function zs(l,c){return Oh(l,null,null,c),Bh(l)}function Lw(l,c,g){l.lanes|=g;var y=l.alternate;y!==null&&(y.lanes|=g);for(var S=!1,_=l.return;_!==null;)_.childLanes|=g,y=_.alternate,y!==null&&(y.childLanes|=g),_.tag===22&&(l=_.stateNode,l===null||l._visibility&1||(S=!0)),l=_,_=_.return;return l.tag===3?(_=l.stateNode,S&&c!==null&&(S=31-dt(g),l=_.hiddenUpdates,y=l[S],y===null?l[S]=[c]:y.push(c),c.lane=g|536870912),_):null}function Bh(l){if(50<hu)throw hu=0,bx=null,Error(n(185));for(var c=l.return;c!==null;)l=c,c=l.return;return l.tag===3?l.stateNode:null}var Wl={};function AB(l,c,g,y){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wn(l,c,g,y){return new AB(l,c,g,y)}function dm(l){return l=l.prototype,!(!l||!l.isReactComponent)}function ca(l,c){var g=l.alternate;return g===null?(g=Wn(l.tag,c,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=c,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&65011712,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,c=l.dependencies,g.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g.refCleanup=l.refCleanup,g}function Dw(l,c){l.flags&=65011714;var g=l.alternate;return g===null?(l.childLanes=0,l.lanes=c,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=g.childLanes,l.lanes=g.lanes,l.child=g.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=g.memoizedProps,l.memoizedState=g.memoizedState,l.updateQueue=g.updateQueue,l.type=g.type,c=g.dependencies,l.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),l}function $h(l,c,g,y,S,_){var F=0;if(y=l,typeof l=="function")dm(l)&&(F=1);else if(typeof l=="string")F=O8(l,g,Z.current)?26:l==="html"||l==="head"||l==="body"?27:5;else e:switch(l){case P:return l=Wn(31,g,c,S),l.elementType=P,l.lanes=_,l;case v:return Is(g.children,S,_,c);case k:F=8,S|=24;break;case w:return l=Wn(12,g,c,S|2),l.elementType=w,l.lanes=_,l;case L:return l=Wn(13,g,c,S),l.elementType=L,l.lanes=_,l;case E:return l=Wn(19,g,c,S),l.elementType=E,l.lanes=_,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case T:F=10;break e;case C:F=9;break e;case j:F=11;break e;case M:F=14;break e;case I:F=16,y=null;break e}F=29,g=Error(n(130,l===null?"null":typeof l,"")),y=null}return c=Wn(F,g,c,S),c.elementType=l,c.type=y,c.lanes=_,c}function Is(l,c,g,y){return l=Wn(7,l,y,c),l.lanes=g,l}function hm(l,c,g){return l=Wn(6,l,null,c),l.lanes=g,l}function Rw(l){var c=Wn(18,null,null,0);return c.stateNode=l,c}function fm(l,c,g){return c=Wn(4,l.children!==null?l.children:[],l.key,c),c.lanes=g,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}var Ow=new WeakMap;function si(l,c){if(typeof l=="object"&&l!==null){var g=Ow.get(l);return g!==void 0?g:(c={value:l,source:c,stack:ut(c)},Ow.set(l,c),c)}return{value:l,source:c,stack:ut(c)}}var Yl=[],Gl=0,zh=null,Vc=0,li=[],oi=0,Fa=null,Ii=1,Fi="";function ua(l,c){Yl[Gl++]=Vc,Yl[Gl++]=zh,zh=l,Vc=c}function Bw(l,c,g){li[oi++]=Ii,li[oi++]=Fi,li[oi++]=Fa,Fa=l;var y=Ii;l=Fi;var S=32-dt(y)-1;y&=~(1<<S),g+=1;var _=32-dt(c)+S;if(30<_){var F=S-S%5;_=(y&(1<<F)-1).toString(32),y>>=F,S-=F,Ii=1<<32-dt(c)+S|g<<S|y,Fi=_+l}else Ii=1<<_|g<<S|y,Fi=l}function pm(l){l.return!==null&&(ua(l,1),Bw(l,1,0))}function gm(l){for(;l===zh;)zh=Yl[--Gl],Yl[Gl]=null,Vc=Yl[--Gl],Yl[Gl]=null;for(;l===Fa;)Fa=li[--oi],li[oi]=null,Fi=li[--oi],li[oi]=null,Ii=li[--oi],li[oi]=null}function $w(l,c){li[oi++]=Ii,li[oi++]=Fi,li[oi++]=Fa,Ii=c.id,Fi=c.overflow,Fa=l}var Vr=null,Jt=null,kt=!1,Pa=null,ci=!1,mm=Error(n(519));function Ha(l){var c=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wc(si(c,l)),mm}function zw(l){var c=l.stateNode,g=l.type,y=l.memoizedProps;switch(c[cr]=l,c[Yt]=y,g){case"dialog":pt("cancel",c),pt("close",c);break;case"iframe":case"object":case"embed":pt("load",c);break;case"video":case"audio":for(g=0;g<pu.length;g++)pt(pu[g],c);break;case"source":pt("error",c);break;case"img":case"image":case"link":pt("error",c),pt("load",c);break;case"details":pt("toggle",c);break;case"input":pt("invalid",c),_h(c,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":pt("invalid",c);break;case"textarea":pt("invalid",c),J2(c,y.value,y.defaultValue,y.children)}g=y.children,typeof g!="string"&&typeof g!="number"&&typeof g!="bigint"||c.textContent===""+g||y.suppressHydrationWarning===!0||tC(c.textContent,g)?(y.popover!=null&&(pt("beforetoggle",c),pt("toggle",c)),y.onScroll!=null&&pt("scroll",c),y.onScrollEnd!=null&&pt("scrollend",c),y.onClick!=null&&(c.onclick=la),c=!0):c=!1,c||Ha(l,!0)}function Iw(l){for(Vr=l.return;Vr;)switch(Vr.tag){case 5:case 31:case 13:ci=!1;return;case 27:case 3:ci=!0;return;default:Vr=Vr.return}}function Xl(l){if(l!==Vr)return!1;if(!kt)return Iw(l),kt=!0,!1;var c=l.tag,g;if((g=c!==3&&c!==27)&&((g=c===5)&&(g=l.type,g=!(g!=="form"&&g!=="button")||Rx(l.type,l.memoizedProps)),g=!g),g&&Jt&&Ha(l),Iw(l),c===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));Jt=uC(l)}else if(c===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));Jt=uC(l)}else c===27?(c=Jt,rs(l.type)?(l=Ix,Ix=null,Jt=l):Jt=c):Jt=Vr?di(l.stateNode.nextSibling):null;return!0}function Fs(){Jt=Vr=null,kt=!1}function xm(){var l=Pa;return l!==null&&(Ln===null?Ln=l:Ln.push.apply(Ln,l),Pa=null),l}function Wc(l){Pa===null?Pa=[l]:Pa.push(l)}var ym=D(null),Ps=null,da=null;function qa(l,c,g){q(ym,c._currentValue),c._currentValue=g}function ha(l){l._currentValue=ym.current,G(ym)}function bm(l,c,g){for(;l!==null;){var y=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),l===g)break;l=l.return}}function vm(l,c,g,y){var S=l.child;for(S!==null&&(S.return=l);S!==null;){var _=S.dependencies;if(_!==null){var F=S.child;_=_.firstContext;e:for(;_!==null;){var X=_;_=S;for(var K=0;K<c.length;K++)if(X.context===c[K]){_.lanes|=g,X=_.alternate,X!==null&&(X.lanes|=g),bm(_.return,g,l),y||(F=null);break e}_=X.next}}else if(S.tag===18){if(F=S.return,F===null)throw Error(n(341));F.lanes|=g,_=F.alternate,_!==null&&(_.lanes|=g),bm(F,g,l),F=null}else F=S.child;if(F!==null)F.return=S;else for(F=S;F!==null;){if(F===l){F=null;break}if(S=F.sibling,S!==null){S.return=F.return,F=S;break}F=F.return}S=F}}function Ql(l,c,g,y){l=null;for(var S=c,_=!1;S!==null;){if(!_){if((S.flags&524288)!==0)_=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var F=S.alternate;if(F===null)throw Error(n(387));if(F=F.memoizedProps,F!==null){var X=S.type;Vn(S.pendingProps.value,F.value)||(l!==null?l.push(X):l=[X])}}else if(S===ie.current){if(F=S.alternate,F===null)throw Error(n(387));F.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(l!==null?l.push(bu):l=[bu])}S=S.return}l!==null&&vm(c,l,g,y),c.flags|=262144}function Ih(l){for(l=l.firstContext;l!==null;){if(!Vn(l.context._currentValue,l.memoizedValue))return!0;l=l.next}return!1}function Hs(l){Ps=l,da=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function Wr(l){return Fw(Ps,l)}function Fh(l,c){return Ps===null&&Hs(l),Fw(l,c)}function Fw(l,c){var g=c._currentValue;if(c={context:c,memoizedValue:g,next:null},da===null){if(l===null)throw Error(n(308));da=c,l.dependencies={lanes:0,firstContext:c},l.flags|=524288}else da=da.next=c;return g}var MB=typeof AbortController<"u"?AbortController:function(){var l=[],c=this.signal={aborted:!1,addEventListener:function(g,y){l.push(y)}};this.abort=function(){c.aborted=!0,l.forEach(function(g){return g()})}},LB=e.unstable_scheduleCallback,DB=e.unstable_NormalPriority,yr={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wm(){return{controller:new MB,data:new Map,refCount:0}}function Yc(l){l.refCount--,l.refCount===0&&LB(DB,function(){l.controller.abort()})}var Gc=null,km=0,Zl=0,Kl=null;function RB(l,c){if(Gc===null){var g=Gc=[];km=0,Zl=_x(),Kl={status:"pending",value:void 0,then:function(y){g.push(y)}}}return km++,c.then(Pw,Pw),c}function Pw(){if(--km===0&&Gc!==null){Kl!==null&&(Kl.status="fulfilled");var l=Gc;Gc=null,Zl=0,Kl=null;for(var c=0;c<l.length;c++)(0,l[c])()}}function OB(l,c){var g=[],y={status:"pending",value:null,reason:null,then:function(S){g.push(S)}};return l.then(function(){y.status="fulfilled",y.value=c;for(var S=0;S<g.length;S++)(0,g[S])(c)},function(S){for(y.status="rejected",y.reason=S,S=0;S<g.length;S++)(0,g[S])(void 0)}),y}var Hw=R.S;R.S=function(l,c){_S=_e(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&RB(l,c),Hw!==null&&Hw(l,c)};var qs=D(null);function Sm(){var l=qs.current;return l!==null?l:Ut.pooledCache}function Ph(l,c){c===null?q(qs,qs.current):q(qs,c.pool)}function qw(){var l=Sm();return l===null?null:{parent:yr._currentValue,pool:l}}var Jl=Error(n(460)),Cm=Error(n(474)),Hh=Error(n(542)),qh={then:function(){}};function Uw(l){return l=l.status,l==="fulfilled"||l==="rejected"}function Vw(l,c,g){switch(g=l[g],g===void 0?l.push(c):g!==c&&(c.then(la,la),c=g),c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,Yw(l),l;default:if(typeof c.status=="string")c.then(la,la);else{if(l=Ut,l!==null&&100<l.shellSuspendCounter)throw Error(n(482));l=c,l.status="pending",l.then(function(y){if(c.status==="pending"){var S=c;S.status="fulfilled",S.value=y}},function(y){if(c.status==="pending"){var S=c;S.status="rejected",S.reason=y}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,Yw(l),l}throw Vs=c,Jl}}function Us(l){try{var c=l._init;return c(l._payload)}catch(g){throw g!==null&&typeof g=="object"&&typeof g.then=="function"?(Vs=g,Jl):g}}var Vs=null;function Ww(){if(Vs===null)throw Error(n(459));var l=Vs;return Vs=null,l}function Yw(l){if(l===Jl||l===Hh)throw Error(n(483))}var eo=null,Xc=0;function Uh(l){var c=Xc;return Xc+=1,eo===null&&(eo=[]),Vw(eo,l,c)}function Qc(l,c){c=c.props.ref,l.ref=c!==void 0?c:null}function Vh(l,c){throw c.$$typeof===m?Error(n(525)):(l=Object.prototype.toString.call(c),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l)))}function Gw(l){function c(ae,te){if(l){var ce=ae.deletions;ce===null?(ae.deletions=[te],ae.flags|=16):ce.push(te)}}function g(ae,te){if(!l)return null;for(;te!==null;)c(ae,te),te=te.sibling;return null}function y(ae){for(var te=new Map;ae!==null;)ae.key!==null?te.set(ae.key,ae):te.set(ae.index,ae),ae=ae.sibling;return te}function S(ae,te){return ae=ca(ae,te),ae.index=0,ae.sibling=null,ae}function _(ae,te,ce){return ae.index=ce,l?(ce=ae.alternate,ce!==null?(ce=ce.index,ce<te?(ae.flags|=67108866,te):ce):(ae.flags|=67108866,te)):(ae.flags|=1048576,te)}function F(ae){return l&&ae.alternate===null&&(ae.flags|=67108866),ae}function X(ae,te,ce,ye){return te===null||te.tag!==6?(te=hm(ce,ae.mode,ye),te.return=ae,te):(te=S(te,ce),te.return=ae,te)}function K(ae,te,ce,ye){var Ue=ce.type;return Ue===v?me(ae,te,ce.props.children,ye,ce.key):te!==null&&(te.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===I&&Us(Ue)===te.type)?(te=S(te,ce.props),Qc(te,ce),te.return=ae,te):(te=$h(ce.type,ce.key,ce.props,null,ae.mode,ye),Qc(te,ce),te.return=ae,te)}function ue(ae,te,ce,ye){return te===null||te.tag!==4||te.stateNode.containerInfo!==ce.containerInfo||te.stateNode.implementation!==ce.implementation?(te=fm(ce,ae.mode,ye),te.return=ae,te):(te=S(te,ce.children||[]),te.return=ae,te)}function me(ae,te,ce,ye,Ue){return te===null||te.tag!==7?(te=Is(ce,ae.mode,ye,Ue),te.return=ae,te):(te=S(te,ce),te.return=ae,te)}function ve(ae,te,ce){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=hm(""+te,ae.mode,ce),te.return=ae,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case x:return ce=$h(te.type,te.key,te.props,null,ae.mode,ce),Qc(ce,te),ce.return=ae,ce;case b:return te=fm(te,ae.mode,ce),te.return=ae,te;case I:return te=Us(te),ve(ae,te,ce)}if(U(te)||W(te))return te=Is(te,ae.mode,ce,null),te.return=ae,te;if(typeof te.then=="function")return ve(ae,Uh(te),ce);if(te.$$typeof===T)return ve(ae,Fh(ae,te),ce);Vh(ae,te)}return null}function he(ae,te,ce,ye){var Ue=te!==null?te.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Ue!==null?null:X(ae,te,""+ce,ye);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:return ce.key===Ue?K(ae,te,ce,ye):null;case b:return ce.key===Ue?ue(ae,te,ce,ye):null;case I:return ce=Us(ce),he(ae,te,ce,ye)}if(U(ce)||W(ce))return Ue!==null?null:me(ae,te,ce,ye,null);if(typeof ce.then=="function")return he(ae,te,Uh(ce),ye);if(ce.$$typeof===T)return he(ae,te,Fh(ae,ce),ye);Vh(ae,ce)}return null}function pe(ae,te,ce,ye,Ue){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return ae=ae.get(ce)||null,X(te,ae,""+ye,Ue);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case x:return ae=ae.get(ye.key===null?ce:ye.key)||null,K(te,ae,ye,Ue);case b:return ae=ae.get(ye.key===null?ce:ye.key)||null,ue(te,ae,ye,Ue);case I:return ye=Us(ye),pe(ae,te,ce,ye,Ue)}if(U(ye)||W(ye))return ae=ae.get(ce)||null,me(te,ae,ye,Ue,null);if(typeof ye.then=="function")return pe(ae,te,ce,Uh(ye),Ue);if(ye.$$typeof===T)return pe(ae,te,ce,Fh(te,ye),Ue);Vh(te,ye)}return null}function De(ae,te,ce,ye){for(var Ue=null,Nt=null,Fe=te,ot=te=0,vt=null;Fe!==null&&ot<ce.length;ot++){Fe.index>ot?(vt=Fe,Fe=null):vt=Fe.sibling;var jt=he(ae,Fe,ce[ot],ye);if(jt===null){Fe===null&&(Fe=vt);break}l&&Fe&&jt.alternate===null&&c(ae,Fe),te=_(jt,te,ot),Nt===null?Ue=jt:Nt.sibling=jt,Nt=jt,Fe=vt}if(ot===ce.length)return g(ae,Fe),kt&&ua(ae,ot),Ue;if(Fe===null){for(;ot<ce.length;ot++)Fe=ve(ae,ce[ot],ye),Fe!==null&&(te=_(Fe,te,ot),Nt===null?Ue=Fe:Nt.sibling=Fe,Nt=Fe);return kt&&ua(ae,ot),Ue}for(Fe=y(Fe);ot<ce.length;ot++)vt=pe(Fe,ae,ot,ce[ot],ye),vt!==null&&(l&&vt.alternate!==null&&Fe.delete(vt.key===null?ot:vt.key),te=_(vt,te,ot),Nt===null?Ue=vt:Nt.sibling=vt,Nt=vt);return l&&Fe.forEach(function(ls){return c(ae,ls)}),kt&&ua(ae,ot),Ue}function Xe(ae,te,ce,ye){if(ce==null)throw Error(n(151));for(var Ue=null,Nt=null,Fe=te,ot=te=0,vt=null,jt=ce.next();Fe!==null&&!jt.done;ot++,jt=ce.next()){Fe.index>ot?(vt=Fe,Fe=null):vt=Fe.sibling;var ls=he(ae,Fe,jt.value,ye);if(ls===null){Fe===null&&(Fe=vt);break}l&&Fe&&ls.alternate===null&&c(ae,Fe),te=_(ls,te,ot),Nt===null?Ue=ls:Nt.sibling=ls,Nt=ls,Fe=vt}if(jt.done)return g(ae,Fe),kt&&ua(ae,ot),Ue;if(Fe===null){for(;!jt.done;ot++,jt=ce.next())jt=ve(ae,jt.value,ye),jt!==null&&(te=_(jt,te,ot),Nt===null?Ue=jt:Nt.sibling=jt,Nt=jt);return kt&&ua(ae,ot),Ue}for(Fe=y(Fe);!jt.done;ot++,jt=ce.next())jt=pe(Fe,ae,ot,jt.value,ye),jt!==null&&(l&&jt.alternate!==null&&Fe.delete(jt.key===null?ot:jt.key),te=_(jt,te,ot),Nt===null?Ue=jt:Nt.sibling=jt,Nt=jt);return l&&Fe.forEach(function(W8){return c(ae,W8)}),kt&&ua(ae,ot),Ue}function Ht(ae,te,ce,ye){if(typeof ce=="object"&&ce!==null&&ce.type===v&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:e:{for(var Ue=ce.key;te!==null;){if(te.key===Ue){if(Ue=ce.type,Ue===v){if(te.tag===7){g(ae,te.sibling),ye=S(te,ce.props.children),ye.return=ae,ae=ye;break e}}else if(te.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===I&&Us(Ue)===te.type){g(ae,te.sibling),ye=S(te,ce.props),Qc(ye,ce),ye.return=ae,ae=ye;break e}g(ae,te);break}else c(ae,te);te=te.sibling}ce.type===v?(ye=Is(ce.props.children,ae.mode,ye,ce.key),ye.return=ae,ae=ye):(ye=$h(ce.type,ce.key,ce.props,null,ae.mode,ye),Qc(ye,ce),ye.return=ae,ae=ye)}return F(ae);case b:e:{for(Ue=ce.key;te!==null;){if(te.key===Ue)if(te.tag===4&&te.stateNode.containerInfo===ce.containerInfo&&te.stateNode.implementation===ce.implementation){g(ae,te.sibling),ye=S(te,ce.children||[]),ye.return=ae,ae=ye;break e}else{g(ae,te);break}else c(ae,te);te=te.sibling}ye=fm(ce,ae.mode,ye),ye.return=ae,ae=ye}return F(ae);case I:return ce=Us(ce),Ht(ae,te,ce,ye)}if(U(ce))return De(ae,te,ce,ye);if(W(ce)){if(Ue=W(ce),typeof Ue!="function")throw Error(n(150));return ce=Ue.call(ce),Xe(ae,te,ce,ye)}if(typeof ce.then=="function")return Ht(ae,te,Uh(ce),ye);if(ce.$$typeof===T)return Ht(ae,te,Fh(ae,ce),ye);Vh(ae,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,te!==null&&te.tag===6?(g(ae,te.sibling),ye=S(te,ce),ye.return=ae,ae=ye):(g(ae,te),ye=hm(ce,ae.mode,ye),ye.return=ae,ae=ye),F(ae)):g(ae,te)}return function(ae,te,ce,ye){try{Xc=0;var Ue=Ht(ae,te,ce,ye);return eo=null,Ue}catch(Fe){if(Fe===Jl||Fe===Hh)throw Fe;var Nt=Wn(29,Fe,null,ae.mode);return Nt.lanes=ye,Nt.return=ae,Nt}finally{}}}var Ws=Gw(!0),Xw=Gw(!1),Ua=!1;function _m(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tm(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Va(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function Wa(l,c,g){var y=l.updateQueue;if(y===null)return null;if(y=y.shared,(Mt&2)!==0){var S=y.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),y.pending=c,c=Bh(l),Lw(l,null,g),c}return Oh(l,y,c,g),Bh(l)}function Zc(l,c,g){if(c=c.updateQueue,c!==null&&(c=c.shared,(g&4194048)!==0)){var y=c.lanes;y&=l.pendingLanes,g|=y,c.lanes=g,Ir(l,g)}}function Em(l,c){var g=l.updateQueue,y=l.alternate;if(y!==null&&(y=y.updateQueue,g===y)){var S=null,_=null;if(g=g.firstBaseUpdate,g!==null){do{var F={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};_===null?S=_=F:_=_.next=F,g=g.next}while(g!==null);_===null?S=_=c:_=_.next=c}else S=_=c;g={baseState:y.baseState,firstBaseUpdate:S,lastBaseUpdate:_,shared:y.shared,callbacks:y.callbacks},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=c:l.next=c,g.lastBaseUpdate=c}var Nm=!1;function Kc(){if(Nm){var l=Kl;if(l!==null)throw l}}function Jc(l,c,g,y){Nm=!1;var S=l.updateQueue;Ua=!1;var _=S.firstBaseUpdate,F=S.lastBaseUpdate,X=S.shared.pending;if(X!==null){S.shared.pending=null;var K=X,ue=K.next;K.next=null,F===null?_=ue:F.next=ue,F=K;var me=l.alternate;me!==null&&(me=me.updateQueue,X=me.lastBaseUpdate,X!==F&&(X===null?me.firstBaseUpdate=ue:X.next=ue,me.lastBaseUpdate=K))}if(_!==null){var ve=S.baseState;F=0,me=ue=K=null,X=_;do{var he=X.lane&-536870913,pe=he!==X.lane;if(pe?(bt&he)===he:(y&he)===he){he!==0&&he===Zl&&(Nm=!0),me!==null&&(me=me.next={lane:0,tag:X.tag,payload:X.payload,callback:null,next:null});e:{var De=l,Xe=X;he=c;var Ht=g;switch(Xe.tag){case 1:if(De=Xe.payload,typeof De=="function"){ve=De.call(Ht,ve,he);break e}ve=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Xe.payload,he=typeof De=="function"?De.call(Ht,ve,he):De,he==null)break e;ve=p({},ve,he);break e;case 2:Ua=!0}}he=X.callback,he!==null&&(l.flags|=64,pe&&(l.flags|=8192),pe=S.callbacks,pe===null?S.callbacks=[he]:pe.push(he))}else pe={lane:he,tag:X.tag,payload:X.payload,callback:X.callback,next:null},me===null?(ue=me=pe,K=ve):me=me.next=pe,F|=he;if(X=X.next,X===null){if(X=S.shared.pending,X===null)break;pe=X,X=pe.next,pe.next=null,S.lastBaseUpdate=pe,S.shared.pending=null}}while(!0);me===null&&(K=ve),S.baseState=K,S.firstBaseUpdate=ue,S.lastBaseUpdate=me,_===null&&(S.shared.lanes=0),Za|=F,l.lanes=F,l.memoizedState=ve}}function Qw(l,c){if(typeof l!="function")throw Error(n(191,l));l.call(c)}function Zw(l,c){var g=l.callbacks;if(g!==null)for(l.callbacks=null,l=0;l<g.length;l++)Qw(g[l],c)}var to=D(null),Wh=D(0);function Kw(l,c){l=wa,q(Wh,l),q(to,c),wa=l|c.baseLanes}function jm(){q(Wh,wa),q(to,to.current)}function Am(){wa=Wh.current,G(to),G(Wh)}var Yn=D(null),ui=null;function Ya(l){var c=l.alternate;q(pr,pr.current&1),q(Yn,l),ui===null&&(c===null||to.current!==null||c.memoizedState!==null)&&(ui=l)}function Mm(l){q(pr,pr.current),q(Yn,l),ui===null&&(ui=l)}function Jw(l){l.tag===22?(q(pr,pr.current),q(Yn,l),ui===null&&(ui=l)):Ga()}function Ga(){q(pr,pr.current),q(Yn,Yn.current)}function Gn(l){G(Yn),ui===l&&(ui=null),G(pr)}var pr=D(0);function Yh(l){for(var c=l;c!==null;){if(c.tag===13){var g=c.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||$x(g)||zx(g)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var fa=0,st=null,Ft=null,br=null,Gh=!1,ro=!1,Ys=!1,Xh=0,eu=0,no=null,BB=0;function ur(){throw Error(n(321))}function Lm(l,c){if(c===null)return!1;for(var g=0;g<c.length&&g<l.length;g++)if(!Vn(l[g],c[g]))return!1;return!0}function Dm(l,c,g,y,S,_){return fa=_,st=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,R.H=l===null||l.memoizedState===null?Bk:Gm,Ys=!1,_=g(y,S),Ys=!1,ro&&(_=tk(c,g,y,S)),ek(l),_}function ek(l){R.H=nu;var c=Ft!==null&&Ft.next!==null;if(fa=0,br=Ft=st=null,Gh=!1,eu=0,no=null,c)throw Error(n(300));l===null||vr||(l=l.dependencies,l!==null&&Ih(l)&&(vr=!0))}function tk(l,c,g,y){st=l;var S=0;do{if(ro&&(no=null),eu=0,ro=!1,25<=S)throw Error(n(301));if(S+=1,br=Ft=null,l.updateQueue!=null){var _=l.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}R.H=$k,_=c(g,y)}while(ro);return _}function $B(){var l=R.H,c=l.useState()[0];return c=typeof c.then=="function"?tu(c):c,l=l.useState()[0],(Ft!==null?Ft.memoizedState:null)!==l&&(st.flags|=1024),c}function Rm(){var l=Xh!==0;return Xh=0,l}function Om(l,c,g){c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~g}function Bm(l){if(Gh){for(l=l.memoizedState;l!==null;){var c=l.queue;c!==null&&(c.pending=null),l=l.next}Gh=!1}fa=0,br=Ft=st=null,ro=!1,eu=Xh=0,no=null}function gn(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return br===null?st.memoizedState=br=l:br=br.next=l,br}function gr(){if(Ft===null){var l=st.alternate;l=l!==null?l.memoizedState:null}else l=Ft.next;var c=br===null?st.memoizedState:br.next;if(c!==null)br=c,Ft=l;else{if(l===null)throw st.alternate===null?Error(n(467)):Error(n(310));Ft=l,l={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},br===null?st.memoizedState=br=l:br=br.next=l}return br}function Qh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tu(l){var c=eu;return eu+=1,no===null&&(no=[]),l=Vw(no,l,c),c=st,(br===null?c.memoizedState:br.next)===null&&(c=c.alternate,R.H=c===null||c.memoizedState===null?Bk:Gm),l}function Zh(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return tu(l);if(l.$$typeof===T)return Wr(l)}throw Error(n(438,String(l)))}function $m(l){var c=null,g=st.updateQueue;if(g!==null&&(c=g.memoCache),c==null){var y=st.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(c={data:y.data.map(function(S){return S.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),g===null&&(g=Qh(),st.updateQueue=g),g.memoCache=c,g=c.data[c.index],g===void 0)for(g=c.data[c.index]=Array(l),y=0;y<l;y++)g[y]=z;return c.index++,g}function pa(l,c){return typeof c=="function"?c(l):c}function Kh(l){var c=gr();return zm(c,Ft,l)}function zm(l,c,g){var y=l.queue;if(y===null)throw Error(n(311));y.lastRenderedReducer=g;var S=l.baseQueue,_=y.pending;if(_!==null){if(S!==null){var F=S.next;S.next=_.next,_.next=F}c.baseQueue=S=_,y.pending=null}if(_=l.baseState,S===null)l.memoizedState=_;else{c=S.next;var X=F=null,K=null,ue=c,me=!1;do{var ve=ue.lane&-536870913;if(ve!==ue.lane?(bt&ve)===ve:(fa&ve)===ve){var he=ue.revertLane;if(he===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),ve===Zl&&(me=!0);else if((fa&he)===he){ue=ue.next,he===Zl&&(me=!0);continue}else ve={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},K===null?(X=K=ve,F=_):K=K.next=ve,st.lanes|=he,Za|=he;ve=ue.action,Ys&&g(_,ve),_=ue.hasEagerState?ue.eagerState:g(_,ve)}else he={lane:ve,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},K===null?(X=K=he,F=_):K=K.next=he,st.lanes|=ve,Za|=ve;ue=ue.next}while(ue!==null&&ue!==c);if(K===null?F=_:K.next=X,!Vn(_,l.memoizedState)&&(vr=!0,me&&(g=Kl,g!==null)))throw g;l.memoizedState=_,l.baseState=F,l.baseQueue=K,y.lastRenderedState=_}return S===null&&(y.lanes=0),[l.memoizedState,y.dispatch]}function Im(l){var c=gr(),g=c.queue;if(g===null)throw Error(n(311));g.lastRenderedReducer=l;var y=g.dispatch,S=g.pending,_=c.memoizedState;if(S!==null){g.pending=null;var F=S=S.next;do _=l(_,F.action),F=F.next;while(F!==S);Vn(_,c.memoizedState)||(vr=!0),c.memoizedState=_,c.baseQueue===null&&(c.baseState=_),g.lastRenderedState=_}return[_,y]}function rk(l,c,g){var y=st,S=gr(),_=kt;if(_){if(g===void 0)throw Error(n(407));g=g()}else g=c();var F=!Vn((Ft||S).memoizedState,g);if(F&&(S.memoizedState=g,vr=!0),S=S.queue,Hm(ak.bind(null,y,S,l),[l]),S.getSnapshot!==c||F||br!==null&&br.memoizedState.tag&1){if(y.flags|=2048,io(9,{destroy:void 0},ik.bind(null,y,S,g,c),null),Ut===null)throw Error(n(349));_||(fa&127)!==0||nk(y,c,g)}return g}function nk(l,c,g){l.flags|=16384,l={getSnapshot:c,value:g},c=st.updateQueue,c===null?(c=Qh(),st.updateQueue=c,c.stores=[l]):(g=c.stores,g===null?c.stores=[l]:g.push(l))}function ik(l,c,g,y){c.value=g,c.getSnapshot=y,sk(c)&&lk(l)}function ak(l,c,g){return g(function(){sk(c)&&lk(l)})}function sk(l){var c=l.getSnapshot;l=l.value;try{var g=c();return!Vn(l,g)}catch{return!0}}function lk(l){var c=zs(l,2);c!==null&&Dn(c,l,2)}function Fm(l){var c=gn();if(typeof l=="function"){var g=l;if(l=g(),Ys){Lt(!0);try{g()}finally{Lt(!1)}}}return c.memoizedState=c.baseState=l,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:l},c}function ok(l,c,g,y){return l.baseState=g,zm(l,Ft,typeof y=="function"?y:pa)}function zB(l,c,g,y,S){if(tf(l))throw Error(n(485));if(l=c.action,l!==null){var _={payload:S,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(F){_.listeners.push(F)}};R.T!==null?g(!0):_.isTransition=!1,y(_),g=c.pending,g===null?(_.next=c.pending=_,ck(c,_)):(_.next=g.next,c.pending=g.next=_)}}function ck(l,c){var g=c.action,y=c.payload,S=l.state;if(c.isTransition){var _=R.T,F={};R.T=F;try{var X=g(S,y),K=R.S;K!==null&&K(F,X),uk(l,c,X)}catch(ue){Pm(l,c,ue)}finally{_!==null&&F.types!==null&&(_.types=F.types),R.T=_}}else try{_=g(S,y),uk(l,c,_)}catch(ue){Pm(l,c,ue)}}function uk(l,c,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(y){dk(l,c,y)},function(y){return Pm(l,c,y)}):dk(l,c,g)}function dk(l,c,g){c.status="fulfilled",c.value=g,hk(c),l.state=g,c=l.pending,c!==null&&(g=c.next,g===c?l.pending=null:(g=g.next,c.next=g,ck(l,g)))}function Pm(l,c,g){var y=l.pending;if(l.pending=null,y!==null){y=y.next;do c.status="rejected",c.reason=g,hk(c),c=c.next;while(c!==y)}l.action=null}function hk(l){l=l.listeners;for(var c=0;c<l.length;c++)(0,l[c])()}function fk(l,c){return c}function pk(l,c){if(kt){var g=Ut.formState;if(g!==null){e:{var y=st;if(kt){if(Jt){t:{for(var S=Jt,_=ci;S.nodeType!==8;){if(!_){S=null;break t}if(S=di(S.nextSibling),S===null){S=null;break t}}_=S.data,S=_==="F!"||_==="F"?S:null}if(S){Jt=di(S.nextSibling),y=S.data==="F!";break e}}Ha(y)}y=!1}y&&(c=g[0])}}return g=gn(),g.memoizedState=g.baseState=c,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fk,lastRenderedState:c},g.queue=y,g=Dk.bind(null,st,y),y.dispatch=g,y=Fm(!1),_=Ym.bind(null,st,!1,y.queue),y=gn(),S={state:c,dispatch:null,action:l,pending:null},y.queue=S,g=zB.bind(null,st,S,_,g),S.dispatch=g,y.memoizedState=l,[c,g,!1]}function gk(l){var c=gr();return mk(c,Ft,l)}function mk(l,c,g){if(c=zm(l,c,fk)[0],l=Kh(pa)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var y=tu(c)}catch(F){throw F===Jl?Hh:F}else y=c;c=gr();var S=c.queue,_=S.dispatch;return g!==c.memoizedState&&(st.flags|=2048,io(9,{destroy:void 0},IB.bind(null,S,g),null)),[y,_,l]}function IB(l,c){l.action=c}function xk(l){var c=gr(),g=Ft;if(g!==null)return mk(c,g,l);gr(),c=c.memoizedState,g=gr();var y=g.queue.dispatch;return g.memoizedState=l,[c,y,!1]}function io(l,c,g,y){return l={tag:l,create:g,deps:y,inst:c,next:null},c=st.updateQueue,c===null&&(c=Qh(),st.updateQueue=c),g=c.lastEffect,g===null?c.lastEffect=l.next=l:(y=g.next,g.next=l,l.next=y,c.lastEffect=l),l}function yk(){return gr().memoizedState}function Jh(l,c,g,y){var S=gn();st.flags|=l,S.memoizedState=io(1|c,{destroy:void 0},g,y===void 0?null:y)}function ef(l,c,g,y){var S=gr();y=y===void 0?null:y;var _=S.memoizedState.inst;Ft!==null&&y!==null&&Lm(y,Ft.memoizedState.deps)?S.memoizedState=io(c,_,g,y):(st.flags|=l,S.memoizedState=io(1|c,_,g,y))}function bk(l,c){Jh(8390656,8,l,c)}function Hm(l,c){ef(2048,8,l,c)}function FB(l){st.flags|=4;var c=st.updateQueue;if(c===null)c=Qh(),st.updateQueue=c,c.events=[l];else{var g=c.events;g===null?c.events=[l]:g.push(l)}}function vk(l){var c=gr().memoizedState;return FB({ref:c,nextImpl:l}),function(){if((Mt&2)!==0)throw Error(n(440));return c.impl.apply(void 0,arguments)}}function wk(l,c){return ef(4,2,l,c)}function kk(l,c){return ef(4,4,l,c)}function Sk(l,c){if(typeof c=="function"){l=l();var g=c(l);return function(){typeof g=="function"?g():c(null)}}if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function Ck(l,c,g){g=g!=null?g.concat([l]):null,ef(4,4,Sk.bind(null,c,l),g)}function qm(){}function _k(l,c){var g=gr();c=c===void 0?null:c;var y=g.memoizedState;return c!==null&&Lm(c,y[1])?y[0]:(g.memoizedState=[l,c],l)}function Tk(l,c){var g=gr();c=c===void 0?null:c;var y=g.memoizedState;if(c!==null&&Lm(c,y[1]))return y[0];if(y=l(),Ys){Lt(!0);try{l()}finally{Lt(!1)}}return g.memoizedState=[y,c],y}function Um(l,c,g){return g===void 0||(fa&1073741824)!==0&&(bt&261930)===0?l.memoizedState=c:(l.memoizedState=g,l=ES(),st.lanes|=l,Za|=l,g)}function Ek(l,c,g,y){return Vn(g,c)?g:to.current!==null?(l=Um(l,g,y),Vn(l,c)||(vr=!0),l):(fa&42)===0||(fa&1073741824)!==0&&(bt&261930)===0?(vr=!0,l.memoizedState=g):(l=ES(),st.lanes|=l,Za|=l,c)}function Nk(l,c,g,y,S){var _=H.p;H.p=_!==0&&8>_?_:8;var F=R.T,X={};R.T=X,Ym(l,!1,c,g);try{var K=S(),ue=R.S;if(ue!==null&&ue(X,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var me=OB(K,y);ru(l,c,me,Zn(l))}else ru(l,c,y,Zn(l))}catch(ve){ru(l,c,{then:function(){},status:"rejected",reason:ve},Zn())}finally{H.p=_,F!==null&&X.types!==null&&(F.types=X.types),R.T=F}}function PB(){}function Vm(l,c,g,y){if(l.tag!==5)throw Error(n(476));var S=jk(l).queue;Nk(l,S,c,V,g===null?PB:function(){return Ak(l),g(y)})}function jk(l){var c=l.memoizedState;if(c!==null)return c;c={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:V},next:null};var g={};return c.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:g},next:null},l.memoizedState=c,l=l.alternate,l!==null&&(l.memoizedState=c),c}function Ak(l){var c=jk(l);c.next===null&&(c=l.alternate.memoizedState),ru(l,c.next.queue,{},Zn())}function Wm(){return Wr(bu)}function Mk(){return gr().memoizedState}function Lk(){return gr().memoizedState}function HB(l){for(var c=l.return;c!==null;){switch(c.tag){case 24:case 3:var g=Zn();l=Va(g);var y=Wa(c,l,g);y!==null&&(Dn(y,c,g),Zc(y,c,g)),c={cache:wm()},l.payload=c;return}c=c.return}}function qB(l,c,g){var y=Zn();g={lane:y,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},tf(l)?Rk(c,g):(g=um(l,c,g,y),g!==null&&(Dn(g,l,y),Ok(g,c,y)))}function Dk(l,c,g){var y=Zn();ru(l,c,g,y)}function ru(l,c,g,y){var S={lane:y,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(tf(l))Rk(c,S);else{var _=l.alternate;if(l.lanes===0&&(_===null||_.lanes===0)&&(_=c.lastRenderedReducer,_!==null))try{var F=c.lastRenderedState,X=_(F,g);if(S.hasEagerState=!0,S.eagerState=X,Vn(X,F))return Oh(l,c,S,0),Ut===null&&Rh(),!1}catch{}finally{}if(g=um(l,c,S,y),g!==null)return Dn(g,l,y),Ok(g,c,y),!0}return!1}function Ym(l,c,g,y){if(y={lane:2,revertLane:_x(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},tf(l)){if(c)throw Error(n(479))}else c=um(l,g,y,2),c!==null&&Dn(c,l,2)}function tf(l){var c=l.alternate;return l===st||c!==null&&c===st}function Rk(l,c){ro=Gh=!0;var g=l.pending;g===null?c.next=c:(c.next=g.next,g.next=c),l.pending=c}function Ok(l,c,g){if((g&4194048)!==0){var y=c.lanes;y&=l.pendingLanes,g|=y,c.lanes=g,Ir(l,g)}}var nu={readContext:Wr,use:Zh,useCallback:ur,useContext:ur,useEffect:ur,useImperativeHandle:ur,useLayoutEffect:ur,useInsertionEffect:ur,useMemo:ur,useReducer:ur,useRef:ur,useState:ur,useDebugValue:ur,useDeferredValue:ur,useTransition:ur,useSyncExternalStore:ur,useId:ur,useHostTransitionStatus:ur,useFormState:ur,useActionState:ur,useOptimistic:ur,useMemoCache:ur,useCacheRefresh:ur};nu.useEffectEvent=ur;var Bk={readContext:Wr,use:Zh,useCallback:function(l,c){return gn().memoizedState=[l,c===void 0?null:c],l},useContext:Wr,useEffect:bk,useImperativeHandle:function(l,c,g){g=g!=null?g.concat([l]):null,Jh(4194308,4,Sk.bind(null,c,l),g)},useLayoutEffect:function(l,c){return Jh(4194308,4,l,c)},useInsertionEffect:function(l,c){Jh(4,2,l,c)},useMemo:function(l,c){var g=gn();c=c===void 0?null:c;var y=l();if(Ys){Lt(!0);try{l()}finally{Lt(!1)}}return g.memoizedState=[y,c],y},useReducer:function(l,c,g){var y=gn();if(g!==void 0){var S=g(c);if(Ys){Lt(!0);try{g(c)}finally{Lt(!1)}}}else S=c;return y.memoizedState=y.baseState=S,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:S},y.queue=l,l=l.dispatch=qB.bind(null,st,l),[y.memoizedState,l]},useRef:function(l){var c=gn();return l={current:l},c.memoizedState=l},useState:function(l){l=Fm(l);var c=l.queue,g=Dk.bind(null,st,c);return c.dispatch=g,[l.memoizedState,g]},useDebugValue:qm,useDeferredValue:function(l,c){var g=gn();return Um(g,l,c)},useTransition:function(){var l=Fm(!1);return l=Nk.bind(null,st,l.queue,!0,!1),gn().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,c,g){var y=st,S=gn();if(kt){if(g===void 0)throw Error(n(407));g=g()}else{if(g=c(),Ut===null)throw Error(n(349));(bt&127)!==0||nk(y,c,g)}S.memoizedState=g;var _={value:g,getSnapshot:c};return S.queue=_,bk(ak.bind(null,y,_,l),[l]),y.flags|=2048,io(9,{destroy:void 0},ik.bind(null,y,_,g,c),null),g},useId:function(){var l=gn(),c=Ut.identifierPrefix;if(kt){var g=Fi,y=Ii;g=(y&~(1<<32-dt(y)-1)).toString(32)+g,c="_"+c+"R_"+g,g=Xh++,0<g&&(c+="H"+g.toString(32)),c+="_"}else g=BB++,c="_"+c+"r_"+g.toString(32)+"_";return l.memoizedState=c},useHostTransitionStatus:Wm,useFormState:pk,useActionState:pk,useOptimistic:function(l){var c=gn();c.memoizedState=c.baseState=l;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=g,c=Ym.bind(null,st,!0,g),g.dispatch=c,[l,c]},useMemoCache:$m,useCacheRefresh:function(){return gn().memoizedState=HB.bind(null,st)},useEffectEvent:function(l){var c=gn(),g={impl:l};return c.memoizedState=g,function(){if((Mt&2)!==0)throw Error(n(440));return g.impl.apply(void 0,arguments)}}},Gm={readContext:Wr,use:Zh,useCallback:_k,useContext:Wr,useEffect:Hm,useImperativeHandle:Ck,useInsertionEffect:wk,useLayoutEffect:kk,useMemo:Tk,useReducer:Kh,useRef:yk,useState:function(){return Kh(pa)},useDebugValue:qm,useDeferredValue:function(l,c){var g=gr();return Ek(g,Ft.memoizedState,l,c)},useTransition:function(){var l=Kh(pa)[0],c=gr().memoizedState;return[typeof l=="boolean"?l:tu(l),c]},useSyncExternalStore:rk,useId:Mk,useHostTransitionStatus:Wm,useFormState:gk,useActionState:gk,useOptimistic:function(l,c){var g=gr();return ok(g,Ft,l,c)},useMemoCache:$m,useCacheRefresh:Lk};Gm.useEffectEvent=vk;var $k={readContext:Wr,use:Zh,useCallback:_k,useContext:Wr,useEffect:Hm,useImperativeHandle:Ck,useInsertionEffect:wk,useLayoutEffect:kk,useMemo:Tk,useReducer:Im,useRef:yk,useState:function(){return Im(pa)},useDebugValue:qm,useDeferredValue:function(l,c){var g=gr();return Ft===null?Um(g,l,c):Ek(g,Ft.memoizedState,l,c)},useTransition:function(){var l=Im(pa)[0],c=gr().memoizedState;return[typeof l=="boolean"?l:tu(l),c]},useSyncExternalStore:rk,useId:Mk,useHostTransitionStatus:Wm,useFormState:xk,useActionState:xk,useOptimistic:function(l,c){var g=gr();return Ft!==null?ok(g,Ft,l,c):(g.baseState=l,[l,g.queue.dispatch])},useMemoCache:$m,useCacheRefresh:Lk};$k.useEffectEvent=vk;function Xm(l,c,g,y){c=l.memoizedState,g=g(y,c),g=g==null?c:p({},c,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}var Qm={enqueueSetState:function(l,c,g){l=l._reactInternals;var y=Zn(),S=Va(y);S.payload=c,g!=null&&(S.callback=g),c=Wa(l,S,y),c!==null&&(Dn(c,l,y),Zc(c,l,y))},enqueueReplaceState:function(l,c,g){l=l._reactInternals;var y=Zn(),S=Va(y);S.tag=1,S.payload=c,g!=null&&(S.callback=g),c=Wa(l,S,y),c!==null&&(Dn(c,l,y),Zc(c,l,y))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var g=Zn(),y=Va(g);y.tag=2,c!=null&&(y.callback=c),c=Wa(l,y,g),c!==null&&(Dn(c,l,g),Zc(c,l,g))}};function zk(l,c,g,y,S,_,F){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(y,_,F):c.prototype&&c.prototype.isPureReactComponent?!qc(g,y)||!qc(S,_):!0}function Ik(l,c,g,y){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(g,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(g,y),c.state!==l&&Qm.enqueueReplaceState(c,c.state,null)}function Gs(l,c){var g=c;if("ref"in c){g={};for(var y in c)y!=="ref"&&(g[y]=c[y])}if(l=l.defaultProps){g===c&&(g=p({},g));for(var S in l)g[S]===void 0&&(g[S]=l[S])}return g}function Fk(l){Dh(l)}function Pk(l){console.error(l)}function Hk(l){Dh(l)}function rf(l,c){try{var g=l.onUncaughtError;g(c.value,{componentStack:c.stack})}catch(y){setTimeout(function(){throw y})}}function qk(l,c,g){try{var y=l.onCaughtError;y(g.value,{componentStack:g.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function Zm(l,c,g){return g=Va(g),g.tag=3,g.payload={element:null},g.callback=function(){rf(l,c)},g}function Uk(l){return l=Va(l),l.tag=3,l}function Vk(l,c,g,y){var S=g.type.getDerivedStateFromError;if(typeof S=="function"){var _=y.value;l.payload=function(){return S(_)},l.callback=function(){qk(c,g,y)}}var F=g.stateNode;F!==null&&typeof F.componentDidCatch=="function"&&(l.callback=function(){qk(c,g,y),typeof S!="function"&&(Ka===null?Ka=new Set([this]):Ka.add(this));var X=y.stack;this.componentDidCatch(y.value,{componentStack:X!==null?X:""})})}function UB(l,c,g,y,S){if(g.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(c=g.alternate,c!==null&&Ql(c,g,S,!0),g=Yn.current,g!==null){switch(g.tag){case 31:case 13:return ui===null?gf():g.alternate===null&&dr===0&&(dr=3),g.flags&=-257,g.flags|=65536,g.lanes=S,y===qh?g.flags|=16384:(c=g.updateQueue,c===null?g.updateQueue=new Set([y]):c.add(y),kx(l,y,S)),!1;case 22:return g.flags|=65536,y===qh?g.flags|=16384:(c=g.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([y])},g.updateQueue=c):(g=c.retryQueue,g===null?c.retryQueue=new Set([y]):g.add(y)),kx(l,y,S)),!1}throw Error(n(435,g.tag))}return kx(l,y,S),gf(),!1}if(kt)return c=Yn.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=S,y!==mm&&(l=Error(n(422),{cause:y}),Wc(si(l,g)))):(y!==mm&&(c=Error(n(423),{cause:y}),Wc(si(c,g))),l=l.current.alternate,l.flags|=65536,S&=-S,l.lanes|=S,y=si(y,g),S=Zm(l.stateNode,y,S),Em(l,S),dr!==4&&(dr=2)),!1;var _=Error(n(520),{cause:y});if(_=si(_,g),du===null?du=[_]:du.push(_),dr!==4&&(dr=2),c===null)return!0;y=si(y,g),g=c;do{switch(g.tag){case 3:return g.flags|=65536,l=S&-S,g.lanes|=l,l=Zm(g.stateNode,y,l),Em(g,l),!1;case 1:if(c=g.type,_=g.stateNode,(g.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Ka===null||!Ka.has(_))))return g.flags|=65536,S&=-S,g.lanes|=S,S=Uk(S),Vk(S,l,g,y),Em(g,S),!1}g=g.return}while(g!==null);return!1}var Km=Error(n(461)),vr=!1;function Yr(l,c,g,y){c.child=l===null?Xw(c,null,g,y):Ws(c,l.child,g,y)}function Wk(l,c,g,y,S){g=g.render;var _=c.ref;if("ref"in y){var F={};for(var X in y)X!=="ref"&&(F[X]=y[X])}else F=y;return Hs(c),y=Dm(l,c,g,F,_,S),X=Rm(),l!==null&&!vr?(Om(l,c,S),ga(l,c,S)):(kt&&X&&pm(c),c.flags|=1,Yr(l,c,y,S),c.child)}function Yk(l,c,g,y,S){if(l===null){var _=g.type;return typeof _=="function"&&!dm(_)&&_.defaultProps===void 0&&g.compare===null?(c.tag=15,c.type=_,Gk(l,c,_,y,S)):(l=$h(g.type,null,y,c,c.mode,S),l.ref=c.ref,l.return=c,c.child=l)}if(_=l.child,!sx(l,S)){var F=_.memoizedProps;if(g=g.compare,g=g!==null?g:qc,g(F,y)&&l.ref===c.ref)return ga(l,c,S)}return c.flags|=1,l=ca(_,y),l.ref=c.ref,l.return=c,c.child=l}function Gk(l,c,g,y,S){if(l!==null){var _=l.memoizedProps;if(qc(_,y)&&l.ref===c.ref)if(vr=!1,c.pendingProps=y=_,sx(l,S))(l.flags&131072)!==0&&(vr=!0);else return c.lanes=l.lanes,ga(l,c,S)}return Jm(l,c,g,y,S)}function Xk(l,c,g,y){var S=y.children,_=l!==null?l.memoizedState:null;if(l===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((c.flags&128)!==0){if(_=_!==null?_.baseLanes|g:g,l!==null){for(y=c.child=l.child,S=0;y!==null;)S=S|y.lanes|y.childLanes,y=y.sibling;y=S&~_}else y=0,c.child=null;return Qk(l,c,_,g,y)}if((g&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},l!==null&&Ph(c,_!==null?_.cachePool:null),_!==null?Kw(c,_):jm(),Jw(c);else return y=c.lanes=536870912,Qk(l,c,_!==null?_.baseLanes|g:g,g,y)}else _!==null?(Ph(c,_.cachePool),Kw(c,_),Ga(),c.memoizedState=null):(l!==null&&Ph(c,null),jm(),Ga());return Yr(l,c,S,g),c.child}function iu(l,c){return l!==null&&l.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function Qk(l,c,g,y,S){var _=Sm();return _=_===null?null:{parent:yr._currentValue,pool:_},c.memoizedState={baseLanes:g,cachePool:_},l!==null&&Ph(c,null),jm(),Jw(c),l!==null&&Ql(l,c,y,!0),c.childLanes=S,null}function nf(l,c){return c=sf({mode:c.mode,children:c.children},l.mode),c.ref=l.ref,l.child=c,c.return=l,c}function Zk(l,c,g){return Ws(c,l.child,null,g),l=nf(c,c.pendingProps),l.flags|=2,Gn(c),c.memoizedState=null,l}function VB(l,c,g){var y=c.pendingProps,S=(c.flags&128)!==0;if(c.flags&=-129,l===null){if(kt){if(y.mode==="hidden")return l=nf(c,y),c.lanes=536870912,iu(null,l);if(Mm(c),(l=Jt)?(l=cC(l,ci),l=l!==null&&l.data==="&"?l:null,l!==null&&(c.memoizedState={dehydrated:l,treeContext:Fa!==null?{id:Ii,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},g=Rw(l),g.return=c,c.child=g,Vr=c,Jt=null)):l=null,l===null)throw Ha(c);return c.lanes=536870912,null}return nf(c,y)}var _=l.memoizedState;if(_!==null){var F=_.dehydrated;if(Mm(c),S)if(c.flags&256)c.flags&=-257,c=Zk(l,c,g);else if(c.memoizedState!==null)c.child=l.child,c.flags|=128,c=null;else throw Error(n(558));else if(vr||Ql(l,c,g,!1),S=(g&l.childLanes)!==0,vr||S){if(y=Ut,y!==null&&(F=en(y,g),F!==0&&F!==_.retryLane))throw _.retryLane=F,zs(l,F),Dn(y,l,F),Km;gf(),c=Zk(l,c,g)}else l=_.treeContext,Jt=di(F.nextSibling),Vr=c,kt=!0,Pa=null,ci=!1,l!==null&&$w(c,l),c=nf(c,y),c.flags|=4096;return c}return l=ca(l.child,{mode:y.mode,children:y.children}),l.ref=c.ref,c.child=l,l.return=c,l}function af(l,c){var g=c.ref;if(g===null)l!==null&&l.ref!==null&&(c.flags|=4194816);else{if(typeof g!="function"&&typeof g!="object")throw Error(n(284));(l===null||l.ref!==g)&&(c.flags|=4194816)}}function Jm(l,c,g,y,S){return Hs(c),g=Dm(l,c,g,y,void 0,S),y=Rm(),l!==null&&!vr?(Om(l,c,S),ga(l,c,S)):(kt&&y&&pm(c),c.flags|=1,Yr(l,c,g,S),c.child)}function Kk(l,c,g,y,S,_){return Hs(c),c.updateQueue=null,g=tk(c,y,g,S),ek(l),y=Rm(),l!==null&&!vr?(Om(l,c,_),ga(l,c,_)):(kt&&y&&pm(c),c.flags|=1,Yr(l,c,g,_),c.child)}function Jk(l,c,g,y,S){if(Hs(c),c.stateNode===null){var _=Wl,F=g.contextType;typeof F=="object"&&F!==null&&(_=Wr(F)),_=new g(y,_),c.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Qm,c.stateNode=_,_._reactInternals=c,_=c.stateNode,_.props=y,_.state=c.memoizedState,_.refs={},_m(c),F=g.contextType,_.context=typeof F=="object"&&F!==null?Wr(F):Wl,_.state=c.memoizedState,F=g.getDerivedStateFromProps,typeof F=="function"&&(Xm(c,g,F,y),_.state=c.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(F=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),F!==_.state&&Qm.enqueueReplaceState(_,_.state,null),Jc(c,y,_,S),Kc(),_.state=c.memoizedState),typeof _.componentDidMount=="function"&&(c.flags|=4194308),y=!0}else if(l===null){_=c.stateNode;var X=c.memoizedProps,K=Gs(g,X);_.props=K;var ue=_.context,me=g.contextType;F=Wl,typeof me=="object"&&me!==null&&(F=Wr(me));var ve=g.getDerivedStateFromProps;me=typeof ve=="function"||typeof _.getSnapshotBeforeUpdate=="function",X=c.pendingProps!==X,me||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(X||ue!==F)&&Ik(c,_,y,F),Ua=!1;var he=c.memoizedState;_.state=he,Jc(c,y,_,S),Kc(),ue=c.memoizedState,X||he!==ue||Ua?(typeof ve=="function"&&(Xm(c,g,ve,y),ue=c.memoizedState),(K=Ua||zk(c,g,K,y,he,ue,F))?(me||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(c.flags|=4194308)):(typeof _.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=ue),_.props=y,_.state=ue,_.context=F,y=K):(typeof _.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{_=c.stateNode,Tm(l,c),F=c.memoizedProps,me=Gs(g,F),_.props=me,ve=c.pendingProps,he=_.context,ue=g.contextType,K=Wl,typeof ue=="object"&&ue!==null&&(K=Wr(ue)),X=g.getDerivedStateFromProps,(ue=typeof X=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(F!==ve||he!==K)&&Ik(c,_,y,K),Ua=!1,he=c.memoizedState,_.state=he,Jc(c,y,_,S),Kc();var pe=c.memoizedState;F!==ve||he!==pe||Ua||l!==null&&l.dependencies!==null&&Ih(l.dependencies)?(typeof X=="function"&&(Xm(c,g,X,y),pe=c.memoizedState),(me=Ua||zk(c,g,me,y,he,pe,K)||l!==null&&l.dependencies!==null&&Ih(l.dependencies))?(ue||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(y,pe,K),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(y,pe,K)),typeof _.componentDidUpdate=="function"&&(c.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof _.componentDidUpdate!="function"||F===l.memoizedProps&&he===l.memoizedState||(c.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||F===l.memoizedProps&&he===l.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=pe),_.props=y,_.state=pe,_.context=K,y=me):(typeof _.componentDidUpdate!="function"||F===l.memoizedProps&&he===l.memoizedState||(c.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||F===l.memoizedProps&&he===l.memoizedState||(c.flags|=1024),y=!1)}return _=y,af(l,c),y=(c.flags&128)!==0,_||y?(_=c.stateNode,g=y&&typeof g.getDerivedStateFromError!="function"?null:_.render(),c.flags|=1,l!==null&&y?(c.child=Ws(c,l.child,null,S),c.child=Ws(c,null,g,S)):Yr(l,c,g,S),c.memoizedState=_.state,l=c.child):l=ga(l,c,S),l}function eS(l,c,g,y){return Fs(),c.flags|=256,Yr(l,c,g,y),c.child}var ex={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tx(l){return{baseLanes:l,cachePool:qw()}}function rx(l,c,g){return l=l!==null?l.childLanes&~g:0,c&&(l|=Qn),l}function tS(l,c,g){var y=c.pendingProps,S=!1,_=(c.flags&128)!==0,F;if((F=_)||(F=l!==null&&l.memoizedState===null?!1:(pr.current&2)!==0),F&&(S=!0,c.flags&=-129),F=(c.flags&32)!==0,c.flags&=-33,l===null){if(kt){if(S?Ya(c):Ga(),(l=Jt)?(l=cC(l,ci),l=l!==null&&l.data!=="&"?l:null,l!==null&&(c.memoizedState={dehydrated:l,treeContext:Fa!==null?{id:Ii,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},g=Rw(l),g.return=c,c.child=g,Vr=c,Jt=null)):l=null,l===null)throw Ha(c);return zx(l)?c.lanes=32:c.lanes=536870912,null}var X=y.children;return y=y.fallback,S?(Ga(),S=c.mode,X=sf({mode:"hidden",children:X},S),y=Is(y,S,g,null),X.return=c,y.return=c,X.sibling=y,c.child=X,y=c.child,y.memoizedState=tx(g),y.childLanes=rx(l,F,g),c.memoizedState=ex,iu(null,y)):(Ya(c),nx(c,X))}var K=l.memoizedState;if(K!==null&&(X=K.dehydrated,X!==null)){if(_)c.flags&256?(Ya(c),c.flags&=-257,c=ix(l,c,g)):c.memoizedState!==null?(Ga(),c.child=l.child,c.flags|=128,c=null):(Ga(),X=y.fallback,S=c.mode,y=sf({mode:"visible",children:y.children},S),X=Is(X,S,g,null),X.flags|=2,y.return=c,X.return=c,y.sibling=X,c.child=y,Ws(c,l.child,null,g),y=c.child,y.memoizedState=tx(g),y.childLanes=rx(l,F,g),c.memoizedState=ex,c=iu(null,y));else if(Ya(c),zx(X)){if(F=X.nextSibling&&X.nextSibling.dataset,F)var ue=F.dgst;F=ue,y=Error(n(419)),y.stack="",y.digest=F,Wc({value:y,source:null,stack:null}),c=ix(l,c,g)}else if(vr||Ql(l,c,g,!1),F=(g&l.childLanes)!==0,vr||F){if(F=Ut,F!==null&&(y=en(F,g),y!==0&&y!==K.retryLane))throw K.retryLane=y,zs(l,y),Dn(F,l,y),Km;$x(X)||gf(),c=ix(l,c,g)}else $x(X)?(c.flags|=192,c.child=l.child,c=null):(l=K.treeContext,Jt=di(X.nextSibling),Vr=c,kt=!0,Pa=null,ci=!1,l!==null&&$w(c,l),c=nx(c,y.children),c.flags|=4096);return c}return S?(Ga(),X=y.fallback,S=c.mode,K=l.child,ue=K.sibling,y=ca(K,{mode:"hidden",children:y.children}),y.subtreeFlags=K.subtreeFlags&65011712,ue!==null?X=ca(ue,X):(X=Is(X,S,g,null),X.flags|=2),X.return=c,y.return=c,y.sibling=X,c.child=y,iu(null,y),y=c.child,X=l.child.memoizedState,X===null?X=tx(g):(S=X.cachePool,S!==null?(K=yr._currentValue,S=S.parent!==K?{parent:K,pool:K}:S):S=qw(),X={baseLanes:X.baseLanes|g,cachePool:S}),y.memoizedState=X,y.childLanes=rx(l,F,g),c.memoizedState=ex,iu(l.child,y)):(Ya(c),g=l.child,l=g.sibling,g=ca(g,{mode:"visible",children:y.children}),g.return=c,g.sibling=null,l!==null&&(F=c.deletions,F===null?(c.deletions=[l],c.flags|=16):F.push(l)),c.child=g,c.memoizedState=null,g)}function nx(l,c){return c=sf({mode:"visible",children:c},l.mode),c.return=l,l.child=c}function sf(l,c){return l=Wn(22,l,null,c),l.lanes=0,l}function ix(l,c,g){return Ws(c,l.child,null,g),l=nx(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function rS(l,c,g){l.lanes|=c;var y=l.alternate;y!==null&&(y.lanes|=c),bm(l.return,c,g)}function ax(l,c,g,y,S,_){var F=l.memoizedState;F===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:g,tailMode:S,treeForkCount:_}:(F.isBackwards=c,F.rendering=null,F.renderingStartTime=0,F.last=y,F.tail=g,F.tailMode=S,F.treeForkCount=_)}function nS(l,c,g){var y=c.pendingProps,S=y.revealOrder,_=y.tail;y=y.children;var F=pr.current,X=(F&2)!==0;if(X?(F=F&1|2,c.flags|=128):F&=1,q(pr,F),Yr(l,c,y,g),y=kt?Vc:0,!X&&l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&rS(l,g,c);else if(l.tag===19)rS(l,g,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(S){case"forwards":for(g=c.child,S=null;g!==null;)l=g.alternate,l!==null&&Yh(l)===null&&(S=g),g=g.sibling;g=S,g===null?(S=c.child,c.child=null):(S=g.sibling,g.sibling=null),ax(c,!1,S,g,_,y);break;case"backwards":case"unstable_legacy-backwards":for(g=null,S=c.child,c.child=null;S!==null;){if(l=S.alternate,l!==null&&Yh(l)===null){c.child=S;break}l=S.sibling,S.sibling=g,g=S,S=l}ax(c,!0,g,null,_,y);break;case"together":ax(c,!1,null,null,void 0,y);break;default:c.memoizedState=null}return c.child}function ga(l,c,g){if(l!==null&&(c.dependencies=l.dependencies),Za|=c.lanes,(g&c.childLanes)===0)if(l!==null){if(Ql(l,c,g,!1),(g&c.childLanes)===0)return null}else return null;if(l!==null&&c.child!==l.child)throw Error(n(153));if(c.child!==null){for(l=c.child,g=ca(l,l.pendingProps),c.child=g,g.return=c;l.sibling!==null;)l=l.sibling,g=g.sibling=ca(l,l.pendingProps),g.return=c;g.sibling=null}return c.child}function sx(l,c){return(l.lanes&c)!==0?!0:(l=l.dependencies,!!(l!==null&&Ih(l)))}function WB(l,c,g){switch(c.tag){case 3:ne(c,c.stateNode.containerInfo),qa(c,yr,l.memoizedState.cache),Fs();break;case 27:case 5:fe(c);break;case 4:ne(c,c.stateNode.containerInfo);break;case 10:qa(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Mm(c),null;break;case 13:var y=c.memoizedState;if(y!==null)return y.dehydrated!==null?(Ya(c),c.flags|=128,null):(g&c.child.childLanes)!==0?tS(l,c,g):(Ya(c),l=ga(l,c,g),l!==null?l.sibling:null);Ya(c);break;case 19:var S=(l.flags&128)!==0;if(y=(g&c.childLanes)!==0,y||(Ql(l,c,g,!1),y=(g&c.childLanes)!==0),S){if(y)return nS(l,c,g);c.flags|=128}if(S=c.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),q(pr,pr.current),y)break;return null;case 22:return c.lanes=0,Xk(l,c,g,c.pendingProps);case 24:qa(c,yr,l.memoizedState.cache)}return ga(l,c,g)}function iS(l,c,g){if(l!==null)if(l.memoizedProps!==c.pendingProps)vr=!0;else{if(!sx(l,g)&&(c.flags&128)===0)return vr=!1,WB(l,c,g);vr=(l.flags&131072)!==0}else vr=!1,kt&&(c.flags&1048576)!==0&&Bw(c,Vc,c.index);switch(c.lanes=0,c.tag){case 16:e:{var y=c.pendingProps;if(l=Us(c.elementType),c.type=l,typeof l=="function")dm(l)?(y=Gs(l,y),c.tag=1,c=Jk(null,c,l,y,g)):(c.tag=0,c=Jm(null,c,l,y,g));else{if(l!=null){var S=l.$$typeof;if(S===j){c.tag=11,c=Wk(null,c,l,y,g);break e}else if(S===M){c.tag=14,c=Yk(null,c,l,y,g);break e}}throw c=B(l)||l,Error(n(306,c,""))}}return c;case 0:return Jm(l,c,c.type,c.pendingProps,g);case 1:return y=c.type,S=Gs(y,c.pendingProps),Jk(l,c,y,S,g);case 3:e:{if(ne(c,c.stateNode.containerInfo),l===null)throw Error(n(387));y=c.pendingProps;var _=c.memoizedState;S=_.element,Tm(l,c),Jc(c,y,null,g);var F=c.memoizedState;if(y=F.cache,qa(c,yr,y),y!==_.cache&&vm(c,[yr],g,!0),Kc(),y=F.element,_.isDehydrated)if(_={element:y,isDehydrated:!1,cache:F.cache},c.updateQueue.baseState=_,c.memoizedState=_,c.flags&256){c=eS(l,c,y,g);break e}else if(y!==S){S=si(Error(n(424)),c),Wc(S),c=eS(l,c,y,g);break e}else{switch(l=c.stateNode.containerInfo,l.nodeType){case 9:l=l.body;break;default:l=l.nodeName==="HTML"?l.ownerDocument.body:l}for(Jt=di(l.firstChild),Vr=c,kt=!0,Pa=null,ci=!0,g=Xw(c,null,y,g),c.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling}else{if(Fs(),y===S){c=ga(l,c,g);break e}Yr(l,c,y,g)}c=c.child}return c;case 26:return af(l,c),l===null?(g=gC(c.type,null,c.pendingProps,null))?c.memoizedState=g:kt||(g=c.type,l=c.pendingProps,y=kf(J.current).createElement(g),y[cr]=c,y[Yt]=l,Gr(y,g,l),lt(y),c.stateNode=y):c.memoizedState=gC(c.type,l.memoizedProps,c.pendingProps,l.memoizedState),null;case 27:return fe(c),l===null&&kt&&(y=c.stateNode=hC(c.type,c.pendingProps,J.current),Vr=c,ci=!0,S=Jt,rs(c.type)?(Ix=S,Jt=di(y.firstChild)):Jt=S),Yr(l,c,c.pendingProps.children,g),af(l,c),l===null&&(c.flags|=4194304),c.child;case 5:return l===null&&kt&&((S=y=Jt)&&(y=k8(y,c.type,c.pendingProps,ci),y!==null?(c.stateNode=y,Vr=c,Jt=di(y.firstChild),ci=!1,S=!0):S=!1),S||Ha(c)),fe(c),S=c.type,_=c.pendingProps,F=l!==null?l.memoizedProps:null,y=_.children,Rx(S,_)?y=null:F!==null&&Rx(S,F)&&(c.flags|=32),c.memoizedState!==null&&(S=Dm(l,c,$B,null,null,g),bu._currentValue=S),af(l,c),Yr(l,c,y,g),c.child;case 6:return l===null&&kt&&((l=g=Jt)&&(g=S8(g,c.pendingProps,ci),g!==null?(c.stateNode=g,Vr=c,Jt=null,l=!0):l=!1),l||Ha(c)),null;case 13:return tS(l,c,g);case 4:return ne(c,c.stateNode.containerInfo),y=c.pendingProps,l===null?c.child=Ws(c,null,y,g):Yr(l,c,y,g),c.child;case 11:return Wk(l,c,c.type,c.pendingProps,g);case 7:return Yr(l,c,c.pendingProps,g),c.child;case 8:return Yr(l,c,c.pendingProps.children,g),c.child;case 12:return Yr(l,c,c.pendingProps.children,g),c.child;case 10:return y=c.pendingProps,qa(c,c.type,y.value),Yr(l,c,y.children,g),c.child;case 9:return S=c.type._context,y=c.pendingProps.children,Hs(c),S=Wr(S),y=y(S),c.flags|=1,Yr(l,c,y,g),c.child;case 14:return Yk(l,c,c.type,c.pendingProps,g);case 15:return Gk(l,c,c.type,c.pendingProps,g);case 19:return nS(l,c,g);case 31:return VB(l,c,g);case 22:return Xk(l,c,g,c.pendingProps);case 24:return Hs(c),y=Wr(yr),l===null?(S=Sm(),S===null&&(S=Ut,_=wm(),S.pooledCache=_,_.refCount++,_!==null&&(S.pooledCacheLanes|=g),S=_),c.memoizedState={parent:y,cache:S},_m(c),qa(c,yr,S)):((l.lanes&g)!==0&&(Tm(l,c),Jc(c,null,null,g),Kc()),S=l.memoizedState,_=c.memoizedState,S.parent!==y?(S={parent:y,cache:y},c.memoizedState=S,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=S),qa(c,yr,y)):(y=_.cache,qa(c,yr,y),y!==S.cache&&vm(c,[yr],g,!0))),Yr(l,c,c.pendingProps.children,g),c.child;case 29:throw c.pendingProps}throw Error(n(156,c.tag))}function ma(l){l.flags|=4}function lx(l,c,g,y,S){if((c=(l.mode&32)!==0)&&(c=!1),c){if(l.flags|=16777216,(S&335544128)===S)if(l.stateNode.complete)l.flags|=8192;else if(MS())l.flags|=8192;else throw Vs=qh,Cm}else l.flags&=-16777217}function aS(l,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!vC(c))if(MS())l.flags|=8192;else throw Vs=qh,Cm}function lf(l,c){c!==null&&(l.flags|=4),l.flags&16384&&(c=l.tag!==22?Qt():536870912,l.lanes|=c,oo|=c)}function au(l,c){if(!kt)switch(l.tailMode){case"hidden":c=l.tail;for(var g=null;c!==null;)c.alternate!==null&&(g=c),c=c.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var y=null;g!==null;)g.alternate!==null&&(y=g),g=g.sibling;y===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:y.sibling=null}}function er(l){var c=l.alternate!==null&&l.alternate.child===l.child,g=0,y=0;if(c)for(var S=l.child;S!==null;)g|=S.lanes|S.childLanes,y|=S.subtreeFlags&65011712,y|=S.flags&65011712,S.return=l,S=S.sibling;else for(S=l.child;S!==null;)g|=S.lanes|S.childLanes,y|=S.subtreeFlags,y|=S.flags,S.return=l,S=S.sibling;return l.subtreeFlags|=y,l.childLanes=g,c}function YB(l,c,g){var y=c.pendingProps;switch(gm(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return er(c),null;case 1:return er(c),null;case 3:return g=c.stateNode,y=null,l!==null&&(y=l.memoizedState.cache),c.memoizedState.cache!==y&&(c.flags|=2048),ha(yr),oe(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(l===null||l.child===null)&&(Xl(c)?ma(c):l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,xm())),er(c),null;case 26:var S=c.type,_=c.memoizedState;return l===null?(ma(c),_!==null?(er(c),aS(c,_)):(er(c),lx(c,S,null,y,g))):_?_!==l.memoizedState?(ma(c),er(c),aS(c,_)):(er(c),c.flags&=-16777217):(l=l.memoizedProps,l!==y&&ma(c),er(c),lx(c,S,l,y,g)),null;case 27:if(xe(c),g=J.current,S=c.type,l!==null&&c.stateNode!=null)l.memoizedProps!==y&&ma(c);else{if(!y){if(c.stateNode===null)throw Error(n(166));return er(c),null}l=Z.current,Xl(c)?zw(c):(l=hC(S,y,g),c.stateNode=l,ma(c))}return er(c),null;case 5:if(xe(c),S=c.type,l!==null&&c.stateNode!=null)l.memoizedProps!==y&&ma(c);else{if(!y){if(c.stateNode===null)throw Error(n(166));return er(c),null}if(_=Z.current,Xl(c))zw(c);else{var F=kf(J.current);switch(_){case 1:_=F.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:_=F.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":_=F.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":_=F.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":_=F.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof y.is=="string"?F.createElement("select",{is:y.is}):F.createElement("select"),y.multiple?_.multiple=!0:y.size&&(_.size=y.size);break;default:_=typeof y.is=="string"?F.createElement(S,{is:y.is}):F.createElement(S)}}_[cr]=c,_[Yt]=y;e:for(F=c.child;F!==null;){if(F.tag===5||F.tag===6)_.appendChild(F.stateNode);else if(F.tag!==4&&F.tag!==27&&F.child!==null){F.child.return=F,F=F.child;continue}if(F===c)break e;for(;F.sibling===null;){if(F.return===null||F.return===c)break e;F=F.return}F.sibling.return=F.return,F=F.sibling}c.stateNode=_;e:switch(Gr(_,S,y),S){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&ma(c)}}return er(c),lx(c,c.type,l===null?null:l.memoizedProps,c.pendingProps,g),null;case 6:if(l&&c.stateNode!=null)l.memoizedProps!==y&&ma(c);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(l=J.current,Xl(c)){if(l=c.stateNode,g=c.memoizedProps,y=null,S=Vr,S!==null)switch(S.tag){case 27:case 5:y=S.memoizedProps}l[cr]=c,l=!!(l.nodeValue===g||y!==null&&y.suppressHydrationWarning===!0||tC(l.nodeValue,g)),l||Ha(c,!0)}else l=kf(l).createTextNode(y),l[cr]=c,c.stateNode=l}return er(c),null;case 31:if(g=c.memoizedState,l===null||l.memoizedState!==null){if(y=Xl(c),g!==null){if(l===null){if(!y)throw Error(n(318));if(l=c.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(557));l[cr]=c}else Fs(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;er(c),l=!1}else g=xm(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),l=!0;if(!l)return c.flags&256?(Gn(c),c):(Gn(c),null);if((c.flags&128)!==0)throw Error(n(558))}return er(c),null;case 13:if(y=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(S=Xl(c),y!==null&&y.dehydrated!==null){if(l===null){if(!S)throw Error(n(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(n(317));S[cr]=c}else Fs(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;er(c),S=!1}else S=xm(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=S),S=!0;if(!S)return c.flags&256?(Gn(c),c):(Gn(c),null)}return Gn(c),(c.flags&128)!==0?(c.lanes=g,c):(g=y!==null,l=l!==null&&l.memoizedState!==null,g&&(y=c.child,S=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(S=y.alternate.memoizedState.cachePool.pool),_=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(_=y.memoizedState.cachePool.pool),_!==S&&(y.flags|=2048)),g!==l&&g&&(c.child.flags|=8192),lf(c,c.updateQueue),er(c),null);case 4:return oe(),l===null&&jx(c.stateNode.containerInfo),er(c),null;case 10:return ha(c.type),er(c),null;case 19:if(G(pr),y=c.memoizedState,y===null)return er(c),null;if(S=(c.flags&128)!==0,_=y.rendering,_===null)if(S)au(y,!1);else{if(dr!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(_=Yh(l),_!==null){for(c.flags|=128,au(y,!1),l=_.updateQueue,c.updateQueue=l,lf(c,l),c.subtreeFlags=0,l=g,g=c.child;g!==null;)Dw(g,l),g=g.sibling;return q(pr,pr.current&1|2),kt&&ua(c,y.treeForkCount),c.child}l=l.sibling}y.tail!==null&&_e()>hf&&(c.flags|=128,S=!0,au(y,!1),c.lanes=4194304)}else{if(!S)if(l=Yh(_),l!==null){if(c.flags|=128,S=!0,l=l.updateQueue,c.updateQueue=l,lf(c,l),au(y,!0),y.tail===null&&y.tailMode==="hidden"&&!_.alternate&&!kt)return er(c),null}else 2*_e()-y.renderingStartTime>hf&&g!==536870912&&(c.flags|=128,S=!0,au(y,!1),c.lanes=4194304);y.isBackwards?(_.sibling=c.child,c.child=_):(l=y.last,l!==null?l.sibling=_:c.child=_,y.last=_)}return y.tail!==null?(l=y.tail,y.rendering=l,y.tail=l.sibling,y.renderingStartTime=_e(),l.sibling=null,g=pr.current,q(pr,S?g&1|2:g&1),kt&&ua(c,y.treeForkCount),l):(er(c),null);case 22:case 23:return Gn(c),Am(),y=c.memoizedState!==null,l!==null?l.memoizedState!==null!==y&&(c.flags|=8192):y&&(c.flags|=8192),y?(g&536870912)!==0&&(c.flags&128)===0&&(er(c),c.subtreeFlags&6&&(c.flags|=8192)):er(c),g=c.updateQueue,g!==null&&lf(c,g.retryQueue),g=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==g&&(c.flags|=2048),l!==null&&G(qs),null;case 24:return g=null,l!==null&&(g=l.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),ha(yr),er(c),null;case 25:return null;case 30:return null}throw Error(n(156,c.tag))}function GB(l,c){switch(gm(c),c.tag){case 1:return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return ha(yr),oe(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 26:case 27:case 5:return xe(c),null;case 31:if(c.memoizedState!==null){if(Gn(c),c.alternate===null)throw Error(n(340));Fs()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 13:if(Gn(c),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Fs()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return G(pr),null;case 4:return oe(),null;case 10:return ha(c.type),null;case 22:case 23:return Gn(c),Am(),l!==null&&G(qs),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 24:return ha(yr),null;case 25:return null;default:return null}}function sS(l,c){switch(gm(c),c.tag){case 3:ha(yr),oe();break;case 26:case 27:case 5:xe(c);break;case 4:oe();break;case 31:c.memoizedState!==null&&Gn(c);break;case 13:Gn(c);break;case 19:G(pr);break;case 10:ha(c.type);break;case 22:case 23:Gn(c),Am(),l!==null&&G(qs);break;case 24:ha(yr)}}function su(l,c){try{var g=c.updateQueue,y=g!==null?g.lastEffect:null;if(y!==null){var S=y.next;g=S;do{if((g.tag&l)===l){y=void 0;var _=g.create,F=g.inst;y=_(),F.destroy=y}g=g.next}while(g!==S)}}catch(X){zt(c,c.return,X)}}function Xa(l,c,g){try{var y=c.updateQueue,S=y!==null?y.lastEffect:null;if(S!==null){var _=S.next;y=_;do{if((y.tag&l)===l){var F=y.inst,X=F.destroy;if(X!==void 0){F.destroy=void 0,S=c;var K=g,ue=X;try{ue()}catch(me){zt(S,K,me)}}}y=y.next}while(y!==_)}}catch(me){zt(c,c.return,me)}}function lS(l){var c=l.updateQueue;if(c!==null){var g=l.stateNode;try{Zw(c,g)}catch(y){zt(l,l.return,y)}}}function oS(l,c,g){g.props=Gs(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(y){zt(l,c,y)}}function lu(l,c){try{var g=l.ref;if(g!==null){switch(l.tag){case 26:case 27:case 5:var y=l.stateNode;break;case 30:y=l.stateNode;break;default:y=l.stateNode}typeof g=="function"?l.refCleanup=g(y):g.current=y}}catch(S){zt(l,c,S)}}function Pi(l,c){var g=l.ref,y=l.refCleanup;if(g!==null)if(typeof y=="function")try{y()}catch(S){zt(l,c,S)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(S){zt(l,c,S)}else g.current=null}function cS(l){var c=l.type,g=l.memoizedProps,y=l.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":g.autoFocus&&y.focus();break e;case"img":g.src?y.src=g.src:g.srcSet&&(y.srcset=g.srcSet)}}catch(S){zt(l,l.return,S)}}function ox(l,c,g){try{var y=l.stateNode;m8(y,l.type,g,c),y[Yt]=c}catch(S){zt(l,l.return,S)}}function uS(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&rs(l.type)||l.tag===4}function cx(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||uS(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&rs(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function ux(l,c,g){var y=l.tag;if(y===5||y===6)l=l.stateNode,c?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(l,c):(c=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,c.appendChild(l),g=g._reactRootContainer,g!=null||c.onclick!==null||(c.onclick=la));else if(y!==4&&(y===27&&rs(l.type)&&(g=l.stateNode,c=null),l=l.child,l!==null))for(ux(l,c,g),l=l.sibling;l!==null;)ux(l,c,g),l=l.sibling}function of(l,c,g){var y=l.tag;if(y===5||y===6)l=l.stateNode,c?g.insertBefore(l,c):g.appendChild(l);else if(y!==4&&(y===27&&rs(l.type)&&(g=l.stateNode),l=l.child,l!==null))for(of(l,c,g),l=l.sibling;l!==null;)of(l,c,g),l=l.sibling}function dS(l){var c=l.stateNode,g=l.memoizedProps;try{for(var y=l.type,S=c.attributes;S.length;)c.removeAttributeNode(S[0]);Gr(c,y,g),c[cr]=l,c[Yt]=g}catch(_){zt(l,l.return,_)}}var xa=!1,wr=!1,dx=!1,hS=typeof WeakSet=="function"?WeakSet:Set,Pr=null;function XB(l,c){if(l=l.containerInfo,Lx=jf,l=Cw(l),im(l)){if("selectionStart"in l)var g={start:l.selectionStart,end:l.selectionEnd};else e:{g=(g=l.ownerDocument)&&g.defaultView||window;var y=g.getSelection&&g.getSelection();if(y&&y.rangeCount!==0){g=y.anchorNode;var S=y.anchorOffset,_=y.focusNode;y=y.focusOffset;try{g.nodeType,_.nodeType}catch{g=null;break e}var F=0,X=-1,K=-1,ue=0,me=0,ve=l,he=null;t:for(;;){for(var pe;ve!==g||S!==0&&ve.nodeType!==3||(X=F+S),ve!==_||y!==0&&ve.nodeType!==3||(K=F+y),ve.nodeType===3&&(F+=ve.nodeValue.length),(pe=ve.firstChild)!==null;)he=ve,ve=pe;for(;;){if(ve===l)break t;if(he===g&&++ue===S&&(X=F),he===_&&++me===y&&(K=F),(pe=ve.nextSibling)!==null)break;ve=he,he=ve.parentNode}ve=pe}g=X===-1||K===-1?null:{start:X,end:K}}else g=null}g=g||{start:0,end:0}}else g=null;for(Dx={focusedElem:l,selectionRange:g},jf=!1,Pr=c;Pr!==null;)if(c=Pr,l=c.child,(c.subtreeFlags&1028)!==0&&l!==null)l.return=c,Pr=l;else for(;Pr!==null;){switch(c=Pr,_=c.alternate,l=c.flags,c.tag){case 0:if((l&4)!==0&&(l=c.updateQueue,l=l!==null?l.events:null,l!==null))for(g=0;g<l.length;g++)S=l[g],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((l&1024)!==0&&_!==null){l=void 0,g=c,S=_.memoizedProps,_=_.memoizedState,y=g.stateNode;try{var De=Gs(g.type,S);l=y.getSnapshotBeforeUpdate(De,_),y.__reactInternalSnapshotBeforeUpdate=l}catch(Xe){zt(g,g.return,Xe)}}break;case 3:if((l&1024)!==0){if(l=c.stateNode.containerInfo,g=l.nodeType,g===9)Bx(l);else if(g===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":Bx(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((l&1024)!==0)throw Error(n(163))}if(l=c.sibling,l!==null){l.return=c.return,Pr=l;break}Pr=c.return}}function fS(l,c,g){var y=g.flags;switch(g.tag){case 0:case 11:case 15:ba(l,g),y&4&&su(5,g);break;case 1:if(ba(l,g),y&4)if(l=g.stateNode,c===null)try{l.componentDidMount()}catch(F){zt(g,g.return,F)}else{var S=Gs(g.type,c.memoizedProps);c=c.memoizedState;try{l.componentDidUpdate(S,c,l.__reactInternalSnapshotBeforeUpdate)}catch(F){zt(g,g.return,F)}}y&64&&lS(g),y&512&&lu(g,g.return);break;case 3:if(ba(l,g),y&64&&(l=g.updateQueue,l!==null)){if(c=null,g.child!==null)switch(g.child.tag){case 27:case 5:c=g.child.stateNode;break;case 1:c=g.child.stateNode}try{Zw(l,c)}catch(F){zt(g,g.return,F)}}break;case 27:c===null&&y&4&&dS(g);case 26:case 5:ba(l,g),c===null&&y&4&&cS(g),y&512&&lu(g,g.return);break;case 12:ba(l,g);break;case 31:ba(l,g),y&4&&mS(l,g);break;case 13:ba(l,g),y&4&&xS(l,g),y&64&&(l=g.memoizedState,l!==null&&(l=l.dehydrated,l!==null&&(g=i8.bind(null,g),C8(l,g))));break;case 22:if(y=g.memoizedState!==null||xa,!y){c=c!==null&&c.memoizedState!==null||wr,S=xa;var _=wr;xa=y,(wr=c)&&!_?va(l,g,(g.subtreeFlags&8772)!==0):ba(l,g),xa=S,wr=_}break;case 30:break;default:ba(l,g)}}function pS(l){var c=l.alternate;c!==null&&(l.alternate=null,pS(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&ee(c)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}var nr=null,jn=!1;function ya(l,c,g){for(g=g.child;g!==null;)gS(l,c,g),g=g.sibling}function gS(l,c,g){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(Wt,g)}catch{}switch(g.tag){case 26:wr||Pi(g,c),ya(l,c,g),g.memoizedState?g.memoizedState.count--:g.stateNode&&(g=g.stateNode,g.parentNode.removeChild(g));break;case 27:wr||Pi(g,c);var y=nr,S=jn;rs(g.type)&&(nr=g.stateNode,jn=!1),ya(l,c,g),mu(g.stateNode),nr=y,jn=S;break;case 5:wr||Pi(g,c);case 6:if(y=nr,S=jn,nr=null,ya(l,c,g),nr=y,jn=S,nr!==null)if(jn)try{(nr.nodeType===9?nr.body:nr.nodeName==="HTML"?nr.ownerDocument.body:nr).removeChild(g.stateNode)}catch(_){zt(g,c,_)}else try{nr.removeChild(g.stateNode)}catch(_){zt(g,c,_)}break;case 18:nr!==null&&(jn?(l=nr,lC(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,g.stateNode),xo(l)):lC(nr,g.stateNode));break;case 4:y=nr,S=jn,nr=g.stateNode.containerInfo,jn=!0,ya(l,c,g),nr=y,jn=S;break;case 0:case 11:case 14:case 15:Xa(2,g,c),wr||Xa(4,g,c),ya(l,c,g);break;case 1:wr||(Pi(g,c),y=g.stateNode,typeof y.componentWillUnmount=="function"&&oS(g,c,y)),ya(l,c,g);break;case 21:ya(l,c,g);break;case 22:wr=(y=wr)||g.memoizedState!==null,ya(l,c,g),wr=y;break;default:ya(l,c,g)}}function mS(l,c){if(c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{xo(l)}catch(g){zt(c,c.return,g)}}}function xS(l,c){if(c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{xo(l)}catch(g){zt(c,c.return,g)}}function QB(l){switch(l.tag){case 31:case 13:case 19:var c=l.stateNode;return c===null&&(c=l.stateNode=new hS),c;case 22:return l=l.stateNode,c=l._retryCache,c===null&&(c=l._retryCache=new hS),c;default:throw Error(n(435,l.tag))}}function cf(l,c){var g=QB(l);c.forEach(function(y){if(!g.has(y)){g.add(y);var S=a8.bind(null,l,y);y.then(S,S)}})}function An(l,c){var g=c.deletions;if(g!==null)for(var y=0;y<g.length;y++){var S=g[y],_=l,F=c,X=F;e:for(;X!==null;){switch(X.tag){case 27:if(rs(X.type)){nr=X.stateNode,jn=!1;break e}break;case 5:nr=X.stateNode,jn=!1;break e;case 3:case 4:nr=X.stateNode.containerInfo,jn=!0;break e}X=X.return}if(nr===null)throw Error(n(160));gS(_,F,S),nr=null,jn=!1,_=S.alternate,_!==null&&(_.return=null),S.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)yS(c,l),c=c.sibling}var wi=null;function yS(l,c){var g=l.alternate,y=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:An(c,l),Mn(l),y&4&&(Xa(3,l,l.return),su(3,l),Xa(5,l,l.return));break;case 1:An(c,l),Mn(l),y&512&&(wr||g===null||Pi(g,g.return)),y&64&&xa&&(l=l.updateQueue,l!==null&&(y=l.callbacks,y!==null&&(g=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=g===null?y:g.concat(y))));break;case 26:var S=wi;if(An(c,l),Mn(l),y&512&&(wr||g===null||Pi(g,g.return)),y&4){var _=g!==null?g.memoizedState:null;if(y=l.memoizedState,g===null)if(y===null)if(l.stateNode===null){e:{y=l.type,g=l.memoizedProps,S=S.ownerDocument||S;t:switch(y){case"title":_=S.getElementsByTagName("title")[0],(!_||_[Be]||_[cr]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=S.createElement(y),S.head.insertBefore(_,S.querySelector("head > title"))),Gr(_,y,g),_[cr]=l,lt(_),y=_;break e;case"link":var F=yC("link","href",S).get(y+(g.href||""));if(F){for(var X=0;X<F.length;X++)if(_=F[X],_.getAttribute("href")===(g.href==null||g.href===""?null:g.href)&&_.getAttribute("rel")===(g.rel==null?null:g.rel)&&_.getAttribute("title")===(g.title==null?null:g.title)&&_.getAttribute("crossorigin")===(g.crossOrigin==null?null:g.crossOrigin)){F.splice(X,1);break t}}_=S.createElement(y),Gr(_,y,g),S.head.appendChild(_);break;case"meta":if(F=yC("meta","content",S).get(y+(g.content||""))){for(X=0;X<F.length;X++)if(_=F[X],_.getAttribute("content")===(g.content==null?null:""+g.content)&&_.getAttribute("name")===(g.name==null?null:g.name)&&_.getAttribute("property")===(g.property==null?null:g.property)&&_.getAttribute("http-equiv")===(g.httpEquiv==null?null:g.httpEquiv)&&_.getAttribute("charset")===(g.charSet==null?null:g.charSet)){F.splice(X,1);break t}}_=S.createElement(y),Gr(_,y,g),S.head.appendChild(_);break;default:throw Error(n(468,y))}_[cr]=l,lt(_),y=_}l.stateNode=y}else bC(S,l.type,l.stateNode);else l.stateNode=xC(S,y,l.memoizedProps);else _!==y?(_===null?g.stateNode!==null&&(g=g.stateNode,g.parentNode.removeChild(g)):_.count--,y===null?bC(S,l.type,l.stateNode):xC(S,y,l.memoizedProps)):y===null&&l.stateNode!==null&&ox(l,l.memoizedProps,g.memoizedProps)}break;case 27:An(c,l),Mn(l),y&512&&(wr||g===null||Pi(g,g.return)),g!==null&&y&4&&ox(l,l.memoizedProps,g.memoizedProps);break;case 5:if(An(c,l),Mn(l),y&512&&(wr||g===null||Pi(g,g.return)),l.flags&32){S=l.stateNode;try{Il(S,"")}catch(De){zt(l,l.return,De)}}y&4&&l.stateNode!=null&&(S=l.memoizedProps,ox(l,S,g!==null?g.memoizedProps:S)),y&1024&&(dx=!0);break;case 6:if(An(c,l),Mn(l),y&4){if(l.stateNode===null)throw Error(n(162));y=l.memoizedProps,g=l.stateNode;try{g.nodeValue=y}catch(De){zt(l,l.return,De)}}break;case 3:if(_f=null,S=wi,wi=Sf(c.containerInfo),An(c,l),wi=S,Mn(l),y&4&&g!==null&&g.memoizedState.isDehydrated)try{xo(c.containerInfo)}catch(De){zt(l,l.return,De)}dx&&(dx=!1,bS(l));break;case 4:y=wi,wi=Sf(l.stateNode.containerInfo),An(c,l),Mn(l),wi=y;break;case 12:An(c,l),Mn(l);break;case 31:An(c,l),Mn(l),y&4&&(y=l.updateQueue,y!==null&&(l.updateQueue=null,cf(l,y)));break;case 13:An(c,l),Mn(l),l.child.flags&8192&&l.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(df=_e()),y&4&&(y=l.updateQueue,y!==null&&(l.updateQueue=null,cf(l,y)));break;case 22:S=l.memoizedState!==null;var K=g!==null&&g.memoizedState!==null,ue=xa,me=wr;if(xa=ue||S,wr=me||K,An(c,l),wr=me,xa=ue,Mn(l),y&8192)e:for(c=l.stateNode,c._visibility=S?c._visibility&-2:c._visibility|1,S&&(g===null||K||xa||wr||Xs(l)),g=null,c=l;;){if(c.tag===5||c.tag===26){if(g===null){K=g=c;try{if(_=K.stateNode,S)F=_.style,typeof F.setProperty=="function"?F.setProperty("display","none","important"):F.display="none";else{X=K.stateNode;var ve=K.memoizedProps.style,he=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;X.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(De){zt(K,K.return,De)}}}else if(c.tag===6){if(g===null){K=c;try{K.stateNode.nodeValue=S?"":K.memoizedProps}catch(De){zt(K,K.return,De)}}}else if(c.tag===18){if(g===null){K=c;try{var pe=K.stateNode;S?oC(pe,!0):oC(K.stateNode,!1)}catch(De){zt(K,K.return,De)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===l)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break e;for(;c.sibling===null;){if(c.return===null||c.return===l)break e;g===c&&(g=null),c=c.return}g===c&&(g=null),c.sibling.return=c.return,c=c.sibling}y&4&&(y=l.updateQueue,y!==null&&(g=y.retryQueue,g!==null&&(y.retryQueue=null,cf(l,g))));break;case 19:An(c,l),Mn(l),y&4&&(y=l.updateQueue,y!==null&&(l.updateQueue=null,cf(l,y)));break;case 30:break;case 21:break;default:An(c,l),Mn(l)}}function Mn(l){var c=l.flags;if(c&2){try{for(var g,y=l.return;y!==null;){if(uS(y)){g=y;break}y=y.return}if(g==null)throw Error(n(160));switch(g.tag){case 27:var S=g.stateNode,_=cx(l);of(l,_,S);break;case 5:var F=g.stateNode;g.flags&32&&(Il(F,""),g.flags&=-33);var X=cx(l);of(l,X,F);break;case 3:case 4:var K=g.stateNode.containerInfo,ue=cx(l);ux(l,ue,K);break;default:throw Error(n(161))}}catch(me){zt(l,l.return,me)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function bS(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var c=l;bS(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),l=l.sibling}}function ba(l,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)fS(l,c.alternate,c),c=c.sibling}function Xs(l){for(l=l.child;l!==null;){var c=l;switch(c.tag){case 0:case 11:case 14:case 15:Xa(4,c,c.return),Xs(c);break;case 1:Pi(c,c.return);var g=c.stateNode;typeof g.componentWillUnmount=="function"&&oS(c,c.return,g),Xs(c);break;case 27:mu(c.stateNode);case 26:case 5:Pi(c,c.return),Xs(c);break;case 22:c.memoizedState===null&&Xs(c);break;case 30:Xs(c);break;default:Xs(c)}l=l.sibling}}function va(l,c,g){for(g=g&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var y=c.alternate,S=l,_=c,F=_.flags;switch(_.tag){case 0:case 11:case 15:va(S,_,g),su(4,_);break;case 1:if(va(S,_,g),y=_,S=y.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(ue){zt(y,y.return,ue)}if(y=_,S=y.updateQueue,S!==null){var X=y.stateNode;try{var K=S.shared.hiddenCallbacks;if(K!==null)for(S.shared.hiddenCallbacks=null,S=0;S<K.length;S++)Qw(K[S],X)}catch(ue){zt(y,y.return,ue)}}g&&F&64&&lS(_),lu(_,_.return);break;case 27:dS(_);case 26:case 5:va(S,_,g),g&&y===null&&F&4&&cS(_),lu(_,_.return);break;case 12:va(S,_,g);break;case 31:va(S,_,g),g&&F&4&&mS(S,_);break;case 13:va(S,_,g),g&&F&4&&xS(S,_);break;case 22:_.memoizedState===null&&va(S,_,g),lu(_,_.return);break;case 30:break;default:va(S,_,g)}c=c.sibling}}function hx(l,c){var g=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),l=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(l=c.memoizedState.cachePool.pool),l!==g&&(l!=null&&l.refCount++,g!=null&&Yc(g))}function fx(l,c){l=null,c.alternate!==null&&(l=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==l&&(c.refCount++,l!=null&&Yc(l))}function ki(l,c,g,y){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)vS(l,c,g,y),c=c.sibling}function vS(l,c,g,y){var S=c.flags;switch(c.tag){case 0:case 11:case 15:ki(l,c,g,y),S&2048&&su(9,c);break;case 1:ki(l,c,g,y);break;case 3:ki(l,c,g,y),S&2048&&(l=null,c.alternate!==null&&(l=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==l&&(c.refCount++,l!=null&&Yc(l)));break;case 12:if(S&2048){ki(l,c,g,y),l=c.stateNode;try{var _=c.memoizedProps,F=_.id,X=_.onPostCommit;typeof X=="function"&&X(F,c.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(K){zt(c,c.return,K)}}else ki(l,c,g,y);break;case 31:ki(l,c,g,y);break;case 13:ki(l,c,g,y);break;case 23:break;case 22:_=c.stateNode,F=c.alternate,c.memoizedState!==null?_._visibility&2?ki(l,c,g,y):ou(l,c):_._visibility&2?ki(l,c,g,y):(_._visibility|=2,ao(l,c,g,y,(c.subtreeFlags&10256)!==0||!1)),S&2048&&hx(F,c);break;case 24:ki(l,c,g,y),S&2048&&fx(c.alternate,c);break;default:ki(l,c,g,y)}}function ao(l,c,g,y,S){for(S=S&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var _=l,F=c,X=g,K=y,ue=F.flags;switch(F.tag){case 0:case 11:case 15:ao(_,F,X,K,S),su(8,F);break;case 23:break;case 22:var me=F.stateNode;F.memoizedState!==null?me._visibility&2?ao(_,F,X,K,S):ou(_,F):(me._visibility|=2,ao(_,F,X,K,S)),S&&ue&2048&&hx(F.alternate,F);break;case 24:ao(_,F,X,K,S),S&&ue&2048&&fx(F.alternate,F);break;default:ao(_,F,X,K,S)}c=c.sibling}}function ou(l,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var g=l,y=c,S=y.flags;switch(y.tag){case 22:ou(g,y),S&2048&&hx(y.alternate,y);break;case 24:ou(g,y),S&2048&&fx(y.alternate,y);break;default:ou(g,y)}c=c.sibling}}var cu=8192;function so(l,c,g){if(l.subtreeFlags&cu)for(l=l.child;l!==null;)wS(l,c,g),l=l.sibling}function wS(l,c,g){switch(l.tag){case 26:so(l,c,g),l.flags&cu&&l.memoizedState!==null&&B8(g,wi,l.memoizedState,l.memoizedProps);break;case 5:so(l,c,g);break;case 3:case 4:var y=wi;wi=Sf(l.stateNode.containerInfo),so(l,c,g),wi=y;break;case 22:l.memoizedState===null&&(y=l.alternate,y!==null&&y.memoizedState!==null?(y=cu,cu=16777216,so(l,c,g),cu=y):so(l,c,g));break;default:so(l,c,g)}}function kS(l){var c=l.alternate;if(c!==null&&(l=c.child,l!==null)){c.child=null;do c=l.sibling,l.sibling=null,l=c;while(l!==null)}}function uu(l){var c=l.deletions;if((l.flags&16)!==0){if(c!==null)for(var g=0;g<c.length;g++){var y=c[g];Pr=y,CS(y,l)}kS(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)SS(l),l=l.sibling}function SS(l){switch(l.tag){case 0:case 11:case 15:uu(l),l.flags&2048&&Xa(9,l,l.return);break;case 3:uu(l);break;case 12:uu(l);break;case 22:var c=l.stateNode;l.memoizedState!==null&&c._visibility&2&&(l.return===null||l.return.tag!==13)?(c._visibility&=-3,uf(l)):uu(l);break;default:uu(l)}}function uf(l){var c=l.deletions;if((l.flags&16)!==0){if(c!==null)for(var g=0;g<c.length;g++){var y=c[g];Pr=y,CS(y,l)}kS(l)}for(l=l.child;l!==null;){switch(c=l,c.tag){case 0:case 11:case 15:Xa(8,c,c.return),uf(c);break;case 22:g=c.stateNode,g._visibility&2&&(g._visibility&=-3,uf(c));break;default:uf(c)}l=l.sibling}}function CS(l,c){for(;Pr!==null;){var g=Pr;switch(g.tag){case 0:case 11:case 15:Xa(8,g,c);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var y=g.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:Yc(g.memoizedState.cache)}if(y=g.child,y!==null)y.return=g,Pr=y;else e:for(g=l;Pr!==null;){y=Pr;var S=y.sibling,_=y.return;if(pS(y),y===g){Pr=null;break e}if(S!==null){S.return=_,Pr=S;break e}Pr=_}}}var ZB={getCacheForType:function(l){var c=Wr(yr),g=c.data.get(l);return g===void 0&&(g=l(),c.data.set(l,g)),g},cacheSignal:function(){return Wr(yr).controller.signal}},KB=typeof WeakMap=="function"?WeakMap:Map,Mt=0,Ut=null,ft=null,bt=0,$t=0,Xn=null,Qa=!1,lo=!1,px=!1,wa=0,dr=0,Za=0,Qs=0,gx=0,Qn=0,oo=0,du=null,Ln=null,mx=!1,df=0,_S=0,hf=1/0,ff=null,Ka=null,Ar=0,Ja=null,co=null,ka=0,xx=0,yx=null,TS=null,hu=0,bx=null;function Zn(){return(Mt&2)!==0&&bt!==0?bt&-bt:R.T!==null?_x():tn()}function ES(){if(Qn===0)if((bt&536870912)===0||kt){var l=qn;qn<<=1,(qn&3932160)===0&&(qn=262144),Qn=l}else Qn=536870912;return l=Yn.current,l!==null&&(l.flags|=32),Qn}function Dn(l,c,g){(l===Ut&&($t===2||$t===9)||l.cancelPendingCommit!==null)&&(uo(l,0),es(l,bt,Qn,!1)),Ur(l,g),((Mt&2)===0||l!==Ut)&&(l===Ut&&((Mt&2)===0&&(Qs|=g),dr===4&&es(l,bt,Qn,!1)),Hi(l))}function NS(l,c,g){if((Mt&6)!==0)throw Error(n(327));var y=!g&&(c&127)===0&&(c&l.expiredLanes)===0||$r(l,c),S=y?t8(l,c):wx(l,c,!0),_=y;do{if(S===0){lo&&!y&&es(l,c,0,!1);break}else{if(g=l.current.alternate,_&&!JB(g)){S=wx(l,c,!1),_=!1;continue}if(S===2){if(_=c,l.errorRecoveryDisabledLanes&_)var F=0;else F=l.pendingLanes&-536870913,F=F!==0?F:F&536870912?536870912:0;if(F!==0){c=F;e:{var X=l;S=du;var K=X.current.memoizedState.isDehydrated;if(K&&(uo(X,F).flags|=256),F=wx(X,F,!1),F!==2){if(px&&!K){X.errorRecoveryDisabledLanes|=_,Qs|=_,S=4;break e}_=Ln,Ln=S,_!==null&&(Ln===null?Ln=_:Ln.push.apply(Ln,_))}S=F}if(_=!1,S!==2)continue}}if(S===1){uo(l,0),es(l,c,0,!0);break}e:{switch(y=l,_=S,_){case 0:case 1:throw Error(n(345));case 4:if((c&4194048)!==c)break;case 6:es(y,c,Qn,!Qa);break e;case 2:Ln=null;break;case 3:case 5:break;default:throw Error(n(329))}if((c&62914560)===c&&(S=df+300-_e(),10<S)){if(es(y,c,Qn,!Qa),lr(y,0,!0)!==0)break e;ka=c,y.timeoutHandle=aC(jS.bind(null,y,g,Ln,ff,mx,c,Qn,Qs,oo,Qa,_,"Throttled",-0,0),S);break e}jS(y,g,Ln,ff,mx,c,Qn,Qs,oo,Qa,_,null,-0,0)}}break}while(!0);Hi(l)}function jS(l,c,g,y,S,_,F,X,K,ue,me,ve,he,pe){if(l.timeoutHandle=-1,ve=c.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:la},wS(c,_,ve);var De=(_&62914560)===_?df-_e():(_&4194048)===_?_S-_e():0;if(De=$8(ve,De),De!==null){ka=_,l.cancelPendingCommit=De($S.bind(null,l,c,_,g,y,S,F,X,K,me,ve,null,he,pe)),es(l,_,F,!ue);return}}$S(l,c,_,g,y,S,F,X,K)}function JB(l){for(var c=l;;){var g=c.tag;if((g===0||g===11||g===15)&&c.flags&16384&&(g=c.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var y=0;y<g.length;y++){var S=g[y],_=S.getSnapshot;S=S.value;try{if(!Vn(_(),S))return!1}catch{return!1}}if(g=c.child,c.subtreeFlags&16384&&g!==null)g.return=c,c=g;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function es(l,c,g,y){c&=~gx,c&=~Qs,l.suspendedLanes|=c,l.pingedLanes&=~c,y&&(l.warmLanes|=c),y=l.expirationTimes;for(var S=c;0<S;){var _=31-dt(S),F=1<<_;y[_]=-1,S&=~F}g!==0&&Jr(l,g,c)}function pf(){return(Mt&6)===0?(fu(0),!1):!0}function vx(){if(ft!==null){if($t===0)var l=ft.return;else l=ft,da=Ps=null,Bm(l),eo=null,Xc=0,l=ft;for(;l!==null;)sS(l.alternate,l),l=l.return;ft=null}}function uo(l,c){var g=l.timeoutHandle;g!==-1&&(l.timeoutHandle=-1,b8(g)),g=l.cancelPendingCommit,g!==null&&(l.cancelPendingCommit=null,g()),ka=0,vx(),Ut=l,ft=g=ca(l.current,null),bt=c,$t=0,Xn=null,Qa=!1,lo=$r(l,c),px=!1,oo=Qn=gx=Qs=Za=dr=0,Ln=du=null,mx=!1,(c&8)!==0&&(c|=c&32);var y=l.entangledLanes;if(y!==0)for(l=l.entanglements,y&=c;0<y;){var S=31-dt(y),_=1<<S;c|=l[S],y&=~_}return wa=c,Rh(),g}function AS(l,c){st=null,R.H=nu,c===Jl||c===Hh?(c=Ww(),$t=3):c===Cm?(c=Ww(),$t=4):$t=c===Km?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Xn=c,ft===null&&(dr=1,rf(l,si(c,l.current)))}function MS(){var l=Yn.current;return l===null?!0:(bt&4194048)===bt?ui===null:(bt&62914560)===bt||(bt&536870912)!==0?l===ui:!1}function LS(){var l=R.H;return R.H=nu,l===null?nu:l}function DS(){var l=R.A;return R.A=ZB,l}function gf(){dr=4,Qa||(bt&4194048)!==bt&&Yn.current!==null||(lo=!0),(Za&134217727)===0&&(Qs&134217727)===0||Ut===null||es(Ut,bt,Qn,!1)}function wx(l,c,g){var y=Mt;Mt|=2;var S=LS(),_=DS();(Ut!==l||bt!==c)&&(ff=null,uo(l,c)),c=!1;var F=dr;e:do try{if($t!==0&&ft!==null){var X=ft,K=Xn;switch($t){case 8:vx(),F=6;break e;case 3:case 2:case 9:case 6:Yn.current===null&&(c=!0);var ue=$t;if($t=0,Xn=null,ho(l,X,K,ue),g&&lo){F=0;break e}break;default:ue=$t,$t=0,Xn=null,ho(l,X,K,ue)}}e8(),F=dr;break}catch(me){AS(l,me)}while(!0);return c&&l.shellSuspendCounter++,da=Ps=null,Mt=y,R.H=S,R.A=_,ft===null&&(Ut=null,bt=0,Rh()),F}function e8(){for(;ft!==null;)RS(ft)}function t8(l,c){var g=Mt;Mt|=2;var y=LS(),S=DS();Ut!==l||bt!==c?(ff=null,hf=_e()+500,uo(l,c)):lo=$r(l,c);e:do try{if($t!==0&&ft!==null){c=ft;var _=Xn;t:switch($t){case 1:$t=0,Xn=null,ho(l,c,_,1);break;case 2:case 9:if(Uw(_)){$t=0,Xn=null,OS(c);break}c=function(){$t!==2&&$t!==9||Ut!==l||($t=7),Hi(l)},_.then(c,c);break e;case 3:$t=7;break e;case 4:$t=5;break e;case 7:Uw(_)?($t=0,Xn=null,OS(c)):($t=0,Xn=null,ho(l,c,_,7));break;case 5:var F=null;switch(ft.tag){case 26:F=ft.memoizedState;case 5:case 27:var X=ft;if(F?vC(F):X.stateNode.complete){$t=0,Xn=null;var K=X.sibling;if(K!==null)ft=K;else{var ue=X.return;ue!==null?(ft=ue,mf(ue)):ft=null}break t}}$t=0,Xn=null,ho(l,c,_,5);break;case 6:$t=0,Xn=null,ho(l,c,_,6);break;case 8:vx(),dr=6;break e;default:throw Error(n(462))}}r8();break}catch(me){AS(l,me)}while(!0);return da=Ps=null,R.H=y,R.A=S,Mt=g,ft!==null?0:(Ut=null,bt=0,Rh(),dr)}function r8(){for(;ft!==null&&!wt();)RS(ft)}function RS(l){var c=iS(l.alternate,l,wa);l.memoizedProps=l.pendingProps,c===null?mf(l):ft=c}function OS(l){var c=l,g=c.alternate;switch(c.tag){case 15:case 0:c=Kk(g,c,c.pendingProps,c.type,void 0,bt);break;case 11:c=Kk(g,c,c.pendingProps,c.type.render,c.ref,bt);break;case 5:Bm(c);default:sS(g,c),c=ft=Dw(c,wa),c=iS(g,c,wa)}l.memoizedProps=l.pendingProps,c===null?mf(l):ft=c}function ho(l,c,g,y){da=Ps=null,Bm(c),eo=null,Xc=0;var S=c.return;try{if(UB(l,S,c,g,bt)){dr=1,rf(l,si(g,l.current)),ft=null;return}}catch(_){if(S!==null)throw ft=S,_;dr=1,rf(l,si(g,l.current)),ft=null;return}c.flags&32768?(kt||y===1?l=!0:lo||(bt&536870912)!==0?l=!1:(Qa=l=!0,(y===2||y===9||y===3||y===6)&&(y=Yn.current,y!==null&&y.tag===13&&(y.flags|=16384))),BS(c,l)):mf(c)}function mf(l){var c=l;do{if((c.flags&32768)!==0){BS(c,Qa);return}l=c.return;var g=YB(c.alternate,c,wa);if(g!==null){ft=g;return}if(c=c.sibling,c!==null){ft=c;return}ft=c=l}while(c!==null);dr===0&&(dr=5)}function BS(l,c){do{var g=GB(l.alternate,l);if(g!==null){g.flags&=32767,ft=g;return}if(g=l.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!c&&(l=l.sibling,l!==null)){ft=l;return}ft=l=g}while(l!==null);dr=6,ft=null}function $S(l,c,g,y,S,_,F,X,K){l.cancelPendingCommit=null;do xf();while(Ar!==0);if((Mt&6)!==0)throw Error(n(327));if(c!==null){if(c===l.current)throw Error(n(177));if(_=c.lanes|c.childLanes,_|=cm,Zt(l,g,_,F,X,K),l===Ut&&(ft=Ut=null,bt=0),co=c,Ja=l,ka=g,xx=_,yx=S,TS=y,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,s8(Le,function(){return HS(),null})):(l.callbackNode=null,l.callbackPriority=0),y=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||y){y=R.T,R.T=null,S=H.p,H.p=2,F=Mt,Mt|=4;try{XB(l,c,g)}finally{Mt=F,H.p=S,R.T=y}}Ar=1,zS(),IS(),FS()}}function zS(){if(Ar===1){Ar=0;var l=Ja,c=co,g=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||g){g=R.T,R.T=null;var y=H.p;H.p=2;var S=Mt;Mt|=4;try{yS(c,l);var _=Dx,F=Cw(l.containerInfo),X=_.focusedElem,K=_.selectionRange;if(F!==X&&X&&X.ownerDocument&&Sw(X.ownerDocument.documentElement,X)){if(K!==null&&im(X)){var ue=K.start,me=K.end;if(me===void 0&&(me=ue),"selectionStart"in X)X.selectionStart=ue,X.selectionEnd=Math.min(me,X.value.length);else{var ve=X.ownerDocument||document,he=ve&&ve.defaultView||window;if(he.getSelection){var pe=he.getSelection(),De=X.textContent.length,Xe=Math.min(K.start,De),Ht=K.end===void 0?Xe:Math.min(K.end,De);!pe.extend&&Xe>Ht&&(F=Ht,Ht=Xe,Xe=F);var ae=kw(X,Xe),te=kw(X,Ht);if(ae&&te&&(pe.rangeCount!==1||pe.anchorNode!==ae.node||pe.anchorOffset!==ae.offset||pe.focusNode!==te.node||pe.focusOffset!==te.offset)){var ce=ve.createRange();ce.setStart(ae.node,ae.offset),pe.removeAllRanges(),Xe>Ht?(pe.addRange(ce),pe.extend(te.node,te.offset)):(ce.setEnd(te.node,te.offset),pe.addRange(ce))}}}}for(ve=[],pe=X;pe=pe.parentNode;)pe.nodeType===1&&ve.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof X.focus=="function"&&X.focus(),X=0;X<ve.length;X++){var ye=ve[X];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}jf=!!Lx,Dx=Lx=null}finally{Mt=S,H.p=y,R.T=g}}l.current=c,Ar=2}}function IS(){if(Ar===2){Ar=0;var l=Ja,c=co,g=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||g){g=R.T,R.T=null;var y=H.p;H.p=2;var S=Mt;Mt|=4;try{fS(l,c.alternate,c)}finally{Mt=S,H.p=y,R.T=g}}Ar=3}}function FS(){if(Ar===4||Ar===3){Ar=0,xt();var l=Ja,c=co,g=ka,y=TS;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Ar=5:(Ar=0,co=Ja=null,PS(l,l.pendingLanes));var S=l.pendingLanes;if(S===0&&(Ka=null),Nr(g),c=c.stateNode,It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(Wt,c,void 0,(c.current.flags&128)===128)}catch{}if(y!==null){c=R.T,S=H.p,H.p=2,R.T=null;try{for(var _=l.onRecoverableError,F=0;F<y.length;F++){var X=y[F];_(X.value,{componentStack:X.stack})}}finally{R.T=c,H.p=S}}(ka&3)!==0&&xf(),Hi(l),S=l.pendingLanes,(g&261930)!==0&&(S&42)!==0?l===bx?hu++:(hu=0,bx=l):hu=0,fu(0)}}function PS(l,c){(l.pooledCacheLanes&=c)===0&&(c=l.pooledCache,c!=null&&(l.pooledCache=null,Yc(c)))}function xf(){return zS(),IS(),FS(),HS()}function HS(){if(Ar!==5)return!1;var l=Ja,c=xx;xx=0;var g=Nr(ka),y=R.T,S=H.p;try{H.p=32>g?32:g,R.T=null,g=yx,yx=null;var _=Ja,F=ka;if(Ar=0,co=Ja=null,ka=0,(Mt&6)!==0)throw Error(n(331));var X=Mt;if(Mt|=4,SS(_.current),vS(_,_.current,F,g),Mt=X,fu(0,!1),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(Wt,_)}catch{}return!0}finally{H.p=S,R.T=y,PS(l,c)}}function qS(l,c,g){c=si(g,c),c=Zm(l.stateNode,c,2),l=Wa(l,c,2),l!==null&&(Ur(l,2),Hi(l))}function zt(l,c,g){if(l.tag===3)qS(l,l,g);else for(;c!==null;){if(c.tag===3){qS(c,l,g);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Ka===null||!Ka.has(y))){l=si(g,l),g=Uk(2),y=Wa(c,g,2),y!==null&&(Vk(g,y,c,l),Ur(y,2),Hi(y));break}}c=c.return}}function kx(l,c,g){var y=l.pingCache;if(y===null){y=l.pingCache=new KB;var S=new Set;y.set(c,S)}else S=y.get(c),S===void 0&&(S=new Set,y.set(c,S));S.has(g)||(px=!0,S.add(g),l=n8.bind(null,l,c,g),c.then(l,l))}function n8(l,c,g){var y=l.pingCache;y!==null&&y.delete(c),l.pingedLanes|=l.suspendedLanes&g,l.warmLanes&=~g,Ut===l&&(bt&g)===g&&(dr===4||dr===3&&(bt&62914560)===bt&&300>_e()-df?(Mt&2)===0&&uo(l,0):gx|=g,oo===bt&&(oo=0)),Hi(l)}function US(l,c){c===0&&(c=Qt()),l=zs(l,c),l!==null&&(Ur(l,c),Hi(l))}function i8(l){var c=l.memoizedState,g=0;c!==null&&(g=c.retryLane),US(l,g)}function a8(l,c){var g=0;switch(l.tag){case 31:case 13:var y=l.stateNode,S=l.memoizedState;S!==null&&(g=S.retryLane);break;case 19:y=l.stateNode;break;case 22:y=l.stateNode._retryCache;break;default:throw Error(n(314))}y!==null&&y.delete(c),US(l,g)}function s8(l,c){return rt(l,c)}var yf=null,fo=null,Sx=!1,bf=!1,Cx=!1,ts=0;function Hi(l){l!==fo&&l.next===null&&(fo===null?yf=fo=l:fo=fo.next=l),bf=!0,Sx||(Sx=!0,o8())}function fu(l,c){if(!Cx&&bf){Cx=!0;do for(var g=!1,y=yf;y!==null;){if(l!==0){var S=y.pendingLanes;if(S===0)var _=0;else{var F=y.suspendedLanes,X=y.pingedLanes;_=(1<<31-dt(42|l)+1)-1,_&=S&~(F&~X),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(g=!0,GS(y,_))}else _=bt,_=lr(y,y===Ut?_:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(_&3)===0||$r(y,_)||(g=!0,GS(y,_));y=y.next}while(g);Cx=!1}}function l8(){VS()}function VS(){bf=Sx=!1;var l=0;ts!==0&&y8()&&(l=ts);for(var c=_e(),g=null,y=yf;y!==null;){var S=y.next,_=WS(y,c);_===0?(y.next=null,g===null?yf=S:g.next=S,S===null&&(fo=g)):(g=y,(l!==0||(_&3)!==0)&&(bf=!0)),y=S}Ar!==0&&Ar!==5||fu(l),ts!==0&&(ts=0)}function WS(l,c){for(var g=l.suspendedLanes,y=l.pingedLanes,S=l.expirationTimes,_=l.pendingLanes&-62914561;0<_;){var F=31-dt(_),X=1<<F,K=S[F];K===-1?((X&g)===0||(X&y)!==0)&&(S[F]=yt(X,c)):K<=c&&(l.expiredLanes|=X),_&=~X}if(c=Ut,g=bt,g=lr(l,l===c?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),y=l.callbackNode,g===0||l===c&&($t===2||$t===9)||l.cancelPendingCommit!==null)return y!==null&&y!==null&&nt(y),l.callbackNode=null,l.callbackPriority=0;if((g&3)===0||$r(l,g)){if(c=g&-g,c===l.callbackPriority)return c;switch(y!==null&&nt(y),Nr(g)){case 2:case 8:g=be;break;case 32:g=Le;break;case 268435456:g=at;break;default:g=Le}return y=YS.bind(null,l),g=rt(g,y),l.callbackPriority=c,l.callbackNode=g,c}return y!==null&&y!==null&&nt(y),l.callbackPriority=2,l.callbackNode=null,2}function YS(l,c){if(Ar!==0&&Ar!==5)return l.callbackNode=null,l.callbackPriority=0,null;var g=l.callbackNode;if(xf()&&l.callbackNode!==g)return null;var y=bt;return y=lr(l,l===Ut?y:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),y===0?null:(NS(l,y,c),WS(l,_e()),l.callbackNode!=null&&l.callbackNode===g?YS.bind(null,l):null)}function GS(l,c){if(xf())return null;NS(l,c,!0)}function o8(){v8(function(){(Mt&6)!==0?rt(le,l8):VS()})}function _x(){if(ts===0){var l=Zl;l===0&&(l=Hn,Hn<<=1,(Hn&261888)===0&&(Hn=256)),ts=l}return ts}function XS(l){return l==null||typeof l=="symbol"||typeof l=="boolean"?null:typeof l=="function"?l:Th(""+l)}function QS(l,c){var g=c.ownerDocument.createElement("input");return g.name=c.name,g.value=c.value,l.id&&g.setAttribute("form",l.id),c.parentNode.insertBefore(g,c),l=new FormData(l),g.parentNode.removeChild(g),l}function c8(l,c,g,y,S){if(c==="submit"&&g&&g.stateNode===S){var _=XS((S[Yt]||null).action),F=y.submitter;F&&(c=(c=F[Yt]||null)?XS(c.formAction):F.getAttribute("formAction"),c!==null&&(_=c,F=null));var X=new Ah("action","action",null,y,S);l.push({event:X,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(ts!==0){var K=F?QS(S,F):new FormData(S);Vm(g,{pending:!0,data:K,method:S.method,action:_},null,K)}}else typeof _=="function"&&(X.preventDefault(),K=F?QS(S,F):new FormData(S),Vm(g,{pending:!0,data:K,method:S.method,action:_},_,K))},currentTarget:S}]})}}for(var Tx=0;Tx<om.length;Tx++){var Ex=om[Tx],u8=Ex.toLowerCase(),d8=Ex[0].toUpperCase()+Ex.slice(1);vi(u8,"on"+d8)}vi(Ew,"onAnimationEnd"),vi(Nw,"onAnimationIteration"),vi(jw,"onAnimationStart"),vi("dblclick","onDoubleClick"),vi("focusin","onFocus"),vi("focusout","onBlur"),vi(EB,"onTransitionRun"),vi(NB,"onTransitionStart"),vi(jB,"onTransitionCancel"),vi(Aw,"onTransitionEnd"),ii("onMouseEnter",["mouseout","mouseover"]),ii("onMouseLeave",["mouseout","mouseover"]),ii("onPointerEnter",["pointerout","pointerover"]),ii("onPointerLeave",["pointerout","pointerover"]),rn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),rn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),rn("onBeforeInput",["compositionend","keypress","textInput","paste"]),rn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),rn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),rn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),h8=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pu));function ZS(l,c){c=(c&4)!==0;for(var g=0;g<l.length;g++){var y=l[g],S=y.event;y=y.listeners;e:{var _=void 0;if(c)for(var F=y.length-1;0<=F;F--){var X=y[F],K=X.instance,ue=X.currentTarget;if(X=X.listener,K!==_&&S.isPropagationStopped())break e;_=X,S.currentTarget=ue;try{_(S)}catch(me){Dh(me)}S.currentTarget=null,_=K}else for(F=0;F<y.length;F++){if(X=y[F],K=X.instance,ue=X.currentTarget,X=X.listener,K!==_&&S.isPropagationStopped())break e;_=X,S.currentTarget=ue;try{_(S)}catch(me){Dh(me)}S.currentTarget=null,_=K}}}}function pt(l,c){var g=c[aa];g===void 0&&(g=c[aa]=new Set);var y=l+"__bubble";g.has(y)||(KS(c,l,2,!1),g.add(y))}function Nx(l,c,g){var y=0;c&&(y|=4),KS(g,l,y,c)}var vf="_reactListening"+Math.random().toString(36).slice(2);function jx(l){if(!l[vf]){l[vf]=!0,jr.forEach(function(g){g!=="selectionchange"&&(h8.has(g)||Nx(g,!1,l),Nx(g,!0,l))});var c=l.nodeType===9?l:l.ownerDocument;c===null||c[vf]||(c[vf]=!0,Nx("selectionchange",!1,c))}}function KS(l,c,g,y){switch(EC(c)){case 2:var S=F8;break;case 8:S=P8;break;default:S=Ux}g=S.bind(null,c,g,l),S=void 0,!Xg||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(S=!0),y?S!==void 0?l.addEventListener(c,g,{capture:!0,passive:S}):l.addEventListener(c,g,!0):S!==void 0?l.addEventListener(c,g,{passive:S}):l.addEventListener(c,g,!1)}function Ax(l,c,g,y,S){var _=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var F=y.tag;if(F===3||F===4){var X=y.stateNode.containerInfo;if(X===S)break;if(F===4)for(F=y.return;F!==null;){var K=F.tag;if((K===3||K===4)&&F.stateNode.containerInfo===S)return;F=F.return}for(;X!==null;){if(F=Se(X),F===null)return;if(K=F.tag,K===5||K===6||K===26||K===27){y=_=F;continue e}X=X.parentNode}}y=y.return}nw(function(){var ue=_,me=Yg(g),ve=[];e:{var he=Mw.get(l);if(he!==void 0){var pe=Ah,De=l;switch(l){case"keypress":if(Nh(g)===0)break e;case"keydown":case"keyup":pe=aB;break;case"focusin":De="focus",pe=Jg;break;case"focusout":De="blur",pe=Jg;break;case"beforeblur":case"afterblur":pe=Jg;break;case"click":if(g.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=sw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=YO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=oB;break;case Ew:case Nw:case jw:pe=QO;break;case Aw:pe=uB;break;case"scroll":case"scrollend":pe=VO;break;case"wheel":pe=hB;break;case"copy":case"cut":case"paste":pe=KO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=ow;break;case"toggle":case"beforetoggle":pe=pB}var Xe=(c&4)!==0,Ht=!Xe&&(l==="scroll"||l==="scrollend"),ae=Xe?he!==null?he+"Capture":null:he;Xe=[];for(var te=ue,ce;te!==null;){var ye=te;if(ce=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||ce===null||ae===null||(ye=Bc(te,ae),ye!=null&&Xe.push(gu(te,ye,ce))),Ht)break;te=te.return}0<Xe.length&&(he=new pe(he,De,null,g,me),ve.push({event:he,listeners:Xe}))}}if((c&7)===0){e:{if(he=l==="mouseover"||l==="pointerover",pe=l==="mouseout"||l==="pointerout",he&&g!==Wg&&(De=g.relatedTarget||g.fromElement)&&(Se(De)||De[ni]))break e;if((pe||he)&&(he=me.window===me?me:(he=me.ownerDocument)?he.defaultView||he.parentWindow:window,pe?(De=g.relatedTarget||g.toElement,pe=ue,De=De?Se(De):null,De!==null&&(Ht=a(De),Xe=De.tag,De!==Ht||Xe!==5&&Xe!==27&&Xe!==6)&&(De=null)):(pe=null,De=ue),pe!==De)){if(Xe=sw,ye="onMouseLeave",ae="onMouseEnter",te="mouse",(l==="pointerout"||l==="pointerover")&&(Xe=ow,ye="onPointerLeave",ae="onPointerEnter",te="pointer"),Ht=pe==null?he:Tt(pe),ce=De==null?he:Tt(De),he=new Xe(ye,te+"leave",pe,g,me),he.target=Ht,he.relatedTarget=ce,ye=null,Se(me)===ue&&(Xe=new Xe(ae,te+"enter",De,g,me),Xe.target=ce,Xe.relatedTarget=Ht,ye=Xe),Ht=ye,pe&&De)t:{for(Xe=f8,ae=pe,te=De,ce=0,ye=ae;ye;ye=Xe(ye))ce++;ye=0;for(var Ue=te;Ue;Ue=Xe(Ue))ye++;for(;0<ce-ye;)ae=Xe(ae),ce--;for(;0<ye-ce;)te=Xe(te),ye--;for(;ce--;){if(ae===te||te!==null&&ae===te.alternate){Xe=ae;break t}ae=Xe(ae),te=Xe(te)}Xe=null}else Xe=null;pe!==null&&JS(ve,he,pe,Xe,!1),De!==null&&Ht!==null&&JS(ve,Ht,De,Xe,!0)}}e:{if(he=ue?Tt(ue):window,pe=he.nodeName&&he.nodeName.toLowerCase(),pe==="select"||pe==="input"&&he.type==="file")var Nt=mw;else if(pw(he))if(xw)Nt=CB;else{Nt=kB;var Fe=wB}else pe=he.nodeName,!pe||pe.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?ue&&Vg(ue.elementType)&&(Nt=mw):Nt=SB;if(Nt&&(Nt=Nt(l,ue))){gw(ve,Nt,g,me);break e}Fe&&Fe(l,he,ue),l==="focusout"&&ue&&he.type==="number"&&ue.memoizedProps.value!=null&&Oc(he,"number",he.value)}switch(Fe=ue?Tt(ue):window,l){case"focusin":(pw(Fe)||Fe.contentEditable==="true")&&(ql=Fe,am=ue,Uc=null);break;case"focusout":Uc=am=ql=null;break;case"mousedown":sm=!0;break;case"contextmenu":case"mouseup":case"dragend":sm=!1,_w(ve,g,me);break;case"selectionchange":if(TB)break;case"keydown":case"keyup":_w(ve,g,me)}var ot;if(tm)e:{switch(l){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else Hl?hw(l,g)&&(vt="onCompositionEnd"):l==="keydown"&&g.keyCode===229&&(vt="onCompositionStart");vt&&(cw&&g.locale!=="ko"&&(Hl||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&Hl&&(ot=iw()):(Ia=me,Qg="value"in Ia?Ia.value:Ia.textContent,Hl=!0)),Fe=wf(ue,vt),0<Fe.length&&(vt=new lw(vt,l,null,g,me),ve.push({event:vt,listeners:Fe}),ot?vt.data=ot:(ot=fw(g),ot!==null&&(vt.data=ot)))),(ot=mB?xB(l,g):yB(l,g))&&(vt=wf(ue,"onBeforeInput"),0<vt.length&&(Fe=new lw("onBeforeInput","beforeinput",null,g,me),ve.push({event:Fe,listeners:vt}),Fe.data=ot)),c8(ve,l,ue,g,me)}ZS(ve,c)})}function gu(l,c,g){return{instance:l,listener:c,currentTarget:g}}function wf(l,c){for(var g=c+"Capture",y=[];l!==null;){var S=l,_=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||_===null||(S=Bc(l,g),S!=null&&y.unshift(gu(l,S,_)),S=Bc(l,c),S!=null&&y.push(gu(l,S,_))),l.tag===3)return y;l=l.return}return[]}function f8(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5&&l.tag!==27);return l||null}function JS(l,c,g,y,S){for(var _=c._reactName,F=[];g!==null&&g!==y;){var X=g,K=X.alternate,ue=X.stateNode;if(X=X.tag,K!==null&&K===y)break;X!==5&&X!==26&&X!==27||ue===null||(K=ue,S?(ue=Bc(g,_),ue!=null&&F.unshift(gu(g,ue,K))):S||(ue=Bc(g,_),ue!=null&&F.push(gu(g,ue,K)))),g=g.return}F.length!==0&&l.push({event:c,listeners:F})}var p8=/\r\n?/g,g8=/\u0000|\uFFFD/g;function eC(l){return(typeof l=="string"?l:""+l).replace(p8,`
50
- `).replace(g8,"")}function tC(l,c){return c=eC(c),eC(l)===c}function Pt(l,c,g,y,S,_){switch(g){case"children":typeof y=="string"?c==="body"||c==="textarea"&&y===""||Il(l,y):(typeof y=="number"||typeof y=="bigint")&&c!=="body"&&Il(l,""+y);break;case"className":zl(l,"class",y);break;case"tabIndex":zl(l,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":zl(l,g,y);break;case"style":tw(l,y,_);break;case"data":if(c!=="object"){zl(l,"data",y);break}case"src":case"href":if(y===""&&(c!=="a"||g!=="href")){l.removeAttribute(g);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){l.removeAttribute(g);break}y=Th(""+y),l.setAttribute(g,y);break;case"action":case"formAction":if(typeof y=="function"){l.setAttribute(g,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(g==="formAction"?(c!=="input"&&Pt(l,c,"name",S.name,S,null),Pt(l,c,"formEncType",S.formEncType,S,null),Pt(l,c,"formMethod",S.formMethod,S,null),Pt(l,c,"formTarget",S.formTarget,S,null)):(Pt(l,c,"encType",S.encType,S,null),Pt(l,c,"method",S.method,S,null),Pt(l,c,"target",S.target,S,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){l.removeAttribute(g);break}y=Th(""+y),l.setAttribute(g,y);break;case"onClick":y!=null&&(l.onclick=la);break;case"onScroll":y!=null&&pt("scroll",l);break;case"onScrollEnd":y!=null&&pt("scrollend",l);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(n(61));if(g=y.__html,g!=null){if(S.children!=null)throw Error(n(60));l.innerHTML=g}}break;case"multiple":l.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":l.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){l.removeAttribute("xlink:href");break}g=Th(""+y),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",g);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?l.setAttribute(g,""+y):l.removeAttribute(g);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":y&&typeof y!="function"&&typeof y!="symbol"?l.setAttribute(g,""):l.removeAttribute(g);break;case"capture":case"download":y===!0?l.setAttribute(g,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?l.setAttribute(g,y):l.removeAttribute(g);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?l.setAttribute(g,y):l.removeAttribute(g);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?l.removeAttribute(g):l.setAttribute(g,y);break;case"popover":pt("beforetoggle",l),pt("toggle",l),$l(l,"popover",y);break;case"xlinkActuate":bi(l,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":bi(l,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":bi(l,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":bi(l,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":bi(l,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":bi(l,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":bi(l,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":bi(l,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":bi(l,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":$l(l,"is",y);break;case"innerText":case"textContent":break;default:(!(2<g.length)||g[0]!=="o"&&g[0]!=="O"||g[1]!=="n"&&g[1]!=="N")&&(g=qO.get(g)||g,$l(l,g,y))}}function Mx(l,c,g,y,S,_){switch(g){case"style":tw(l,y,_);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(n(61));if(g=y.__html,g!=null){if(S.children!=null)throw Error(n(60));l.innerHTML=g}}break;case"children":typeof y=="string"?Il(l,y):(typeof y=="number"||typeof y=="bigint")&&Il(l,""+y);break;case"onScroll":y!=null&&pt("scroll",l);break;case"onScrollEnd":y!=null&&pt("scrollend",l);break;case"onClick":y!=null&&(l.onclick=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_n.hasOwnProperty(g))e:{if(g[0]==="o"&&g[1]==="n"&&(S=g.endsWith("Capture"),c=g.slice(2,S?g.length-7:void 0),_=l[Yt]||null,_=_!=null?_[g]:null,typeof _=="function"&&l.removeEventListener(c,_,S),typeof y=="function")){typeof _!="function"&&_!==null&&(g in l?l[g]=null:l.hasAttribute(g)&&l.removeAttribute(g)),l.addEventListener(c,y,S);break e}g in l?l[g]=y:y===!0?l.setAttribute(g,""):$l(l,g,y)}}}function Gr(l,c,g){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":pt("error",l),pt("load",l);var y=!1,S=!1,_;for(_ in g)if(g.hasOwnProperty(_)){var F=g[_];if(F!=null)switch(_){case"src":y=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,c));default:Pt(l,c,_,F,g,null)}}S&&Pt(l,c,"srcSet",g.srcSet,g,null),y&&Pt(l,c,"src",g.src,g,null);return;case"input":pt("invalid",l);var X=_=F=S=null,K=null,ue=null;for(y in g)if(g.hasOwnProperty(y)){var me=g[y];if(me!=null)switch(y){case"name":S=me;break;case"type":F=me;break;case"checked":K=me;break;case"defaultChecked":ue=me;break;case"value":_=me;break;case"defaultValue":X=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(n(137,c));break;default:Pt(l,c,y,me,g,null)}}_h(l,_,X,K,ue,F,S,!1);return;case"select":pt("invalid",l),y=F=_=null;for(S in g)if(g.hasOwnProperty(S)&&(X=g[S],X!=null))switch(S){case"value":_=X;break;case"defaultValue":F=X;break;case"multiple":y=X;default:Pt(l,c,S,X,g,null)}c=_,g=F,l.multiple=!!y,c!=null?sa(l,!!y,c,!1):g!=null&&sa(l,!!y,g,!0);return;case"textarea":pt("invalid",l),_=S=y=null;for(F in g)if(g.hasOwnProperty(F)&&(X=g[F],X!=null))switch(F){case"value":y=X;break;case"defaultValue":S=X;break;case"children":_=X;break;case"dangerouslySetInnerHTML":if(X!=null)throw Error(n(91));break;default:Pt(l,c,F,X,g,null)}J2(l,y,S,_);return;case"option":for(K in g)if(g.hasOwnProperty(K)&&(y=g[K],y!=null))switch(K){case"selected":l.selected=y&&typeof y!="function"&&typeof y!="symbol";break;default:Pt(l,c,K,y,g,null)}return;case"dialog":pt("beforetoggle",l),pt("toggle",l),pt("cancel",l),pt("close",l);break;case"iframe":case"object":pt("load",l);break;case"video":case"audio":for(y=0;y<pu.length;y++)pt(pu[y],l);break;case"image":pt("error",l),pt("load",l);break;case"details":pt("toggle",l);break;case"embed":case"source":case"link":pt("error",l),pt("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in g)if(g.hasOwnProperty(ue)&&(y=g[ue],y!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,c));default:Pt(l,c,ue,y,g,null)}return;default:if(Vg(c)){for(me in g)g.hasOwnProperty(me)&&(y=g[me],y!==void 0&&Mx(l,c,me,y,g,void 0));return}}for(X in g)g.hasOwnProperty(X)&&(y=g[X],y!=null&&Pt(l,c,X,y,g,null))}function m8(l,c,g,y){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,_=null,F=null,X=null,K=null,ue=null,me=null;for(pe in g){var ve=g[pe];if(g.hasOwnProperty(pe)&&ve!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":K=ve;default:y.hasOwnProperty(pe)||Pt(l,c,pe,null,y,ve)}}for(var he in y){var pe=y[he];if(ve=g[he],y.hasOwnProperty(he)&&(pe!=null||ve!=null))switch(he){case"type":_=pe;break;case"name":S=pe;break;case"checked":ue=pe;break;case"defaultChecked":me=pe;break;case"value":F=pe;break;case"defaultValue":X=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(n(137,c));break;default:pe!==ve&&Pt(l,c,he,pe,y,ve)}}Rs(l,F,X,K,ue,me,_,S);return;case"select":pe=F=X=he=null;for(_ in g)if(K=g[_],g.hasOwnProperty(_)&&K!=null)switch(_){case"value":break;case"multiple":pe=K;default:y.hasOwnProperty(_)||Pt(l,c,_,null,y,K)}for(S in y)if(_=y[S],K=g[S],y.hasOwnProperty(S)&&(_!=null||K!=null))switch(S){case"value":he=_;break;case"defaultValue":X=_;break;case"multiple":F=_;default:_!==K&&Pt(l,c,S,_,y,K)}c=X,g=F,y=pe,he!=null?sa(l,!!g,he,!1):!!y!=!!g&&(c!=null?sa(l,!!g,c,!0):sa(l,!!g,g?[]:"",!1));return;case"textarea":pe=he=null;for(X in g)if(S=g[X],g.hasOwnProperty(X)&&S!=null&&!y.hasOwnProperty(X))switch(X){case"value":break;case"children":break;default:Pt(l,c,X,null,y,S)}for(F in y)if(S=y[F],_=g[F],y.hasOwnProperty(F)&&(S!=null||_!=null))switch(F){case"value":he=S;break;case"defaultValue":pe=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(n(91));break;default:S!==_&&Pt(l,c,F,S,y,_)}K2(l,he,pe);return;case"option":for(var De in g)if(he=g[De],g.hasOwnProperty(De)&&he!=null&&!y.hasOwnProperty(De))switch(De){case"selected":l.selected=!1;break;default:Pt(l,c,De,null,y,he)}for(K in y)if(he=y[K],pe=g[K],y.hasOwnProperty(K)&&he!==pe&&(he!=null||pe!=null))switch(K){case"selected":l.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:Pt(l,c,K,he,y,pe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Xe in g)he=g[Xe],g.hasOwnProperty(Xe)&&he!=null&&!y.hasOwnProperty(Xe)&&Pt(l,c,Xe,null,y,he);for(ue in y)if(he=y[ue],pe=g[ue],y.hasOwnProperty(ue)&&he!==pe&&(he!=null||pe!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(n(137,c));break;default:Pt(l,c,ue,he,y,pe)}return;default:if(Vg(c)){for(var Ht in g)he=g[Ht],g.hasOwnProperty(Ht)&&he!==void 0&&!y.hasOwnProperty(Ht)&&Mx(l,c,Ht,void 0,y,he);for(me in y)he=y[me],pe=g[me],!y.hasOwnProperty(me)||he===pe||he===void 0&&pe===void 0||Mx(l,c,me,he,y,pe);return}}for(var ae in g)he=g[ae],g.hasOwnProperty(ae)&&he!=null&&!y.hasOwnProperty(ae)&&Pt(l,c,ae,null,y,he);for(ve in y)he=y[ve],pe=g[ve],!y.hasOwnProperty(ve)||he===pe||he==null&&pe==null||Pt(l,c,ve,he,y,pe)}function rC(l){switch(l){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function x8(){if(typeof performance.getEntriesByType=="function"){for(var l=0,c=0,g=performance.getEntriesByType("resource"),y=0;y<g.length;y++){var S=g[y],_=S.transferSize,F=S.initiatorType,X=S.duration;if(_&&X&&rC(F)){for(F=0,X=S.responseEnd,y+=1;y<g.length;y++){var K=g[y],ue=K.startTime;if(ue>X)break;var me=K.transferSize,ve=K.initiatorType;me&&rC(ve)&&(K=K.responseEnd,F+=me*(K<X?1:(X-ue)/(K-ue)))}if(--y,c+=8*(_+F)/(S.duration/1e3),l++,10<l)break}}if(0<l)return c/l/1e6}return navigator.connection&&(l=navigator.connection.downlink,typeof l=="number")?l:5}var Lx=null,Dx=null;function kf(l){return l.nodeType===9?l:l.ownerDocument}function nC(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function iC(l,c){if(l===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&c==="foreignObject"?0:l}function Rx(l,c){return l==="textarea"||l==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Ox=null;function y8(){var l=window.event;return l&&l.type==="popstate"?l===Ox?!1:(Ox=l,!0):(Ox=null,!1)}var aC=typeof setTimeout=="function"?setTimeout:void 0,b8=typeof clearTimeout=="function"?clearTimeout:void 0,sC=typeof Promise=="function"?Promise:void 0,v8=typeof queueMicrotask=="function"?queueMicrotask:typeof sC<"u"?function(l){return sC.resolve(null).then(l).catch(w8)}:aC;function w8(l){setTimeout(function(){throw l})}function rs(l){return l==="head"}function lC(l,c){var g=c,y=0;do{var S=g.nextSibling;if(l.removeChild(g),S&&S.nodeType===8)if(g=S.data,g==="/$"||g==="/&"){if(y===0){l.removeChild(S),xo(c);return}y--}else if(g==="$"||g==="$?"||g==="$~"||g==="$!"||g==="&")y++;else if(g==="html")mu(l.ownerDocument.documentElement);else if(g==="head"){g=l.ownerDocument.head,mu(g);for(var _=g.firstChild;_;){var F=_.nextSibling,X=_.nodeName;_[Be]||X==="SCRIPT"||X==="STYLE"||X==="LINK"&&_.rel.toLowerCase()==="stylesheet"||g.removeChild(_),_=F}}else g==="body"&&mu(l.ownerDocument.body);g=S}while(g);xo(c)}function oC(l,c){var g=l;l=0;do{var y=g.nextSibling;if(g.nodeType===1?c?(g._stashedDisplay=g.style.display,g.style.display="none"):(g.style.display=g._stashedDisplay||"",g.getAttribute("style")===""&&g.removeAttribute("style")):g.nodeType===3&&(c?(g._stashedText=g.nodeValue,g.nodeValue=""):g.nodeValue=g._stashedText||""),y&&y.nodeType===8)if(g=y.data,g==="/$"){if(l===0)break;l--}else g!=="$"&&g!=="$?"&&g!=="$~"&&g!=="$!"||l++;g=y}while(g)}function Bx(l){var c=l.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var g=c;switch(c=c.nextSibling,g.nodeName){case"HTML":case"HEAD":case"BODY":Bx(g),ee(g);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(g.rel.toLowerCase()==="stylesheet")continue}l.removeChild(g)}}function k8(l,c,g,y){for(;l.nodeType===1;){var S=g;if(l.nodeName.toLowerCase()!==c.toLowerCase()){if(!y&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(y){if(!l[Be])switch(c){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(_=l.getAttribute("rel"),_==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(_!==S.rel||l.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||l.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||l.getAttribute("title")!==(S.title==null?null:S.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(_=l.getAttribute("src"),(_!==(S.src==null?null:S.src)||l.getAttribute("type")!==(S.type==null?null:S.type)||l.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&_&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(c==="input"&&l.type==="hidden"){var _=S.name==null?null:""+S.name;if(S.type==="hidden"&&l.getAttribute("name")===_)return l}else return l;if(l=di(l.nextSibling),l===null)break}return null}function S8(l,c,g){if(c==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!g||(l=di(l.nextSibling),l===null))return null;return l}function cC(l,c){for(;l.nodeType!==8;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!c||(l=di(l.nextSibling),l===null))return null;return l}function $x(l){return l.data==="$?"||l.data==="$~"}function zx(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState!=="loading"}function C8(l,c){var g=l.ownerDocument;if(l.data==="$~")l._reactRetry=c;else if(l.data!=="$?"||g.readyState!=="loading")c();else{var y=function(){c(),g.removeEventListener("DOMContentLoaded",y)};g.addEventListener("DOMContentLoaded",y),l._reactRetry=y}}function di(l){for(;l!=null;l=l.nextSibling){var c=l.nodeType;if(c===1||c===3)break;if(c===8){if(c=l.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return l}var Ix=null;function uC(l){l=l.nextSibling;for(var c=0;l;){if(l.nodeType===8){var g=l.data;if(g==="/$"||g==="/&"){if(c===0)return di(l.nextSibling);c--}else g!=="$"&&g!=="$!"&&g!=="$?"&&g!=="$~"&&g!=="&"||c++}l=l.nextSibling}return null}function dC(l){l=l.previousSibling;for(var c=0;l;){if(l.nodeType===8){var g=l.data;if(g==="$"||g==="$!"||g==="$?"||g==="$~"||g==="&"){if(c===0)return l;c--}else g!=="/$"&&g!=="/&"||c++}l=l.previousSibling}return null}function hC(l,c,g){switch(c=kf(g),l){case"html":if(l=c.documentElement,!l)throw Error(n(452));return l;case"head":if(l=c.head,!l)throw Error(n(453));return l;case"body":if(l=c.body,!l)throw Error(n(454));return l;default:throw Error(n(451))}}function mu(l){for(var c=l.attributes;c.length;)l.removeAttributeNode(c[0]);ee(l)}var hi=new Map,fC=new Set;function Sf(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var Sa=H.d;H.d={f:_8,r:T8,D:E8,C:N8,L:j8,m:A8,X:L8,S:M8,M:D8};function _8(){var l=Sa.f(),c=pf();return l||c}function T8(l){var c=Me(l);c!==null&&c.tag===5&&c.type==="form"?Ak(c):Sa.r(l)}var po=typeof document>"u"?null:document;function pC(l,c,g){var y=po;if(y&&typeof c=="string"&&c){var S=En(c);S='link[rel="'+l+'"][href="'+S+'"]',typeof g=="string"&&(S+='[crossorigin="'+g+'"]'),fC.has(S)||(fC.add(S),l={rel:l,crossOrigin:g,href:c},y.querySelector(S)===null&&(c=y.createElement("link"),Gr(c,"link",l),lt(c),y.head.appendChild(c)))}}function E8(l){Sa.D(l),pC("dns-prefetch",l,null)}function N8(l,c){Sa.C(l,c),pC("preconnect",l,c)}function j8(l,c,g){Sa.L(l,c,g);var y=po;if(y&&l&&c){var S='link[rel="preload"][as="'+En(c)+'"]';c==="image"&&g&&g.imageSrcSet?(S+='[imagesrcset="'+En(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(S+='[imagesizes="'+En(g.imageSizes)+'"]')):S+='[href="'+En(l)+'"]';var _=S;switch(c){case"style":_=go(l);break;case"script":_=mo(l)}hi.has(_)||(l=p({rel:"preload",href:c==="image"&&g&&g.imageSrcSet?void 0:l,as:c},g),hi.set(_,l),y.querySelector(S)!==null||c==="style"&&y.querySelector(xu(_))||c==="script"&&y.querySelector(yu(_))||(c=y.createElement("link"),Gr(c,"link",l),lt(c),y.head.appendChild(c)))}}function A8(l,c){Sa.m(l,c);var g=po;if(g&&l){var y=c&&typeof c.as=="string"?c.as:"script",S='link[rel="modulepreload"][as="'+En(y)+'"][href="'+En(l)+'"]',_=S;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=mo(l)}if(!hi.has(_)&&(l=p({rel:"modulepreload",href:l},c),hi.set(_,l),g.querySelector(S)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(yu(_)))return}y=g.createElement("link"),Gr(y,"link",l),lt(y),g.head.appendChild(y)}}}function M8(l,c,g){Sa.S(l,c,g);var y=po;if(y&&l){var S=Kt(y).hoistableStyles,_=go(l);c=c||"default";var F=S.get(_);if(!F){var X={loading:0,preload:null};if(F=y.querySelector(xu(_)))X.loading=5;else{l=p({rel:"stylesheet",href:l,"data-precedence":c},g),(g=hi.get(_))&&Fx(l,g);var K=F=y.createElement("link");lt(K),Gr(K,"link",l),K._p=new Promise(function(ue,me){K.onload=ue,K.onerror=me}),K.addEventListener("load",function(){X.loading|=1}),K.addEventListener("error",function(){X.loading|=2}),X.loading|=4,Cf(F,c,y)}F={type:"stylesheet",instance:F,count:1,state:X},S.set(_,F)}}}function L8(l,c){Sa.X(l,c);var g=po;if(g&&l){var y=Kt(g).hoistableScripts,S=mo(l),_=y.get(S);_||(_=g.querySelector(yu(S)),_||(l=p({src:l,async:!0},c),(c=hi.get(S))&&Px(l,c),_=g.createElement("script"),lt(_),Gr(_,"link",l),g.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},y.set(S,_))}}function D8(l,c){Sa.M(l,c);var g=po;if(g&&l){var y=Kt(g).hoistableScripts,S=mo(l),_=y.get(S);_||(_=g.querySelector(yu(S)),_||(l=p({src:l,async:!0,type:"module"},c),(c=hi.get(S))&&Px(l,c),_=g.createElement("script"),lt(_),Gr(_,"link",l),g.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},y.set(S,_))}}function gC(l,c,g,y){var S=(S=J.current)?Sf(S):null;if(!S)throw Error(n(446));switch(l){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(c=go(g.href),g=Kt(S).hoistableStyles,y=g.get(c),y||(y={type:"style",instance:null,count:0,state:null},g.set(c,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){l=go(g.href);var _=Kt(S).hoistableStyles,F=_.get(l);if(F||(S=S.ownerDocument||S,F={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(l,F),(_=S.querySelector(xu(l)))&&!_._p&&(F.instance=_,F.state.loading=5),hi.has(l)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},hi.set(l,g),_||R8(S,l,g,F.state))),c&&y===null)throw Error(n(528,""));return F}if(c&&y!==null)throw Error(n(529,""));return null;case"script":return c=g.async,g=g.src,typeof g=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=mo(g),g=Kt(S).hoistableScripts,y=g.get(c),y||(y={type:"script",instance:null,count:0,state:null},g.set(c,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,l))}}function go(l){return'href="'+En(l)+'"'}function xu(l){return'link[rel="stylesheet"]['+l+"]"}function mC(l){return p({},l,{"data-precedence":l.precedence,precedence:null})}function R8(l,c,g,y){l.querySelector('link[rel="preload"][as="style"]['+c+"]")?y.loading=1:(c=l.createElement("link"),y.preload=c,c.addEventListener("load",function(){return y.loading|=1}),c.addEventListener("error",function(){return y.loading|=2}),Gr(c,"link",g),lt(c),l.head.appendChild(c))}function mo(l){return'[src="'+En(l)+'"]'}function yu(l){return"script[async]"+l}function xC(l,c,g){if(c.count++,c.instance===null)switch(c.type){case"style":var y=l.querySelector('style[data-href~="'+En(g.href)+'"]');if(y)return c.instance=y,lt(y),y;var S=p({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return y=(l.ownerDocument||l).createElement("style"),lt(y),Gr(y,"style",S),Cf(y,g.precedence,l),c.instance=y;case"stylesheet":S=go(g.href);var _=l.querySelector(xu(S));if(_)return c.state.loading|=4,c.instance=_,lt(_),_;y=mC(g),(S=hi.get(S))&&Fx(y,S),_=(l.ownerDocument||l).createElement("link"),lt(_);var F=_;return F._p=new Promise(function(X,K){F.onload=X,F.onerror=K}),Gr(_,"link",y),c.state.loading|=4,Cf(_,g.precedence,l),c.instance=_;case"script":return _=mo(g.src),(S=l.querySelector(yu(_)))?(c.instance=S,lt(S),S):(y=g,(S=hi.get(_))&&(y=p({},g),Px(y,S)),l=l.ownerDocument||l,S=l.createElement("script"),lt(S),Gr(S,"link",y),l.head.appendChild(S),c.instance=S);case"void":return null;default:throw Error(n(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(y=c.instance,c.state.loading|=4,Cf(y,g.precedence,l));return c.instance}function Cf(l,c,g){for(var y=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=y.length?y[y.length-1]:null,_=S,F=0;F<y.length;F++){var X=y[F];if(X.dataset.precedence===c)_=X;else if(_!==S)break}_?_.parentNode.insertBefore(l,_.nextSibling):(c=g.nodeType===9?g.head:g,c.insertBefore(l,c.firstChild))}function Fx(l,c){l.crossOrigin==null&&(l.crossOrigin=c.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=c.referrerPolicy),l.title==null&&(l.title=c.title)}function Px(l,c){l.crossOrigin==null&&(l.crossOrigin=c.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=c.referrerPolicy),l.integrity==null&&(l.integrity=c.integrity)}var _f=null;function yC(l,c,g){if(_f===null){var y=new Map,S=_f=new Map;S.set(g,y)}else S=_f,y=S.get(g),y||(y=new Map,S.set(g,y));if(y.has(l))return y;for(y.set(l,null),g=g.getElementsByTagName(l),S=0;S<g.length;S++){var _=g[S];if(!(_[Be]||_[cr]||l==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var F=_.getAttribute(c)||"";F=l+F;var X=y.get(F);X?X.push(_):y.set(F,[_])}}return y}function bC(l,c,g){l=l.ownerDocument||l,l.head.insertBefore(g,c==="title"?l.querySelector("head > title"):null)}function O8(l,c,g){if(g===1||c.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return l=c.disabled,typeof c.precedence=="string"&&l==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function vC(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function B8(l,c,g,y){if(g.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var S=go(y.href),_=c.querySelector(xu(S));if(_){c=_._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(l.count++,l=Tf.bind(l),c.then(l,l)),g.state.loading|=4,g.instance=_,lt(_);return}_=c.ownerDocument||c,y=mC(y),(S=hi.get(S))&&Fx(y,S),_=_.createElement("link"),lt(_);var F=_;F._p=new Promise(function(X,K){F.onload=X,F.onerror=K}),Gr(_,"link",y),g.instance=_}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(g,c),(c=g.state.preload)&&(g.state.loading&3)===0&&(l.count++,g=Tf.bind(l),c.addEventListener("load",g),c.addEventListener("error",g))}}var Hx=0;function $8(l,c){return l.stylesheets&&l.count===0&&Nf(l,l.stylesheets),0<l.count||0<l.imgCount?function(g){var y=setTimeout(function(){if(l.stylesheets&&Nf(l,l.stylesheets),l.unsuspend){var _=l.unsuspend;l.unsuspend=null,_()}},6e4+c);0<l.imgBytes&&Hx===0&&(Hx=62500*x8());var S=setTimeout(function(){if(l.waitingForImages=!1,l.count===0&&(l.stylesheets&&Nf(l,l.stylesheets),l.unsuspend)){var _=l.unsuspend;l.unsuspend=null,_()}},(l.imgBytes>Hx?50:800)+c);return l.unsuspend=g,function(){l.unsuspend=null,clearTimeout(y),clearTimeout(S)}}:null}function Tf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nf(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Ef=null;function Nf(l,c){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Ef=new Map,c.forEach(z8,l),Ef=null,Tf.call(l))}function z8(l,c){if(!(c.state.loading&4)){var g=Ef.get(l);if(g)var y=g.get(null);else{g=new Map,Ef.set(l,g);for(var S=l.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<S.length;_++){var F=S[_];(F.nodeName==="LINK"||F.getAttribute("media")!=="not all")&&(g.set(F.dataset.precedence,F),y=F)}y&&g.set(null,y)}S=c.instance,F=S.getAttribute("data-precedence"),_=g.get(F)||y,_===y&&g.set(null,S),g.set(F,S),this.count++,y=Tf.bind(this),S.addEventListener("load",y),S.addEventListener("error",y),_?_.parentNode.insertBefore(S,_.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(S,l.firstChild)),c.state.loading|=4}}var bu={$$typeof:T,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function I8(l,c,g,y,S,_,F,X,K){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=zr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zr(0),this.hiddenUpdates=zr(null),this.identifierPrefix=y,this.onUncaughtError=S,this.onCaughtError=_,this.onRecoverableError=F,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function wC(l,c,g,y,S,_,F,X,K,ue,me,ve){return l=new I8(l,c,g,F,K,ue,me,ve,X),c=1,_===!0&&(c|=24),_=Wn(3,null,null,c),l.current=_,_.stateNode=l,c=wm(),c.refCount++,l.pooledCache=c,c.refCount++,_.memoizedState={element:y,isDehydrated:g,cache:c},_m(_),l}function kC(l){return l?(l=Wl,l):Wl}function SC(l,c,g,y,S,_){S=kC(S),y.context===null?y.context=S:y.pendingContext=S,y=Va(c),y.payload={element:g},_=_===void 0?null:_,_!==null&&(y.callback=_),g=Wa(l,y,c),g!==null&&(Dn(g,l,c),Zc(g,l,c))}function CC(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<c?g:c}}function qx(l,c){CC(l,c),(l=l.alternate)&&CC(l,c)}function _C(l){if(l.tag===13||l.tag===31){var c=zs(l,67108864);c!==null&&Dn(c,l,67108864),qx(l,67108864)}}function TC(l){if(l.tag===13||l.tag===31){var c=Zn();c=or(c);var g=zs(l,c);g!==null&&Dn(g,l,c),qx(l,c)}}var jf=!0;function F8(l,c,g,y){var S=R.T;R.T=null;var _=H.p;try{H.p=2,Ux(l,c,g,y)}finally{H.p=_,R.T=S}}function P8(l,c,g,y){var S=R.T;R.T=null;var _=H.p;try{H.p=8,Ux(l,c,g,y)}finally{H.p=_,R.T=S}}function Ux(l,c,g,y){if(jf){var S=Vx(y);if(S===null)Ax(l,c,y,Af,g),NC(l,y);else if(q8(S,l,c,g,y))y.stopPropagation();else if(NC(l,y),c&4&&-1<H8.indexOf(l)){for(;S!==null;){var _=Me(S);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var F=Bt(_.pendingLanes);if(F!==0){var X=_;for(X.pendingLanes|=2,X.entangledLanes|=2;F;){var K=1<<31-dt(F);X.entanglements[1]|=K,F&=~K}Hi(_),(Mt&6)===0&&(hf=_e()+500,fu(0))}}break;case 31:case 13:X=zs(_,2),X!==null&&Dn(X,_,2),pf(),qx(_,2)}if(_=Vx(y),_===null&&Ax(l,c,y,Af,g),_===S)break;S=_}S!==null&&y.stopPropagation()}else Ax(l,c,y,null,g)}}function Vx(l){return l=Yg(l),Wx(l)}var Af=null;function Wx(l){if(Af=null,l=Se(l),l!==null){var c=a(l);if(c===null)l=null;else{var g=c.tag;if(g===13){if(l=s(c),l!==null)return l;l=null}else if(g===31){if(l=o(c),l!==null)return l;l=null}else if(g===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;l=null}else c!==l&&(l=null)}}return Af=l,null}function EC(l){switch(l){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(je()){case le:return 2;case be:return 8;case Le:case We:return 32;case at:return 268435456;default:return 32}default:return 32}}var Yx=!1,ns=null,is=null,as=null,vu=new Map,wu=new Map,ss=[],H8="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function NC(l,c){switch(l){case"focusin":case"focusout":ns=null;break;case"dragenter":case"dragleave":is=null;break;case"mouseover":case"mouseout":as=null;break;case"pointerover":case"pointerout":vu.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":wu.delete(c.pointerId)}}function ku(l,c,g,y,S,_){return l===null||l.nativeEvent!==_?(l={blockedOn:c,domEventName:g,eventSystemFlags:y,nativeEvent:_,targetContainers:[S]},c!==null&&(c=Me(c),c!==null&&_C(c)),l):(l.eventSystemFlags|=y,c=l.targetContainers,S!==null&&c.indexOf(S)===-1&&c.push(S),l)}function q8(l,c,g,y,S){switch(c){case"focusin":return ns=ku(ns,l,c,g,y,S),!0;case"dragenter":return is=ku(is,l,c,g,y,S),!0;case"mouseover":return as=ku(as,l,c,g,y,S),!0;case"pointerover":var _=S.pointerId;return vu.set(_,ku(vu.get(_)||null,l,c,g,y,S)),!0;case"gotpointercapture":return _=S.pointerId,wu.set(_,ku(wu.get(_)||null,l,c,g,y,S)),!0}return!1}function jC(l){var c=Se(l.target);if(c!==null){var g=a(c);if(g!==null){if(c=g.tag,c===13){if(c=s(g),c!==null){l.blockedOn=c,Un(l.priority,function(){TC(g)});return}}else if(c===31){if(c=o(g),c!==null){l.blockedOn=c,Un(l.priority,function(){TC(g)});return}}else if(c===3&&g.stateNode.current.memoizedState.isDehydrated){l.blockedOn=g.tag===3?g.stateNode.containerInfo:null;return}}}l.blockedOn=null}function Mf(l){if(l.blockedOn!==null)return!1;for(var c=l.targetContainers;0<c.length;){var g=Vx(l.nativeEvent);if(g===null){g=l.nativeEvent;var y=new g.constructor(g.type,g);Wg=y,g.target.dispatchEvent(y),Wg=null}else return c=Me(g),c!==null&&_C(c),l.blockedOn=g,!1;c.shift()}return!0}function AC(l,c,g){Mf(l)&&g.delete(c)}function U8(){Yx=!1,ns!==null&&Mf(ns)&&(ns=null),is!==null&&Mf(is)&&(is=null),as!==null&&Mf(as)&&(as=null),vu.forEach(AC),wu.forEach(AC)}function Lf(l,c){l.blockedOn===c&&(l.blockedOn=null,Yx||(Yx=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,U8)))}var Df=null;function MC(l){Df!==l&&(Df=l,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Df===l&&(Df=null);for(var c=0;c<l.length;c+=3){var g=l[c],y=l[c+1],S=l[c+2];if(typeof y!="function"){if(Wx(y||g)===null)continue;break}var _=Me(g);_!==null&&(l.splice(c,3),c-=3,Vm(_,{pending:!0,data:S,method:g.method,action:y},y,S))}}))}function xo(l){function c(K){return Lf(K,l)}ns!==null&&Lf(ns,l),is!==null&&Lf(is,l),as!==null&&Lf(as,l),vu.forEach(c),wu.forEach(c);for(var g=0;g<ss.length;g++){var y=ss[g];y.blockedOn===l&&(y.blockedOn=null)}for(;0<ss.length&&(g=ss[0],g.blockedOn===null);)jC(g),g.blockedOn===null&&ss.shift();if(g=(l.ownerDocument||l).$$reactFormReplay,g!=null)for(y=0;y<g.length;y+=3){var S=g[y],_=g[y+1],F=S[Yt]||null;if(typeof _=="function")F||MC(g);else if(F){var X=null;if(_&&_.hasAttribute("formAction")){if(S=_,F=_[Yt]||null)X=F.formAction;else if(Wx(S)!==null)continue}else X=F.action;typeof X=="function"?g[y+1]=X:(g.splice(y,3),y-=3),MC(g)}}}function LC(){function l(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(F){return S=F})},focusReset:"manual",scroll:"manual"})}function c(){S!==null&&(S(),S=null),y||setTimeout(g,20)}function g(){if(!y&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var y=!1,S=null;return navigation.addEventListener("navigate",l),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(g,100),function(){y=!0,navigation.removeEventListener("navigate",l),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),S!==null&&(S(),S=null)}}}function Gx(l){this._internalRoot=l}Rf.prototype.render=Gx.prototype.render=function(l){var c=this._internalRoot;if(c===null)throw Error(n(409));var g=c.current,y=Zn();SC(g,y,l,c,null,null)},Rf.prototype.unmount=Gx.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var c=l.containerInfo;SC(l.current,2,null,l,null,null),pf(),c[ni]=null}};function Rf(l){this._internalRoot=l}Rf.prototype.unstable_scheduleHydration=function(l){if(l){var c=tn();l={blockedOn:null,target:l,priority:c};for(var g=0;g<ss.length&&c!==0&&c<ss[g].priority;g++);ss.splice(g,0,l),g===0&&jC(l)}};var DC=t.version;if(DC!=="19.2.3")throw Error(n(527,DC,"19.2.3"));H.findDOMNode=function(l){var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=d(c),l=l!==null?f(l):null,l=l===null?null:l.stateNode,l};var V8={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Of=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Of.isDisabled&&Of.supportsFiber)try{Wt=Of.inject(V8),It=Of}catch{}}return Cu.createRoot=function(l,c){if(!i(l))throw Error(n(299));var g=!1,y="",S=Fk,_=Pk,F=Hk;return c!=null&&(c.unstable_strictMode===!0&&(g=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(S=c.onUncaughtError),c.onCaughtError!==void 0&&(_=c.onCaughtError),c.onRecoverableError!==void 0&&(F=c.onRecoverableError)),c=wC(l,1,!1,null,null,g,y,null,S,_,F,LC),l[ni]=c.current,jx(l),new Gx(c)},Cu.hydrateRoot=function(l,c,g){if(!i(l))throw Error(n(299));var y=!1,S="",_=Fk,F=Pk,X=Hk,K=null;return g!=null&&(g.unstable_strictMode===!0&&(y=!0),g.identifierPrefix!==void 0&&(S=g.identifierPrefix),g.onUncaughtError!==void 0&&(_=g.onUncaughtError),g.onCaughtError!==void 0&&(F=g.onCaughtError),g.onRecoverableError!==void 0&&(X=g.onRecoverableError),g.formState!==void 0&&(K=g.formState)),c=wC(l,1,!0,c,g??null,y,S,K,_,F,X,LC),c.context=kC(null),g=c.current,y=Zn(),y=or(y),S=Va(y),S.callback=null,Wa(g,S,y),g=y,c.current.lanes=g,Ur(c,g),Hi(c),l[ni]=c.current,jx(l),new Rf(c)},Cu.version="19.2.3",Cu}var qC;function r$(){if(qC)return Zx.exports;qC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Zx.exports=t$(),Zx.exports}var n$=r$();function Sr(e){return"group"in e&&"steps"in e}function xc(e){return"slide"in e||"step"in e&&e.step==="slide"}function Tl(e){return"rest"in e||"step"in e&&e.step==="rest"}function yc(e){return"shell"in e||"step"in e&&e.step==="shell"}function Zd(e){return"browser"in e||"step"in e&&e.step==="browser"}function Kd(e){return"code"in e||"step"in e&&e.step==="code"}function Jd(e){return"wait"in e||"step"in e&&e.step==="wait"}function eh(e){return"assert"in e||"step"in e&&e.step==="assert"}function bc(e){return"graphql"in e||"step"in e&&e.step==="graphql"}function th(e){return"db"in e||"step"in e&&e.step==="db"}function vc(e){return"form"in e||"step"in e&&e.step==="form"}function wc(e){return"terminal"in e||"step"in e&&e.step==="terminal"}function kc(e){return"poll"in e||"step"in e&&e.step==="poll"}function El(e,t){if(Sr(e))return e.group;if(e.title)return e.title;if(xc(e)){const i=("slide"in e?e.slide:e.content).trim().split(`
51
- `)[0].match(/^#+ (.+)$/);return i?i[1]:`Slide ${t+1}`}if(Tl(e))return"rest"in e?e.rest:`${e.method} ${e.path}`;if(yc(e)){const r="shell"in e?e.shell:e.command;return r.length>40?r.substring(0,40)+"...":r}if(Zd(e))return"browser"in e?e.browser:e.url;if(Kd(e))return e.filename||`Code ${t+1}`;if(Jd(e)){const r="wait"in e?e.wait:e.duration;return e.message||`Wait ${r}ms`}if(eh(e)){const r="assert"in e?e.assert:e.condition;return r.length>30?r.substring(0,30)+"...":r}if(bc(e)){const n=("graphql"in e?e.graphql:e.query).trim().split(`
52
- `)[0];return n.length>40?n.substring(0,40)+"...":n}if(th(e))return`${"db"in e?e.db:e.operation} ${e.collection||e.table||""}`.trim();if(vc(e))return"form"in e?e.form:e.title;if(wc(e)){const n=("terminal"in e?e.terminal:e.content).trim().split(`
53
- `)[0];return n.length>40?n.substring(0,40)+"...":n}return kc(e)?`Poll ${"poll"in e?e.poll:e.endpoint}`:`Step ${t+1}`}function Sc(e){if(Sr(e))return"group";if(xc(e))return"slide";if(Tl(e))return"rest";if(yc(e))return"shell";if(Zd(e))return"browser";if(Kd(e))return"code";if(Jd(e))return"wait";if(eh(e))return"assert";if(bc(e))return"graphql";if(th(e))return"db";if(vc(e))return"form";if(wc(e))return"terminal";if(kc(e))return"poll";throw new Error("Unknown step type")}function L0(e){if("rest"in e){const t=e.rest.trim().split(/\s+/);return t.length===1?{method:"GET",endpoint:t[0]}:{method:t[0].toUpperCase(),endpoint:t.slice(1).join(" ")}}return{method:e.method,endpoint:e.path}}function oE(e){const t=[];for(const r of e)Sr(r)?t.push(...r.steps):t.push(r);return t}function D0(e){return"slide"in e?e.slide:e.content}function hb(e){return"shell"in e?e.shell:e.command}function fb(e){return"browser"in e?e.browser:e.url}function pb(e){return"code"in e?e.code:e.source}function gb(e){return"wait"in e?e.wait:e.duration}function R0(e){return"assert"in e?e.assert:e.condition}function wd(e){return"graphql"in e?e.graphql:e.query}function id(e){return"db"in e?e.db:e.operation}function O0(e){return"form"in e?e.form:e.title}function B0(e){return"terminal"in e?e.terminal:e.content}function $0(e){return"poll"in e?e.poll:e.endpoint}function hr(e,t){return e.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(r,n)=>{if(n in t){const i=t[n];return String(i??"")}return r})}function ln(e,t){if(typeof e=="string")return hr(e,t);if(Array.isArray(e))return e.map(r=>ln(r,t));if(e!==null&&typeof e=="object"){const r={};for(const[n,i]of Object.entries(e))r[n]=ln(i,t);return r}return e}function i$(e){const t=e.match(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g);return t?[...new Set(t.map(r=>r.slice(1)))]:[]}function jo(e){return typeof e=="string"?i$(e):Array.isArray(e)?[...new Set(e.flatMap(t=>jo(t)))]:e!==null&&typeof e=="object"?[...new Set(Object.values(e).flatMap(t=>jo(t)))]:[]}function a$(e,t){return e.filter(r=>!(r in t))}function qr(e,t){if(!t)return e;const r=[];let n=0;for(;n<t.length;)if(t[n]==="["){const a=t.indexOf("]",n);if(a===-1)break;const s=parseInt(t.slice(n+1,a),10);isNaN(s)||r.push(s),n=a+1,t[n]==="."&&n++}else if(t[n]===".")n++;else{let a=n;for(;a<t.length&&t[a]!=="."&&t[a]!=="[";)a++;a>n&&r.push(t.slice(n,a)),n=a,t[n]==="."&&n++}let i=e;for(const a of r){if(i==null)return;if(typeof a=="number")if(Array.isArray(i))i=i[a];else return;else if(typeof i=="object")i=i[a];else return}return i}const cE={config:null,recordings:null,currentStep:0,stepStatuses:{},stepErrors:{},stepResponses:{},variables:{},mode:"recorded",isLiveAvailable:!1,stepIdMap:new Map,flatSteps:[],sidebarCollapsed:!1,variableProviders:new Map,diagramVisible:!1,completedDiagramPaths:[]};function s$(e){const t=new Map;return e.forEach((r,n)=>{"id"in r&&r.id&&t.set(r.id,n)}),t}function l$(e){const t=new Map;return e.forEach((r,n)=>{if("save"in r&&r.save){const i=r.save;for(const a of Object.keys(i))t.set(a,{stepIndex:n,stepTitle:El(r,n)})}}),t}function o$(e,t){const r={};return e.forEach((n,i)=>{var a;if("save"in n&&n.save){const s=t.recordings.find(u=>u.stepId===`step-${i}`);if(!s)return;const o=n.save;for(const[u,d]of Object.entries(o))if("rest"in n&&((a=s.response)==null?void 0:a.body)!==void 0&&(d==="_status"?s.response.status!==void 0&&(r[u]=s.response.status):r[u]=qr(s.response.body,d)),"shell"in n)if(d==="stdout"||d==="output")r[u]=s.stdout??s.output;else if(d==="stderr")r[u]=s.stderr;else if(d==="status")r[u]=s.status;else{const f=s.stdout??s.output??"";if(typeof f=="string")try{const p=new RegExp(d),m=f.match(p);m&&(r[u]=m[1]||m[0])}catch{}}}}),r}function c$(e,t){var r,n;switch(t.type){case"SET_CONFIG":{const i=oE(t.payload.steps),a=((n=(r=t.payload.settings)==null?void 0:r.sidebar)==null?void 0:n.collapsed)??!1;return{...e,config:t.payload,flatSteps:i,stepIdMap:s$(i),variableProviders:l$(i),sidebarCollapsed:a}}case"SET_RECORDINGS":{const i=e.flatSteps.length>0?o$(e.flatSteps,t.payload):{};return{...e,recordings:t.payload,variables:{...e.variables,...i}}}case"SET_STEP":{const i=t.payload;if(i<e.currentStep){const a=e.flatSteps.slice(0,i).map(s=>"diagram"in s?s.diagram:void 0).filter(s=>!!s);return{...e,currentStep:i,completedDiagramPaths:a}}if(i>e.currentStep){const a=e.flatSteps.slice(e.currentStep,i).map(s=>"diagram"in s?s.diagram:void 0).filter(s=>!!s);return{...e,currentStep:i,completedDiagramPaths:[...e.completedDiagramPaths,...a]}}return{...e,currentStep:i}}case"NEXT_STEP":{const i=e.flatSteps[e.currentStep],a=i&&"diagram"in i?i.diagram:void 0,s=a?[...e.completedDiagramPaths,a]:e.completedDiagramPaths;return{...e,currentStep:Math.min(e.currentStep+1,e.flatSteps.length-1),completedDiagramPaths:s}}case"PREV_STEP":{const i=e.completedDiagramPaths.slice(0,-1);return{...e,currentStep:Math.max(e.currentStep-1,0),completedDiagramPaths:i}}case"GOTO_STEP_BY_ID":{const i=e.stepIdMap.get(t.payload);return i!==void 0?{...e,currentStep:i}:(console.warn(`Step ID "${t.payload}" not found, staying on current step`),e)}case"SET_STEP_STATUS":return{...e,stepStatuses:{...e.stepStatuses,[t.payload.step]:t.payload.status}};case"SET_STEP_ERROR":{const i={...e.stepErrors};return t.payload.error===null?delete i[t.payload.step]:i[t.payload.step]=t.payload.error,{...e,stepErrors:i}}case"SET_STEP_RESPONSE":return{...e,stepResponses:{...e.stepResponses,[t.payload.step]:t.payload.response}};case"SET_VARIABLE":return{...e,variables:{...e.variables,[t.payload.name]:t.payload.value}};case"SET_VARIABLES":return{...e,variables:{...e.variables,...t.payload}};case"SET_MODE":return{...e,mode:t.payload};case"SET_LIVE_AVAILABLE":return{...e,isLiveAvailable:t.payload};case"TOGGLE_SIDEBAR":return{...e,sidebarCollapsed:!e.sidebarCollapsed};case"TOGGLE_DIAGRAM":return{...e,diagramVisible:!e.diagramVisible};case"RESET":return{...cE,config:e.config,recordings:e.recordings,mode:e.mode,isLiveAvailable:e.isLiveAvailable,stepIdMap:e.stepIdMap,flatSteps:e.flatSteps,sidebarCollapsed:e.sidebarCollapsed,diagramVisible:e.diagramVisible,completedDiagramPaths:[]};default:return e}}function u$(e){const t=[];let r=0;for(let n=0;n<e.length;n++){const i=e[n];if(Sr(i)){const a=i.steps.map(s=>({step:s,flatIndex:r++}));t.push({type:"group",group:i,groupIndex:n,stepsInGroup:a})}else t.push({type:"step",step:i,flatIndex:r++})}return t}const uE=N.createContext(null);function UC({children:e}){var T,j,L,E;const[t,r]=N.useReducer(c$,cE),[n,i]=N.useState({});N.useMemo(()=>{if(t.config){const M={};t.config.steps.forEach((I,P)=>{Sr(I)&&(M[P]=!I.collapsed)}),i(M)}},[t.config]);const a=N.useCallback(M=>{i(I=>({...I,[M]:!I[M]}))},[]),s=N.useCallback(()=>{r({type:"TOGGLE_DIAGRAM"})},[]),o=t.flatSteps[t.currentStep]??null,u=o&&"diagram"in o?o.diagram:void 0,d=!!((L=(j=(T=t.config)==null?void 0:T.settings)==null?void 0:j.diagram)!=null&&L.chart),f=((E=t.recordings)==null?void 0:E.recordings.find(M=>M.stepId===`step-${t.currentStep}`))??null,p=t.flatSteps.length,m=t.currentStep===0,x=t.currentStep===p-1,b=M=>t.stepStatuses[M]??"pending",v=M=>{r({type:"GOTO_STEP_BY_ID",payload:M})},k=M=>t.stepIdMap.has(M),w=M=>t.variableProviders.get(M),C=N.useMemo(()=>t.config?u$(t.config.steps):[],[t.config]);return h.jsx(uE.Provider,{value:{state:t,dispatch:r,currentStepConfig:o,currentRecording:f,totalSteps:p,isFirstStep:m,isLastStep:x,getStepStatus:b,gotoStepById:v,hasStepId:k,getVariableProvider:w,expandedGroups:n,toggleGroup:a,stepperStructure:C,toggleDiagram:s,currentDiagramPath:u,hasDiagram:d},children:e})}function rr(){const e=N.useContext(uE);if(!e)throw new Error("useDemo must be used within a DemoProvider");return e}function z0(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?`${parseInt(t[1],16)}, ${parseInt(t[2],16)}, ${parseInt(t[3],16)}`:"139, 92, 246"}const il={purple:{primary:"#8b5cf6",accent:"#06b6d4"},blue:{primary:"#3b82f6",accent:"#8b5cf6"},green:{primary:"#10b981",accent:"#059669"},teal:{primary:"#14b8a6",accent:"#f59e0b"},orange:{primary:"#f97316",accent:"#8b5cf6"},rose:{primary:"#f43f5e",accent:"#8b5cf6"}},ty={primary:il.purple.primary,accent:il.purple.accent,primaryRgb:z0(il.purple.primary),accentRgb:z0(il.purple.accent)};function ev(e){if(!e)return ty;let t=ty.primary,r=ty.accent;return e.preset&&il[e.preset]&&(t=il[e.preset].primary,r=il[e.preset].accent),e.primary&&VC(e.primary)&&(t=e.primary),e.accent&&VC(e.accent)&&(r=e.accent),{primary:t,accent:r,primaryRgb:z0(t),accentRgb:z0(r)}}function VC(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)}function tv(e,t){const r=document.documentElement;r.style.setProperty("--color-primary",e.primary),r.style.setProperty("--color-accent",e.accent),r.style.setProperty("--color-primary-rgb",e.primaryRgb),r.style.setProperty("--color-accent-rgb",e.accentRgb),t?r.setAttribute("data-theme-preset",t):r.removeAttribute("data-theme-preset")}const dE=N.createContext(null);function WC({children:e,defaultTheme:t="dark",themeSettings:r}){const n=r==null?void 0:r.mode,i=n==="light"||n==="dark",[a,s]=N.useState(()=>{if(n==="light"||n==="dark")return n;if(typeof window<"u"){const f=localStorage.getItem("demoscript-theme");if(f)return f;if(window.matchMedia("(prefers-color-scheme: dark)").matches)return"dark"}return t}),o=ev(r);N.useEffect(()=>{r&&tv(o)},[r,o]),N.useEffect(()=>{const f=document.documentElement;a==="dark"?f.classList.add("dark"):f.classList.remove("dark"),i||localStorage.setItem("demoscript-theme",a)},[a,i]);const u=f=>{i||s(f)},d=()=>{i||s(f=>f==="light"?"dark":"light")};return h.jsx(dE.Provider,{value:{theme:a,toggleTheme:d,setTheme:u,colors:o,isModeLocked:i},children:e})}function rh(){const e=N.useContext(dE);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}function d$({className:e=""}){const{theme:t,toggleTheme:r,isModeLocked:n}=rh();return n?null:h.jsx("button",{onClick:r,className:`
54
- relative w-14 h-7 rounded-full transition-all duration-300
55
- ${t==="dark"?"bg-gradient-to-r from-theme-primary to-theme-accent shadow-[0_0_15px_rgba(var(--color-primary-rgb),0.5)]":"bg-gray-200 hover:bg-gray-300"}
56
- ${e}
57
- `,"aria-label":`Switch to ${t==="light"?"dark":"light"} mode`,children:h.jsx("span",{className:`
58
- absolute top-0.5 w-6 h-6 rounded-full transition-all duration-300 flex items-center justify-center
59
- ${t==="dark"?"left-7 bg-slate-900":"left-0.5 bg-white shadow-md"}
60
- `,children:t==="dark"?h.jsx("svg",{className:"w-4 h-4 text-yellow-400",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"})}):h.jsx("svg",{className:"w-4 h-4 text-orange-400",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z",clipRule:"evenodd"})})})})}const h$={blue:{subtle:"shadow-[0_0_15px_rgba(59,130,246,0.2)]",medium:"shadow-[0_0_25px_rgba(59,130,246,0.3)]",strong:"shadow-[0_0_40px_rgba(59,130,246,0.4)]",border:"border-blue-400/50",ring:"ring-blue-400/30"},green:{subtle:"shadow-[0_0_15px_rgba(34,197,94,0.2)]",medium:"shadow-[0_0_25px_rgba(34,197,94,0.3)]",strong:"shadow-[0_0_40px_rgba(34,197,94,0.4)]",border:"border-green-400/50",ring:"ring-green-400/30"},purple:{subtle:"shadow-[0_0_15px_rgba(168,85,247,0.2)]",medium:"shadow-[0_0_25px_rgba(168,85,247,0.3)]",strong:"shadow-[0_0_40px_rgba(168,85,247,0.4)]",border:"border-purple-400/50",ring:"ring-purple-400/30"},orange:{subtle:"shadow-[0_0_15px_rgba(249,115,22,0.2)]",medium:"shadow-[0_0_25px_rgba(249,115,22,0.3)]",strong:"shadow-[0_0_40px_rgba(249,115,22,0.4)]",border:"border-orange-400/50",ring:"ring-orange-400/30"},cyan:{subtle:"shadow-[0_0_15px_rgba(6,182,212,0.2)]",medium:"shadow-[0_0_25px_rgba(6,182,212,0.3)]",strong:"shadow-[0_0_40px_rgba(6,182,212,0.4)]",border:"border-cyan-400/50",ring:"ring-cyan-400/30"},yellow:{subtle:"shadow-[0_0_15px_rgba(234,179,8,0.2)]",medium:"shadow-[0_0_25px_rgba(234,179,8,0.3)]",strong:"shadow-[0_0_40px_rgba(234,179,8,0.4)]",border:"border-yellow-400/50",ring:"ring-yellow-400/30"},pink:{subtle:"shadow-[0_0_15px_rgba(236,72,153,0.2)]",medium:"shadow-[0_0_25px_rgba(236,72,153,0.3)]",strong:"shadow-[0_0_40px_rgba(236,72,153,0.4)]",border:"border-pink-400/50",ring:"ring-pink-400/30"},red:{subtle:"shadow-[0_0_15px_rgba(239,68,68,0.2)]",medium:"shadow-[0_0_25px_rgba(239,68,68,0.3)]",strong:"shadow-[0_0_40px_rgba(239,68,68,0.4)]",border:"border-red-400/50",ring:"ring-red-400/30"},emerald:{subtle:"shadow-[0_0_15px_rgba(16,185,129,0.2)]",medium:"shadow-[0_0_25px_rgba(16,185,129,0.3)]",strong:"shadow-[0_0_40px_rgba(16,185,129,0.4)]",border:"border-emerald-400/50",ring:"ring-emerald-400/30"},indigo:{subtle:"shadow-[0_0_15px_rgba(99,102,241,0.2)]",medium:"shadow-[0_0_25px_rgba(99,102,241,0.3)]",strong:"shadow-[0_0_40px_rgba(99,102,241,0.4)]",border:"border-indigo-400/50",ring:"ring-indigo-400/30"},amber:{subtle:"shadow-[0_0_15px_rgba(245,158,11,0.2)]",medium:"shadow-[0_0_25px_rgba(245,158,11,0.3)]",strong:"shadow-[0_0_40px_rgba(245,158,11,0.4)]",border:"border-amber-400/50",ring:"ring-amber-400/30"},primary:{subtle:"shadow-[0_0_15px_rgba(var(--color-primary-rgb),0.2)]",medium:"shadow-[0_0_25px_rgba(var(--color-primary-rgb),0.3)]",strong:"shadow-[0_0_40px_rgba(var(--color-primary-rgb),0.4)]",border:"border-[rgba(var(--color-primary-rgb),0.5)]",ring:"ring-[rgba(var(--color-primary-rgb),0.3)]"}};function Bi({children:e,isActive:t=!1,color:r="blue",intensity:n="medium"}){const i=h$[r];return h.jsx("div",{className:`
61
- rounded-xl transition-all duration-500 ease-out
62
- ${t?`${i[n]} ${i.border} ring-2 ${i.ring} border`:"shadow-sm"}
63
- `,children:e})}function kd({color:e="blue",size:t="md"}){const r={blue:"bg-blue-500",green:"bg-green-500",orange:"bg-orange-500",purple:"bg-purple-500",slate:"bg-slate-500",cyan:"bg-cyan-500",red:"bg-red-500"},n={sm:"w-2 h-2",md:"w-3 h-3",lg:"w-4 h-4"};return h.jsxs("span",{className:"relative flex",children:[h.jsx("span",{className:`animate-ping absolute inline-flex h-full w-full rounded-full ${r[e]} opacity-75`}),h.jsx("span",{className:`relative inline-flex rounded-full ${n[t]} ${r[e]}`})]})}function $i({size:e=24,animated:t=!0}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",className:t?"animate-bounce-once":"",children:[h.jsx("circle",{cx:"12",cy:"12",r:"10",className:"fill-green-100 stroke-green-500",strokeWidth:"2"}),h.jsx("path",{d:"M8 12l2.5 2.5L16 9",className:"stroke-green-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:t?{strokeDasharray:20,strokeDashoffset:20,animation:"draw-check 0.5s ease-out forwards 0.2s"}:void 0})]})}function I0({children:e,variant:t="primary"}){if(t==="primary")return h.jsx("span",{className:"bg-clip-text text-transparent",style:{backgroundImage:"linear-gradient(to right, var(--color-primary), var(--color-accent))"},children:e});const r={success:"from-green-500 via-emerald-400 to-teal-400",warning:"from-orange-500 via-amber-400 to-yellow-400"};return h.jsx("span",{className:`bg-gradient-to-r ${r[t]} bg-clip-text text-transparent`,children:e})}function f$({stage:e}){const t=["Sending","Processing","Complete"],r=e==="submitting"?0:e==="confirming"?1:2;return h.jsx("div",{className:"flex items-center justify-between w-full max-w-md mx-auto",children:t.map((n,i)=>h.jsxs("div",{className:"flex items-center",children:[h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsx("div",{className:`
64
- w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium
65
- transition-all duration-500
66
- ${i<r?"bg-green-500 text-white shadow-[0_0_15px_rgba(34,197,94,0.5)]":i===r?"bg-purple-500 text-white animate-pulse shadow-[0_0_15px_rgba(168,85,247,0.5)]":"bg-gray-200 dark:bg-slate-700 text-gray-500 dark:text-slate-400 border border-gray-300 dark:border-slate-600"}
67
- `,children:i<r?h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):i+1}),h.jsx("span",{className:`mt-2 text-xs ${i<=r?"text-gray-700 dark:text-slate-200 font-medium":"text-gray-400 dark:text-slate-500"}`,children:n})]}),i<t.length-1&&h.jsx("div",{className:`
68
- w-16 h-1 mx-2 rounded transition-all duration-500
69
- ${i<r?"bg-green-500":"bg-gray-300 dark:bg-slate-700"}
70
- `})]},n))})}function p$({status:e}){const t=e==="pending"?"idle":e==="submitted"?"sending":e==="confirming"?"processing":e==="confirmed"?"confirmed":"idle",r=e==="submitted"||e==="confirming";return h.jsxs("div",{className:"relative h-24 overflow-hidden rounded-lg bg-gray-100 dark:bg-slate-900/50 border border-gray-200 dark:border-slate-700/50",children:[h.jsx("div",{className:"absolute inset-0 opacity-20",children:h.jsx("div",{className:"absolute inset-0",style:{backgroundImage:`linear-gradient(rgba(139,92,246,0.3) 1px, transparent 1px),
71
- linear-gradient(90deg, rgba(139,92,246,0.3) 1px, transparent 1px)`,backgroundSize:"20px 20px"}})}),h.jsx("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 z-10",children:h.jsx("div",{className:`
72
- w-12 h-12 rounded-lg flex items-center justify-center transition-all duration-300
73
- ${t==="sending"?"bg-cyan-500 shadow-[0_0_20px_rgba(6,182,212,0.6)] scale-110":"bg-gray-200 dark:bg-slate-700 border border-gray-300 dark:border-slate-600"}
74
- `,children:h.jsx("svg",{className:`w-6 h-6 ${t==="sending"?"text-white":"text-gray-500 dark:text-slate-400"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})})}),r&&h.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 z-20 animate-[movePacket_2s_ease-in-out_infinite]",children:h.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-r from-purple-400 to-cyan-500 shadow-[0_0_20px_rgba(139,92,246,0.8)] flex items-center justify-center",children:h.jsx("svg",{className:"w-4 h-4 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{d:"M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z"})})})}),h.jsxs("div",{className:"absolute left-20 right-20 top-1/2 -translate-y-1/2 h-0.5",children:[h.jsx("div",{className:`
75
- h-full transition-all duration-500
76
- ${t==="confirmed"?"bg-gradient-to-r from-cyan-500 via-purple-500 to-green-500":"bg-gray-300 dark:bg-slate-600"}
77
- `}),r&&h.jsx("div",{className:"absolute inset-0 overflow-hidden",children:h.jsx("div",{className:"h-full w-1/3 bg-gradient-to-r from-transparent via-cyan-400 to-transparent animate-[shimmer_1.5s_linear_infinite]"})})]}),t==="processing"&&h.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",children:h.jsx("div",{className:"w-14 h-14 rounded-lg bg-purple-500 shadow-[0_0_25px_rgba(168,85,247,0.6)] flex items-center justify-center animate-pulse",children:h.jsx("svg",{className:"w-7 h-7 text-white animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})}),h.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 z-10",children:h.jsx("div",{className:`
78
- w-12 h-12 rounded-lg flex items-center justify-center transition-all duration-500
79
- ${t==="confirmed"?"bg-green-500 shadow-[0_0_20px_rgba(34,197,94,0.6)] scale-110":"bg-gray-200 dark:bg-slate-700 border border-gray-300 dark:border-slate-600"}
80
- `,children:h.jsx("svg",{className:`w-6 h-6 ${t==="confirmed"?"text-white":"text-gray-500 dark:text-slate-400"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"})})})})]})}var rv={};(function e(t,r,n,i){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),s=typeof Path2D=="function"&&typeof DOMMatrix=="function",o=(function(){if(!t.OffscreenCanvas)return!1;try{var A=new OffscreenCanvas(1,1),D=A.getContext("2d");D.fillRect(0,0,1,1);var G=A.transferToImageBitmap();D.createPattern(G,"no-repeat")}catch{return!1}return!0})();function u(){}function d(A){var D=r.exports.Promise,G=D!==void 0?D:t.Promise;return typeof G=="function"?new G(A):(A(u,u),null)}var f=(function(A,D){return{transform:function(G){if(A)return G;if(D.has(G))return D.get(G);var q=new OffscreenCanvas(G.width,G.height),Z=q.getContext("2d");return Z.drawImage(G,0,0),D.set(G,q),q},clear:function(){D.clear()}}})(o,new Map),p=(function(){var A=Math.floor(16.666666666666668),D,G,q={},Z=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(D=function(re){var J=Math.random();return q[J]=requestAnimationFrame(function ie(ne){Z===ne||Z+A-1<ne?(Z=ne,delete q[J],re()):q[J]=requestAnimationFrame(ie)}),J},G=function(re){q[re]&&cancelAnimationFrame(q[re])}):(D=function(re){return setTimeout(re,A)},G=function(re){return clearTimeout(re)}),{frame:D,cancel:G}})(),m=(function(){var A,D,G={};function q(Z){function re(J,ie){Z.postMessage({options:J||{},callback:ie})}Z.init=function(ie){var ne=ie.transferControlToOffscreen();Z.postMessage({canvas:ne},[ne])},Z.fire=function(ie,ne,oe){if(D)return re(ie,null),D;var fe=Math.random().toString(36).slice(2);return D=d(function(xe){function de(ge){ge.data.callback===fe&&(delete G[fe],Z.removeEventListener("message",de),D=null,f.clear(),oe(),xe())}Z.addEventListener("message",de),re(ie,fe),G[fe]=de.bind(null,{data:{callback:fe}})}),D},Z.reset=function(){Z.postMessage({reset:!0});for(var ie in G)G[ie](),delete G[ie]}}return function(){if(A)return A;if(!n&&a){var Z=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
81
- `);try{A=new Worker(URL.createObjectURL(new Blob([Z])))}catch(re){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",re),null}q(A)}return A}})(),x={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function b(A,D){return D?D(A):A}function v(A){return A!=null}function k(A,D,G){return b(A&&v(A[D])?A[D]:x[D],G)}function w(A){return A<0?0:Math.floor(A)}function C(A,D){return Math.floor(Math.random()*(D-A))+A}function T(A){return parseInt(A,16)}function j(A){return A.map(L)}function L(A){var D=String(A).replace(/[^0-9a-f]/gi,"");return D.length<6&&(D=D[0]+D[0]+D[1]+D[1]+D[2]+D[2]),{r:T(D.substring(0,2)),g:T(D.substring(2,4)),b:T(D.substring(4,6))}}function E(A){var D=k(A,"origin",Object);return D.x=k(D,"x",Number),D.y=k(D,"y",Number),D}function M(A){A.width=document.documentElement.clientWidth,A.height=document.documentElement.clientHeight}function I(A){var D=A.getBoundingClientRect();A.width=D.width,A.height=D.height}function P(A){var D=document.createElement("canvas");return D.style.position="fixed",D.style.top="0px",D.style.left="0px",D.style.pointerEvents="none",D.style.zIndex=A,D}function z(A,D,G,q,Z,re,J,ie,ne){A.save(),A.translate(D,G),A.rotate(re),A.scale(q,Z),A.arc(0,0,1,J,ie,ne),A.restore()}function $(A){var D=A.angle*(Math.PI/180),G=A.spread*(Math.PI/180);return{x:A.x,y:A.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:A.startVelocity*.5+Math.random()*A.startVelocity,angle2D:-D+(.5*G-Math.random()*G),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:A.color,shape:A.shape,tick:0,totalTicks:A.ticks,decay:A.decay,drift:A.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:A.gravity*3,ovalScalar:.6,scalar:A.scalar,flat:A.flat}}function W(A,D){D.x+=Math.cos(D.angle2D)*D.velocity+D.drift,D.y+=Math.sin(D.angle2D)*D.velocity+D.gravity,D.velocity*=D.decay,D.flat?(D.wobble=0,D.wobbleX=D.x+10*D.scalar,D.wobbleY=D.y+10*D.scalar,D.tiltSin=0,D.tiltCos=0,D.random=1):(D.wobble+=D.wobbleSpeed,D.wobbleX=D.x+10*D.scalar*Math.cos(D.wobble),D.wobbleY=D.y+10*D.scalar*Math.sin(D.wobble),D.tiltAngle+=.1,D.tiltSin=Math.sin(D.tiltAngle),D.tiltCos=Math.cos(D.tiltAngle),D.random=Math.random()+2);var G=D.tick++/D.totalTicks,q=D.x+D.random*D.tiltCos,Z=D.y+D.random*D.tiltSin,re=D.wobbleX+D.random*D.tiltCos,J=D.wobbleY+D.random*D.tiltSin;if(A.fillStyle="rgba("+D.color.r+", "+D.color.g+", "+D.color.b+", "+(1-G)+")",A.beginPath(),s&&D.shape.type==="path"&&typeof D.shape.path=="string"&&Array.isArray(D.shape.matrix))A.fill(H(D.shape.path,D.shape.matrix,D.x,D.y,Math.abs(re-q)*.1,Math.abs(J-Z)*.1,Math.PI/10*D.wobble));else if(D.shape.type==="bitmap"){var ie=Math.PI/10*D.wobble,ne=Math.abs(re-q)*.1,oe=Math.abs(J-Z)*.1,fe=D.shape.bitmap.width*D.scalar,xe=D.shape.bitmap.height*D.scalar,de=new DOMMatrix([Math.cos(ie)*ne,Math.sin(ie)*ne,-Math.sin(ie)*oe,Math.cos(ie)*oe,D.x,D.y]);de.multiplySelf(new DOMMatrix(D.shape.matrix));var ge=A.createPattern(f.transform(D.shape.bitmap),"no-repeat");ge.setTransform(de),A.globalAlpha=1-G,A.fillStyle=ge,A.fillRect(D.x-fe/2,D.y-xe/2,fe,xe),A.globalAlpha=1}else if(D.shape==="circle")A.ellipse?A.ellipse(D.x,D.y,Math.abs(re-q)*D.ovalScalar,Math.abs(J-Z)*D.ovalScalar,Math.PI/10*D.wobble,0,2*Math.PI):z(A,D.x,D.y,Math.abs(re-q)*D.ovalScalar,Math.abs(J-Z)*D.ovalScalar,Math.PI/10*D.wobble,0,2*Math.PI);else if(D.shape==="star")for(var ke=Math.PI/2*3,Te=4*D.scalar,Ne=8*D.scalar,Ke=D.x,ut=D.y,tt=5,rt=Math.PI/tt;tt--;)Ke=D.x+Math.cos(ke)*Ne,ut=D.y+Math.sin(ke)*Ne,A.lineTo(Ke,ut),ke+=rt,Ke=D.x+Math.cos(ke)*Te,ut=D.y+Math.sin(ke)*Te,A.lineTo(Ke,ut),ke+=rt;else A.moveTo(Math.floor(D.x),Math.floor(D.y)),A.lineTo(Math.floor(D.wobbleX),Math.floor(Z)),A.lineTo(Math.floor(re),Math.floor(J)),A.lineTo(Math.floor(q),Math.floor(D.wobbleY));return A.closePath(),A.fill(),D.tick<D.totalTicks}function Y(A,D,G,q,Z){var re=D.slice(),J=A.getContext("2d"),ie,ne,oe=d(function(fe){function xe(){ie=ne=null,J.clearRect(0,0,q.width,q.height),f.clear(),Z(),fe()}function de(){n&&!(q.width===i.width&&q.height===i.height)&&(q.width=A.width=i.width,q.height=A.height=i.height),!q.width&&!q.height&&(G(A),q.width=A.width,q.height=A.height),J.clearRect(0,0,q.width,q.height),re=re.filter(function(ge){return W(J,ge)}),re.length?ie=p.frame(de):xe()}ie=p.frame(de),ne=xe});return{addFettis:function(fe){return re=re.concat(fe),oe},canvas:A,promise:oe,reset:function(){ie&&p.cancel(ie),ne&&ne()}}}function B(A,D){var G=!A,q=!!k(D||{},"resize"),Z=!1,re=k(D,"disableForReducedMotion",Boolean),J=a&&!!k(D||{},"useWorker"),ie=J?m():null,ne=G?M:I,oe=A&&ie?!!A.__confetti_initialized:!1,fe=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,xe;function de(ke,Te,Ne){for(var Ke=k(ke,"particleCount",w),ut=k(ke,"angle",Number),tt=k(ke,"spread",Number),rt=k(ke,"startVelocity",Number),nt=k(ke,"decay",Number),wt=k(ke,"gravity",Number),xt=k(ke,"drift",Number),_e=k(ke,"colors",j),je=k(ke,"ticks",Number),le=k(ke,"shapes"),be=k(ke,"scalar"),Le=!!k(ke,"flat"),We=E(ke),at=Ke,Et=[],Er=A.width*We.x,Wt=A.height*We.y;at--;)Et.push($({x:Er,y:Wt,angle:ut,spread:tt,startVelocity:rt,color:_e[at%_e.length],shape:le[C(0,le.length)],ticks:je,decay:nt,gravity:wt,drift:xt,scalar:be,flat:Le}));return xe?xe.addFettis(Et):(xe=Y(A,Et,ne,Te,Ne),xe.promise)}function ge(ke){var Te=re||k(ke,"disableForReducedMotion",Boolean),Ne=k(ke,"zIndex",Number);if(Te&&fe)return d(function(rt){rt()});G&&xe?A=xe.canvas:G&&!A&&(A=P(Ne),document.body.appendChild(A)),q&&!oe&&ne(A);var Ke={width:A.width,height:A.height};ie&&!oe&&ie.init(A),oe=!0,ie&&(A.__confetti_initialized=!0);function ut(){if(ie){var rt={getBoundingClientRect:function(){if(!G)return A.getBoundingClientRect()}};ne(rt),ie.postMessage({resize:{width:rt.width,height:rt.height}});return}Ke.width=Ke.height=null}function tt(){xe=null,q&&(Z=!1,t.removeEventListener("resize",ut)),G&&A&&(document.body.contains(A)&&document.body.removeChild(A),A=null,oe=!1)}return q&&!Z&&(Z=!0,t.addEventListener("resize",ut,!1)),ie?ie.fire(ke,Ke,tt):de(ke,Ke,tt)}return ge.reset=function(){ie&&ie.reset(),xe&&xe.reset()},ge}var U;function R(){return U||(U=B(null,{useWorker:!0,resize:!0})),U}function H(A,D,G,q,Z,re,J){var ie=new Path2D(A),ne=new Path2D;ne.addPath(ie,new DOMMatrix(D));var oe=new Path2D;return oe.addPath(ne,new DOMMatrix([Math.cos(J)*Z,Math.sin(J)*Z,-Math.sin(J)*re,Math.cos(J)*re,G,q])),oe}function V(A){if(!s)throw new Error("path confetti are not supported in this browser");var D,G;typeof A=="string"?D=A:(D=A.path,G=A.matrix);var q=new Path2D(D),Z=document.createElement("canvas"),re=Z.getContext("2d");if(!G){for(var J=1e3,ie=J,ne=J,oe=0,fe=0,xe,de,ge=0;ge<J;ge+=2)for(var ke=0;ke<J;ke+=2)re.isPointInPath(q,ge,ke,"nonzero")&&(ie=Math.min(ie,ge),ne=Math.min(ne,ke),oe=Math.max(oe,ge),fe=Math.max(fe,ke));xe=oe-ie,de=fe-ne;var Te=10,Ne=Math.min(Te/xe,Te/de);G=[Ne,0,0,Ne,-Math.round(xe/2+ie)*Ne,-Math.round(de/2+ne)*Ne]}return{type:"path",path:D,matrix:G}}function Q(A){var D,G=1,q="#000000",Z='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof A=="string"?D=A:(D=A.text,G="scalar"in A?A.scalar:G,Z="fontFamily"in A?A.fontFamily:Z,q="color"in A?A.color:q);var re=10*G,J=""+re+"px "+Z,ie=new OffscreenCanvas(re,re),ne=ie.getContext("2d");ne.font=J;var oe=ne.measureText(D),fe=Math.ceil(oe.actualBoundingBoxRight+oe.actualBoundingBoxLeft),xe=Math.ceil(oe.actualBoundingBoxAscent+oe.actualBoundingBoxDescent),de=2,ge=oe.actualBoundingBoxLeft+de,ke=oe.actualBoundingBoxAscent+de;fe+=de+de,xe+=de+de,ie=new OffscreenCanvas(fe,xe),ne=ie.getContext("2d"),ne.font=J,ne.fillStyle=q,ne.fillText(D,ge,ke);var Te=1/G;return{type:"bitmap",bitmap:ie.transferToImageBitmap(),matrix:[Te,0,0,Te,-fe*Te/2,-xe*Te/2]}}r.exports=function(){return R().apply(this,arguments)},r.exports.reset=function(){R().reset()},r.exports.create=B,r.exports.shapeFromPath=V,r.exports.shapeFromText=Q})((function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}})(),rv,!1);const _u=rv.exports;rv.exports.create;const Bf=["#6366f1","#8b5cf6","#a855f7","#22c55e","#3b82f6"];function g$(){const e=N.useCallback(()=>{_u({particleCount:100,spread:70,origin:{y:.6},colors:Bf})},[]),t=N.useCallback(()=>{const n=Date.now()+2e3,i=()=>{_u({particleCount:3,angle:60,spread:55,origin:{x:0},colors:Bf}),_u({particleCount:3,angle:120,spread:55,origin:{x:1},colors:Bf}),Date.now()<n&&requestAnimationFrame(i)};i()},[]),r=N.useCallback(()=>{const n={spread:360,ticks:100,gravity:0,decay:.94,startVelocity:30,colors:Bf,shapes:["star"]};_u({...n,particleCount:40,scalar:1.2}),_u({...n,particleCount:25,scalar:.75})},[]);return{fire:e,fireCannon:t,fireStars:r}}const m$={left:"translateX(-20px)",right:"translateX(20px)",up:"translateY(-20px)",down:"translateY(20px)"};function x$({children:e,direction:t="right",duration:r=300,isVisible:n=!0}){const[i,a]=N.useState(!1);N.useEffect(()=>{const o=setTimeout(()=>a(!0),10);return()=>clearTimeout(o)},[]);const s=i&&n;return h.jsx("div",{style:{transitionProperty:"opacity, transform",transitionDuration:`${r}ms`,transitionTimingFunction:"ease-out",opacity:s?1:0,transform:s?"translate(0, 0)":m$[t]},children:e})}let ry=null,nv=.3;function iv(){return ry||(ry=new AudioContext),ry}function y$(e){nv=Math.max(0,Math.min(1,e))}function bs(e,t,r="sine",n=.3){const i=iv(),a=i.createOscillator(),s=i.createGain();a.type=r,a.frequency.setValueAtTime(e,i.currentTime),a.connect(s),s.connect(i.destination);const o=n*nv;s.gain.setValueAtTime(o,i.currentTime),s.gain.exponentialRampToValueAtTime(.01,i.currentTime+t/1e3),a.start(),a.stop(i.currentTime+t/1e3)}function b$(){iv(),[523.25,659.25,783.99].forEach((e,t)=>{setTimeout(()=>bs(e,150,"sine",.2),t*50)}),setTimeout(()=>{[659.25,783.99,1046.5].forEach((e,t)=>{setTimeout(()=>bs(e,200,"sine",.15),t*30)})},150)}function v$(){bs(800,50,"square",.1)}function w$(){bs(880,100,"sine",.2),setTimeout(()=>bs(1100,150,"sine",.15),100)}function k$(){bs(660,100,"triangle",.2),setTimeout(()=>bs(440,150,"triangle",.18),120)}function S$(){bs(1200,20,"square",.05)}function C$(){const e=iv(),t=e.createOscillator(),r=e.createGain();t.type="sawtooth",t.frequency.setValueAtTime(200,e.currentTime),t.frequency.linearRampToValueAtTime(150,e.currentTime+.3),t.connect(r),r.connect(e.destination);const n=.2*nv;r.gain.setValueAtTime(n,e.currentTime),r.gain.exponentialRampToValueAtTime(.01,e.currentTime+.3),t.start(),t.stop(e.currentTime+.3)}const hE=N.createContext(null);function YC({children:e,volume:t=.3}){const[r,n]=N.useState(()=>typeof window<"u"?localStorage.getItem("demoscript-sound-enabled")!=="false":!0);N.useEffect(()=>{y$(t)},[t]),N.useEffect(()=>{localStorage.setItem("demoscript-sound-enabled",String(r))},[r]);const i=N.useCallback(()=>{r&&b$()},[r]),a=N.useCallback(()=>{r&&v$()},[r]),s=N.useCallback(()=>{r&&w$()},[r]),o=N.useCallback(()=>{r&&k$()},[r]),u=N.useCallback(()=>{r&&S$()},[r]),d=N.useCallback(()=>{r&&C$()},[r]);return h.jsx(hE.Provider,{value:{enabled:r,setEnabled:n,playSuccess:i,playClick:a,playNotification:s,playWarning:o,playTyping:u,playError:d},children:e})}function fE(){const e=N.useContext(hE);return e||{enabled:!1,setEnabled:()=>{},playSuccess:()=>{},playClick:()=>{},playNotification:()=>{},playWarning:()=>{},playTyping:()=>{},playError:()=>{}}}function _$(){const{enabled:e,setEnabled:t,playClick:r}=fE(),n=()=>{const i=!e;t(i),i&&r()};return h.jsx("button",{onClick:n,className:`p-2 rounded-lg transition-all hover:scale-105 active:scale-95 ${e?"bg-purple-100 text-purple-600 dark:bg-purple-900/50 dark:text-purple-400":"bg-gray-100 text-gray-400 dark:bg-gray-800 dark:text-gray-500"}`,title:e?"Sound enabled":"Sound disabled",children:e?h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"})}):h.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"})]})})}var Tu={},Yu={exports:{}},T$=Yu.exports,GC;function E$(){return GC||(GC=1,(function(e,t){(function(r,n){n(t)})(T$,(function(r){var n=function(){return n=Object.assign||function(a){for(var s,o=1,u=arguments.length;o<u;o++)for(var d in s=arguments[o])Object.prototype.hasOwnProperty.call(s,d)&&(a[d]=s[d]);return a},n.apply(this,arguments)},i=(function(){function a(s,o,u){var d=this;this.endVal=o,this.options=u,this.version="2.9.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",enableScrollSpy:!1,scrollSpyDelay:200,scrollSpyOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(f){d.startTime||(d.startTime=f);var p=f-d.startTime;d.remaining=d.duration-p,d.useEasing?d.countDown?d.frameVal=d.startVal-d.easingFn(p,0,d.startVal-d.endVal,d.duration):d.frameVal=d.easingFn(p,d.startVal,d.endVal-d.startVal,d.duration):d.frameVal=d.startVal+(d.endVal-d.startVal)*(p/d.duration);var m=d.countDown?d.frameVal<d.endVal:d.frameVal>d.endVal;d.frameVal=m?d.endVal:d.frameVal,d.frameVal=Number(d.frameVal.toFixed(d.options.decimalPlaces)),d.printValue(d.frameVal),p<d.duration?d.rAF=requestAnimationFrame(d.count):d.finalEndVal!==null?d.update(d.finalEndVal):d.options.onCompleteCallback&&d.options.onCompleteCallback()},this.formatNumber=function(f){var p,m,x,b,v=f<0?"-":"";p=Math.abs(f).toFixed(d.options.decimalPlaces);var k=(p+="").split(".");if(m=k[0],x=k.length>1?d.options.decimal+k[1]:"",d.options.useGrouping){b="";for(var w=3,C=0,T=0,j=m.length;T<j;++T)d.options.useIndianSeparators&&T===4&&(w=2,C=1),T!==0&&C%w==0&&(b=d.options.separator+b),C++,b=m[j-T-1]+b;m=b}return d.options.numerals&&d.options.numerals.length&&(m=m.replace(/[0-9]/g,(function(L){return d.options.numerals[+L]})),x=x.replace(/[0-9]/g,(function(L){return d.options.numerals[+L]}))),v+d.options.prefix+m+x+d.options.suffix},this.easeOutExpo=function(f,p,m,x){return m*(1-Math.pow(2,-10*f/x))*1024/1023+p},this.options=n(n({},this.defaults),u),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.el=typeof s=="string"?document.getElementById(s):s,o=o??this.parse(this.el.innerHTML),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(o),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,this.options.separator===""&&(this.options.useGrouping=!1),this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined",typeof window<"u"&&this.options.enableScrollSpy&&(this.error?console.error(this.error,s):(window.onScrollFns=window.onScrollFns||[],window.onScrollFns.push((function(){return d.handleScroll(d)})),window.onscroll=function(){window.onScrollFns.forEach((function(f){return f()}))},this.handleScroll(this)))}return a.prototype.handleScroll=function(s){if(s&&window&&!s.once){var o=window.innerHeight+window.scrollY,u=s.el.getBoundingClientRect(),d=u.top+window.pageYOffset,f=u.top+u.height+window.pageYOffset;f<o&&f>window.scrollY&&s.paused?(s.paused=!1,setTimeout((function(){return s.start()}),s.options.scrollSpyDelay),s.options.scrollSpyOnce&&(s.once=!0)):(window.scrollY>f||d>o)&&!s.paused&&s.reset()}},a.prototype.determineDirectionAndSmartEasing=function(){var s=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>s;var o=s-this.startVal;if(Math.abs(o)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=s;var u=this.countDown?1:-1;this.endVal=s+u*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=s,this.finalEndVal=null;this.finalEndVal!==null?this.useEasing=!1:this.useEasing=this.options.useEasing},a.prototype.start=function(s){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),s&&(this.options.onCompleteCallback=s),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},a.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},a.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},a.prototype.update=function(s){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(s),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,this.finalEndVal==null&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},a.prototype.printValue=function(s){var o;if(this.el){var u=this.formattingFn(s);!((o=this.options.plugin)===null||o===void 0)&&o.render?this.options.plugin.render(this.el,u):this.el.tagName==="INPUT"?this.el.value=u:this.el.tagName==="text"||this.el.tagName==="tspan"?this.el.textContent=u:this.el.innerHTML=u}},a.prototype.ensureNumber=function(s){return typeof s=="number"&&!isNaN(s)},a.prototype.validateValue=function(s){var o=Number(s);return this.ensureNumber(o)?o:(this.error="[CountUp] invalid start or end value: ".concat(s),null)},a.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},a.prototype.parse=function(s){var o=function(p){return p.replace(/([.,'  ])/g,"\\$1")},u=o(this.options.separator),d=o(this.options.decimal),f=s.replace(new RegExp(u,"g"),"").replace(new RegExp(d,"g"),".");return parseFloat(f)},a})();r.CountUp=i}))})(Yu,Yu.exports)),Yu.exports}var XC;function N$(){if(XC)return Tu;XC=1,Object.defineProperty(Tu,"__esModule",{value:!0});var e=mc(),t=E$();function r(I,P){var z=I==null?null:typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(z!=null){var $,W,Y,B,U=[],R=!0,H=!1;try{if(Y=(z=z.call(I)).next,P!==0)for(;!(R=($=Y.call(z)).done)&&(U.push($.value),U.length!==P);R=!0);}catch(V){H=!0,W=V}finally{try{if(!R&&z.return!=null&&(B=z.return(),Object(B)!==B))return}finally{if(H)throw W}}return U}}function n(I,P){var z=Object.keys(I);if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(I);P&&($=$.filter(function(W){return Object.getOwnPropertyDescriptor(I,W).enumerable})),z.push.apply(z,$)}return z}function i(I){for(var P=1;P<arguments.length;P++){var z=arguments[P]!=null?arguments[P]:{};P%2?n(Object(z),!0).forEach(function($){o(I,$,z[$])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(z)):n(Object(z)).forEach(function($){Object.defineProperty(I,$,Object.getOwnPropertyDescriptor(z,$))})}return I}function a(I,P){if(typeof I!="object"||!I)return I;var z=I[Symbol.toPrimitive];if(z!==void 0){var $=z.call(I,P);if(typeof $!="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(I)}function s(I){var P=a(I,"string");return typeof P=="symbol"?P:String(P)}function o(I,P,z){return P=s(P),P in I?Object.defineProperty(I,P,{value:z,enumerable:!0,configurable:!0,writable:!0}):I[P]=z,I}function u(){return u=Object.assign?Object.assign.bind():function(I){for(var P=1;P<arguments.length;P++){var z=arguments[P];for(var $ in z)Object.prototype.hasOwnProperty.call(z,$)&&(I[$]=z[$])}return I},u.apply(this,arguments)}function d(I,P){if(I==null)return{};var z={},$=Object.keys(I),W,Y;for(Y=0;Y<$.length;Y++)W=$[Y],!(P.indexOf(W)>=0)&&(z[W]=I[W]);return z}function f(I,P){if(I==null)return{};var z=d(I,P),$,W;if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(I);for(W=0;W<Y.length;W++)$=Y[W],!(P.indexOf($)>=0)&&Object.prototype.propertyIsEnumerable.call(I,$)&&(z[$]=I[$])}return z}function p(I,P){return m(I)||r(I,P)||x(I,P)||v()}function m(I){if(Array.isArray(I))return I}function x(I,P){if(I){if(typeof I=="string")return b(I,P);var z=Object.prototype.toString.call(I).slice(8,-1);if(z==="Object"&&I.constructor&&(z=I.constructor.name),z==="Map"||z==="Set")return Array.from(I);if(z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(z))return b(I,P)}}function b(I,P){(P==null||P>I.length)&&(P=I.length);for(var z=0,$=new Array(P);z<P;z++)$[z]=I[z];return $}function v(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
82
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var k=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function w(I){var P=e.useRef(I);return k(function(){P.current=I}),e.useCallback(function(){for(var z=arguments.length,$=new Array(z),W=0;W<z;W++)$[W]=arguments[W];return P.current.apply(void 0,$)},[])}var C=function(P,z){var $=z.decimal,W=z.decimals,Y=z.duration,B=z.easingFn,U=z.end,R=z.formattingFn,H=z.numerals,V=z.prefix,Q=z.separator,A=z.start,D=z.suffix,G=z.useEasing,q=z.useGrouping,Z=z.useIndianSeparators,re=z.enableScrollSpy,J=z.scrollSpyDelay,ie=z.scrollSpyOnce,ne=z.plugin;return new t.CountUp(P,U,{startVal:A,duration:Y,decimal:$,decimalPlaces:W,easingFn:B,formattingFn:R,numerals:H,separator:Q,prefix:V,suffix:D,plugin:ne,useEasing:G,useIndianSeparators:Z,useGrouping:q,enableScrollSpy:re,scrollSpyDelay:J,scrollSpyOnce:ie})},T=["ref","startOnMount","enableReinitialize","delay","onEnd","onStart","onPauseResume","onReset","onUpdate"],j={decimal:".",separator:",",delay:null,prefix:"",suffix:"",duration:2,start:0,decimals:0,startOnMount:!0,enableReinitialize:!0,useEasing:!0,useGrouping:!0,useIndianSeparators:!1},L=function(P){var z=Object.fromEntries(Object.entries(P).filter(function(ge){var ke=p(ge,2),Te=ke[1];return Te!==void 0})),$=e.useMemo(function(){return i(i({},j),z)},[P]),W=$.ref,Y=$.startOnMount,B=$.enableReinitialize,U=$.delay,R=$.onEnd,H=$.onStart,V=$.onPauseResume,Q=$.onReset,A=$.onUpdate,D=f($,T),G=e.useRef(),q=e.useRef(),Z=e.useRef(!1),re=w(function(){return C(typeof W=="string"?W:W.current,D)}),J=w(function(ge){var ke=G.current;if(ke&&!ge)return ke;var Te=re();return G.current=Te,Te}),ie=w(function(){var ge=function(){return J(!0).start(function(){R==null||R({pauseResume:ne,reset:oe,start:xe,update:fe})})};U&&U>0?q.current=setTimeout(ge,U*1e3):ge(),H==null||H({pauseResume:ne,reset:oe,update:fe})}),ne=w(function(){J().pauseResume(),V==null||V({reset:oe,start:xe,update:fe})}),oe=w(function(){J().el&&(q.current&&clearTimeout(q.current),J().reset(),Q==null||Q({pauseResume:ne,start:xe,update:fe}))}),fe=w(function(ge){J().update(ge),A==null||A({pauseResume:ne,reset:oe,start:xe})}),xe=w(function(){oe(),ie()}),de=w(function(ge){Y&&(ge&&oe(),ie())});return e.useEffect(function(){Z.current?B&&de(!0):(Z.current=!0,de())},[B,Z,de,U,P.start,P.suffix,P.prefix,P.duration,P.separator,P.decimals,P.decimal,P.formattingFn]),e.useEffect(function(){return function(){oe()}},[oe]),{start:xe,pauseResume:ne,reset:oe,update:fe,getCountUp:J}},E=["className","redraw","containerProps","children","style"],M=function(P){var z=P.className,$=P.redraw,W=P.containerProps,Y=P.children,B=P.style,U=f(P,E),R=e.useRef(null),H=e.useRef(!1),V=L(i(i({},U),{},{ref:R,startOnMount:typeof Y!="function"||P.delay===0,enableReinitialize:!1})),Q=V.start,A=V.reset,D=V.update,G=V.pauseResume,q=V.getCountUp,Z=w(function(){Q()}),re=w(function(ne){P.preserveValue||A(),D(ne)}),J=w(function(){if(typeof P.children=="function"&&!(R.current instanceof Element)){console.error(`Couldn't find attached element to hook the CountUp instance into! Try to attach "containerRef" from the render prop to a an Element, eg. <span ref={containerRef} />.`);return}q()});e.useEffect(function(){J()},[J]),e.useEffect(function(){H.current&&re(P.end)},[P.end,re]);var ie=$&&P;return e.useEffect(function(){$&&H.current&&Z()},[Z,$,ie]),e.useEffect(function(){!$&&H.current&&Z()},[Z,$,P.start,P.suffix,P.prefix,P.duration,P.separator,P.decimals,P.decimal,P.className,P.formattingFn]),e.useEffect(function(){H.current=!0},[]),typeof Y=="function"?Y({countUpRef:R,start:Q,reset:A,update:D,pauseResume:G,getCountUp:q}):e.createElement("span",u({className:z,ref:R,style:B},W),typeof P.start<"u"?q().formattingFn(P.start):"")};return Tu.default=M,Tu.useCountUp=L,Tu}var j$=N$();const A$=gc(j$);function av({end:e,start:t=0,duration:r=1.5,decimals:n=0,prefix:i="",suffix:a="",className:s="",separator:o=","}){return h.jsx("span",{className:s,children:h.jsx(A$,{start:t,end:e,duration:r,decimals:n,prefix:i,suffix:a,separator:o})})}const M$={USD:"$",EUR:"€",GBP:"£"};function pE({amount:e,currency:t="USD",duration:r=1.5,className:n=""}){return h.jsx(av,{end:e,decimals:2,prefix:M$[t],duration:r,className:n})}function L$({enabled:e=!0,color:t="rgba(var(--color-primary-rgb), 0.3)",opacity:r=.2,gridSize:n=50}){const{theme:i}=rh();return!e||i!=="dark"?null:h.jsx("div",{className:"fixed inset-0 pointer-events-none z-0 transition-opacity duration-300",style:{opacity:r},children:h.jsx("div",{className:"absolute inset-0",style:{backgroundImage:`linear-gradient(${t} 1px, transparent 1px),
83
- linear-gradient(90deg, ${t} 1px, transparent 1px)`,backgroundSize:`${n}px ${n}px`}})})}function D$({enabled:e=!0}){const{theme:t}=rh();return!e||t!=="dark"?null:h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed top-0 left-1/4 w-96 h-96 rounded-full blur-3xl pointer-events-none z-0 transition-all duration-500",style:{background:"radial-gradient(circle, rgba(var(--color-primary-rgb), 0.3) 0%, transparent 70%)"}}),h.jsx("div",{className:"fixed bottom-0 right-1/4 w-96 h-96 rounded-full blur-3xl pointer-events-none z-0 transition-all duration-500",style:{background:"radial-gradient(circle, rgba(var(--color-accent-rgb), 0.3) 0%, transparent 70%)"}})]})}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function gE(e){return typeof e>"u"||e===null}function R$(e){return typeof e=="object"&&e!==null}function O$(e){return Array.isArray(e)?e:gE(e)?[]:[e]}function B$(e,t){var r,n,i,a;if(t)for(a=Object.keys(t),r=0,n=a.length;r<n;r+=1)i=a[r],e[i]=t[i];return e}function $$(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function z$(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var I$=gE,F$=R$,P$=O$,H$=$$,q$=z$,U$=B$,Dr={isNothing:I$,isObject:F$,toArray:P$,repeat:H$,isNegativeZero:q$,extend:U$};function mE(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
84
-
85
- `+e.mark.snippet),n+" "+r):n}function Sd(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=mE(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Sd.prototype=Object.create(Error.prototype);Sd.prototype.constructor=Sd;Sd.prototype.toString=function(t){return this.name+": "+mE(this,t)};var yn=Sd;function ny(e,t,r,n,i){var a="",s="",o=Math.floor(i/2)-1;return n-t>o&&(a=" ... ",t=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+e.slice(t,r).replace(/\t/g,"→")+s,pos:n-t+a.length}}function iy(e,t){return Dr.repeat(" ",t-e.length)+e}function V$(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(e.buffer);)i.push(a.index),n.push(a.index+a[0].length),e.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",u,d,f=Math.min(e.line+t.linesAfter,i.length).toString().length,p=t.maxLength-(t.indent+f+3);for(u=1;u<=t.linesBefore&&!(s-u<0);u++)d=ny(e.buffer,n[s-u],i[s-u],e.position-(n[s]-n[s-u]),p),o=Dr.repeat(" ",t.indent)+iy((e.line-u+1).toString(),f)+" | "+d.str+`
86
- `+o;for(d=ny(e.buffer,n[s],i[s],e.position,p),o+=Dr.repeat(" ",t.indent)+iy((e.line+1).toString(),f)+" | "+d.str+`
87
- `,o+=Dr.repeat("-",t.indent+f+3+d.pos)+`^
88
- `,u=1;u<=t.linesAfter&&!(s+u>=i.length);u++)d=ny(e.buffer,n[s+u],i[s+u],e.position-(n[s]-n[s+u]),p),o+=Dr.repeat(" ",t.indent)+iy((e.line+u+1).toString(),f)+" | "+d.str+`
89
- `;return o.replace(/\n$/,"")}var W$=V$,Y$=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],G$=["scalar","sequence","mapping"];function X$(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function Q$(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Y$.indexOf(r)===-1)throw new yn('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=X$(t.styleAliases||null),G$.indexOf(this.kind)===-1)throw new yn('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Zr=Q$;function QC(e,t){var r=[];return e[t].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}function Z$(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function mb(e){return this.extend(e)}mb.prototype.extend=function(t){var r=[],n=[];if(t instanceof Zr)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new yn("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(a){if(!(a instanceof Zr))throw new yn("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new yn("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new yn("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(a){if(!(a instanceof Zr))throw new yn("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(mb.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=QC(i,"implicit"),i.compiledExplicit=QC(i,"explicit"),i.compiledTypeMap=Z$(i.compiledImplicit,i.compiledExplicit),i};var xE=mb,yE=new Zr("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),bE=new Zr("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),vE=new Zr("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),wE=new xE({explicit:[yE,bE,vE]});function K$(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function J$(){return null}function e7(e){return e===null}var kE=new Zr("tag:yaml.org,2002:null",{kind:"scalar",resolve:K$,construct:J$,predicate:e7,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function t7(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function r7(e){return e==="true"||e==="True"||e==="TRUE"}function n7(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var SE=new Zr("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t7,construct:r7,predicate:n7,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function i7(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function a7(e){return 48<=e&&e<=55}function s7(e){return 48<=e&&e<=57}function l7(e){if(e===null)return!1;var t=e.length,r=0,n=!1,i;if(!t)return!1;if(i=e[r],(i==="-"||i==="+")&&(i=e[++r]),i==="0"){if(r+1===t)return!0;if(i=e[++r],i==="b"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;n=!0}return n&&i!=="_"}if(i==="x"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!i7(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}if(i==="o"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!a7(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}}if(i==="_")return!1;for(;r<t;r++)if(i=e[r],i!=="_"){if(!s7(e.charCodeAt(r)))return!1;n=!0}return!(!n||i==="_")}function o7(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function c7(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Dr.isNegativeZero(e)}var CE=new Zr("tag:yaml.org,2002:int",{kind:"scalar",resolve:l7,construct:o7,predicate:c7,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),u7=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function d7(e){return!(e===null||!u7.test(e)||e[e.length-1]==="_")}function h7(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var f7=/^[-+]?[0-9]+e/;function p7(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Dr.isNegativeZero(e))return"-0.0";return r=e.toString(10),f7.test(r)?r.replace("e",".e"):r}function g7(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Dr.isNegativeZero(e))}var _E=new Zr("tag:yaml.org,2002:float",{kind:"scalar",resolve:d7,construct:h7,predicate:g7,represent:p7,defaultStyle:"lowercase"}),TE=wE.extend({implicit:[kE,SE,CE,_E]}),EE=TE,NE=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),jE=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function m7(e){return e===null?!1:NE.exec(e)!==null||jE.exec(e)!==null}function x7(e){var t,r,n,i,a,s,o,u=0,d=null,f,p,m;if(t=NE.exec(e),t===null&&(t=jE.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(r,n,i));if(a=+t[4],s=+t[5],o=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(f=+t[10],p=+(t[11]||0),d=(f*60+p)*6e4,t[9]==="-"&&(d=-d)),m=new Date(Date.UTC(r,n,i,a,s,o,u)),d&&m.setTime(m.getTime()-d),m}function y7(e){return e.toISOString()}var AE=new Zr("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:m7,construct:x7,instanceOf:Date,represent:y7});function b7(e){return e==="<<"||e===null}var ME=new Zr("tag:yaml.org,2002:merge",{kind:"scalar",resolve:b7}),sv=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
90
- \r`;function v7(e){if(e===null)return!1;var t,r,n=0,i=e.length,a=sv;for(r=0;r<i;r++)if(t=a.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function w7(e){var t,r,n=e.replace(/[\r\n=]/g,""),i=n.length,a=sv,s=0,o=[];for(t=0;t<i;t++)t%4===0&&t&&(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(t));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}function k7(e){var t="",r=0,n,i,a=e.length,s=sv;for(n=0;n<a;n++)n%3===0&&n&&(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[n];return i=a%3,i===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):i===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):i===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}function S7(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var LE=new Zr("tag:yaml.org,2002:binary",{kind:"scalar",resolve:v7,construct:w7,predicate:S7,represent:k7}),C7=Object.prototype.hasOwnProperty,_7=Object.prototype.toString;function T7(e){if(e===null)return!0;var t=[],r,n,i,a,s,o=e;for(r=0,n=o.length;r<n;r+=1){if(i=o[r],s=!1,_7.call(i)!=="[object Object]")return!1;for(a in i)if(C7.call(i,a))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function E7(e){return e!==null?e:[]}var DE=new Zr("tag:yaml.org,2002:omap",{kind:"sequence",resolve:T7,construct:E7}),N7=Object.prototype.toString;function j7(e){if(e===null)return!0;var t,r,n,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(n=s[t],N7.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;a[t]=[i[0],n[i[0]]]}return!0}function A7(e){if(e===null)return[];var t,r,n,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1)n=s[t],i=Object.keys(n),a[t]=[i[0],n[i[0]]];return a}var RE=new Zr("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:j7,construct:A7}),M7=Object.prototype.hasOwnProperty;function L7(e){if(e===null)return!0;var t,r=e;for(t in r)if(M7.call(r,t)&&r[t]!==null)return!1;return!0}function D7(e){return e!==null?e:{}}var OE=new Zr("tag:yaml.org,2002:set",{kind:"mapping",resolve:L7,construct:D7}),lv=EE.extend({implicit:[AE,ME],explicit:[LE,DE,RE,OE]}),vs=Object.prototype.hasOwnProperty,F0=1,BE=2,$E=3,P0=4,ay=1,R7=2,ZC=3,O7=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,B7=/[\x85\u2028\u2029]/,$7=/[,\[\]\{\}]/,zE=/^(?:!|!!|![a-z\-]+!)$/i,IE=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function KC(e){return Object.prototype.toString.call(e)}function Qi(e){return e===10||e===13}function dl(e){return e===9||e===32}function zn(e){return e===9||e===32||e===10||e===13}function Ao(e){return e===44||e===91||e===93||e===123||e===125}function z7(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function I7(e){return e===120?2:e===117?4:e===85?8:0}function F7(e){return 48<=e&&e<=57?e-48:-1}function JC(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
91
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function P7(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function FE(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}var PE=new Array(256),HE=new Array(256);for(var yo=0;yo<256;yo++)PE[yo]=JC(yo)?1:0,HE[yo]=JC(yo);function H7(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||lv,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function qE(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=W$(r),new yn(t,r)}function He(e,t){throw qE(e,t)}function H0(e,t){e.onWarning&&e.onWarning.call(null,qE(e,t))}var e_={YAML:function(t,r,n){var i,a,s;t.version!==null&&He(t,"duplication of %YAML directive"),n.length!==1&&He(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&He(t,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&He(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&H0(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var i,a;n.length!==2&&He(t,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],zE.test(i)||He(t,"ill-formed tag handle (first argument) of the TAG directive"),vs.call(t.tagMap,i)&&He(t,'there is a previously declared suffix for "'+i+'" tag handle'),IE.test(a)||He(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{He(t,"tag prefix is malformed: "+a)}t.tagMap[i]=a}};function gs(e,t,r,n){var i,a,s,o;if(t<r){if(o=e.input.slice(t,r),n)for(i=0,a=o.length;i<a;i+=1)s=o.charCodeAt(i),s===9||32<=s&&s<=1114111||He(e,"expected valid JSON character");else O7.test(o)&&He(e,"the stream contains non-printable characters");e.result+=o}}function t_(e,t,r,n){var i,a,s,o;for(Dr.isObject(r)||He(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),s=0,o=i.length;s<o;s+=1)a=i[s],vs.call(t,a)||(FE(t,a,r[a]),n[a]=!0)}function Mo(e,t,r,n,i,a,s,o,u){var d,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),d=0,f=i.length;d<f;d+=1)Array.isArray(i[d])&&He(e,"nested arrays are not supported inside keys"),typeof i=="object"&&KC(i[d])==="[object Object]"&&(i[d]="[object Object]");if(typeof i=="object"&&KC(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(d=0,f=a.length;d<f;d+=1)t_(e,t,a[d],r);else t_(e,t,a,r);else!e.json&&!vs.call(r,i)&&vs.call(t,i)&&(e.line=s||e.line,e.lineStart=o||e.lineStart,e.position=u||e.position,He(e,"duplicated mapping key")),FE(t,i,a),delete r[i];return t}function ov(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):He(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function _r(e,t,r){for(var n=0,i=e.input.charCodeAt(e.position);i!==0;){for(;dl(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Qi(i))for(ov(e),i=e.input.charCodeAt(e.position),n++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&H0(e,"deficient indentation"),n}function Vp(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||zn(r)))}function cv(e,t){t===1?e.result+=" ":t>1&&(e.result+=Dr.repeat(`
92
- `,t-1))}function q7(e,t,r){var n,i,a,s,o,u,d,f,p=e.kind,m=e.result,x;if(x=e.input.charCodeAt(e.position),zn(x)||Ao(x)||x===35||x===38||x===42||x===33||x===124||x===62||x===39||x===34||x===37||x===64||x===96||(x===63||x===45)&&(i=e.input.charCodeAt(e.position+1),zn(i)||r&&Ao(i)))return!1;for(e.kind="scalar",e.result="",a=s=e.position,o=!1;x!==0;){if(x===58){if(i=e.input.charCodeAt(e.position+1),zn(i)||r&&Ao(i))break}else if(x===35){if(n=e.input.charCodeAt(e.position-1),zn(n))break}else{if(e.position===e.lineStart&&Vp(e)||r&&Ao(x))break;if(Qi(x))if(u=e.line,d=e.lineStart,f=e.lineIndent,_r(e,!1,-1),e.lineIndent>=t){o=!0,x=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=u,e.lineStart=d,e.lineIndent=f;break}}o&&(gs(e,a,s,!1),cv(e,e.line-u),a=s=e.position,o=!1),dl(x)||(s=e.position+1),x=e.input.charCodeAt(++e.position)}return gs(e,a,s,!1),e.result?!0:(e.kind=p,e.result=m,!1)}function U7(e,t){var r,n,i;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(gs(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,i=e.position;else return!0;else Qi(r)?(gs(e,n,i,!0),cv(e,_r(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Vp(e)?He(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);He(e,"unexpected end of the stream within a single quoted scalar")}function V7(e,t){var r,n,i,a,s,o;if(o=e.input.charCodeAt(e.position),o!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(o=e.input.charCodeAt(e.position))!==0;){if(o===34)return gs(e,r,e.position,!0),e.position++,!0;if(o===92){if(gs(e,r,e.position,!0),o=e.input.charCodeAt(++e.position),Qi(o))_r(e,!1,t);else if(o<256&&PE[o])e.result+=HE[o],e.position++;else if((s=I7(o))>0){for(i=s,a=0;i>0;i--)o=e.input.charCodeAt(++e.position),(s=z7(o))>=0?a=(a<<4)+s:He(e,"expected hexadecimal character");e.result+=P7(a),e.position++}else He(e,"unknown escape sequence");r=n=e.position}else Qi(o)?(gs(e,r,n,!0),cv(e,_r(e,!1,t)),r=n=e.position):e.position===e.lineStart&&Vp(e)?He(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}He(e,"unexpected end of the stream within a double quoted scalar")}function W7(e,t){var r=!0,n,i,a,s=e.tag,o,u=e.anchor,d,f,p,m,x,b=Object.create(null),v,k,w,C;if(C=e.input.charCodeAt(e.position),C===91)f=93,x=!1,o=[];else if(C===123)f=125,x=!0,o={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),C=e.input.charCodeAt(++e.position);C!==0;){if(_r(e,!0,t),C=e.input.charCodeAt(e.position),C===f)return e.position++,e.tag=s,e.anchor=u,e.kind=x?"mapping":"sequence",e.result=o,!0;r?C===44&&He(e,"expected the node content, but found ','"):He(e,"missed comma between flow collection entries"),k=v=w=null,p=m=!1,C===63&&(d=e.input.charCodeAt(e.position+1),zn(d)&&(p=m=!0,e.position++,_r(e,!0,t))),n=e.line,i=e.lineStart,a=e.position,Qo(e,t,F0,!1,!0),k=e.tag,v=e.result,_r(e,!0,t),C=e.input.charCodeAt(e.position),(m||e.line===n)&&C===58&&(p=!0,C=e.input.charCodeAt(++e.position),_r(e,!0,t),Qo(e,t,F0,!1,!0),w=e.result),x?Mo(e,o,b,k,v,w,n,i,a):p?o.push(Mo(e,null,b,k,v,w,n,i,a)):o.push(v),_r(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(r=!0,C=e.input.charCodeAt(++e.position)):r=!1}He(e,"unexpected end of the stream within a flow collection")}function Y7(e,t){var r,n,i=ay,a=!1,s=!1,o=t,u=0,d=!1,f,p;if(p=e.input.charCodeAt(e.position),p===124)n=!1;else if(p===62)n=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)ay===i?i=p===43?ZC:R7:He(e,"repeat of a chomping mode identifier");else if((f=F7(p))>=0)f===0?He(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?He(e,"repeat of an indentation width identifier"):(o=t+f-1,s=!0);else break;if(dl(p)){do p=e.input.charCodeAt(++e.position);while(dl(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!Qi(p)&&p!==0)}for(;p!==0;){for(ov(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!s||e.lineIndent<o)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>o&&(o=e.lineIndent),Qi(p)){u++;continue}if(e.lineIndent<o){i===ZC?e.result+=Dr.repeat(`
93
- `,a?1+u:u):i===ay&&a&&(e.result+=`
94
- `);break}for(n?dl(p)?(d=!0,e.result+=Dr.repeat(`
95
- `,a?1+u:u)):d?(d=!1,e.result+=Dr.repeat(`
96
- `,u+1)):u===0?a&&(e.result+=" "):e.result+=Dr.repeat(`
97
- `,u):e.result+=Dr.repeat(`
98
- `,a?1+u:u),a=!0,s=!0,u=0,r=e.position;!Qi(p)&&p!==0;)p=e.input.charCodeAt(++e.position);gs(e,r,e.position,!1)}return!0}function r_(e,t){var r,n=e.tag,i=e.anchor,a=[],s,o=!1,u;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),u=e.input.charCodeAt(e.position);u!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,He(e,"tab characters must not be used in indentation")),!(u!==45||(s=e.input.charCodeAt(e.position+1),!zn(s))));){if(o=!0,e.position++,_r(e,!0,-1)&&e.lineIndent<=t){a.push(null),u=e.input.charCodeAt(e.position);continue}if(r=e.line,Qo(e,t,$E,!1,!0),a.push(e.result),_r(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&u!==0)He(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return o?(e.tag=n,e.anchor=i,e.kind="sequence",e.result=a,!0):!1}function G7(e,t,r){var n,i,a,s,o,u,d=e.tag,f=e.anchor,p={},m=Object.create(null),x=null,b=null,v=null,k=!1,w=!1,C;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),C=e.input.charCodeAt(e.position);C!==0;){if(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,He(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),a=e.line,(C===63||C===58)&&zn(n))C===63?(k&&(Mo(e,p,m,x,b,null,s,o,u),x=b=v=null),w=!0,k=!0,i=!0):k?(k=!1,i=!0):He(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,C=n;else{if(s=e.line,o=e.lineStart,u=e.position,!Qo(e,r,BE,!1,!0))break;if(e.line===a){for(C=e.input.charCodeAt(e.position);dl(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),zn(C)||He(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(Mo(e,p,m,x,b,null,s,o,u),x=b=v=null),w=!0,k=!1,i=!1,x=e.tag,b=e.result;else if(w)He(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=f,!0}else if(w)He(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=f,!0}if((e.line===a||e.lineIndent>t)&&(k&&(s=e.line,o=e.lineStart,u=e.position),Qo(e,t,P0,!0,i)&&(k?b=e.result:v=e.result),k||(Mo(e,p,m,x,b,v,s,o,u),x=b=v=null),_r(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&C!==0)He(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&Mo(e,p,m,x,b,null,s,o,u),w&&(e.tag=d,e.anchor=f,e.kind="mapping",e.result=p),w}function X7(e){var t,r=!1,n=!1,i,a,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&He(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(r=!0,s=e.input.charCodeAt(++e.position)):s===33?(n=!0,i="!!",s=e.input.charCodeAt(++e.position)):i="!",t=e.position,r){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(a=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):He(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!zn(s);)s===33&&(n?He(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),zE.test(i)||He(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),$7.test(a)&&He(e,"tag suffix cannot contain flow indicator characters")}a&&!IE.test(a)&&He(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{He(e,"tag name is malformed: "+a)}return r?e.tag=a:vs.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i==="!"?e.tag="!"+a:i==="!!"?e.tag="tag:yaml.org,2002:"+a:He(e,'undeclared tag handle "'+i+'"'),!0}function Q7(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&He(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!zn(r)&&!Ao(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&He(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Z7(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!zn(n)&&!Ao(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&He(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),vs.call(e.anchorMap,r)||He(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],_r(e,!0,-1),!0}function Qo(e,t,r,n,i){var a,s,o,u=1,d=!1,f=!1,p,m,x,b,v,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=s=o=P0===r||$E===r,n&&_r(e,!0,-1)&&(d=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;X7(e)||Q7(e);)_r(e,!0,-1)?(d=!0,o=a,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)):o=!1;if(o&&(o=d||i),(u===1||P0===r)&&(F0===r||BE===r?v=t:v=t+1,k=e.position-e.lineStart,u===1?o&&(r_(e,k)||G7(e,k,v))||W7(e,v)?f=!0:(s&&Y7(e,v)||U7(e,v)||V7(e,v)?f=!0:Z7(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&He(e,"alias node should not have any properties")):q7(e,v,F0===r)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(f=o&&r_(e,k))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&He(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,m=e.implicitTypes.length;p<m;p+=1)if(b=e.implicitTypes[p],b.resolve(e.result)){e.result=b.construct(e.result),e.tag=b.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(vs.call(e.typeMap[e.kind||"fallback"],e.tag))b=e.typeMap[e.kind||"fallback"][e.tag];else for(b=null,x=e.typeMap.multi[e.kind||"fallback"],p=0,m=x.length;p<m;p+=1)if(e.tag.slice(0,x[p].tag.length)===x[p].tag){b=x[p];break}b||He(e,"unknown tag !<"+e.tag+">"),e.result!==null&&b.kind!==e.kind&&He(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result,e.tag)?(e.result=b.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):He(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function K7(e){var t=e.position,r,n,i,a=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(_r(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(a=!0,s=e.input.charCodeAt(++e.position),r=e.position;s!==0&&!zn(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),i=[],n.length<1&&He(e,"directive name must not be less than one character in length");s!==0;){for(;dl(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Qi(s));break}if(Qi(s))break;for(r=e.position;s!==0&&!zn(s);)s=e.input.charCodeAt(++e.position);i.push(e.input.slice(r,e.position))}s!==0&&ov(e),vs.call(e_,n)?e_[n](e,n,i):H0(e,'unknown document directive "'+n+'"')}if(_r(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,_r(e,!0,-1)):a&&He(e,"directives end mark is expected"),Qo(e,e.lineIndent-1,P0,!1,!0),_r(e,!0,-1),e.checkLineBreaks&&B7.test(e.input.slice(t,e.position))&&H0(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Vp(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,_r(e,!0,-1));return}if(e.position<e.length-1)He(e,"end of the stream or a document separator is expected");else return}function UE(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
99
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new H7(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,He(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)K7(r);return r.documents}function J7(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=UE(e,r);if(typeof t!="function")return n;for(var i=0,a=n.length;i<a;i+=1)t(n[i])}function e9(e,t){var r=UE(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new yn("expected a single document in the stream, but found more")}}var t9=J7,r9=e9,VE={loadAll:t9,load:r9},WE=Object.prototype.toString,YE=Object.prototype.hasOwnProperty,uv=65279,n9=9,Cd=10,i9=13,a9=32,s9=33,l9=34,xb=35,o9=37,c9=38,u9=39,d9=42,GE=44,h9=45,q0=58,f9=61,p9=62,g9=63,m9=64,XE=91,QE=93,x9=96,ZE=123,y9=124,KE=125,hn={};hn[0]="\\0";hn[7]="\\a";hn[8]="\\b";hn[9]="\\t";hn[10]="\\n";hn[11]="\\v";hn[12]="\\f";hn[13]="\\r";hn[27]="\\e";hn[34]='\\"';hn[92]="\\\\";hn[133]="\\N";hn[160]="\\_";hn[8232]="\\L";hn[8233]="\\P";var b9=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],v9=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function w9(e,t){var r,n,i,a,s,o,u;if(t===null)return{};for(r={},n=Object.keys(t),i=0,a=n.length;i<a;i+=1)s=n[i],o=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),u=e.compiledTypeMap.fallback[s],u&&YE.call(u.styleAliases,o)&&(o=u.styleAliases[o]),r[s]=o;return r}function k9(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new yn("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Dr.repeat("0",n-t.length)+t}var S9=1,_d=2;function C9(e){this.schema=e.schema||lv,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Dr.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=w9(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?_d:S9,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function n_(e,t){for(var r=Dr.repeat(" ",t),n=0,i=-1,a="",s,o=e.length;n<o;)i=e.indexOf(`
100
- `,n),i===-1?(s=e.slice(n),n=o):(s=e.slice(n,i+1),n=i+1),s.length&&s!==`
101
- `&&(a+=r),a+=s;return a}function yb(e,t){return`
102
- `+Dr.repeat(" ",e.indent*t)}function _9(e,t){var r,n,i;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(i=e.implicitTypes[r],i.resolve(t))return!0;return!1}function U0(e){return e===a9||e===n9}function Td(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==uv||65536<=e&&e<=1114111}function i_(e){return Td(e)&&e!==uv&&e!==i9&&e!==Cd}function a_(e,t,r){var n=i_(e),i=n&&!U0(e);return(r?n:n&&e!==GE&&e!==XE&&e!==QE&&e!==ZE&&e!==KE)&&e!==xb&&!(t===q0&&!i)||i_(t)&&!U0(t)&&e===xb||t===q0&&i}function T9(e){return Td(e)&&e!==uv&&!U0(e)&&e!==h9&&e!==g9&&e!==q0&&e!==GE&&e!==XE&&e!==QE&&e!==ZE&&e!==KE&&e!==xb&&e!==c9&&e!==d9&&e!==s9&&e!==y9&&e!==f9&&e!==p9&&e!==u9&&e!==l9&&e!==o9&&e!==m9&&e!==x9}function E9(e){return!U0(e)&&e!==q0}function Gu(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function JE(e){var t=/^\n* /;return t.test(e)}var eN=1,bb=2,tN=3,rN=4,_o=5;function N9(e,t,r,n,i,a,s,o){var u,d=0,f=null,p=!1,m=!1,x=n!==-1,b=-1,v=T9(Gu(e,0))&&E9(Gu(e,e.length-1));if(t||s)for(u=0;u<e.length;d>=65536?u+=2:u++){if(d=Gu(e,u),!Td(d))return _o;v=v&&a_(d,f,o),f=d}else{for(u=0;u<e.length;d>=65536?u+=2:u++){if(d=Gu(e,u),d===Cd)p=!0,x&&(m=m||u-b-1>n&&e[b+1]!==" ",b=u);else if(!Td(d))return _o;v=v&&a_(d,f,o),f=d}m=m||x&&u-b-1>n&&e[b+1]!==" "}return!p&&!m?v&&!s&&!i(e)?eN:a===_d?_o:bb:r>9&&JE(e)?_o:s?a===_d?_o:bb:m?rN:tN}function j9(e,t,r,n,i){e.dump=(function(){if(t.length===0)return e.quotingType===_d?'""':"''";if(!e.noCompatMode&&(b9.indexOf(t)!==-1||v9.test(t)))return e.quotingType===_d?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,r),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),o=n||e.flowLevel>-1&&r>=e.flowLevel;function u(d){return _9(e,d)}switch(N9(t,o,e.indent,s,u,e.quotingType,e.forceQuotes&&!n,i)){case eN:return t;case bb:return"'"+t.replace(/'/g,"''")+"'";case tN:return"|"+s_(t,e.indent)+l_(n_(t,a));case rN:return">"+s_(t,e.indent)+l_(n_(A9(t,s),a));case _o:return'"'+M9(t)+'"';default:throw new yn("impossible error: invalid scalar style")}})()}function s_(e,t){var r=JE(e)?String(t):"",n=e[e.length-1]===`
103
- `,i=n&&(e[e.length-2]===`
104
- `||e===`
105
- `),a=i?"+":n?"":"-";return r+a+`
106
- `}function l_(e){return e[e.length-1]===`
107
- `?e.slice(0,-1):e}function A9(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var d=e.indexOf(`
108
- `);return d=d!==-1?d:e.length,r.lastIndex=d,o_(e.slice(0,d),t)})(),i=e[0]===`
109
- `||e[0]===" ",a,s;s=r.exec(e);){var o=s[1],u=s[2];a=u[0]===" ",n+=o+(!i&&!a&&u!==""?`
110
- `:"")+o_(u,t),i=a}return n}function o_(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,u="";n=r.exec(e);)o=n.index,o-i>t&&(a=s>i?s:o,u+=`
111
- `+e.slice(i,a),i=a+1),s=o;return u+=`
112
- `,e.length-i>t&&s>i?u+=e.slice(i,s)+`
113
- `+e.slice(s+1):u+=e.slice(i),u.slice(1)}function M9(e){for(var t="",r=0,n,i=0;i<e.length;r>=65536?i+=2:i++)r=Gu(e,i),n=hn[r],!n&&Td(r)?(t+=e[i],r>=65536&&(t+=e[i+1])):t+=n||k9(r);return t}function L9(e,t,r){var n="",i=e.tag,a,s,o;for(a=0,s=r.length;a<s;a+=1)o=r[a],e.replacer&&(o=e.replacer.call(r,String(a),o)),(Ma(e,t,o,!1,!1)||typeof o>"u"&&Ma(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=i,e.dump="["+n+"]"}function c_(e,t,r,n){var i="",a=e.tag,s,o,u;for(s=0,o=r.length;s<o;s+=1)u=r[s],e.replacer&&(u=e.replacer.call(r,String(s),u)),(Ma(e,t+1,u,!0,!0,!1,!0)||typeof u>"u"&&Ma(e,t+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=yb(e,t)),e.dump&&Cd===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=a,e.dump=i||"[]"}function D9(e,t,r){var n="",i=e.tag,a=Object.keys(r),s,o,u,d,f;for(s=0,o=a.length;s<o;s+=1)f="",n!==""&&(f+=", "),e.condenseFlow&&(f+='"'),u=a[s],d=r[u],e.replacer&&(d=e.replacer.call(r,u,d)),Ma(e,t,u,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ma(e,t,d,!1,!1)&&(f+=e.dump,n+=f));e.tag=i,e.dump="{"+n+"}"}function R9(e,t,r,n){var i="",a=e.tag,s=Object.keys(r),o,u,d,f,p,m;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new yn("sortKeys must be a boolean or a function");for(o=0,u=s.length;o<u;o+=1)m="",(!n||i!=="")&&(m+=yb(e,t)),d=s[o],f=r[d],e.replacer&&(f=e.replacer.call(r,d,f)),Ma(e,t+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Cd===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,p&&(m+=yb(e,t)),Ma(e,t+1,f,!0,p)&&(e.dump&&Cd===e.dump.charCodeAt(0)?m+=":":m+=": ",m+=e.dump,i+=m));e.tag=a,e.dump=i||"{}"}function u_(e,t,r){var n,i,a,s,o,u;for(i=r?e.explicitTypes:e.implicitTypes,a=0,s=i.length;a<s;a+=1)if(o=i[a],(o.instanceOf||o.predicate)&&(!o.instanceOf||typeof t=="object"&&t instanceof o.instanceOf)&&(!o.predicate||o.predicate(t))){if(r?o.multi&&o.representName?e.tag=o.representName(t):e.tag=o.tag:e.tag="?",o.represent){if(u=e.styleMap[o.tag]||o.defaultStyle,WE.call(o.represent)==="[object Function]")n=o.represent(t,u);else if(YE.call(o.represent,u))n=o.represent[u](t,u);else throw new yn("!<"+o.tag+'> tag resolver accepts not "'+u+'" style');e.dump=n}return!0}return!1}function Ma(e,t,r,n,i,a,s){e.tag=null,e.dump=r,u_(e,r,!1)||u_(e,r,!0);var o=WE.call(e.dump),u=n,d;n&&(n=e.flowLevel<0||e.flowLevel>t);var f=o==="[object Object]"||o==="[object Array]",p,m;if(f&&(p=e.duplicates.indexOf(r),m=p!==-1),(e.tag!==null&&e.tag!=="?"||m||e.indent!==2&&t>0)&&(i=!1),m&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(f&&m&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),o==="[object Object]")n&&Object.keys(e.dump).length!==0?(R9(e,t,e.dump,i),m&&(e.dump="&ref_"+p+e.dump)):(D9(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if(o==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?c_(e,t-1,e.dump,i):c_(e,t,e.dump,i),m&&(e.dump="&ref_"+p+e.dump)):(L9(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if(o==="[object String]")e.tag!=="?"&&j9(e,e.dump,t,a,u);else{if(o==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new yn("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function O9(e,t){var r=[],n=[],i,a;for(vb(e,r,n),i=0,a=n.length;i<a;i+=1)t.duplicates.push(r[n[i]]);t.usedDuplicates=new Array(a)}function vb(e,t,r){var n,i,a;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)vb(e[i],t,r);else for(n=Object.keys(e),i=0,a=n.length;i<a;i+=1)vb(e[n[i]],t,r)}function B9(e,t){t=t||{};var r=new C9(t);r.noRefs||O9(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Ma(r,0,n,!0,!0)?r.dump+`
114
- `:""}var $9=B9,z9={dump:$9};function dv(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var I9=Zr,F9=xE,P9=wE,H9=TE,q9=EE,U9=lv,Wp=VE.load,V9=VE.loadAll,Ed=z9.dump,hv=yn,W9={binary:LE,float:_E,map:vE,null:kE,pairs:RE,set:OE,timestamp:AE,bool:SE,int:CE,merge:ME,omap:DE,seq:bE,str:yE},Y9=dv("safeLoad","load"),G9=dv("safeLoadAll","loadAll"),X9=dv("safeDump","dump"),Q9={Type:I9,Schema:F9,FAILSAFE_SCHEMA:P9,JSON_SCHEMA:H9,CORE_SCHEMA:q9,DEFAULT_SCHEMA:U9,load:Wp,loadAll:V9,dump:Ed,YAMLException:hv,types:W9,safeLoad:Y9,safeLoadAll:G9,safeDump:X9};function nN({onNext:e,onPrev:t,onReset:r,enabled:n=!0}){const i=N.useCallback(a=>{var s;if(!(a.target instanceof HTMLInputElement||a.target instanceof HTMLTextAreaElement||(s=a.target)!=null&&s.isContentEditable))switch(a.key){case"ArrowRight":case" ":e&&(a.preventDefault(),e());break;case"ArrowLeft":t&&(a.preventDefault(),t());break;case"r":r&&r();break}},[e,t,r]);N.useEffect(()=>{if(n)return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[n,i])}function Z9(){const{state:e,dispatch:t,getStepStatus:r,expandedGroups:n,toggleGroup:i,stepperStructure:a}=rr(),s=N.useRef(null),[o,u]=N.useState(!1),[d,f]=N.useState(!1),p=()=>{if(s.current){const{scrollLeft:x,scrollWidth:b,clientWidth:v}=s.current;u(x>0),f(x<b-v-1)}};N.useEffect(()=>(p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)),[e.config]);const m=x=>{s.current&&(s.current.scrollBy({left:x==="left"?-200:200,behavior:"smooth"}),setTimeout(p,300))};return e.config?h.jsxs("div",{className:"bg-white/80 dark:bg-slate-800/50 backdrop-blur-sm rounded-xl border border-[rgba(var(--color-primary-rgb),0.15)] dark:border-[rgba(var(--color-primary-rgb),0.2)] p-4 shadow-[0_4px_12px_rgba(var(--color-primary-rgb),0.08)] dark:shadow-xl transition-colors duration-300",children:[h.jsxs("div",{className:"relative flex items-center",children:[o&&h.jsx("button",{onClick:()=>m("left"),className:"absolute left-0 z-10 w-8 h-8 flex items-center justify-center bg-white/90 dark:bg-slate-700/90 rounded-full shadow-md hover:bg-gray-100 dark:hover:bg-slate-600 transition-colors","aria-label":"Scroll left",children:h.jsx("svg",{className:"w-4 h-4 text-gray-600 dark:text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),h.jsx("div",{ref:s,onScroll:p,className:"flex items-center gap-2 overflow-x-auto pb-2 scrollbar-hide px-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:a.map((x,b)=>h.jsx(J9,{item:x,currentStep:e.currentStep,getStepStatus:r,dispatch:t,expandedGroups:n,toggleGroup:i},b))}),d&&h.jsx("button",{onClick:()=>m("right"),className:"absolute right-0 z-10 w-8 h-8 flex items-center justify-center bg-white/90 dark:bg-slate-700/90 rounded-full shadow-md hover:bg-gray-100 dark:hover:bg-slate-600 transition-colors","aria-label":"Scroll right",children:h.jsx("svg",{className:"w-4 h-4 text-gray-600 dark:text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),h.jsx("div",{className:"mt-3 h-1 bg-gray-200 dark:bg-slate-700 rounded-full overflow-hidden",children:h.jsx("div",{className:"h-full bg-gradient-to-r from-theme-primary via-theme-accent to-theme-primary transition-all duration-500",style:{width:`${(e.currentStep+1)/e.flatSteps.length*100}%`}})})]}):null}function K9(e,t){let r=0,n=!1;for(const{flatIndex:i}of e){const a=t(i);a==="complete"&&r++,a==="error"&&(n=!0)}return{completed:r,total:e.length,hasError:n}}function J9({item:e,currentStep:t,getStepStatus:r,dispatch:n,expandedGroups:i,toggleGroup:a}){if(e.type==="group"&&e.group&&e.stepsInGroup&&e.groupIndex!==void 0){const s=i[e.groupIndex]??!0,o=e.stepsInGroup.some(p=>p.flatIndex===t),u=K9(e.stepsInGroup,r),d=u.completed===u.total,f=u.completed/u.total*100;return h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsxs("div",{className:"relative",children:[h.jsxs("button",{onClick:()=>a(e.groupIndex),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg whitespace-nowrap transition-all duration-300 ${o?"bg-gradient-to-r from-[rgba(var(--color-primary-rgb),0.1)] to-[rgba(var(--color-accent-rgb),0.1)] dark:from-[rgba(var(--color-primary-rgb),0.2)] dark:to-[rgba(var(--color-accent-rgb),0.2)] text-theme-primary border-2 border-[rgba(var(--color-primary-rgb),0.5)] dark:border-[rgba(var(--color-primary-rgb),0.4)] shadow-md":d?"bg-green-50 dark:bg-green-500/10 text-green-700 dark:text-green-400 border border-green-200 dark:border-green-500/30":u.hasError?"bg-red-50 dark:bg-red-500/10 text-red-700 dark:text-red-400 border border-red-200 dark:border-red-500/30":"bg-gray-50 dark:bg-slate-800/50 text-gray-600 dark:text-slate-400 hover:bg-gray-100 dark:hover:bg-slate-700/50 border border-gray-200 dark:border-slate-600/30"}`,children:[h.jsx("svg",{className:`w-3 h-3 transition-transform duration-200 ${s?"rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),h.jsx("svg",{className:"w-3.5 h-3.5 opacity-60",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{d:"M2 6a2 2 0 012-2h5l2 2h5a2 2 0 012 2v6a2 2 0 01-2 2H4a2 2 0 01-2-2V6z"})}),h.jsx("span",{className:"text-xs font-medium",children:e.group.group}),h.jsxs("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium ${d?"bg-green-100 dark:bg-green-500/20 text-green-600 dark:text-green-400":u.hasError?"bg-red-100 dark:bg-red-500/20 text-red-600 dark:text-red-400":"bg-gray-200 dark:bg-slate-600 text-gray-600 dark:text-slate-300"}`,children:[u.completed,"/",u.total]}),d&&h.jsx($i,{size:12,animated:!1})]}),!d&&u.completed>0&&h.jsx("div",{className:"absolute -bottom-0.5 left-2 right-2 h-0.5 bg-gray-200 dark:bg-slate-700 rounded-full overflow-hidden",children:h.jsx("div",{className:"h-full bg-gradient-to-r from-theme-primary to-theme-accent transition-all duration-500",style:{width:`${f}%`}})})]}),s&&h.jsx("div",{className:"flex items-center gap-1 pl-2 border-l-2 border-[rgba(var(--color-primary-rgb),0.3)] dark:border-[rgba(var(--color-primary-rgb),0.3)] ml-1",children:e.stepsInGroup.map(({step:p,flatIndex:m})=>h.jsx(d_,{step:p,flatIndex:m,currentStep:t,getStepStatus:r,dispatch:n,compact:!0},m))})]})}return e.step&&e.flatIndex!==void 0?h.jsx(d_,{step:e.step,flatIndex:e.flatIndex,currentStep:t,getStepStatus:r,dispatch:n}):null}function d_({step:e,flatIndex:t,currentStep:r,getStepStatus:n,dispatch:i,compact:a}){const s=n(t),o=t===r,u=El(e,t),d=Sc(e);return h.jsxs("button",{onClick:()=>i({type:"SET_STEP",payload:t}),"aria-label":`Step ${t+1}: ${u}`,"aria-current":o?"step":void 0,className:`flex items-center gap-1 sm:gap-2 ${a?"px-2 py-1":"px-2 sm:px-3 py-1.5 sm:py-2"} rounded-lg whitespace-nowrap transition-all duration-300 ${o?"bg-gradient-to-r from-theme-primary to-theme-accent text-white shadow-lg shadow-[rgba(var(--color-primary-rgb),0.3)] scale-105":s==="complete"?"bg-green-50 dark:bg-slate-700/50 text-green-600 dark:text-green-400 hover:bg-green-100 dark:hover:bg-slate-700":s==="error"?"bg-red-50 dark:bg-red-900/30 text-red-600 dark:text-red-400 hover:bg-red-100 dark:hover:bg-red-900/50":"bg-gray-100 dark:bg-slate-800/50 text-gray-600 dark:text-slate-400 hover:bg-gray-200 dark:hover:bg-slate-700/50"}`,children:[h.jsx("span",{className:`${a?"w-4 h-4 text-[10px]":"w-5 h-5 sm:w-6 sm:h-6 text-xs"} rounded-full flex items-center justify-center font-bold transition-all duration-300 ${o?"bg-white/20 text-white ring-2 ring-white/30":s==="complete"?"bg-green-100 dark:bg-green-500/20":s==="error"?"bg-red-500 text-white":"bg-gray-200 dark:bg-slate-600 text-gray-500 dark:text-slate-400"}`,children:s==="complete"?h.jsx($i,{size:a?12:16,animated:!1}):s==="error"?h.jsx("svg",{className:a?"w-2 h-2":"w-3 h-3 sm:w-4 sm:h-4",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})}):t+1}),!a&&h.jsx("span",{className:"text-xs sm:text-sm font-medium hidden sm:inline",children:u}),h.jsx(ez,{type:d,compact:a})]})}function ez({type:e,compact:t}){const r={slide:"bg-purple-100 dark:bg-purple-500/20 text-purple-700 dark:text-purple-300 border border-purple-200 dark:border-purple-500/30",rest:"bg-blue-100 dark:bg-blue-500/20 text-blue-700 dark:text-blue-300 border border-blue-200 dark:border-blue-500/30",shell:"bg-orange-100 dark:bg-orange-500/20 text-orange-700 dark:text-orange-300 border border-orange-200 dark:border-orange-500/30",browser:"bg-green-100 dark:bg-green-500/20 text-green-700 dark:text-green-300 border border-green-200 dark:border-green-500/30",code:"bg-slate-100 dark:bg-slate-500/20 text-slate-700 dark:text-slate-300 border border-slate-200 dark:border-slate-500/30",wait:"bg-yellow-100 dark:bg-yellow-500/20 text-yellow-700 dark:text-yellow-300 border border-yellow-200 dark:border-yellow-500/30",assert:"bg-cyan-100 dark:bg-cyan-500/20 text-cyan-700 dark:text-cyan-300 border border-cyan-200 dark:border-cyan-500/30",graphql:"bg-pink-100 dark:bg-pink-500/20 text-pink-700 dark:text-pink-300 border border-pink-200 dark:border-pink-500/30",db:"bg-emerald-100 dark:bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 border border-emerald-200 dark:border-emerald-500/30",group:"bg-gray-100 dark:bg-gray-500/20 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-gray-500/30",form:"bg-indigo-100 dark:bg-indigo-500/20 text-indigo-700 dark:text-indigo-300 border border-indigo-200 dark:border-indigo-500/30",terminal:"bg-emerald-100 dark:bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 border border-emerald-200 dark:border-emerald-500/30",poll:"bg-amber-100 dark:bg-amber-500/20 text-amber-700 dark:text-amber-300 border border-amber-200 dark:border-amber-500/30"},n={slide:"Slide",rest:"REST",shell:"Shell",browser:"Web",code:"Code",wait:"Wait",assert:"Assert",graphql:"GraphQL",db:"DB",group:"Group",form:"Form",terminal:"Terminal",poll:"Poll"};return h.jsx("span",{className:`${t?"px-1 py-0.5 text-[10px]":"px-1.5 py-0.5 text-xs"} rounded font-medium ${r[e]}`,children:n[e]})}function tz(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const rz=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iz={};function h_(e,t){return(iz.jsx?nz:rz).test(e)}const az=/[ \t\n\f\r]/g;function sz(e){return typeof e=="object"?e.type==="text"?f_(e.value):!1:f_(e)}function f_(e){return e.replace(az,"")===""}class nh{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}nh.prototype.normal={};nh.prototype.property={};nh.prototype.space=void 0;function iN(e,t){const r={},n={};for(const i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new nh(r,n,t)}function wb(e){return e.toLowerCase()}class Fn{constructor(t,r){this.attribute=r,this.property=t}}Fn.prototype.attribute="";Fn.prototype.booleanish=!1;Fn.prototype.boolean=!1;Fn.prototype.commaOrSpaceSeparated=!1;Fn.prototype.commaSeparated=!1;Fn.prototype.defined=!1;Fn.prototype.mustUseProperty=!1;Fn.prototype.number=!1;Fn.prototype.overloadedBoolean=!1;Fn.prototype.property="";Fn.prototype.spaceSeparated=!1;Fn.prototype.space=void 0;let lz=0;const ct=Nl(),kr=Nl(),kb=Nl(),Ce=Nl(),Gt=Nl(),Oo=Nl(),Jn=Nl();function Nl(){return 2**++lz}const Sb=Object.freeze(Object.defineProperty({__proto__:null,boolean:ct,booleanish:kr,commaOrSpaceSeparated:Jn,commaSeparated:Oo,number:Ce,overloadedBoolean:kb,spaceSeparated:Gt},Symbol.toStringTag,{value:"Module"})),sy=Object.keys(Sb);class fv extends Fn{constructor(t,r,n,i){let a=-1;if(super(t,r),p_(this,"space",i),typeof n=="number")for(;++a<sy.length;){const s=sy[a];p_(this,sy[a],(n&Sb[s])===Sb[s])}}}fv.prototype.defined=!0;function p_(e,t,r){r&&(e[t]=r)}function Cc(e){const t={},r={};for(const[n,i]of Object.entries(e.properties)){const a=new fv(n,e.transform(e.attributes||{},n),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(a.mustUseProperty=!0),t[n]=a,r[wb(n)]=n,r[wb(a.attribute)]=n}return new nh(t,r,e.space)}const aN=Cc({properties:{ariaActiveDescendant:null,ariaAtomic:kr,ariaAutoComplete:null,ariaBusy:kr,ariaChecked:kr,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:Gt,ariaCurrent:null,ariaDescribedBy:Gt,ariaDetails:null,ariaDisabled:kr,ariaDropEffect:Gt,ariaErrorMessage:null,ariaExpanded:kr,ariaFlowTo:Gt,ariaGrabbed:kr,ariaHasPopup:null,ariaHidden:kr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Gt,ariaLevel:Ce,ariaLive:null,ariaModal:kr,ariaMultiLine:kr,ariaMultiSelectable:kr,ariaOrientation:null,ariaOwns:Gt,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:kr,ariaReadOnly:kr,ariaRelevant:null,ariaRequired:kr,ariaRoleDescription:Gt,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:kr,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sN(e,t){return t in e?e[t]:t}function lN(e,t){return sN(e,t.toLowerCase())}const oz=Cc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Oo,acceptCharset:Gt,accessKey:Gt,action:null,allow:null,allowFullScreen:ct,allowPaymentRequest:ct,allowUserMedia:ct,alt:null,as:null,async:ct,autoCapitalize:null,autoComplete:Gt,autoFocus:ct,autoPlay:ct,blocking:Gt,capture:null,charSet:null,checked:ct,cite:null,className:Gt,cols:Ce,colSpan:null,content:null,contentEditable:kr,controls:ct,controlsList:Gt,coords:Ce|Oo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ct,defer:ct,dir:null,dirName:null,disabled:ct,download:kb,draggable:kr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ct,formTarget:null,headers:Gt,height:Ce,hidden:kb,high:Ce,href:null,hrefLang:null,htmlFor:Gt,httpEquiv:Gt,id:null,imageSizes:null,imageSrcSet:null,inert:ct,inputMode:null,integrity:null,is:null,isMap:ct,itemId:null,itemProp:Gt,itemRef:Gt,itemScope:ct,itemType:Gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ct,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,multiple:ct,muted:ct,name:null,nonce:null,noModule:ct,noValidate:ct,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ct,optimum:Ce,pattern:null,ping:Gt,placeholder:null,playsInline:ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ct,referrerPolicy:null,rel:Gt,required:ct,reversed:ct,rows:Ce,rowSpan:Ce,sandbox:Gt,scope:null,scoped:ct,seamless:ct,selected:ct,shadowRootClonable:ct,shadowRootDelegatesFocus:ct,shadowRootMode:null,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:kr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:ct,useMap:null,value:kr,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Gt,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ct,declare:ct,event:null,face:null,frame:null,frameBorder:null,hSpace:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:ct,noHref:ct,noShade:ct,noWrap:ct,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:kr,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ct,disableRemotePlayback:ct,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:lN}),cz=Cc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Jn,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:Gt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Oo,g2:Oo,glyphName:Oo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:Jn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jn,rev:Jn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jn,requiredFeatures:Jn,requiredFonts:Jn,requiredFormats:Jn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:Jn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jn,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sN}),oN=Cc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),cN=Cc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:lN}),uN=Cc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),uz={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},dz=/[A-Z]/g,g_=/-[a-z]/g,hz=/^data[-\w.:]+$/i;function fz(e,t){const r=wb(t);let n=t,i=Fn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&hz.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(g_,gz);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!g_.test(a)){let s=a.replace(dz,pz);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=fv}return new i(n,t)}function pz(e){return"-"+e.toLowerCase()}function gz(e){return e.charAt(1).toUpperCase()}const mz=iN([aN,oz,oN,cN,uN],"html"),pv=iN([aN,cz,oN,cN,uN],"svg");function xz(e){return e.join(" ").trim()}var bo={},ly,m_;function yz(){if(m_)return ly;m_=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
115
- `,d="/",f="*",p="",m="comment",x="declaration";function b(k,w){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];w=w||{};var C=1,T=1;function j(B){var U=B.match(t);U&&(C+=U.length);var R=B.lastIndexOf(u);T=~R?B.length-R:T+B.length}function L(){var B={line:C,column:T};return function(U){return U.position=new E(B),P(),U}}function E(B){this.start=B,this.end={line:C,column:T},this.source=w.source}E.prototype.content=k;function M(B){var U=new Error(w.source+":"+C+":"+T+": "+B);if(U.reason=B,U.filename=w.source,U.line=C,U.column=T,U.source=k,!w.silent)throw U}function I(B){var U=B.exec(k);if(U){var R=U[0];return j(R),k=k.slice(R.length),U}}function P(){I(r)}function z(B){var U;for(B=B||[];U=$();)U!==!1&&B.push(U);return B}function $(){var B=L();if(!(d!=k.charAt(0)||f!=k.charAt(1))){for(var U=2;p!=k.charAt(U)&&(f!=k.charAt(U)||d!=k.charAt(U+1));)++U;if(U+=2,p===k.charAt(U-1))return M("End of comment missing");var R=k.slice(2,U-2);return T+=2,j(R),k=k.slice(U),T+=2,B({type:m,comment:R})}}function W(){var B=L(),U=I(n);if(U){if($(),!I(i))return M("property missing ':'");var R=I(a),H=B({type:x,property:v(U[0].replace(e,p)),value:R?v(R[0].replace(e,p)):p});return I(s),H}}function Y(){var B=[];z(B);for(var U;U=W();)U!==!1&&(B.push(U),z(B));return B}return P(),Y()}function v(k){return k?k.replace(o,p):p}return ly=b,ly}var x_;function bz(){if(x_)return bo;x_=1;var e=bo&&bo.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(bo,"__esModule",{value:!0}),bo.default=r;const t=e(yz());function r(n,i){let a=null;if(!n||typeof n!="string")return a;const s=(0,t.default)(n),o=typeof i=="function";return s.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:f}=u;o?i(d,f,u):f&&(a=a||{},a[d]=f)}),a}return bo}var Eu={},y_;function vz(){if(y_)return Eu;y_=1,Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(d){return!d||r.test(d)||e.test(d)},s=function(d,f){return f.toUpperCase()},o=function(d,f){return"".concat(f,"-")},u=function(d,f){return f===void 0&&(f={}),a(d)?d:(d=d.toLowerCase(),f.reactCompat?d=d.replace(i,o):d=d.replace(n,o),d.replace(t,s))};return Eu.camelCase=u,Eu}var Nu,b_;function wz(){if(b_)return Nu;b_=1;var e=Nu&&Nu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(bz()),r=vz();function n(i,a){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(o,u){o&&u&&(s[(0,r.camelCase)(o,a)]=u)}),s}return n.default=n,Nu=n,Nu}var kz=wz();const Sz=gc(kz),dN=hN("end"),gv=hN("start");function hN(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Cz(e){const t=gv(e),r=dN(e);if(t&&r)return{start:t,end:r}}function ad(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?v_(e.position):"start"in e||"end"in e?v_(e):"line"in e||"column"in e?Cb(e):""}function Cb(e){return w_(e&&e.line)+":"+w_(e&&e.column)}function v_(e){return Cb(e&&e.start)+"-"+Cb(e&&e.end)}function w_(e){return e&&typeof e=="number"?e:1}class fn extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",a={},s=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof t=="string"?i=t:!a.cause&&t&&(s=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof n=="string"){const u=n.indexOf(":");u===-1?a.ruleId=n:(a.source=n.slice(0,u),a.ruleId=n.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=ad(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fn.prototype.file="";fn.prototype.name="";fn.prototype.reason="";fn.prototype.message="";fn.prototype.stack="";fn.prototype.column=void 0;fn.prototype.line=void 0;fn.prototype.ancestors=void 0;fn.prototype.cause=void 0;fn.prototype.fatal=void 0;fn.prototype.place=void 0;fn.prototype.ruleId=void 0;fn.prototype.source=void 0;const mv={}.hasOwnProperty,_z=new Map,Tz=/[A-Z]/g,Ez=new Set(["table","tbody","thead","tfoot","tr"]),Nz=new Set(["td","th"]),fN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function jz(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=$z(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Bz(r,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?pv:mz,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=pN(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function pN(e,t,r){if(t.type==="element")return Az(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Mz(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Dz(e,t,r);if(t.type==="mdxjsEsm")return Lz(e,t);if(t.type==="root")return Rz(e,t,r);if(t.type==="text")return Oz(e,t)}function Az(e,t,r){const n=e.schema;let i=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=pv,e.schema=i),e.ancestors.push(t);const a=mN(e,t.tagName,!1),s=zz(e,t);let o=yv(e,t);return Ez.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!sz(u):!0})),gN(e,s,a,t),xv(s,o),e.ancestors.pop(),e.schema=n,e.create(t,a,s,r)}function Mz(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Nd(e,t.position)}function Lz(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Nd(e,t.position)}function Dz(e,t,r){const n=e.schema;let i=n;t.name==="svg"&&n.space==="html"&&(i=pv,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:mN(e,t.name,!0),s=Iz(e,t),o=yv(e,t);return gN(e,s,a,t),xv(s,o),e.ancestors.pop(),e.schema=n,e.create(t,a,s,r)}function Rz(e,t,r){const n={};return xv(n,yv(e,t)),e.create(t,e.Fragment,n,r)}function Oz(e,t){return t.value}function gN(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function xv(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function Bz(e,t,r){return n;function n(i,a,s,o){const d=Array.isArray(s.children)?r:t;return o?d(a,s,o):d(a,s)}}function $z(e,t){return r;function r(n,i,a,s){const o=Array.isArray(a.children),u=gv(n);return t(i,a,s,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function zz(e,t){const r={};let n,i;for(i in t.properties)if(i!=="children"&&mv.call(t.properties,i)){const a=Fz(e,i,t.properties[i]);if(a){const[s,o]=a;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&Nz.has(t.tagName)?n=o:r[s]=o}}if(n){const a=r.style||(r.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function Iz(e,t){const r={};for(const n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const a=n.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(r,e.evaluater.evaluateExpression(o.argument))}else Nd(e,t.position);else{const i=n.name;let a;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const o=n.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else Nd(e,t.position);else a=n.value===null?!0:n.value;r[i]=a}return r}function yv(e,t){const r=[];let n=-1;const i=e.passKeys?new Map:_z;for(;++n<t.children.length;){const a=t.children[n];let s;if(e.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const d=i.get(u)||0;s=u+"-"+d,i.set(u,d+1)}}const o=pN(e,a,s);o!==void 0&&r.push(o)}return r}function Fz(e,t,r){const n=fz(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?tz(r):xz(r)),n.property==="style"){let i=typeof r=="object"?r:Pz(e,String(r));return e.stylePropertyNameCase==="css"&&(i=Hz(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&n.space?uz[n.property]||n.property:n.attribute,r]}}function Pz(e,t){try{return Sz(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const n=r,i=new fn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=fN+"#cannot-parse-style-attribute",i}}function mN(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const o=h_(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}n=s}else n=h_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){const i=n.value;return mv.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(n);Nd(e)}function Nd(e,t){const r=new fn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=fN+"#cannot-handle-mdx-estrees-without-createevaluater",r}function Hz(e){const t={};let r;for(r in e)mv.call(e,r)&&(t[qz(r)]=e[r]);return t}function qz(e){let t=e.replace(Tz,Uz);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Uz(e){return"-"+e.toLowerCase()}const oy={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Vz={};function bv(e,t){const r=Vz,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return xN(e,n,i)}function xN(e,t,r){if(Wz(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return k_(e.children,t,r)}return Array.isArray(e)?k_(e,t,r):""}function k_(e,t,r){const n=[];let i=-1;for(;++i<e.length;)n[i]=xN(e[i],t,r);return n.join("")}function Wz(e){return!!(e&&typeof e=="object")}const S_=document.createElement("i");function vv(e){const t="&"+e+";";S_.innerHTML=t;const r=S_.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function ei(e,t,r,n){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(t,r),e.splice(...s);else for(r&&e.splice(t,r);a<n.length;)s=n.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function gi(e,t){return e.length>0?(ei(e,e.length,0,t),e):t}const C_={}.hasOwnProperty;function yN(e){const t={};let r=-1;for(;++r<e.length;)Yz(t,e[r]);return t}function Yz(e,t){let r;for(r in t){const i=(C_.call(e,r)?e[r]:void 0)||(e[r]={}),a=t[r];let s;if(a)for(s in a){C_.call(i,s)||(i[s]=[]);const o=a[s];Gz(i[s],Array.isArray(o)?o:o?[o]:[])}}}function Gz(e,t){let r=-1;const n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);ei(e,0,0,n)}function bN(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Li(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bn=_s(/[A-Za-z]/),on=_s(/[\dA-Za-z]/),Xz=_s(/[#-'*+\--9=?A-Z^-~]/);function V0(e){return e!==null&&(e<32||e===127)}const _b=_s(/\d/),Qz=_s(/[\dA-Fa-f]/),Zz=_s(/[!-/:-@[-`{-~]/);function Ge(e){return e!==null&&e<-2}function Vt(e){return e!==null&&(e<0||e===32)}function gt(e){return e===-2||e===-1||e===32}const Yp=_s(new RegExp("\\p{P}|\\p{S}","u")),gl=_s(/\s/);function _s(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function _c(e){const t=[];let r=-1,n=0,i=0;for(;++r<e.length;){const a=e.charCodeAt(r);let s="";if(a===37&&on(e.charCodeAt(r+1))&&on(e.charCodeAt(r+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=e.charCodeAt(r+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(n,r),encodeURIComponent(s)),n=r+i+1,s=""),i&&(r+=i,i=0)}return t.join("")+e.slice(n)}function Ct(e,t,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(u){return gt(u)?(e.enter(r),o(u)):t(u)}function o(u){return gt(u)&&a++<i?(e.consume(u),o):(e.exit(r),t(u))}}const Kz={tokenize:Jz};function Jz(e){const t=e.attempt(this.parser.constructs.contentInitial,n,i);let r;return t;function n(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ct(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),a(o)}function a(o){const u=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Ge(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),s)}}const eI={tokenize:tI},__={tokenize:rI};function tI(e){const t=this,r=[];let n=0,i,a,s;return o;function o(T){if(n<r.length){const j=r[n];return t.containerState=j[1],e.attempt(j[0].continuation,u,d)(T)}return d(T)}function u(T){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&C();const j=t.events.length;let L=j,E;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){E=t.events[L][1].end;break}w(n);let M=j;for(;M<t.events.length;)t.events[M][1].end={...E},M++;return ei(t.events,L+1,0,t.events.slice(j)),t.events.length=M,d(T)}return o(T)}function d(T){if(n===r.length){if(!i)return m(T);if(i.currentConstruct&&i.currentConstruct.concrete)return b(T);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(__,f,p)(T)}function f(T){return i&&C(),w(n),m(T)}function p(T){return t.parser.lazy[t.now().line]=n!==r.length,s=t.now().offset,b(T)}function m(T){return t.containerState={},e.attempt(__,x,b)(T)}function x(T){return n++,r.push([t.currentConstruct,t.containerState]),m(T)}function b(T){if(T===null){i&&C(),w(0),e.consume(T);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),v(T)}function v(T){if(T===null){k(e.exit("chunkFlow"),!0),w(0),e.consume(T);return}return Ge(T)?(e.consume(T),k(e.exit("chunkFlow")),n=0,t.interrupt=void 0,o):(e.consume(T),v)}function k(T,j){const L=t.sliceStream(T);if(j&&L.push(null),T.previous=a,a&&(a.next=T),a=T,i.defineSkip(T.start),i.write(L),t.parser.lazy[T.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<s&&(!i.events[E][1].end||i.events[E][1].end.offset>s))return;const M=t.events.length;let I=M,P,z;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(P){z=t.events[I][1].end;break}P=!0}for(w(n),E=M;E<t.events.length;)t.events[E][1].end={...z},E++;ei(t.events,I+1,0,t.events.slice(M)),t.events.length=E}}function w(T){let j=r.length;for(;j-- >T;){const L=r[j];t.containerState=L[1],L[0].exit.call(t,e)}r.length=T}function C(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function rI(e,t,r){return Ct(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Zo(e){if(e===null||Vt(e)||gl(e))return 1;if(Yp(e))return 2}function Gp(e,t,r){const n=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!n.includes(a)&&(t=a(t,r),n.push(a))}return t}const Tb={name:"attention",resolveAll:nI,tokenize:iI};function nI(e,t){let r=-1,n,i,a,s,o,u,d,f;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;u=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const p={...e[n][1].end},m={...e[r][1].start};T_(p,-u),T_(m,u),s={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[n][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:m},a={type:u>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},e[n][1].end={...s.start},e[r][1].start={...o.end},d=[],e[n][1].end.offset-e[n][1].start.offset&&(d=gi(d,[["enter",e[n][1],t],["exit",e[n][1],t]])),d=gi(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),d=gi(d,Gp(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),d=gi(d,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[r][1].end.offset-e[r][1].start.offset?(f=2,d=gi(d,[["enter",e[r][1],t],["exit",e[r][1],t]])):f=0,ei(e,n-1,r-n+3,d),r=n+d.length-f-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function iI(e,t){const r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=Zo(n);let a;return s;function s(u){return a=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===a)return e.consume(u),o;const d=e.exit("attentionSequence"),f=Zo(u),p=!f||f===2&&i||r.includes(u),m=!i||i===2&&f||r.includes(n);return d._open=!!(a===42?p:p&&(i||!m)),d._close=!!(a===42?m:m&&(f||!p)),t(u)}}function T_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const aI={name:"autolink",tokenize:sI};function sI(e,t,r){let n=0;return i;function i(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(x){return bn(x)?(e.consume(x),s):x===64?r(x):d(x)}function s(x){return x===43||x===45||x===46||on(x)?(n=1,o(x)):d(x)}function o(x){return x===58?(e.consume(x),n=0,u):(x===43||x===45||x===46||on(x))&&n++<32?(e.consume(x),o):(n=0,d(x))}function u(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||V0(x)?r(x):(e.consume(x),u)}function d(x){return x===64?(e.consume(x),f):Xz(x)?(e.consume(x),d):r(x)}function f(x){return on(x)?p(x):r(x)}function p(x){return x===46?(e.consume(x),n=0,f):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):m(x)}function m(x){if((x===45||on(x))&&n++<63){const b=x===45?m:p;return e.consume(x),b}return r(x)}}const ih={partial:!0,tokenize:lI};function lI(e,t,r){return n;function n(a){return gt(a)?Ct(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ge(a)?t(a):r(a)}}const vN={continuation:{tokenize:cI},exit:uI,name:"blockQuote",tokenize:oI};function oI(e,t,r){const n=this;return i;function i(s){if(s===62){const o=n.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return r(s)}function a(s){return gt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function cI(e,t,r){const n=this;return i;function i(s){return gt(s)?Ct(e,a,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(vN,t,r)(s)}}function uI(e){e.exit("blockQuote")}const wN={name:"characterEscape",tokenize:dI};function dI(e,t,r){return n;function n(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Zz(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(a)}}const kN={name:"characterReference",tokenize:hI};function hI(e,t,r){const n=this;let i=0,a,s;return o;function o(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),u}function u(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),a=31,s=on,f(p))}function d(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=Qz,f):(e.enter("characterReferenceValue"),a=7,s=_b,f(p))}function f(p){if(p===59&&i){const m=e.exit("characterReferenceValue");return s===on&&!vv(n.sliceSerialize(m))?r(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(p)&&i++<a?(e.consume(p),f):r(p)}}const E_={partial:!0,tokenize:pI},N_={concrete:!0,name:"codeFenced",tokenize:fI};function fI(e,t,r){const n=this,i={partial:!0,tokenize:L};let a=0,s=0,o;return u;function u(E){return d(E)}function d(E){const M=n.events[n.events.length-1];return a=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,o=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(E)}function f(E){return E===o?(s++,e.consume(E),f):s<3?r(E):(e.exit("codeFencedFenceSequence"),gt(E)?Ct(e,p,"whitespace")(E):p(E))}function p(E){return E===null||Ge(E)?(e.exit("codeFencedFence"),n.interrupt?t(E):e.check(E_,v,j)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||Ge(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(E)):gt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ct(e,x,"whitespace")(E)):E===96&&E===o?r(E):(e.consume(E),m)}function x(E){return E===null||Ge(E)?p(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===null||Ge(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(E)):E===96&&E===o?r(E):(e.consume(E),b)}function v(E){return e.attempt(i,j,k)(E)}function k(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),w}function w(E){return a>0&&gt(E)?Ct(e,C,"linePrefix",a+1)(E):C(E)}function C(E){return E===null||Ge(E)?e.check(E_,v,j)(E):(e.enter("codeFlowValue"),T(E))}function T(E){return E===null||Ge(E)?(e.exit("codeFlowValue"),C(E)):(e.consume(E),T)}function j(E){return e.exit("codeFenced"),t(E)}function L(E,M,I){let P=0;return z;function z(U){return E.enter("lineEnding"),E.consume(U),E.exit("lineEnding"),$}function $(U){return E.enter("codeFencedFence"),gt(U)?Ct(E,W,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):W(U)}function W(U){return U===o?(E.enter("codeFencedFenceSequence"),Y(U)):I(U)}function Y(U){return U===o?(P++,E.consume(U),Y):P>=s?(E.exit("codeFencedFenceSequence"),gt(U)?Ct(E,B,"whitespace")(U):B(U)):I(U)}function B(U){return U===null||Ge(U)?(E.exit("codeFencedFence"),M(U)):I(U)}}}function pI(e,t,r){const n=this;return i;function i(s){return s===null?r(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return n.parser.lazy[n.now().line]?r(s):t(s)}}const cy={name:"codeIndented",tokenize:mI},gI={partial:!0,tokenize:xI};function mI(e,t,r){const n=this;return i;function i(d){return e.enter("codeIndented"),Ct(e,a,"linePrefix",5)(d)}function a(d){const f=n.events[n.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(d):r(d)}function s(d){return d===null?u(d):Ge(d)?e.attempt(gI,s,u)(d):(e.enter("codeFlowValue"),o(d))}function o(d){return d===null||Ge(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),o)}function u(d){return e.exit("codeIndented"),t(d)}}function xI(e,t,r){const n=this;return i;function i(s){return n.parser.lazy[n.now().line]?r(s):Ge(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Ct(e,a,"linePrefix",5)(s)}function a(s){const o=n.events[n.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):Ge(s)?i(s):r(s)}}const yI={name:"codeText",previous:vI,resolve:bI,tokenize:wI};function bI(e){let t=e.length-4,r=3,n,i;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)i===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(i=n):(n===t||e[n][1].type==="lineEnding")&&(e[i][1].type="codeTextData",n!==i+2&&(e[i][1].end=e[n-1][1].end,e.splice(i+2,n-i-2),t-=n-i-2,n=i+2),i=void 0);return e}function vI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wI(e,t,r){let n=0,i,a;return s;function s(p){return e.enter("codeText"),e.enter("codeTextSequence"),o(p)}function o(p){return p===96?(e.consume(p),n++,o):(e.exit("codeTextSequence"),u(p))}function u(p){return p===null?r(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),u):p===96?(a=e.enter("codeTextSequence"),i=0,f(p)):Ge(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||Ge(p)?(e.exit("codeTextData"),u(p)):(e.consume(p),d)}function f(p){return p===96?(e.consume(p),i++,f):i===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(a.type="codeTextData",d(p))}}class kI{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){const i=r||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&ju(this.left,n),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ju(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ju(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);ju(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ju(this.left,r.reverse())}}}function ju(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function SN(e){const t={};let r=-1,n,i,a,s,o,u,d;const f=new kI(e);for(;++r<f.length;){for(;r in t;)r=t[r];if(n=f.get(r),r&&n[1].type==="chunkFlow"&&f.get(r-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,SI(f,r)),r=t[r],d=!0);else if(n[1]._container){for(a=r,i=void 0;a--;)if(s=f.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(n[1].end={...f.get(i)[1].start},o=f.slice(i,r),o.unshift(n),f.splice(i,r-i+1,o))}}return ei(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!d}function SI(e,t){const r=e.get(t)[1],n=e.get(t)[2];let i=t-1;const a=[];let s=r._tokenizer;s||(s=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,u=[],d={};let f,p,m=-1,x=r,b=0,v=0;const k=[v];for(;x;){for(;e.get(++i)[1]!==x;);a.push(i),x._tokenizer||(f=n.sliceStream(x),x.next||f.push(null),p&&s.defineSkip(x.start),x._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),x._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),p=x,x=x.next}for(x=r;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(v=m+1,k.push(v),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(s.events=[],x?(x._tokenizer=void 0,x.previous=void 0):k.pop(),m=k.length;m--;){const w=o.slice(k[m],k[m+1]),C=a.pop();u.push([C,C+w.length-1]),e.splice(C,2,w)}for(u.reverse(),m=-1;++m<u.length;)d[b+u[m][0]]=b+u[m][1],b+=u[m][1]-u[m][0]-1;return d}const CI={resolve:TI,tokenize:EI},_I={partial:!0,tokenize:NI};function TI(e){return SN(e),e}function EI(e,t){let r;return n;function n(o){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):Ge(o)?e.check(_I,s,a)(o):(e.consume(o),i)}function a(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function NI(e,t,r){const n=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ct(e,a,"linePrefix")}function a(s){if(s===null||Ge(s))return r(s);const o=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(n.parser.constructs.flow,r,t)(s)}}function CN(e,t,r,n,i,a,s,o,u){const d=u||Number.POSITIVE_INFINITY;let f=0;return p;function p(w){return w===60?(e.enter(n),e.enter(i),e.enter(a),e.consume(w),e.exit(a),m):w===null||w===32||w===41||V0(w)?r(w):(e.enter(n),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),v(w))}function m(w){return w===62?(e.enter(a),e.consume(w),e.exit(a),e.exit(i),e.exit(n),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===62?(e.exit("chunkString"),e.exit(o),m(w)):w===null||w===60||Ge(w)?r(w):(e.consume(w),w===92?b:x)}function b(w){return w===60||w===62||w===92?(e.consume(w),x):x(w)}function v(w){return!f&&(w===null||w===41||Vt(w))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(n),t(w)):f<d&&w===40?(e.consume(w),f++,v):w===41?(e.consume(w),f--,v):w===null||w===32||w===40||V0(w)?r(w):(e.consume(w),w===92?k:v)}function k(w){return w===40||w===41||w===92?(e.consume(w),v):v(w)}}function _N(e,t,r,n,i,a){const s=this;let o=0,u;return d;function d(x){return e.enter(n),e.enter(i),e.consume(x),e.exit(i),e.enter(a),f}function f(x){return o>999||x===null||x===91||x===93&&!u||x===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?r(x):x===93?(e.exit(a),e.enter(i),e.consume(x),e.exit(i),e.exit(n),t):Ge(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null||x===91||x===93||Ge(x)||o++>999?(e.exit("chunkString"),f(x)):(e.consume(x),u||(u=!gt(x)),x===92?m:p)}function m(x){return x===91||x===92||x===93?(e.consume(x),o++,p):p(x)}}function TN(e,t,r,n,i,a){let s;return o;function o(m){return m===34||m===39||m===40?(e.enter(n),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,u):r(m)}function u(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(n),t):(e.enter(a),d(m))}function d(m){return m===s?(e.exit(a),u(s)):m===null?r(m):Ge(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Ct(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===s||m===null||Ge(m)?(e.exit("chunkString"),d(m)):(e.consume(m),m===92?p:f)}function p(m){return m===s||m===92?(e.consume(m),f):f(m)}}function sd(e,t){let r;return n;function n(i){return Ge(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r=!0,n):gt(i)?Ct(e,n,r?"linePrefix":"lineSuffix")(i):t(i)}}const jI={name:"definition",tokenize:MI},AI={partial:!0,tokenize:LI};function MI(e,t,r){const n=this;let i;return a;function a(x){return e.enter("definition"),s(x)}function s(x){return _N.call(n,e,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function o(x){return i=Li(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),u):r(x)}function u(x){return Vt(x)?sd(e,d)(x):d(x)}function d(x){return CN(e,f,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function f(x){return e.attempt(AI,p,p)(x)}function p(x){return gt(x)?Ct(e,m,"whitespace")(x):m(x)}function m(x){return x===null||Ge(x)?(e.exit("definition"),n.parser.defined.push(i),t(x)):r(x)}}function LI(e,t,r){return n;function n(o){return Vt(o)?sd(e,i)(o):r(o)}function i(o){return TN(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return gt(o)?Ct(e,s,"whitespace")(o):s(o)}function s(o){return o===null||Ge(o)?t(o):r(o)}}const DI={name:"hardBreakEscape",tokenize:RI};function RI(e,t,r){return n;function n(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ge(a)?(e.exit("hardBreakEscape"),t(a)):r(a)}}const OI={name:"headingAtx",resolve:BI,tokenize:$I};function BI(e,t){let r=e.length-2,n=3,i,a;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},a={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},ei(e,n,r-n+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function $I(e,t,r){let n=0;return i;function i(f){return e.enter("atxHeading"),a(f)}function a(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&n++<6?(e.consume(f),s):f===null||Vt(f)?(e.exit("atxHeadingSequence"),o(f)):r(f)}function o(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||Ge(f)?(e.exit("atxHeading"),t(f)):gt(f)?Ct(e,o,"whitespace")(f):(e.enter("atxHeadingText"),d(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),o(f))}function d(f){return f===null||f===35||Vt(f)?(e.exit("atxHeadingText"),o(f)):(e.consume(f),d)}}const zI=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],j_=["pre","script","style","textarea"],II={concrete:!0,name:"htmlFlow",resolveTo:HI,tokenize:qI},FI={partial:!0,tokenize:VI},PI={partial:!0,tokenize:UI};function HI(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function qI(e,t,r){const n=this;let i,a,s,o,u;return d;function d(q){return f(q)}function f(q){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(q),p}function p(q){return q===33?(e.consume(q),m):q===47?(e.consume(q),a=!0,v):q===63?(e.consume(q),i=3,n.interrupt?t:A):bn(q)?(e.consume(q),s=String.fromCharCode(q),k):r(q)}function m(q){return q===45?(e.consume(q),i=2,x):q===91?(e.consume(q),i=5,o=0,b):bn(q)?(e.consume(q),i=4,n.interrupt?t:A):r(q)}function x(q){return q===45?(e.consume(q),n.interrupt?t:A):r(q)}function b(q){const Z="CDATA[";return q===Z.charCodeAt(o++)?(e.consume(q),o===Z.length?n.interrupt?t:W:b):r(q)}function v(q){return bn(q)?(e.consume(q),s=String.fromCharCode(q),k):r(q)}function k(q){if(q===null||q===47||q===62||Vt(q)){const Z=q===47,re=s.toLowerCase();return!Z&&!a&&j_.includes(re)?(i=1,n.interrupt?t(q):W(q)):zI.includes(s.toLowerCase())?(i=6,Z?(e.consume(q),w):n.interrupt?t(q):W(q)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(q):a?C(q):T(q))}return q===45||on(q)?(e.consume(q),s+=String.fromCharCode(q),k):r(q)}function w(q){return q===62?(e.consume(q),n.interrupt?t:W):r(q)}function C(q){return gt(q)?(e.consume(q),C):z(q)}function T(q){return q===47?(e.consume(q),z):q===58||q===95||bn(q)?(e.consume(q),j):gt(q)?(e.consume(q),T):z(q)}function j(q){return q===45||q===46||q===58||q===95||on(q)?(e.consume(q),j):L(q)}function L(q){return q===61?(e.consume(q),E):gt(q)?(e.consume(q),L):T(q)}function E(q){return q===null||q===60||q===61||q===62||q===96?r(q):q===34||q===39?(e.consume(q),u=q,M):gt(q)?(e.consume(q),E):I(q)}function M(q){return q===u?(e.consume(q),u=null,P):q===null||Ge(q)?r(q):(e.consume(q),M)}function I(q){return q===null||q===34||q===39||q===47||q===60||q===61||q===62||q===96||Vt(q)?L(q):(e.consume(q),I)}function P(q){return q===47||q===62||gt(q)?T(q):r(q)}function z(q){return q===62?(e.consume(q),$):r(q)}function $(q){return q===null||Ge(q)?W(q):gt(q)?(e.consume(q),$):r(q)}function W(q){return q===45&&i===2?(e.consume(q),R):q===60&&i===1?(e.consume(q),H):q===62&&i===4?(e.consume(q),D):q===63&&i===3?(e.consume(q),A):q===93&&i===5?(e.consume(q),Q):Ge(q)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(FI,G,Y)(q)):q===null||Ge(q)?(e.exit("htmlFlowData"),Y(q)):(e.consume(q),W)}function Y(q){return e.check(PI,B,G)(q)}function B(q){return e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),U}function U(q){return q===null||Ge(q)?Y(q):(e.enter("htmlFlowData"),W(q))}function R(q){return q===45?(e.consume(q),A):W(q)}function H(q){return q===47?(e.consume(q),s="",V):W(q)}function V(q){if(q===62){const Z=s.toLowerCase();return j_.includes(Z)?(e.consume(q),D):W(q)}return bn(q)&&s.length<8?(e.consume(q),s+=String.fromCharCode(q),V):W(q)}function Q(q){return q===93?(e.consume(q),A):W(q)}function A(q){return q===62?(e.consume(q),D):q===45&&i===2?(e.consume(q),A):W(q)}function D(q){return q===null||Ge(q)?(e.exit("htmlFlowData"),G(q)):(e.consume(q),D)}function G(q){return e.exit("htmlFlow"),t(q)}}function UI(e,t,r){const n=this;return i;function i(s){return Ge(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):r(s)}function a(s){return n.parser.lazy[n.now().line]?r(s):t(s)}}function VI(e,t,r){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ih,t,r)}}const WI={name:"htmlText",tokenize:YI};function YI(e,t,r){const n=this;let i,a,s;return o;function o(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),u}function u(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),L):A===63?(e.consume(A),T):bn(A)?(e.consume(A),I):r(A)}function d(A){return A===45?(e.consume(A),f):A===91?(e.consume(A),a=0,b):bn(A)?(e.consume(A),C):r(A)}function f(A){return A===45?(e.consume(A),x):r(A)}function p(A){return A===null?r(A):A===45?(e.consume(A),m):Ge(A)?(s=p,H(A)):(e.consume(A),p)}function m(A){return A===45?(e.consume(A),x):p(A)}function x(A){return A===62?R(A):A===45?m(A):p(A)}function b(A){const D="CDATA[";return A===D.charCodeAt(a++)?(e.consume(A),a===D.length?v:b):r(A)}function v(A){return A===null?r(A):A===93?(e.consume(A),k):Ge(A)?(s=v,H(A)):(e.consume(A),v)}function k(A){return A===93?(e.consume(A),w):v(A)}function w(A){return A===62?R(A):A===93?(e.consume(A),w):v(A)}function C(A){return A===null||A===62?R(A):Ge(A)?(s=C,H(A)):(e.consume(A),C)}function T(A){return A===null?r(A):A===63?(e.consume(A),j):Ge(A)?(s=T,H(A)):(e.consume(A),T)}function j(A){return A===62?R(A):T(A)}function L(A){return bn(A)?(e.consume(A),E):r(A)}function E(A){return A===45||on(A)?(e.consume(A),E):M(A)}function M(A){return Ge(A)?(s=M,H(A)):gt(A)?(e.consume(A),M):R(A)}function I(A){return A===45||on(A)?(e.consume(A),I):A===47||A===62||Vt(A)?P(A):r(A)}function P(A){return A===47?(e.consume(A),R):A===58||A===95||bn(A)?(e.consume(A),z):Ge(A)?(s=P,H(A)):gt(A)?(e.consume(A),P):R(A)}function z(A){return A===45||A===46||A===58||A===95||on(A)?(e.consume(A),z):$(A)}function $(A){return A===61?(e.consume(A),W):Ge(A)?(s=$,H(A)):gt(A)?(e.consume(A),$):P(A)}function W(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),i=A,Y):Ge(A)?(s=W,H(A)):gt(A)?(e.consume(A),W):(e.consume(A),B)}function Y(A){return A===i?(e.consume(A),i=void 0,U):A===null?r(A):Ge(A)?(s=Y,H(A)):(e.consume(A),Y)}function B(A){return A===null||A===34||A===39||A===60||A===61||A===96?r(A):A===47||A===62||Vt(A)?P(A):(e.consume(A),B)}function U(A){return A===47||A===62||Vt(A)?P(A):r(A)}function R(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):r(A)}function H(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),V}function V(A){return gt(A)?Ct(e,Q,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):Q(A)}function Q(A){return e.enter("htmlTextData"),s(A)}}const wv={name:"labelEnd",resolveAll:ZI,resolveTo:KI,tokenize:JI},GI={tokenize:eF},XI={tokenize:tF},QI={tokenize:rF};function ZI(e){let t=-1;const r=[];for(;++t<e.length;){const n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const i=n.type==="labelImage"?4:2;n.type="data",t+=i}}return e.length!==r.length&&ei(e,0,e.length,r),e}function KI(e,t){let r=e.length,n=0,i,a,s,o;for(;r--;)if(i=e[r][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[r][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[r][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=r,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(s=r);const u={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[a][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[a+n+2][1].end},end:{...e[s-2][1].start}};return o=[["enter",u,t],["enter",d,t]],o=gi(o,e.slice(a+1,a+n+3)),o=gi(o,[["enter",f,t]]),o=gi(o,Gp(t.parser.constructs.insideSpan.null,e.slice(a+n+4,s-3),t)),o=gi(o,[["exit",f,t],e[s-2],e[s-1],["exit",d,t]]),o=gi(o,e.slice(s+1)),o=gi(o,[["exit",u,t]]),ei(e,a,e.length,o),e}function JI(e,t,r){const n=this;let i=n.events.length,a,s;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){a=n.events[i][1];break}return o;function o(m){return a?a._inactive?p(m):(s=n.parser.defined.includes(Li(n.sliceSerialize({start:a.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):r(m)}function u(m){return m===40?e.attempt(GI,f,s?f:p)(m):m===91?e.attempt(XI,f,s?d:p)(m):s?f(m):p(m)}function d(m){return e.attempt(QI,f,p)(m)}function f(m){return t(m)}function p(m){return a._balanced=!0,r(m)}}function eF(e,t,r){return n;function n(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return Vt(p)?sd(e,a)(p):a(p)}function a(p){return p===41?f(p):CN(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function s(p){return Vt(p)?sd(e,u)(p):f(p)}function o(p){return r(p)}function u(p){return p===34||p===39||p===40?TN(e,d,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):f(p)}function d(p){return Vt(p)?sd(e,f)(p):f(p)}function f(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):r(p)}}function tF(e,t,r){const n=this;return i;function i(o){return _N.call(n,e,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return n.parser.defined.includes(Li(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(o):r(o)}function s(o){return r(o)}}function rF(e,t,r){return n;function n(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):r(a)}}const nF={name:"labelStartImage",resolveAll:wv.resolveAll,tokenize:iF};function iF(e,t,r){const n=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),a}function a(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):r(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(o):t(o)}}const aF={name:"labelStartLink",resolveAll:wv.resolveAll,tokenize:sF};function sF(e,t,r){const n=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):t(s)}}const uy={name:"lineEnding",tokenize:lF};function lF(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Ct(e,t,"linePrefix")}}const d0={name:"thematicBreak",tokenize:oF};function oF(e,t,r){let n=0,i;return a;function a(d){return e.enter("thematicBreak"),s(d)}function s(d){return i=d,o(d)}function o(d){return d===i?(e.enter("thematicBreakSequence"),u(d)):n>=3&&(d===null||Ge(d))?(e.exit("thematicBreak"),t(d)):r(d)}function u(d){return d===i?(e.consume(d),n++,u):(e.exit("thematicBreakSequence"),gt(d)?Ct(e,o,"whitespace")(d):o(d))}}const On={continuation:{tokenize:hF},exit:pF,name:"list",tokenize:dF},cF={partial:!0,tokenize:gF},uF={partial:!0,tokenize:fF};function dF(e,t,r){const n=this,i=n.events[n.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return o;function o(x){const b=n.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!n.containerState.marker||x===n.containerState.marker:_b(x)){if(n.containerState.type||(n.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(d0,r,d)(x):d(x);if(!n.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(x)}return r(x)}function u(x){return _b(x)&&++s<10?(e.consume(x),u):(!n.interrupt||s<2)&&(n.containerState.marker?x===n.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),d(x)):r(x)}function d(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||x,e.check(ih,n.interrupt?r:f,e.attempt(cF,m,p))}function f(x){return n.containerState.initialBlankLine=!0,a++,m(x)}function p(x){return gt(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),m):r(x)}function m(x){return n.containerState.size=a+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function hF(e,t,r){const n=this;return n.containerState._closeFlow=void 0,e.check(ih,i,a);function i(o){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Ct(e,t,"listItemIndent",n.containerState.size+1)(o)}function a(o){return n.containerState.furtherBlankLines||!gt(o)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(o)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(uF,t,s)(o))}function s(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,Ct(e,e.attempt(On,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function fF(e,t,r){const n=this;return Ct(e,i,"listItemIndent",n.containerState.size+1);function i(a){const s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?t(a):r(a)}}function pF(e){e.exit(this.containerState.type)}function gF(e,t,r){const n=this;return Ct(e,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=n.events[n.events.length-1];return!gt(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):r(a)}}const A_={name:"setextUnderline",resolveTo:mF,tokenize:xF};function mF(e,t){let r=e.length,n,i,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(i=r)}else e[r][1].type==="content"&&e.splice(r,1),!a&&e[r][1].type==="definition"&&(a=r);const s={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",s,t]),e.splice(a+1,0,["exit",e[n][1],t]),e[n][1].end={...e[a][1].end}):e[n][1]=s,e.push(["exit",s,t]),e}function xF(e,t,r){const n=this;let i;return a;function a(d){let f=n.events.length,p;for(;f--;)if(n.events[f][1].type!=="lineEnding"&&n.events[f][1].type!=="linePrefix"&&n.events[f][1].type!=="content"){p=n.events[f][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||p)?(e.enter("setextHeadingLine"),i=d,s(d)):r(d)}function s(d){return e.enter("setextHeadingLineSequence"),o(d)}function o(d){return d===i?(e.consume(d),o):(e.exit("setextHeadingLineSequence"),gt(d)?Ct(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||Ge(d)?(e.exit("setextHeadingLine"),t(d)):r(d)}}const yF={tokenize:bF};function bF(e){const t=this,r=e.attempt(ih,n,e.attempt(this.parser.constructs.flowInitial,i,Ct(e,e.attempt(this.parser.constructs.flow,i,e.attempt(CI,i)),"linePrefix")));return r;function n(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const vF={resolveAll:NN()},wF=EN("string"),kF=EN("text");function EN(e){return{resolveAll:NN(e==="text"?SF:void 0),tokenize:t};function t(r){const n=this,i=this.parser.constructs[e],a=r.attempt(i,s,o);return s;function s(f){return d(f)?a(f):o(f)}function o(f){if(f===null){r.consume(f);return}return r.enter("data"),r.consume(f),u}function u(f){return d(f)?(r.exit("data"),a(f)):(r.consume(f),u)}function d(f){if(f===null)return!0;const p=i[f];let m=-1;if(p)for(;++m<p.length;){const x=p[m];if(!x.previous||x.previous.call(n,n.previous))return!0}return!1}}}function NN(e){return t;function t(r,n){let i=-1,a;for(;++i<=r.length;)a===void 0?r[i]&&r[i][1].type==="data"&&(a=i,i++):(!r[i]||r[i][1].type!=="data")&&(i!==a+2&&(r[a][1].end=r[i-1][1].end,r.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(r,n):r}}function SF(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const n=e[r-1][1],i=t.sliceStream(n);let a=i.length,s=-1,o=0,u;for(;a--;){const d=i[a];if(typeof d=="string"){for(s=d.length;d.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(d===-2)u=!0,o++;else if(d!==-1){a++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(o=0),o){const d={type:r===e.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:n.start._bufferIndex+s,_index:n.start._index+a,line:n.end.line,column:n.end.column-o,offset:n.end.offset-o},end:{...n.end}};n.end={...d.start},n.start.offset===n.end.offset?Object.assign(n,d):(e.splice(r,0,["enter",d,t],["exit",d,t]),r+=2)}r++}return e}const CF={42:On,43:On,45:On,48:On,49:On,50:On,51:On,52:On,53:On,54:On,55:On,56:On,57:On,62:vN},_F={91:jI},TF={[-2]:cy,[-1]:cy,32:cy},EF={35:OI,42:d0,45:[A_,d0],60:II,61:A_,95:d0,96:N_,126:N_},NF={38:kN,92:wN},jF={[-5]:uy,[-4]:uy,[-3]:uy,33:nF,38:kN,42:Tb,60:[aI,WI],91:aF,92:[DI,wN],93:wv,95:Tb,96:yI},AF={null:[Tb,vF]},MF={null:[42,95]},LF={null:[]},DF=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:MF,contentInitial:_F,disable:LF,document:CF,flow:EF,flowInitial:TF,insideSpan:AF,string:NF,text:jF},Symbol.toStringTag,{value:"Module"}));function RF(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const i={},a=[];let s=[],o=[];const u={attempt:M(L),check:M(E),consume:C,enter:T,exit:j,interrupt:M(E,{interrupt:!0})},d={code:null,containerState:{},defineSkip:v,events:[],now:b,parser:e,previous:null,sliceSerialize:m,sliceStream:x,write:p};let f=t.tokenize.call(d,u);return t.resolveAll&&a.push(t),d;function p($){return s=gi(s,$),k(),s[s.length-1]!==null?[]:(I(t,0),d.events=Gp(a,d.events,d),d.events)}function m($,W){return BF(x($),W)}function x($){return OF(s,$)}function b(){const{_bufferIndex:$,_index:W,line:Y,column:B,offset:U}=n;return{_bufferIndex:$,_index:W,line:Y,column:B,offset:U}}function v($){i[$.line]=$.column,z()}function k(){let $;for(;n._index<s.length;){const W=s[n._index];if(typeof W=="string")for($=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===$&&n._bufferIndex<W.length;)w(W.charCodeAt(n._bufferIndex));else w(W)}}function w($){f=f($)}function C($){Ge($)?(n.line++,n.column=1,n.offset+=$===-3?2:1,z()):$!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),d.previous=$}function T($,W){const Y=W||{};return Y.type=$,Y.start=b(),d.events.push(["enter",Y,d]),o.push(Y),Y}function j($){const W=o.pop();return W.end=b(),d.events.push(["exit",W,d]),W}function L($,W){I($,W.from)}function E($,W){W.restore()}function M($,W){return Y;function Y(B,U,R){let H,V,Q,A;return Array.isArray(B)?G(B):"tokenize"in B?G([B]):D(B);function D(J){return ie;function ie(ne){const oe=ne!==null&&J[ne],fe=ne!==null&&J.null,xe=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(fe)?fe:fe?[fe]:[]];return G(xe)(ne)}}function G(J){return H=J,V=0,J.length===0?R:q(J[V])}function q(J){return ie;function ie(ne){return A=P(),Q=J,J.partial||(d.currentConstruct=J),J.name&&d.parser.constructs.disable.null.includes(J.name)?re():J.tokenize.call(W?Object.assign(Object.create(d),W):d,u,Z,re)(ne)}}function Z(J){return $(Q,A),U}function re(J){return A.restore(),++V<H.length?q(H[V]):R}}}function I($,W){$.resolveAll&&!a.includes($)&&a.push($),$.resolve&&ei(d.events,W,d.events.length-W,$.resolve(d.events.slice(W),d)),$.resolveTo&&(d.events=$.resolveTo(d.events,d))}function P(){const $=b(),W=d.previous,Y=d.currentConstruct,B=d.events.length,U=Array.from(o);return{from:B,restore:R};function R(){n=$,d.previous=W,d.currentConstruct=Y,d.events.length=B,o=U,z()}}function z(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function OF(e,t){const r=t.start._index,n=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(r===i)s=[e[r].slice(n,a)];else{if(s=e.slice(r,i),n>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(n):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function BF(e,t){let r=-1;const n=[];let i;for(;++r<e.length;){const a=e[r];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
116
- `;break}case-3:{s=`\r
117
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,n.push(s)}return n.join("")}function $F(e){const n={constructs:yN([DF,...(e||{}).extensions||[]]),content:i(Kz),defined:[],document:i(eI),flow:i(yF),lazy:{},string:i(wF),text:i(kF)};return n;function i(a){return s;function s(o){return RF(n,a,o)}}}function zF(e){for(;!SN(e););return e}const M_=/[\0\t\n\r]/g;function IF(){let e=1,t="",r=!0,n;return i;function i(a,s,o){const u=[];let d,f,p,m,x;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),p=0,t="",r&&(a.charCodeAt(0)===65279&&p++,r=void 0);p<a.length;){if(M_.lastIndex=p,d=M_.exec(a),m=d&&d.index!==void 0?d.index:a.length,x=a.charCodeAt(m),!d){t=a.slice(p);break}if(x===10&&p===m&&n)u.push(-3),n=void 0;else switch(n&&(u.push(-5),n=void 0),p<m&&(u.push(a.slice(p,m)),e+=m-p),x){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:n=!0,e=1}p=m+1}return o&&(n&&u.push(-5),t&&u.push(t),u.push(null)),u}}const FF=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function PF(e){return e.replace(FF,HF)}function HF(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const i=r.charCodeAt(1),a=i===120||i===88;return bN(r.slice(a?2:1),a?16:10)}return vv(r)||e}const jN={}.hasOwnProperty;function qF(e,t,r){return typeof t!="string"&&(r=t,t=void 0),UF(r)(zF($F(r).document().write(IF()(e,t,!0))))}function UF(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(tt),autolinkProtocol:P,autolinkEmail:P,atxHeading:a(Te),blockQuote:a(fe),characterEscape:P,characterReference:P,codeFenced:a(xe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(xe,s),codeText:a(de,s),codeTextData:P,data:P,codeFlowValue:P,definition:a(ge),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(ke),hardBreakEscape:a(Ne),hardBreakTrailing:a(Ne),htmlFlow:a(Ke,s),htmlFlowData:P,htmlText:a(Ke,s),htmlTextData:P,image:a(ut),label:s,link:a(tt),listItem:a(nt),listItemValue:m,listOrdered:a(rt,p),listUnordered:a(rt),paragraph:a(wt),reference:q,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Te),strong:a(xt),thematicBreak:a(je)},exit:{atxHeading:u(),atxHeadingSequence:L,autolink:u(),autolinkEmail:oe,autolinkProtocol:ne,blockQuote:u(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:J,characterReference:ie,codeFenced:u(k),codeFencedFence:v,codeFencedFenceInfo:x,codeFencedFenceMeta:b,codeFlowValue:z,codeIndented:u(w),codeText:u(U),codeTextData:z,data:z,definition:u(),definitionDestinationString:j,definitionLabelString:C,definitionTitleString:T,emphasis:u(),hardBreakEscape:u(W),hardBreakTrailing:u(W),htmlFlow:u(Y),htmlFlowData:z,htmlText:u(B),htmlTextData:z,image:u(H),label:Q,labelText:V,lineEnding:$,link:u(R),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Z,resourceDestinationString:A,resourceTitleString:D,resource:G,setextHeading:u(I),setextHeadingLineSequence:M,setextHeadingText:E,strong:u(),thematicBreak:u()}};AN(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(le){let be={type:"root",children:[]};const Le={stack:[be],tokenStack:[],config:t,enter:o,exit:d,buffer:s,resume:f,data:r},We=[];let at=-1;for(;++at<le.length;)if(le[at][1].type==="listOrdered"||le[at][1].type==="listUnordered")if(le[at][0]==="enter")We.push(at);else{const Et=We.pop();at=i(le,Et,at)}for(at=-1;++at<le.length;){const Et=t[le[at][0]];jN.call(Et,le[at][1].type)&&Et[le[at][1].type].call(Object.assign({sliceSerialize:le[at][2].sliceSerialize},Le),le[at][1])}if(Le.tokenStack.length>0){const Et=Le.tokenStack[Le.tokenStack.length-1];(Et[1]||L_).call(Le,void 0,Et[0])}for(be.position={start:os(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:os(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)be=t.transforms[at](be)||be;return be}function i(le,be,Le){let We=be-1,at=-1,Et=!1,Er,Wt,It,Lt;for(;++We<=Le;){const dt=le[We];switch(dt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{dt[0]==="enter"?at++:at--,Lt=void 0;break}case"lineEndingBlank":{dt[0]==="enter"&&(Er&&!Lt&&!at&&!It&&(It=We),Lt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Lt=void 0}if(!at&&dt[0]==="enter"&&dt[1].type==="listItemPrefix"||at===-1&&dt[0]==="exit"&&(dt[1].type==="listUnordered"||dt[1].type==="listOrdered")){if(Er){let Kr=We;for(Wt=void 0;Kr--;){const xr=le[Kr];if(xr[1].type==="lineEnding"||xr[1].type==="lineEndingBlank"){if(xr[0]==="exit")continue;Wt&&(le[Wt][1].type="lineEndingBlank",Et=!0),xr[1].type="lineEnding",Wt=Kr}else if(!(xr[1].type==="linePrefix"||xr[1].type==="blockQuotePrefix"||xr[1].type==="blockQuotePrefixWhitespace"||xr[1].type==="blockQuoteMarker"||xr[1].type==="listItemIndent"))break}It&&(!Wt||It<Wt)&&(Er._spread=!0),Er.end=Object.assign({},Wt?le[Wt][1].start:dt[1].end),le.splice(Wt||We,0,["exit",Er,dt[2]]),We++,Le++}if(dt[1].type==="listItemPrefix"){const Kr={type:"listItem",_spread:!1,start:Object.assign({},dt[1].start),end:void 0};Er=Kr,le.splice(We,0,["enter",Kr,dt[2]]),We++,Le++,It=void 0,Lt=!0}}}return le[be][1]._spread=Et,Le}function a(le,be){return Le;function Le(We){o.call(this,le(We),We),be&&be.call(this,We)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(le,be,Le){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([be,Le||void 0]),le.position={start:os(be.start),end:void 0}}function u(le){return be;function be(Le){le&&le.call(this,Le),d.call(this,Le)}}function d(le,be){const Le=this.stack.pop(),We=this.tokenStack.pop();if(We)We[0].type!==le.type&&(be?be.call(this,le,We[0]):(We[1]||L_).call(this,le,We[0]));else throw new Error("Cannot close `"+le.type+"` ("+ad({start:le.start,end:le.end})+"): it’s not open");Le.position.end=os(le.end)}function f(){return bv(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(le){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function x(){const le=this.resume(),be=this.stack[this.stack.length-1];be.lang=le}function b(){const le=this.resume(),be=this.stack[this.stack.length-1];be.meta=le}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const le=this.resume(),be=this.stack[this.stack.length-1];be.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const le=this.resume(),be=this.stack[this.stack.length-1];be.value=le.replace(/(\r?\n|\r)$/g,"")}function C(le){const be=this.resume(),Le=this.stack[this.stack.length-1];Le.label=be,Le.identifier=Li(this.sliceSerialize(le)).toLowerCase()}function T(){const le=this.resume(),be=this.stack[this.stack.length-1];be.title=le}function j(){const le=this.resume(),be=this.stack[this.stack.length-1];be.url=le}function L(le){const be=this.stack[this.stack.length-1];if(!be.depth){const Le=this.sliceSerialize(le).length;be.depth=Le}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function M(le){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function P(le){const Le=this.stack[this.stack.length-1].children;let We=Le[Le.length-1];(!We||We.type!=="text")&&(We=_e(),We.position={start:os(le.start),end:void 0},Le.push(We)),this.stack.push(We)}function z(le){const be=this.stack.pop();be.value+=this.sliceSerialize(le),be.position.end=os(le.end)}function $(le){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=be.children[be.children.length-1];Le.position.end=os(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type)&&(P.call(this,le),z.call(this,le))}function W(){this.data.atHardBreak=!0}function Y(){const le=this.resume(),be=this.stack[this.stack.length-1];be.value=le}function B(){const le=this.resume(),be=this.stack[this.stack.length-1];be.value=le}function U(){const le=this.resume(),be=this.stack[this.stack.length-1];be.value=le}function R(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=be,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function H(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=be,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function V(le){const be=this.sliceSerialize(le),Le=this.stack[this.stack.length-2];Le.label=PF(be),Le.identifier=Li(be).toLowerCase()}function Q(){const le=this.stack[this.stack.length-1],be=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const We=le.children;Le.children=We}else Le.alt=be}function A(){const le=this.resume(),be=this.stack[this.stack.length-1];be.url=le}function D(){const le=this.resume(),be=this.stack[this.stack.length-1];be.title=le}function G(){this.data.inReference=void 0}function q(){this.data.referenceType="collapsed"}function Z(le){const be=this.resume(),Le=this.stack[this.stack.length-1];Le.label=be,Le.identifier=Li(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function re(le){this.data.characterReferenceType=le.type}function J(le){const be=this.sliceSerialize(le),Le=this.data.characterReferenceType;let We;Le?(We=bN(be,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):We=vv(be);const at=this.stack[this.stack.length-1];at.value+=We}function ie(le){const be=this.stack.pop();be.position.end=os(le.end)}function ne(le){z.call(this,le);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(le)}function oe(le){z.call(this,le);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(le)}function fe(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function de(){return{type:"inlineCode",value:""}}function ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ke(){return{type:"emphasis",children:[]}}function Te(){return{type:"heading",depth:0,children:[]}}function Ne(){return{type:"break"}}function Ke(){return{type:"html",value:""}}function ut(){return{type:"image",title:null,url:"",alt:null}}function tt(){return{type:"link",title:null,url:"",children:[]}}function rt(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function nt(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function wt(){return{type:"paragraph",children:[]}}function xt(){return{type:"strong",children:[]}}function _e(){return{type:"text",value:""}}function je(){return{type:"thematicBreak"}}}function os(e){return{line:e.line,column:e.column,offset:e.offset}}function AN(e,t){let r=-1;for(;++r<t.length;){const n=t[r];Array.isArray(n)?AN(e,n):VF(e,n)}}function VF(e,t){let r;for(r in t)if(jN.call(t,r))switch(r){case"canContainEols":{const n=t[r];n&&e[r].push(...n);break}case"transforms":{const n=t[r];n&&e[r].push(...n);break}case"enter":case"exit":{const n=t[r];n&&Object.assign(e[r],n);break}}}function L_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ad({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ad({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ad({start:t.start,end:t.end})+") is still open")}function WF(e){const t=this;t.parser=r;function r(n){return qF(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function YF(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function GF(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
118
- `}]}function XF(e,t){const r=t.value?t.value+`
119
- `:"",n={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(n.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function QF(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ZF(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function KF(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),i=_c(n.toLowerCase()),a=e.footnoteOrder.indexOf(n);let s,o=e.footnoteCounts.get(n);o===void 0?(o=0,e.footnoteOrder.push(n),s=e.footnoteOrder.length):s=a+1,o+=1,e.footnoteCounts.set(n,o);const u={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,d),e.applyData(t,d)}function JF(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function eP(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function MN(e,t){const r=t.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=n:i.push({type:"text",value:n}),i}function tP(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return MN(e,t);const i={src:_c(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function rP(e,t){const r={src:_c(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)}function nP(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)}function iP(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return MN(e,t);const i={href:_c(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function aP(e,t){const r={href:_c(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sP(e,t,r){const n=e.all(t),i=r?lP(r):LN(t),a={},s=[];if(typeof t.checked=="boolean"){const f=n[0];let p;f&&f.type==="element"&&f.tagName==="p"?p=f:(p={type:"element",tagName:"p",properties:{},children:[]},n.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<n.length;){const f=n[o];(i||o!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
120
- `}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const u=n[n.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
121
- `});const d={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,d),e.applyData(t,d)}function lP(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let n=-1;for(;!t&&++n<r.length;)t=LN(r[n])}return t}function LN(e){const t=e.spread;return t??e.children.length>1}function oP(e,t){const r={},n=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++i<n.length;){const s=n[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(t,a),e.applyData(t,a)}function cP(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function uP(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function dP(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hP(e,t){const r=e.all(t),n=r.shift(),i=[];if(n){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],s),i.push(s)}if(r.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},o=gv(t.children[1]),u=dN(t.children[t.children.length-1]);o&&u&&(s.position={start:o,end:u}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function fP(e,t,r){const n=r?r.children:void 0,a=(n?n.indexOf(t):1)===0?"th":"td",s=r&&r.type==="table"?r.align:void 0,o=s?s.length:t.children.length;let u=-1;const d=[];for(;++u<o;){const p=t.children[u],m={},x=s?s[u]:void 0;x&&(m.align=x);let b={type:"element",tagName:a,properties:m,children:[]};p&&(b.children=e.all(p),e.patch(p,b),b=e.applyData(p,b)),d.push(b)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,f),e.applyData(t,f)}function pP(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const D_=9,R_=32;function gP(e){const t=String(e),r=/\r?\n|\r/g;let n=r.exec(t),i=0;const a=[];for(;n;)a.push(O_(t.slice(i,n.index),i>0,!0),n[0]),i=n.index+n[0].length,n=r.exec(t);return a.push(O_(t.slice(i),i>0,!1)),a.join("")}function O_(e,t,r){let n=0,i=e.length;if(t){let a=e.codePointAt(n);for(;a===D_||a===R_;)n++,a=e.codePointAt(n)}if(r){let a=e.codePointAt(i-1);for(;a===D_||a===R_;)i--,a=e.codePointAt(i-1)}return i>n?e.slice(n,i):""}function mP(e,t){const r={type:"text",value:gP(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function xP(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const yP={blockquote:YF,break:GF,code:XF,delete:QF,emphasis:ZF,footnoteReference:KF,heading:JF,html:eP,imageReference:tP,image:rP,inlineCode:nP,linkReference:iP,link:aP,listItem:sP,list:oP,paragraph:cP,root:uP,strong:dP,table:hP,tableCell:pP,tableRow:fP,text:mP,thematicBreak:xP,toml:$f,yaml:$f,definition:$f,footnoteDefinition:$f};function $f(){}const DN=-1,Xp=0,ld=1,W0=2,kv=3,Sv=4,Cv=5,_v=6,RN=7,ON=8,B_=typeof self=="object"?self:globalThis,bP=(e,t)=>{const r=(i,a)=>(e.set(a,i),i),n=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case Xp:case DN:return r(s,i);case ld:{const o=r([],i);for(const u of s)o.push(n(u));return o}case W0:{const o=r({},i);for(const[u,d]of s)o[n(u)]=n(d);return o}case kv:return r(new Date(s),i);case Sv:{const{source:o,flags:u}=s;return r(new RegExp(o,u),i)}case Cv:{const o=r(new Map,i);for(const[u,d]of s)o.set(n(u),n(d));return o}case _v:{const o=r(new Set,i);for(const u of s)o.add(n(u));return o}case RN:{const{name:o,message:u}=s;return r(new B_[o](u),i)}case ON:return r(BigInt(s),i);case"BigInt":return r(Object(BigInt(s)),i);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return r(new DataView(o),s)}}return r(new B_[a](s),i)};return n},$_=e=>bP(new Map,e)(0),vo="",{toString:vP}={},{keys:wP}=Object,Au=e=>{const t=typeof e;if(t!=="object"||!e)return[Xp,t];const r=vP.call(e).slice(8,-1);switch(r){case"Array":return[ld,vo];case"Object":return[W0,vo];case"Date":return[kv,vo];case"RegExp":return[Sv,vo];case"Map":return[Cv,vo];case"Set":return[_v,vo];case"DataView":return[ld,r]}return r.includes("Array")?[ld,r]:r.includes("Error")?[RN,r]:[W0,r]},zf=([e,t])=>e===Xp&&(t==="function"||t==="symbol"),kP=(e,t,r,n)=>{const i=(s,o)=>{const u=n.push(s)-1;return r.set(o,u),u},a=s=>{if(r.has(s))return r.get(s);let[o,u]=Au(s);switch(o){case Xp:{let f=s;switch(u){case"bigint":o=ON,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([DN],s)}return i([o,f],s)}case ld:{if(u){let m=s;return u==="DataView"?m=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(s)),i([u,[...m]],s)}const f=[],p=i([o,f],s);for(const m of s)f.push(a(m));return p}case W0:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const f=[],p=i([o,f],s);for(const m of wP(s))(e||!zf(Au(s[m])))&&f.push([a(m),a(s[m])]);return p}case kv:return i([o,s.toISOString()],s);case Sv:{const{source:f,flags:p}=s;return i([o,{source:f,flags:p}],s)}case Cv:{const f=[],p=i([o,f],s);for(const[m,x]of s)(e||!(zf(Au(m))||zf(Au(x))))&&f.push([a(m),a(x)]);return p}case _v:{const f=[],p=i([o,f],s);for(const m of s)(e||!zf(Au(m)))&&f.push(a(m));return p}}const{message:d}=s;return i([o,{name:u,message:d}],s)};return a},z_=(e,{json:t,lossy:r}={})=>{const n=[];return kP(!(t||r),!!t,new Map,n)(e),n},Y0=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?$_(z_(e,t)):structuredClone(e):(e,t)=>$_(z_(e,t));function SP(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function CP(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function _P(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||SP,n=e.options.footnoteBackLabel||CP,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[u]);if(!d)continue;const f=e.all(d),p=String(d.identifier).toUpperCase(),m=_c(p.toLowerCase());let x=0;const b=[],v=e.footnoteCounts.get(p);for(;v!==void 0&&++x<=v;){b.length>0&&b.push({type:"text",value:" "});let C=typeof r=="string"?r:r(u,x);typeof C=="string"&&(C={type:"text",value:C}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(u,x),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const k=f[f.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const C=k.children[k.children.length-1];C&&C.type==="text"?C.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...b)}else f.push(...b);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(f,!0)};e.patch(d,w),o.push(w)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Y0(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
122
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
123
- `}]}}const Qp=(function(e){if(e==null)return jP;if(typeof e=="function")return Zp(e);if(typeof e=="object")return Array.isArray(e)?TP(e):EP(e);if(typeof e=="string")return NP(e);throw new Error("Expected function, string, or object as test")});function TP(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=Qp(e[r]);return Zp(n);function n(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function EP(e){const t=e;return Zp(r);function r(n){const i=n;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function NP(e){return Zp(t);function t(r){return r&&r.type===e}}function Zp(e){return t;function t(r,n,i){return!!(AP(r)&&e.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function jP(){return!0}function AP(e){return e!==null&&typeof e=="object"&&"type"in e}const BN=[],MP=!0,Eb=!1,LP="skip";function $N(e,t,r,n){let i;typeof t=="function"&&typeof r!="function"?(n=r,r=t):i=t;const a=Qp(i),s=n?-1:1;o(e,void 0,[])();function o(u,d,f){const p=u&&typeof u=="object"?u:{};if(typeof p.type=="string"){const x=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(u.type+(x?"<"+x+">":""))+")"})}return m;function m(){let x=BN,b,v,k;if((!t||a(u,d,f[f.length-1]||void 0))&&(x=DP(r(u,f)),x[0]===Eb))return x;if("children"in u&&u.children){const w=u;if(w.children&&x[0]!==LP)for(v=(n?w.children.length:-1)+s,k=f.concat(w);v>-1&&v<w.children.length;){const C=w.children[v];if(b=o(C,v,k)(),b[0]===Eb)return b;v=typeof b[1]=="number"?b[1]:v+s}}return x}}}function DP(e){return Array.isArray(e)?e:typeof e=="number"?[MP,e]:e==null?BN:[e]}function Tv(e,t,r,n){let i,a,s;typeof t=="function"&&typeof r!="function"?(a=void 0,s=t,i=r):(a=t,s=r,i=n),$N(e,a,o,i);function o(u,d){const f=d[d.length-1],p=f?f.children.indexOf(u):void 0;return s(u,p,f)}}const Nb={}.hasOwnProperty,RP={};function OP(e,t){const r=t||RP,n=new Map,i=new Map,a=new Map,s={...yP,...r.handlers},o={all:d,applyData:$P,definitionById:n,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:u,options:r,patch:BP,wrap:IP};return Tv(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const p=f.type==="definition"?n:i,m=String(f.identifier).toUpperCase();p.has(m)||p.set(m,f)}}),o;function u(f,p){const m=f.type,x=o.handlers[m];if(Nb.call(o.handlers,m)&&x)return x(o,f,p);if(o.options.passThrough&&o.options.passThrough.includes(m)){if("children"in f){const{children:v,...k}=f,w=Y0(k);return w.children=o.all(f),w}return Y0(f)}return(o.options.unknownHandler||zP)(o,f,p)}function d(f){const p=[];if("children"in f){const m=f.children;let x=-1;for(;++x<m.length;){const b=o.one(m[x],f);if(b){if(x&&m[x-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=I_(b.value)),!Array.isArray(b)&&b.type==="element")){const v=b.children[0];v&&v.type==="text"&&(v.value=I_(v.value))}Array.isArray(b)?p.push(...b):p.push(b)}}}return p}}function BP(e,t){e.position&&(t.position=Cz(e))}function $P(e,t){let r=t;if(e&&e.data){const n=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof n=="string")if(r.type==="element")r.tagName=n;else{const s="children"in r?r.children:[r];r={type:"element",tagName:n,properties:{},children:s}}r.type==="element"&&a&&Object.assign(r.properties,Y0(a)),"children"in r&&r.children&&i!==null&&i!==void 0&&(r.children=i)}return r}function zP(e,t){const r=t.data||{},n="value"in t&&!(Nb.call(r,"hProperties")||Nb.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IP(e,t){const r=[];let n=-1;for(t&&r.push({type:"text",value:`
124
- `});++n<e.length;)n&&r.push({type:"text",value:`
125
- `}),r.push(e[n]);return t&&e.length>0&&r.push({type:"text",value:`
126
- `}),r}function I_(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function F_(e,t){const r=OP(e,t),n=r.one(e,void 0),i=_P(r),a=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
127
- `},i),a}function FP(e,t){return e&&"run"in e?async function(r,n){const i=F_(r,{file:n,...t});await e.run(i,n)}:function(r,n){return F_(r,{file:n,...e||t})}}function P_(e){if(e)throw e}var dy,H_;function PP(){if(H_)return dy;H_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},a=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var f=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!f&&!p)return!1;var m;for(m in d);return typeof m>"u"||e.call(d,m)},s=function(d,f){r&&f.name==="__proto__"?r(d,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):d[f.name]=f.newValue},o=function(d,f){if(f==="__proto__")if(e.call(d,f)){if(n)return n(d,f).value}else return;return d[f]};return dy=function u(){var d,f,p,m,x,b,v=arguments[0],k=1,w=arguments.length,C=!1;for(typeof v=="boolean"&&(C=v,v=arguments[1]||{},k=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});k<w;++k)if(d=arguments[k],d!=null)for(f in d)p=o(v,f),m=o(d,f),v!==m&&(C&&m&&(a(m)||(x=i(m)))?(x?(x=!1,b=p&&i(p)?p:[]):b=p&&a(p)?p:{},s(v,{name:f,newValue:u(C,b,m)})):typeof m<"u"&&s(v,{name:f,newValue:m}));return v},dy}var HP=PP();const hy=gc(HP);function jb(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function qP(){const e=[],t={run:r,use:n};return t;function r(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...i);function o(u,...d){const f=e[++a];let p=-1;if(u){s(u);return}for(;++p<i.length;)(d[p]===null||d[p]===void 0)&&(d[p]=i[p]);i=d,f?UP(f,o)(...d):s(null,...d)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function UP(e,t){let r;return n;function n(...s){const o=e.length>s.length;let u;o&&s.push(i);try{u=e.apply(this,s)}catch(d){const f=d;if(o&&r)throw f;return i(f)}o||(u&&u.then&&typeof u.then=="function"?u.then(a,i):u instanceof Error?i(u):a(u))}function i(s,...o){r||(r=!0,t(s,...o))}function a(s){i(null,s)}}const Yi={basename:VP,dirname:WP,extname:YP,join:GP,sep:"/"};function VP(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ah(e);let r=0,n=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let s=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else s<0&&(a=!0,s=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(n=i):(o=-1,n=s));return r===n?n=s:n<0&&(n=e.length),e.slice(r,n)}function WP(e){if(ah(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function YP(e){ah(e);let t=e.length,r=-1,n=0,i=-1,a=0,s;for(;t--;){const o=e.codePointAt(t);if(o===47){if(s){n=t+1;break}continue}r<0&&(s=!0,r=t+1),o===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||r<0||a===0||a===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function GP(...e){let t=-1,r;for(;++t<e.length;)ah(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":XP(r)}function XP(e){ah(e);const t=e.codePointAt(0)===47;let r=QP(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function QP(e,t){let r="",n=0,i=-1,a=0,s=-1,o,u;for(;++s<=e.length;){if(s<e.length)o=e.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(u=r.lastIndexOf("/"),u!==r.length-1){u<0?(r="",n=0):(r=r.slice(0,u),n=r.length-1-r.lastIndexOf("/")),i=s,a=0;continue}}else if(r.length>0){r="",n=0,i=s,a=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,s):r=e.slice(i+1,s),n=s-i-1;i=s,a=0}else o===46&&a>-1?a++:a=-1}return r}function ah(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ZP={cwd:KP};function KP(){return"/"}function Ab(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function JP(e){if(typeof e=="string")e=new URL(e);else if(!Ab(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return eH(e)}function eH(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const fy=["history","path","basename","stem","extname","dirname"];class zN{constructor(t){let r;t?Ab(t)?r={path:t}:typeof t=="string"||tH(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":ZP.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<fy.length;){const a=fy[n];a in r&&r[a]!==void 0&&r[a]!==null&&(this[a]=a==="history"?[...r[a]]:r[a])}let i;for(i in r)fy.includes(i)||(this[i]=r[i])}get basename(){return typeof this.path=="string"?Yi.basename(this.path):void 0}set basename(t){gy(t,"basename"),py(t,"basename"),this.path=Yi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Yi.dirname(this.path):void 0}set dirname(t){q_(this.basename,"dirname"),this.path=Yi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Yi.extname(this.path):void 0}set extname(t){if(py(t,"extname"),q_(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Yi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ab(t)&&(t=JP(t)),gy(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Yi.basename(this.path,this.extname):void 0}set stem(t){gy(t,"stem"),py(t,"stem"),this.path=Yi.join(this.dirname||"",t+(this.extname||""))}fail(t,r,n){const i=this.message(t,r,n);throw i.fatal=!0,i}info(t,r,n){const i=this.message(t,r,n);return i.fatal=void 0,i}message(t,r,n){const i=new fn(t,r,n);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function py(e,t){if(e&&e.includes(Yi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Yi.sep+"`")}function gy(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function q_(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function tH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rH=(function(e){const n=this.constructor.prototype,i=n[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,n),a}),nH={}.hasOwnProperty;class Ev extends rH{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=qP()}copy(){const t=new Ev;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];t.use(...n)}return t.data(hy(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(yy("data",this.frozen),this.namespace[t]=r,this):nH.call(this.namespace,t)&&this.namespace[t]||void 0:t?(yy("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const i=r.call(t,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=If(t),n=this.parser||this.Parser;return my("parse",n),n(String(r),r)}process(t,r){const n=this;return this.freeze(),my("process",this.parser||this.Parser),xy("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(a,s){const o=If(t),u=n.parse(o);n.run(u,o,function(f,p,m){if(f||!p||!m)return d(f);const x=p,b=n.stringify(x,m);sH(b)?m.value=b:m.result=b,d(f,m)});function d(f,p){f||!p?s(f):a?a(p):r(void 0,p)}}}processSync(t){let r=!1,n;return this.freeze(),my("processSync",this.parser||this.Parser),xy("processSync",this.compiler||this.Compiler),this.process(t,i),V_("processSync","process",r),n;function i(a,s){r=!0,P_(a),n=s}}run(t,r,n){U_(t),this.freeze();const i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?a(void 0,n):new Promise(a);function a(s,o){const u=If(r);i.run(t,u,d);function d(f,p,m){const x=p||t;f?o(f):s?s(x):n(void 0,x,m)}}}runSync(t,r){let n=!1,i;return this.run(t,r,a),V_("runSync","run",n),i;function a(s,o){P_(s),i=o,n=!0}}stringify(t,r){this.freeze();const n=If(r),i=this.compiler||this.Compiler;return xy("stringify",i),U_(t),i(t,n)}use(t,...r){const n=this.attachers,i=this.namespace;if(yy("use",this.frozen),t!=null)if(typeof t=="function")u(t,r);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[f,...p]=d;u(f,p)}else s(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function s(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(d.plugins),d.settings&&(i.settings=hy(!0,i.settings,d.settings))}function o(d){let f=-1;if(d!=null)if(Array.isArray(d))for(;++f<d.length;){const p=d[f];a(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,f){let p=-1,m=-1;for(;++p<n.length;)if(n[p][0]===d){m=p;break}if(m===-1)n.push([d,...f]);else if(f.length>0){let[x,...b]=f;const v=n[m][1];jb(v)&&jb(x)&&(x=hy(!0,v,x)),n[m]=[d,x,...b]}}}}const iH=new Ev().freeze();function my(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function yy(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function U_(e){if(!jb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function V_(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function If(e){return aH(e)?e:new zN(e)}function aH(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function sH(e){return typeof e=="string"||lH(e)}function lH(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oH="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",W_=[],Y_={allowDangerousHtml:!0},cH=/^(https?|ircs?|mailto|xmpp)$/i,uH=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function dH(e){const t=hH(e),r=fH(e);return pH(t.runSync(t.parse(r),r),e)}function hH(e){const t=e.rehypePlugins||W_,r=e.remarkPlugins||W_,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Y_}:Y_;return iH().use(WF).use(r).use(FP,n).use(t)}function fH(e){const t=e.children||"",r=new zN;return typeof t=="string"&&(r.value=t),r}function pH(e,t){const r=t.allowedElements,n=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,u=t.urlTransform||gH;for(const f of uH)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+oH+f.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Tv(e,d),jz(e,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function d(f,p,m){if(f.type==="raw"&&m&&typeof p=="number")return s?m.children.splice(p,1):m.children[p]={type:"text",value:f.value},p;if(f.type==="element"){let x;for(x in oy)if(Object.hasOwn(oy,x)&&Object.hasOwn(f.properties,x)){const b=f.properties[x],v=oy[x];(v===null||v.includes(f.tagName))&&(f.properties[x]=u(String(b||""),x,f))}}if(f.type==="element"){let x=r?!r.includes(f.tagName):a?a.includes(f.tagName):!1;if(!x&&n&&typeof p=="number"&&(x=!n(f,p,m)),x&&m&&typeof p=="number")return o&&f.children?m.children.splice(p,1,...f.children):m.children.splice(p,1),p}}}function gH(e){const t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||r!==-1&&t>r||n!==-1&&t>n||cH.test(e.slice(0,t))?e:""}function G_(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(t);for(;i!==-1;)n++,i=r.indexOf(t,i+t.length);return n}function mH(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function xH(e,t,r){const i=Qp((r||{}).ignore||[]),a=yH(t);let s=-1;for(;++s<a.length;)$N(e,"text",o);function o(d,f){let p=-1,m;for(;++p<f.length;){const x=f[p],b=m?m.children:void 0;if(i(x,b?b.indexOf(x):void 0,m))return;m=x}if(m)return u(d,f)}function u(d,f){const p=f[f.length-1],m=a[s][0],x=a[s][1];let b=0;const k=p.children.indexOf(d);let w=!1,C=[];m.lastIndex=0;let T=m.exec(d.value);for(;T;){const j=T.index,L={index:T.index,input:T.input,stack:[...f,d]};let E=x(...T,L);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?m.lastIndex=j+1:(b!==j&&C.push({type:"text",value:d.value.slice(b,j)}),Array.isArray(E)?C.push(...E):E&&C.push(E),b=j+T[0].length,w=!0),!m.global)break;T=m.exec(d.value)}return w?(b<d.value.length&&C.push({type:"text",value:d.value.slice(b)}),p.children.splice(k,1,...C)):C=[d],k+C.length}}function yH(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let n=-1;for(;++n<r.length;){const i=r[n];t.push([bH(i[0]),vH(i[1])])}return t}function bH(e){return typeof e=="string"?new RegExp(mH(e),"g"):e}function vH(e){return typeof e=="function"?e:function(){return e}}const by="phrasing",vy=["autolink","link","image","label"];function wH(){return{transforms:[NH],enter:{literalAutolink:SH,literalAutolinkEmail:wy,literalAutolinkHttp:wy,literalAutolinkWww:wy},exit:{literalAutolink:EH,literalAutolinkEmail:TH,literalAutolinkHttp:CH,literalAutolinkWww:_H}}}function kH(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:by,notInConstruct:vy},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:by,notInConstruct:vy},{character:":",before:"[ps]",after:"\\/",inConstruct:by,notInConstruct:vy}]}}function SH(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function wy(e){this.config.enter.autolinkProtocol.call(this,e)}function CH(e){this.config.exit.autolinkProtocol.call(this,e)}function _H(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function TH(e){this.config.exit.autolinkEmail.call(this,e)}function EH(e){this.exit(e)}function NH(e){xH(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,jH],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),AH]],{ignore:["link","linkReference"]})}function jH(e,t,r,n,i){let a="";if(!IN(i)||(/^w/i.test(t)&&(r=t+r,t="",a="http://"),!MH(r)))return!1;const s=LH(r+n);if(!s[0])return!1;const o={type:"link",title:null,url:a+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function AH(e,t,r,n){return!IN(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function MH(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function LH(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],n=r.indexOf(")");const i=G_(e,"(");let a=G_(e,")");for(;n!==-1&&i>a;)e+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),a++;return[e,r]}function IN(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||gl(r)||Yp(r))&&(!t||r!==47)}FN.peek=PH;function DH(){this.buffer()}function RH(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function OH(){this.buffer()}function BH(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function $H(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Li(this.sliceSerialize(e)).toLowerCase(),r.label=t}function zH(e){this.exit(e)}function IH(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Li(this.sliceSerialize(e)).toLowerCase(),r.label=t}function FH(e){this.exit(e)}function PH(){return"["}function FN(e,t,r,n){const i=r.createTracker(n);let a=i.move("[^");const s=r.enter("footnoteReference"),o=r.enter("reference");return a+=i.move(r.safe(r.associationId(e),{after:"]",before:a})),o(),s(),a+=i.move("]"),a}function HH(){return{enter:{gfmFootnoteCallString:DH,gfmFootnoteCall:RH,gfmFootnoteDefinitionLabelString:OH,gfmFootnoteDefinition:BH},exit:{gfmFootnoteCallString:$H,gfmFootnoteCall:zH,gfmFootnoteDefinitionLabelString:IH,gfmFootnoteDefinition:FH}}}function qH(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:FN},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,a,s){const o=a.createTracker(s);let u=o.move("[^");const d=a.enter("footnoteDefinition"),f=a.enter("label");return u+=o.move(a.safe(a.associationId(n),{before:u,after:"]"})),f(),u+=o.move("]:"),n.children&&n.children.length>0&&(o.shift(4),u+=o.move((t?`
128
- `:" ")+a.indentLines(a.containerFlow(n,o.current()),t?PN:UH))),d(),u}}function UH(e,t,r){return t===0?e:PN(e,t,r)}function PN(e,t,r){return(r?"":" ")+e}const VH=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];HN.peek=QH;function WH(){return{canContainEols:["delete"],enter:{strikethrough:GH},exit:{strikethrough:XH}}}function YH(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:VH}],handlers:{delete:HN}}}function GH(e){this.enter({type:"delete",children:[]},e)}function XH(e){this.exit(e)}function HN(e,t,r,n){const i=r.createTracker(n),a=r.enter("strikethrough");let s=i.move("~~");return s+=r.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function QH(){return"~"}function ZH(e){return e.length}function KH(e,t){const r=t||{},n=(r.align||[]).concat(),i=r.stringLength||ZH,a=[],s=[],o=[],u=[];let d=0,f=-1;for(;++f<e.length;){const v=[],k=[];let w=-1;for(e[f].length>d&&(d=e[f].length);++w<e[f].length;){const C=JH(e[f][w]);if(r.alignDelimiters!==!1){const T=i(C);k[w]=T,(u[w]===void 0||T>u[w])&&(u[w]=T)}v.push(C)}s[f]=v,o[f]=k}let p=-1;if(typeof n=="object"&&"length"in n)for(;++p<d;)a[p]=X_(n[p]);else{const v=X_(n);for(;++p<d;)a[p]=v}p=-1;const m=[],x=[];for(;++p<d;){const v=a[p];let k="",w="";v===99?(k=":",w=":"):v===108?k=":":v===114&&(w=":");let C=r.alignDelimiters===!1?1:Math.max(1,u[p]-k.length-w.length);const T=k+"-".repeat(C)+w;r.alignDelimiters!==!1&&(C=k.length+C+w.length,C>u[p]&&(u[p]=C),x[p]=C),m[p]=T}s.splice(1,0,m),o.splice(1,0,x),f=-1;const b=[];for(;++f<s.length;){const v=s[f],k=o[f];p=-1;const w=[];for(;++p<d;){const C=v[p]||"";let T="",j="";if(r.alignDelimiters!==!1){const L=u[p]-(k[p]||0),E=a[p];E===114?T=" ".repeat(L):E===99?L%2?(T=" ".repeat(L/2+.5),j=" ".repeat(L/2-.5)):(T=" ".repeat(L/2),j=T):j=" ".repeat(L)}r.delimiterStart!==!1&&!p&&w.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&C==="")&&(r.delimiterStart!==!1||p)&&w.push(" "),r.alignDelimiters!==!1&&w.push(T),w.push(C),r.alignDelimiters!==!1&&w.push(j),r.padding!==!1&&w.push(" "),(r.delimiterEnd!==!1||p!==d-1)&&w.push("|")}b.push(r.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return b.join(`
129
- `)}function JH(e){return e==null?"":String(e)}function X_(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function eq(e,t,r,n){const i=r.enter("blockquote"),a=r.createTracker(n);a.move("> "),a.shift(2);const s=r.indentLines(r.containerFlow(e,a.current()),tq);return i(),s}function tq(e,t,r){return">"+(r?"":" ")+e}function rq(e,t){return Q_(e,t.inConstruct,!0)&&!Q_(e,t.notInConstruct,!1)}function Q_(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let n=-1;for(;++n<t.length;)if(e.includes(t[n]))return!0;return!1}function Z_(e,t,r,n){let i=-1;for(;++i<r.unsafe.length;)if(r.unsafe[i].character===`
130
- `&&rq(r.stack,r.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return`\\
131
- `}function nq(e,t){const r=String(e);let n=r.indexOf(t),i=n,a=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===i?++a>s&&(s=a):a=1,i=n+t.length,n=r.indexOf(t,i);return s}function iq(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function aq(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function sq(e,t,r,n){const i=aq(r),a=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(iq(e,r)){const p=r.enter("codeIndented"),m=r.indentLines(a,lq);return p(),m}const o=r.createTracker(n),u=i.repeat(Math.max(nq(a,i)+1,3)),d=r.enter("codeFenced");let f=o.move(u);if(e.lang){const p=r.enter(`codeFencedLang${s}`);f+=o.move(r.safe(e.lang,{before:f,after:" ",encode:["`"],...o.current()})),p()}if(e.lang&&e.meta){const p=r.enter(`codeFencedMeta${s}`);f+=o.move(" "),f+=o.move(r.safe(e.meta,{before:f,after:`
132
- `,encode:["`"],...o.current()})),p()}return f+=o.move(`
133
- `),a&&(f+=o.move(a+`
134
- `)),f+=o.move(u),d(),f}function lq(e,t,r){return(r?"":" ")+e}function Nv(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function oq(e,t,r,n){const i=Nv(r),a=i==='"'?"Quote":"Apostrophe",s=r.enter("definition");let o=r.enter("label");const u=r.createTracker(n);let d=u.move("[");return d+=u.move(r.safe(r.associationId(e),{before:d,after:"]",...u.current()})),d+=u.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=r.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(r.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(o=r.enter("destinationRaw"),d+=u.move(r.safe(e.url,{before:d,after:e.title?" ":`
135
- `,...u.current()}))),o(),e.title&&(o=r.enter(`title${a}`),d+=u.move(" "+i),d+=u.move(r.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),o()),s(),d}function cq(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function jd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function G0(e,t,r){const n=Zo(e),i=Zo(t);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}qN.peek=uq;function qN(e,t,r,n){const i=cq(r),a=r.enter("emphasis"),s=r.createTracker(n),o=s.move(i);let u=s.move(r.containerPhrasing(e,{after:i,before:o,...s.current()}));const d=u.charCodeAt(0),f=G0(n.before.charCodeAt(n.before.length-1),d,i);f.inside&&(u=jd(d)+u.slice(1));const p=u.charCodeAt(u.length-1),m=G0(n.after.charCodeAt(0),p,i);m.inside&&(u=u.slice(0,-1)+jd(p));const x=s.move(i);return a(),r.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},o+u+x}function uq(e,t,r){return r.options.emphasis||"*"}function dq(e,t){let r=!1;return Tv(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,Eb}),!!((!e.depth||e.depth<3)&&bv(e)&&(t.options.setext||r))}function hq(e,t,r,n){const i=Math.max(Math.min(6,e.depth||1),1),a=r.createTracker(n);if(dq(e,r)){const f=r.enter("headingSetext"),p=r.enter("phrasing"),m=r.containerPhrasing(e,{...a.current(),before:`
136
- `,after:`
137
- `});return p(),f(),m+`
138
- `+(i===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
139
- `))+1))}const s="#".repeat(i),o=r.enter("headingAtx"),u=r.enter("phrasing");a.move(s+" ");let d=r.containerPhrasing(e,{before:"# ",after:`
140
- `,...a.current()});return/^[\t ]/.test(d)&&(d=jd(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,r.options.closeAtx&&(d+=" "+s),u(),o(),d}UN.peek=fq;function UN(e){return e.value||""}function fq(){return"<"}VN.peek=pq;function VN(e,t,r,n){const i=Nv(r),a=i==='"'?"Quote":"Apostrophe",s=r.enter("image");let o=r.enter("label");const u=r.createTracker(n);let d=u.move("![");return d+=u.move(r.safe(e.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=r.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(r.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(o=r.enter("destinationRaw"),d+=u.move(r.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=r.enter(`title${a}`),d+=u.move(" "+i),d+=u.move(r.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),o()),d+=u.move(")"),s(),d}function pq(){return"!"}WN.peek=gq;function WN(e,t,r,n){const i=e.referenceType,a=r.enter("imageReference");let s=r.enter("label");const o=r.createTracker(n);let u=o.move("![");const d=r.safe(e.alt,{before:u,after:"]",...o.current()});u+=o.move(d+"]["),s();const f=r.stack;r.stack=[],s=r.enter("reference");const p=r.safe(r.associationId(e),{before:u,after:"]",...o.current()});return s(),r.stack=f,a(),i==="full"||!d||d!==p?u+=o.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function gq(){return"!"}YN.peek=mq;function YN(e,t,r){let n=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++a<r.unsafe.length;){const s=r.unsafe[a],o=r.compilePattern(s);let u;if(s.atBreak)for(;u=o.exec(n);){let d=u.index;n.charCodeAt(d)===10&&n.charCodeAt(d-1)===13&&d--,n=n.slice(0,d)+" "+n.slice(u.index+1)}}return i+n+i}function mq(){return"`"}function GN(e,t){const r=bv(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}XN.peek=xq;function XN(e,t,r,n){const i=Nv(r),a=i==='"'?"Quote":"Apostrophe",s=r.createTracker(n);let o,u;if(GN(e,r)){const f=r.stack;r.stack=[],o=r.enter("autolink");let p=s.move("<");return p+=s.move(r.containerPhrasing(e,{before:p,after:">",...s.current()})),p+=s.move(">"),o(),r.stack=f,p}o=r.enter("link"),u=r.enter("label");let d=s.move("[");return d+=s.move(r.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=r.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(r.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(u=r.enter("destinationRaw"),d+=s.move(r.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=r.enter(`title${a}`),d+=s.move(" "+i),d+=s.move(r.safe(e.title,{before:d,after:i,...s.current()})),d+=s.move(i),u()),d+=s.move(")"),o(),d}function xq(e,t,r){return GN(e,r)?"<":"["}QN.peek=yq;function QN(e,t,r,n){const i=e.referenceType,a=r.enter("linkReference");let s=r.enter("label");const o=r.createTracker(n);let u=o.move("[");const d=r.containerPhrasing(e,{before:u,after:"]",...o.current()});u+=o.move(d+"]["),s();const f=r.stack;r.stack=[],s=r.enter("reference");const p=r.safe(r.associationId(e),{before:u,after:"]",...o.current()});return s(),r.stack=f,a(),i==="full"||!d||d!==p?u+=o.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function yq(){return"["}function jv(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function bq(e){const t=jv(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function vq(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ZN(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function wq(e,t,r,n){const i=r.enter("list"),a=r.bulletCurrent;let s=e.ordered?vq(r):jv(r);const o=e.ordered?s==="."?")":".":bq(r);let u=t&&r.bulletLastUsed?s===r.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(u=!0),ZN(r)===s&&f){let p=-1;for(;++p<e.children.length;){const m=e.children[p];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=o),r.bulletCurrent=s;const d=r.containerFlow(e,n);return r.bulletLastUsed=s,r.bulletCurrent=a,i(),d}function kq(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Sq(e,t,r,n){const i=kq(r);let a=r.bulletCurrent||jv(r);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const o=r.createTracker(n);o.move(a+" ".repeat(s-a.length)),o.shift(s);const u=r.enter("listItem"),d=r.indentLines(r.containerFlow(e,o.current()),f);return u(),d;function f(p,m,x){return m?(x?"":" ".repeat(s))+p:(x?a:a+" ".repeat(s-a.length))+p}}function Cq(e,t,r,n){const i=r.enter("paragraph"),a=r.enter("phrasing"),s=r.containerPhrasing(e,n);return a(),i(),s}const _q=Qp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Tq(e,t,r,n){return(e.children.some(function(s){return _q(s)})?r.containerPhrasing:r.containerFlow).call(r,e,n)}function Eq(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}KN.peek=Nq;function KN(e,t,r,n){const i=Eq(r),a=r.enter("strong"),s=r.createTracker(n),o=s.move(i+i);let u=s.move(r.containerPhrasing(e,{after:i,before:o,...s.current()}));const d=u.charCodeAt(0),f=G0(n.before.charCodeAt(n.before.length-1),d,i);f.inside&&(u=jd(d)+u.slice(1));const p=u.charCodeAt(u.length-1),m=G0(n.after.charCodeAt(0),p,i);m.inside&&(u=u.slice(0,-1)+jd(p));const x=s.move(i+i);return a(),r.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},o+u+x}function Nq(e,t,r){return r.options.strong||"*"}function jq(e,t,r,n){return r.safe(e.value,n)}function Aq(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Mq(e,t,r){const n=(ZN(r)+(r.options.ruleSpaces?" ":"")).repeat(Aq(r));return r.options.ruleSpaces?n.slice(0,-1):n}const JN={blockquote:eq,break:Z_,code:sq,definition:oq,emphasis:qN,hardBreak:Z_,heading:hq,html:UN,image:VN,imageReference:WN,inlineCode:YN,link:XN,linkReference:QN,list:wq,listItem:Sq,paragraph:Cq,root:Tq,strong:KN,text:jq,thematicBreak:Mq};function Lq(){return{enter:{table:Dq,tableData:K_,tableHeader:K_,tableRow:Oq},exit:{codeText:Bq,table:Rq,tableData:ky,tableHeader:ky,tableRow:ky}}}function Dq(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function Rq(e){this.exit(e),this.data.inTable=void 0}function Oq(e){this.enter({type:"tableRow",children:[]},e)}function ky(e){this.exit(e)}function K_(e){this.enter({type:"tableCell",children:[]},e)}function Bq(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,$q));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function $q(e,t){return t==="|"?t:e}function zq(e){const t=e||{},r=t.tableCellPadding,n=t.tablePipeAlign,i=t.stringLength,a=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
141
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:s,tableCell:u,tableRow:o}};function s(x,b,v,k){return d(f(x,v,k),x.align)}function o(x,b,v,k){const w=p(x,v,k),C=d([w]);return C.slice(0,C.indexOf(`
142
- `))}function u(x,b,v,k){const w=v.enter("tableCell"),C=v.enter("phrasing"),T=v.containerPhrasing(x,{...k,before:a,after:a});return C(),w(),T}function d(x,b){return KH(x,{align:b,alignDelimiters:n,padding:r,stringLength:i})}function f(x,b,v){const k=x.children;let w=-1;const C=[],T=b.enter("table");for(;++w<k.length;)C[w]=p(k[w],b,v);return T(),C}function p(x,b,v){const k=x.children;let w=-1;const C=[],T=b.enter("tableRow");for(;++w<k.length;)C[w]=u(k[w],x,b,v);return T(),C}function m(x,b,v){let k=JN.inlineCode(x,b,v);return v.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function Iq(){return{exit:{taskListCheckValueChecked:J_,taskListCheckValueUnchecked:J_,paragraph:Pq}}}function Fq(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Hq}}}function J_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Pq(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const n=r.children[0];if(n&&n.type==="text"){const i=t.children;let a=-1,s;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){s=o;break}}s===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Hq(e,t,r,n){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=r.createTracker(n);a&&o.move(s);let u=JN.listItem(e,t,r,{...n,...o.current()});return a&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(f){return f+s}}function qq(){return[wH(),HH(),WH(),Lq(),Iq()]}function Uq(e){return{extensions:[kH(),qH(e),YH(),zq(e),Fq()]}}const Vq={tokenize:Zq,partial:!0},e3={tokenize:Kq,partial:!0},t3={tokenize:Jq,partial:!0},r3={tokenize:eU,partial:!0},Wq={tokenize:tU,partial:!0},n3={name:"wwwAutolink",tokenize:Xq,previous:a3},i3={name:"protocolAutolink",tokenize:Qq,previous:s3},Ra={name:"emailAutolink",tokenize:Gq,previous:l3},ra={};function Yq(){return{text:ra}}let Zs=48;for(;Zs<123;)ra[Zs]=Ra,Zs++,Zs===58?Zs=65:Zs===91&&(Zs=97);ra[43]=Ra;ra[45]=Ra;ra[46]=Ra;ra[95]=Ra;ra[72]=[Ra,i3];ra[104]=[Ra,i3];ra[87]=[Ra,n3];ra[119]=[Ra,n3];function Gq(e,t,r){const n=this;let i,a;return s;function s(p){return!Mb(p)||!l3.call(n,n.previous)||Av(n.events)?r(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(p))}function o(p){return Mb(p)?(e.consume(p),o):p===64?(e.consume(p),u):r(p)}function u(p){return p===46?e.check(Wq,f,d)(p):p===45||p===95||on(p)?(a=!0,e.consume(p),u):f(p)}function d(p){return e.consume(p),i=!0,u}function f(p){return a&&i&&bn(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):r(p)}}function Xq(e,t,r){const n=this;return i;function i(s){return s!==87&&s!==119||!a3.call(n,n.previous)||Av(n.events)?r(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Vq,e.attempt(e3,e.attempt(t3,a),r),r)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function Qq(e,t,r){const n=this;let i="",a=!1;return s;function s(p){return(p===72||p===104)&&s3.call(n,n.previous)&&!Av(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),e.consume(p),o):r(p)}function o(p){if(bn(p)&&i.length<5)return i+=String.fromCodePoint(p),e.consume(p),o;if(p===58){const m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(p),u}return r(p)}function u(p){return p===47?(e.consume(p),a?d:(a=!0,u)):r(p)}function d(p){return p===null||V0(p)||Vt(p)||gl(p)||Yp(p)?r(p):e.attempt(e3,e.attempt(t3,f),r)(p)}function f(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function Zq(e,t,r){let n=0;return i;function i(s){return(s===87||s===119)&&n<3?(n++,e.consume(s),i):s===46&&n===3?(e.consume(s),a):r(s)}function a(s){return s===null?r(s):t(s)}}function Kq(e,t,r){let n,i,a;return s;function s(d){return d===46||d===95?e.check(r3,u,o)(d):d===null||Vt(d)||gl(d)||d!==45&&Yp(d)?u(d):(a=!0,e.consume(d),s)}function o(d){return d===95?n=!0:(i=n,n=void 0),e.consume(d),s}function u(d){return i||n||!a?r(d):t(d)}}function Jq(e,t){let r=0,n=0;return i;function i(s){return s===40?(r++,e.consume(s),i):s===41&&n<r?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(r3,t,a)(s):s===null||Vt(s)||gl(s)?t(s):(e.consume(s),i)}function a(s){return s===41&&n++,e.consume(s),i}}function eU(e,t,r){return n;function n(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),n):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Vt(o)||gl(o)?t(o):r(o)}function i(o){return o===null||o===40||o===91||Vt(o)||gl(o)?t(o):n(o)}function a(o){return bn(o)?s(o):r(o)}function s(o){return o===59?(e.consume(o),n):bn(o)?(e.consume(o),s):r(o)}}function tU(e,t,r){return n;function n(a){return e.consume(a),i}function i(a){return on(a)?r(a):t(a)}}function a3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Vt(e)}function s3(e){return!bn(e)}function l3(e){return!(e===47||Mb(e))}function Mb(e){return e===43||e===45||e===46||e===95||on(e)}function Av(e){let t=e.length,r=!1;for(;t--;){const n=e[t][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const rU={tokenize:uU,partial:!0};function nU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:lU,continuation:{tokenize:oU},exit:cU}},text:{91:{name:"gfmFootnoteCall",tokenize:sU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iU,resolveTo:aU}}}}function iU(e,t,r){const n=this;let i=n.events.length;const a=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let s;for(;i--;){const u=n.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!s||!s._balanced)return r(u);const d=Li(n.sliceSerialize({start:s.end,end:n.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?r(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function aU(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const n={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[r+1],e[r+2],["enter",n,t],e[r+3],e[r+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",n,t]];return e.splice(r,e.length-r+1,...o),e}function sU(e,t,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a=0,s;return o;function o(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?r(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(p){if(a>999||p===93&&!s||p===null||p===91||Vt(p))return r(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(Li(n.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(p)}return Vt(p)||(s=!0),a++,e.consume(p),p===92?f:d}function f(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function lU(e,t,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a,s=0,o;return u;function u(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):r(b)}function f(b){if(s>999||b===93&&!o||b===null||b===91||Vt(b))return r(b);if(b===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return a=Li(n.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Vt(b)||(o=!0),s++,e.consume(b),b===92?p:f}function p(b){return b===91||b===92||b===93?(e.consume(b),s++,f):f(b)}function m(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(a)||i.push(a),Ct(e,x,"gfmFootnoteDefinitionWhitespace")):r(b)}function x(b){return t(b)}}function oU(e,t,r){return e.check(ih,t,e.attempt(rU,t,r))}function cU(e){e.exit("gfmFootnoteDefinition")}function uU(e,t,r){const n=this;return Ct(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=n.events[n.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):r(a)}}function dU(e){let r=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:a,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(s,o){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let d=u;for(;d--;)if(s[d][0]==="exit"&&s[d][1].type==="strikethroughSequenceTemporary"&&s[d][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[d][1].end.offset-s[d][1].start.offset){s[u][1].type="strikethroughSequence",s[d][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[d][1].start),end:Object.assign({},s[u][1].end)},p={type:"strikethroughText",start:Object.assign({},s[d][1].end),end:Object.assign({},s[u][1].start)},m=[["enter",f,o],["enter",s[d][1],o],["exit",s[d][1],o],["enter",p,o]],x=o.parser.constructs.insideSpan.null;x&&ei(m,m.length,0,Gp(x,s.slice(d+1,u),o)),ei(m,m.length,0,[["exit",p,o],["enter",s[u][1],o],["exit",s[u][1],o],["exit",f,o]]),ei(s,d-1,u-d+3,m),u=d+m.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function a(s,o,u){const d=this.previous,f=this.events;let p=0;return m;function m(b){return d===126&&f[f.length-1][1].type!=="characterEscape"?u(b):(s.enter("strikethroughSequenceTemporary"),x(b))}function x(b){const v=Zo(d);if(b===126)return p>1?u(b):(s.consume(b),p++,x);if(p<2&&!r)return u(b);const k=s.exit("strikethroughSequenceTemporary"),w=Zo(b);return k._open=!w||w===2&&!!v,k._close=!v||v===2&&!!w,o(b)}}}class hU{constructor(){this.map=[]}add(t,r,n){fU(this,t,r,n)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let r=this.map.length;const n=[];for(;r>0;)r-=1,n.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];n.push(t.slice()),t.length=0;let i=n.pop();for(;i;){for(const a of i)t.push(a);i=n.pop()}this.map.length=0}}function fU(e,t,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=r,e.map[i][2].push(...n);return}i+=1}e.map.push([t,r,n])}}function pU(e,t){let r=!1;const n=[];for(;t<e.length;){const i=e[t];if(r){if(i[0]==="enter")i[1].type==="tableContent"&&n.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=n.length-1;n[a]=n[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return n}function gU(){return{flow:{null:{name:"table",tokenize:mU,resolveAll:xU}}}}function mU(e,t,r){const n=this;let i=0,a=0,s;return o;function o(z){let $=n.events.length-1;for(;$>-1;){const B=n.events[$][1].type;if(B==="lineEnding"||B==="linePrefix")$--;else break}const W=$>-1?n.events[$][1].type:null,Y=W==="tableHead"||W==="tableRow"?E:u;return Y===E&&n.parser.lazy[n.now().line]?r(z):Y(z)}function u(z){return e.enter("tableHead"),e.enter("tableRow"),d(z)}function d(z){return z===124||(s=!0,a+=1),f(z)}function f(z){return z===null?r(z):Ge(z)?a>1?(a=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),x):r(z):gt(z)?Ct(e,f,"whitespace")(z):(a+=1,s&&(s=!1,i+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),p(z)))}function p(z){return z===null||z===124||Vt(z)?(e.exit("data"),f(z)):(e.consume(z),z===92?m:p)}function m(z){return z===92||z===124?(e.consume(z),p):p(z)}function x(z){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(z):(e.enter("tableDelimiterRow"),s=!1,gt(z)?Ct(e,b,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):b(z))}function b(z){return z===45||z===58?k(z):z===124?(s=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),v):L(z)}function v(z){return gt(z)?Ct(e,k,"whitespace")(z):k(z)}function k(z){return z===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),w):z===45?(a+=1,w(z)):z===null||Ge(z)?j(z):L(z)}function w(z){return z===45?(e.enter("tableDelimiterFiller"),C(z)):L(z)}function C(z){return z===45?(e.consume(z),C):z===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(z))}function T(z){return gt(z)?Ct(e,j,"whitespace")(z):j(z)}function j(z){return z===124?b(z):z===null||Ge(z)?!s||i!==a?L(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):L(z)}function L(z){return r(z)}function E(z){return e.enter("tableRow"),M(z)}function M(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),M):z===null||Ge(z)?(e.exit("tableRow"),t(z)):gt(z)?Ct(e,M,"whitespace")(z):(e.enter("data"),I(z))}function I(z){return z===null||z===124||Vt(z)?(e.exit("data"),M(z)):(e.consume(z),z===92?P:I)}function P(z){return z===92||z===124?(e.consume(z),I):I(z)}}function xU(e,t){let r=-1,n=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,u=0,d,f,p;const m=new hU;for(;++r<e.length;){const x=e[r],b=x[1];x[0]==="enter"?b.type==="tableHead"?(o=!1,u!==0&&(e5(m,t,u,d,f),f=void 0,u=0),d={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},m.add(r,0,[["enter",d,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(n=!0,p=void 0,a=[0,0,0,0],s=[0,r+1,0,0],o&&(o=!1,f={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},m.add(r,0,[["enter",f,t]])),i=b.type==="tableDelimiterRow"?2:f?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(n=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],p=Ff(m,t,a,i,void 0,p),a=[0,0,0,0]),s[2]=r)):b.type==="tableCellDivider"&&(n?n=!1:(a[1]!==0&&(s[0]=s[1],p=Ff(m,t,a,i,void 0,p)),a=s,s=[a[1],r,0,0])):b.type==="tableHead"?(o=!0,u=r):b.type==="tableRow"||b.type==="tableDelimiterRow"?(u=r,a[1]!==0?(s[0]=s[1],p=Ff(m,t,a,i,r,p)):s[1]!==0&&(p=Ff(m,t,s,i,r,p)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(s[3]=r)}for(u!==0&&e5(m,t,u,d,f),m.consume(t.events),r=-1;++r<t.events.length;){const x=t.events[r];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=pU(t.events,r))}return e}function Ff(e,t,r,n,i,a){const s=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",o="tableContent";r[0]!==0&&(a.end=Object.assign({},To(t.events,r[0])),e.add(r[0],0,[["exit",a,t]]));const u=To(t.events,r[1]);if(a={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(r[1],0,[["enter",a,t]]),r[2]!==0){const d=To(t.events,r[2]),f=To(t.events,r[3]),p={type:o,start:Object.assign({},d),end:Object.assign({},f)};if(e.add(r[2],0,[["enter",p,t]]),n!==2){const m=t.events[r[2]],x=t.events[r[3]];if(m[1].end=Object.assign({},x[1].end),m[1].type="chunkText",m[1].contentType="text",r[3]>r[2]+1){const b=r[2]+1,v=r[3]-r[2]-1;e.add(b,v,[])}}e.add(r[3]+1,0,[["exit",p,t]])}return i!==void 0&&(a.end=Object.assign({},To(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function e5(e,t,r,n,i){const a=[],s=To(t.events,r);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),n.end=Object.assign({},s),a.push(["exit",n,t]),e.add(r+1,0,a)}function To(e,t){const r=e[t],n=r[0]==="enter"?"start":"end";return r[1][n]}const yU={name:"tasklistCheck",tokenize:vU};function bU(){return{text:{91:yU}}}function vU(e,t,r){const n=this;return i;function i(u){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return Vt(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):r(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):r(u)}function o(u){return Ge(u)?t(u):gt(u)?e.check({tokenize:wU},t,r)(u):r(u)}}function wU(e,t,r){return Ct(e,n,"whitespace");function n(i){return i===null?r(i):t(i)}}function kU(e){return yN([Yq(),nU(),dU(e),gU(),bU()])}const SU={};function CU(e){const t=this,r=e||SU,n=t.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),a=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(kU(r)),a.push(qq()),s.push(Uq(r))}function _U({choices:e,onSelect:t}){return h.jsx("div",{className:"mt-8 flex flex-wrap gap-4 justify-center",children:e.map((r,n)=>h.jsxs("button",{onClick:()=>t(r.goto),className:`group px-6 py-4 bg-gradient-to-r from-theme-primary to-theme-accent
143
- text-white rounded-xl font-medium
144
- hover:opacity-90
145
- shadow-lg shadow-[rgba(var(--color-primary-rgb),0.25)]
146
- hover:shadow-xl hover:shadow-[rgba(var(--color-primary-rgb),0.4)]
147
- transition-all duration-300
148
- border border-[rgba(var(--color-primary-rgb),0.3)]
149
- flex flex-col items-center min-w-[180px]
150
- transform hover:scale-105`,children:[h.jsx("span",{className:"text-base font-semibold",children:r.label}),r.description&&h.jsx("span",{className:"text-xs text-white/70 mt-1 group-hover:text-white/90 transition-colors",children:r.description})]},n))})}const TU="modulepreload",EU=function(e){return"/"+e},t5={},Ot=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){let s=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),u=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=s(r.map(d=>{if(d=EU(d),d in t5)return;t5[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":TU,f||(m.as="script"),m.crossOrigin="",m.href=d,u&&m.setAttribute("nonce",u),document.head.appendChild(m),f)return new Promise((x,b)=>{m.addEventListener("load",x),m.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return t().catch(a)})};var r5={name:"mermaid",version:"11.12.2",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",type:"module",module:"./dist/mermaid.core.mjs",types:"./dist/mermaid.d.ts",exports:{".":{types:"./dist/mermaid.d.ts",import:"./dist/mermaid.core.mjs",default:"./dist/mermaid.core.mjs"},"./*":"./*"},keywords:["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph","mindmap","packet diagram","c4 diagram","er diagram","pie chart","pie diagram","quadrant chart","requirement diagram","graph"],scripts:{clean:"rimraf dist",dev:"pnpm -w dev","docs:code":"typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup","docs:build":"rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts","docs:verify":"pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify","docs:pre:vitepress":"pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts","docs:build:vitepress":"pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing","docs:dev":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:dev:docker":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:serve":"pnpm docs:build:vitepress && vitepress serve src/vitepress","docs:spellcheck":'cspell "src/docs/**/*.md"',"docs:release-version":"tsx scripts/update-release-version.mts","docs:verify-version":"tsx scripts/update-release-version.mts --verify","types:build-config":"tsx scripts/create-types-from-json-schema.mts","types:verify-config":"tsx scripts/create-types-from-json-schema.mts --verify",checkCircle:"npx madge --circular ./src",prepublishOnly:"pnpm docs:verify-version"},repository:{type:"git",url:"https://github.com/mermaid-js/mermaid"},author:"Knut Sveidqvist",license:"MIT",standard:{ignore:["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],globals:["page"]},dependencies:{"@braintree/sanitize-url":"^7.1.1","@iconify/utils":"^3.0.1","@mermaid-js/parser":"workspace:^","@types/d3":"^7.4.3",cytoscape:"^3.29.3","cytoscape-cose-bilkent":"^4.1.0","cytoscape-fcose":"^2.2.0",d3:"^7.9.0","d3-sankey":"^0.12.3","dagre-d3-es":"7.0.13",dayjs:"^1.11.18",dompurify:"^3.2.5",katex:"^0.16.22",khroma:"^2.1.0","lodash-es":"^4.17.21",marked:"^16.2.1",roughjs:"^4.6.6",stylis:"^4.3.6","ts-dedent":"^2.2.0",uuid:"^11.1.0"},devDependencies:{"@adobe/jsonschema2md":"^8.0.5","@iconify/types":"^2.0.0","@types/cytoscape":"^3.21.9","@types/cytoscape-fcose":"^2.2.4","@types/d3-sankey":"^0.12.4","@types/d3-scale":"^4.0.9","@types/d3-scale-chromatic":"^3.1.0","@types/d3-selection":"^3.0.11","@types/d3-shape":"^3.1.7","@types/jsdom":"^21.1.7","@types/katex":"^0.16.7","@types/lodash-es":"^4.17.12","@types/micromatch":"^4.0.9","@types/stylis":"^4.2.7","@types/uuid":"^10.0.0",ajv:"^8.17.1",canvas:"^3.1.2",chokidar:"3.6.0",concurrently:"^9.1.2","csstree-validator":"^4.0.1",globby:"^14.1.0",jison:"^0.4.18","js-base64":"^3.7.8",jsdom:"^26.1.0","json-schema-to-typescript":"^15.0.4",micromatch:"^4.0.8","path-browserify":"^1.0.1",prettier:"^3.5.3",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-gfm":"^4.0.1",rimraf:"^6.0.1","start-server-and-test":"^2.0.13","type-fest":"^4.35.0",typedoc:"^0.28.12","typedoc-plugin-markdown":"^4.8.1",typescript:"~5.7.3","unist-util-flatmap":"^1.0.0","unist-util-visit":"^5.0.0",vitepress:"^1.6.4","vitepress-plugin-search":"1.0.4-alpha.22"},files:["dist/","README.md"],publishConfig:{access:"public"}},h0={exports:{}},NU=h0.exports,n5;function jU(){return n5||(n5=1,(function(e,t){(function(r,n){e.exports=n()})(NU,(function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",u="hour",d="day",f="week",p="month",m="quarter",x="year",b="date",v="Invalid Date",k=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var U=["th","st","nd","rd"],R=B%100;return"["+B+(U[(R-20)%10]||U[R]||U[0])+"]"}},T=function(B,U,R){var H=String(B);return!H||H.length>=U?B:""+Array(U+1-H.length).join(R)+B},j={s:T,z:function(B){var U=-B.utcOffset(),R=Math.abs(U),H=Math.floor(R/60),V=R%60;return(U<=0?"+":"-")+T(H,2,"0")+":"+T(V,2,"0")},m:function B(U,R){if(U.date()<R.date())return-B(R,U);var H=12*(R.year()-U.year())+(R.month()-U.month()),V=U.clone().add(H,p),Q=R-V<0,A=U.clone().add(H+(Q?-1:1),p);return+(-(H+(R-V)/(Q?V-A:A-V))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:p,y:x,w:f,d,D:b,h:u,m:o,s,ms:a,Q:m}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},L="en",E={};E[L]=C;var M="$isDayjsObject",I=function(B){return B instanceof W||!(!B||!B[M])},P=function B(U,R,H){var V;if(!U)return L;if(typeof U=="string"){var Q=U.toLowerCase();E[Q]&&(V=Q),R&&(E[Q]=R,V=Q);var A=U.split("-");if(!V&&A.length>1)return B(A[0])}else{var D=U.name;E[D]=U,V=D}return!H&&V&&(L=V),V||!H&&L},z=function(B,U){if(I(B))return B.clone();var R=typeof U=="object"?U:{};return R.date=B,R.args=arguments,new W(R)},$=j;$.l=P,$.i=I,$.w=function(B,U){return z(B,{locale:U.$L,utc:U.$u,x:U.$x,$offset:U.$offset})};var W=(function(){function B(R){this.$L=P(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[M]=!0}var U=B.prototype;return U.parse=function(R){this.$d=(function(H){var V=H.date,Q=H.utc;if(V===null)return new Date(NaN);if($.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var A=V.match(k);if(A){var D=A[2]-1||0,G=(A[7]||"0").substring(0,3);return Q?new Date(Date.UTC(A[1],D,A[3]||1,A[4]||0,A[5]||0,A[6]||0,G)):new Date(A[1],D,A[3]||1,A[4]||0,A[5]||0,A[6]||0,G)}}return new Date(V)})(R),this.init()},U.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},U.$utils=function(){return $},U.isValid=function(){return this.$d.toString()!==v},U.isSame=function(R,H){var V=z(R);return this.startOf(H)<=V&&V<=this.endOf(H)},U.isAfter=function(R,H){return z(R)<this.startOf(H)},U.isBefore=function(R,H){return this.endOf(H)<z(R)},U.$g=function(R,H,V){return $.u(R)?this[H]:this.set(V,R)},U.unix=function(){return Math.floor(this.valueOf()/1e3)},U.valueOf=function(){return this.$d.getTime()},U.startOf=function(R,H){var V=this,Q=!!$.u(H)||H,A=$.p(R),D=function(oe,fe){var xe=$.w(V.$u?Date.UTC(V.$y,fe,oe):new Date(V.$y,fe,oe),V);return Q?xe:xe.endOf(d)},G=function(oe,fe){return $.w(V.toDate()[oe].apply(V.toDate("s"),(Q?[0,0,0,0]:[23,59,59,999]).slice(fe)),V)},q=this.$W,Z=this.$M,re=this.$D,J="set"+(this.$u?"UTC":"");switch(A){case x:return Q?D(1,0):D(31,11);case p:return Q?D(1,Z):D(0,Z+1);case f:var ie=this.$locale().weekStart||0,ne=(q<ie?q+7:q)-ie;return D(Q?re-ne:re+(6-ne),Z);case d:case b:return G(J+"Hours",0);case u:return G(J+"Minutes",1);case o:return G(J+"Seconds",2);case s:return G(J+"Milliseconds",3);default:return this.clone()}},U.endOf=function(R){return this.startOf(R,!1)},U.$set=function(R,H){var V,Q=$.p(R),A="set"+(this.$u?"UTC":""),D=(V={},V[d]=A+"Date",V[b]=A+"Date",V[p]=A+"Month",V[x]=A+"FullYear",V[u]=A+"Hours",V[o]=A+"Minutes",V[s]=A+"Seconds",V[a]=A+"Milliseconds",V)[Q],G=Q===d?this.$D+(H-this.$W):H;if(Q===p||Q===x){var q=this.clone().set(b,1);q.$d[D](G),q.init(),this.$d=q.set(b,Math.min(this.$D,q.daysInMonth())).$d}else D&&this.$d[D](G);return this.init(),this},U.set=function(R,H){return this.clone().$set(R,H)},U.get=function(R){return this[$.p(R)]()},U.add=function(R,H){var V,Q=this;R=Number(R);var A=$.p(H),D=function(Z){var re=z(Q);return $.w(re.date(re.date()+Math.round(Z*R)),Q)};if(A===p)return this.set(p,this.$M+R);if(A===x)return this.set(x,this.$y+R);if(A===d)return D(1);if(A===f)return D(7);var G=(V={},V[o]=n,V[u]=i,V[s]=r,V)[A]||1,q=this.$d.getTime()+R*G;return $.w(q,this)},U.subtract=function(R,H){return this.add(-1*R,H)},U.format=function(R){var H=this,V=this.$locale();if(!this.isValid())return V.invalidDate||v;var Q=R||"YYYY-MM-DDTHH:mm:ssZ",A=$.z(this),D=this.$H,G=this.$m,q=this.$M,Z=V.weekdays,re=V.months,J=V.meridiem,ie=function(fe,xe,de,ge){return fe&&(fe[xe]||fe(H,Q))||de[xe].slice(0,ge)},ne=function(fe){return $.s(D%12||12,fe,"0")},oe=J||function(fe,xe,de){var ge=fe<12?"AM":"PM";return de?ge.toLowerCase():ge};return Q.replace(w,(function(fe,xe){return xe||(function(de){switch(de){case"YY":return String(H.$y).slice(-2);case"YYYY":return $.s(H.$y,4,"0");case"M":return q+1;case"MM":return $.s(q+1,2,"0");case"MMM":return ie(V.monthsShort,q,re,3);case"MMMM":return ie(re,q);case"D":return H.$D;case"DD":return $.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return ie(V.weekdaysMin,H.$W,Z,2);case"ddd":return ie(V.weekdaysShort,H.$W,Z,3);case"dddd":return Z[H.$W];case"H":return String(D);case"HH":return $.s(D,2,"0");case"h":return ne(1);case"hh":return ne(2);case"a":return oe(D,G,!0);case"A":return oe(D,G,!1);case"m":return String(G);case"mm":return $.s(G,2,"0");case"s":return String(H.$s);case"ss":return $.s(H.$s,2,"0");case"SSS":return $.s(H.$ms,3,"0");case"Z":return A}return null})(fe)||A.replace(":","")}))},U.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},U.diff=function(R,H,V){var Q,A=this,D=$.p(H),G=z(R),q=(G.utcOffset()-this.utcOffset())*n,Z=this-G,re=function(){return $.m(A,G)};switch(D){case x:Q=re()/12;break;case p:Q=re();break;case m:Q=re()/3;break;case f:Q=(Z-q)/6048e5;break;case d:Q=(Z-q)/864e5;break;case u:Q=Z/i;break;case o:Q=Z/n;break;case s:Q=Z/r;break;default:Q=Z}return V?Q:$.a(Q)},U.daysInMonth=function(){return this.endOf(p).$D},U.$locale=function(){return E[this.$L]},U.locale=function(R,H){if(!R)return this.$L;var V=this.clone(),Q=P(R,H,!0);return Q&&(V.$L=Q),V},U.clone=function(){return $.w(this.$d,this)},U.toDate=function(){return new Date(this.valueOf())},U.toJSON=function(){return this.isValid()?this.toISOString():null},U.toISOString=function(){return this.$d.toISOString()},U.toString=function(){return this.$d.toUTCString()},B})(),Y=W.prototype;return z.prototype=Y,[["$ms",a],["$s",s],["$m",o],["$H",u],["$W",d],["$M",p],["$y",x],["$D",b]].forEach((function(B){Y[B[1]]=function(U){return this.$g(U,B[0],B[1])}})),z.extend=function(B,U){return B.$i||(B(U,W,z),B.$i=!0),z},z.locale=P,z.isDayjs=I,z.unix=function(B){return z(1e3*B)},z.en=E[L],z.Ls=E,z.p={},z}))})(h0)),h0.exports}var AU=jU();const MU=gc(AU);var o3=Object.defineProperty,O=(e,t)=>o3(e,"name",{value:t,configurable:!0}),LU=(e,t)=>{for(var r in t)o3(e,r,{get:t[r],enumerable:!0})},Ca={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},we={trace:O((...e)=>{},"trace"),debug:O((...e)=>{},"debug"),info:O((...e)=>{},"info"),warn:O((...e)=>{},"warn"),error:O((...e)=>{},"error"),fatal:O((...e)=>{},"fatal")},Mv=O(function(e="fatal"){let t=Ca.fatal;typeof e=="string"?e.toLowerCase()in Ca&&(t=Ca[e]):typeof e=="number"&&(t=e),we.trace=()=>{},we.debug=()=>{},we.info=()=>{},we.warn=()=>{},we.error=()=>{},we.fatal=()=>{},t<=Ca.fatal&&(we.fatal=console.error?console.error.bind(console,fi("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",fi("FATAL"))),t<=Ca.error&&(we.error=console.error?console.error.bind(console,fi("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",fi("ERROR"))),t<=Ca.warn&&(we.warn=console.warn?console.warn.bind(console,fi("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",fi("WARN"))),t<=Ca.info&&(we.info=console.info?console.info.bind(console,fi("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",fi("INFO"))),t<=Ca.debug&&(we.debug=console.debug?console.debug.bind(console,fi("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",fi("DEBUG"))),t<=Ca.trace&&(we.trace=console.debug?console.debug.bind(console,fi("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",fi("TRACE")))},"setLogLevel"),fi=O(e=>`%c${MU().format("ss.SSS")} : ${e} : `,"format");const f0={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},n)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const i=r<.5?r*(1+t):r+t-r*t,a=2*r-i;switch(n){case"r":return f0.hue2rgb(a,i,e+1/3)*255;case"g":return f0.hue2rgb(a,i,e)*255;case"b":return f0.hue2rgb(a,i,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},n)=>{e/=255,t/=255,r/=255;const i=Math.max(e,t,r),a=Math.min(e,t,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,u=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return u*100;switch(i){case e:return((t-r)/o+(t<r?6:0))*60;case t:return((r-e)/o+2)*60;case r:return((e-t)/o+4)*60;default:return-1}}},DU={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},RU={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},Je={channel:f0,lang:DU,unit:RU},ds={};for(let e=0;e<=255;e++)ds[e]=Je.unit.dec2hex(e);const an={ALL:0,RGB:1,HSL:2};class OU{constructor(){this.type=an.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=an.ALL}is(t){return this.type===t}}class BU{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new OU}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=an.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:n,l:i}=t;r===void 0&&(t.h=Je.channel.rgb2hsl(t,"h")),n===void 0&&(t.s=Je.channel.rgb2hsl(t,"s")),i===void 0&&(t.l=Je.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:n,b:i}=t;r===void 0&&(t.r=Je.channel.hsl2rgb(t,"r")),n===void 0&&(t.g=Je.channel.hsl2rgb(t,"g")),i===void 0&&(t.b=Je.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(an.HSL)&&r!==void 0?r:(this._ensureHSL(),Je.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(an.HSL)&&r!==void 0?r:(this._ensureHSL(),Je.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(an.HSL)&&r!==void 0?r:(this._ensureHSL(),Je.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(an.RGB)&&r!==void 0?r:(this._ensureRGB(),Je.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(an.RGB)&&r!==void 0?r:(this._ensureRGB(),Je.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(an.RGB)&&r!==void 0?r:(this._ensureRGB(),Je.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(an.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(an.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(an.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(an.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(an.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(an.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Kp=new BU({r:0,g:0,b:0,a:0},"transparent"),Bo={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Bo.re);if(!t)return;const r=t[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,u=s?8:4,d=a?0:-1,f=s?255:15;return Kp.set({r:(n>>u*(d+3)&f)*o,g:(n>>u*(d+2)&f)*o,b:(n>>u*(d+1)&f)*o,a:a?(n&f)*o/255:1},e)},stringify:e=>{const{r:t,g:r,b:n,a:i}=e;return i<1?`#${ds[Math.round(t)]}${ds[Math.round(r)]}${ds[Math.round(n)]}${ds[Math.round(i*255)]}`:`#${ds[Math.round(t)]}${ds[Math.round(r)]}${ds[Math.round(n)]}`}},al={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(al.hueRe);if(t){const[,r,n]=t;switch(n){case"grad":return Je.channel.clamp.h(parseFloat(r)*.9);case"rad":return Je.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Je.channel.clamp.h(parseFloat(r)*360)}}return Je.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(al.re);if(!r)return;const[,n,i,a,s,o]=r;return Kp.set({h:al._hue2deg(n),s:Je.channel.clamp.s(parseFloat(i)),l:Je.channel.clamp.l(parseFloat(a)),a:s?Je.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},e)},stringify:e=>{const{h:t,s:r,l:n,a:i}=e;return i<1?`hsla(${Je.lang.round(t)}, ${Je.lang.round(r)}%, ${Je.lang.round(n)}%, ${i})`:`hsl(${Je.lang.round(t)}, ${Je.lang.round(r)}%, ${Je.lang.round(n)}%)`}},od={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=od.colors[e];if(t)return Bo.parse(t)},stringify:e=>{const t=Bo.stringify(e);for(const r in od.colors)if(od.colors[r]===t)return r}},Xu={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Xu.re);if(!r)return;const[,n,i,a,s,o,u,d,f]=r;return Kp.set({r:Je.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Je.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Je.channel.clamp.b(u?parseFloat(o)*2.55:parseFloat(o)),a:d?Je.channel.clamp.a(f?parseFloat(d)/100:parseFloat(d)):1},e)},stringify:e=>{const{r:t,g:r,b:n,a:i}=e;return i<1?`rgba(${Je.lang.round(t)}, ${Je.lang.round(r)}, ${Je.lang.round(n)}, ${Je.lang.round(i)})`:`rgb(${Je.lang.round(t)}, ${Je.lang.round(r)}, ${Je.lang.round(n)})`}},Ki={format:{keyword:od,hex:Bo,rgb:Xu,rgba:Xu,hsl:al,hsla:al},parse:e=>{if(typeof e!="string")return e;const t=Bo.parse(e)||Xu.parse(e)||al.parse(e)||od.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(an.HSL)||e.data.r===void 0?al.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Xu.stringify(e):Bo.stringify(e)},c3=(e,t)=>{const r=Ki.parse(e);for(const n in t)r[n]=Je.channel.clamp[n](t[n]);return Ki.stringify(r)},cd=(e,t,r=0,n=1)=>{if(typeof e!="number")return c3(e,{a:t});const i=Kp.set({r:Je.channel.clamp.r(e),g:Je.channel.clamp.g(t),b:Je.channel.clamp.b(r),a:Je.channel.clamp.a(n)});return Ki.stringify(i)},$U=e=>{const{r:t,g:r,b:n}=Ki.parse(e),i=.2126*Je.channel.toLinear(t)+.7152*Je.channel.toLinear(r)+.0722*Je.channel.toLinear(n);return Je.lang.round(i)},zU=e=>$U(e)>=.5,sh=e=>!zU(e),u3=(e,t,r)=>{const n=Ki.parse(e),i=n[t],a=Je.channel.clamp[t](i+r);return i!==a&&(n[t]=a),Ki.stringify(n)},Re=(e,t)=>u3(e,"l",t),Ve=(e,t)=>u3(e,"l",-t),se=(e,t)=>{const r=Ki.parse(e),n={};for(const i in t)t[i]&&(n[i]=r[i]+t[i]);return c3(e,n)},IU=(e,t,r=50)=>{const{r:n,g:i,b:a,a:s}=Ki.parse(e),{r:o,g:u,b:d,a:f}=Ki.parse(t),p=r/100,m=p*2-1,x=s-f,v=((m*x===-1?m:(m+x)/(1+m*x))+1)/2,k=1-v,w=n*v+o*k,C=i*v+u*k,T=a*v+d*k,j=s*p+f*(1-p);return cd(w,C,T,j)},Ee=(e,t=100)=>{const r=Ki.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,IU(r,e,t)};/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:d3,setPrototypeOf:i5,isFrozen:FU,getPrototypeOf:PU,getOwnPropertyDescriptor:HU}=Object;let{freeze:Sn,seal:mi,create:Lb}=Object,{apply:Db,construct:Rb}=typeof Reflect<"u"&&Reflect;Sn||(Sn=function(t){return t});mi||(mi=function(t){return t});Db||(Db=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];return t.apply(r,i)});Rb||(Rb=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return new t(...n)});const Pf=Cn(Array.prototype.forEach),qU=Cn(Array.prototype.lastIndexOf),a5=Cn(Array.prototype.pop),Mu=Cn(Array.prototype.push),UU=Cn(Array.prototype.splice),p0=Cn(String.prototype.toLowerCase),Sy=Cn(String.prototype.toString),Cy=Cn(String.prototype.match),Lu=Cn(String.prototype.replace),VU=Cn(String.prototype.indexOf),WU=Cn(String.prototype.trim),Ci=Cn(Object.prototype.hasOwnProperty),mn=Cn(RegExp.prototype.test),Du=YU(TypeError);function Cn(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return Db(e,t,n)}}function YU(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Rb(e,r)}}function ht(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p0;i5&&i5(e,null);let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){const a=r(i);a!==i&&(FU(t)||(t[n]=a),i=a)}e[i]=!0}return e}function GU(e){for(let t=0;t<e.length;t++)Ci(e,t)||(e[t]=null);return e}function Ui(e){const t=Lb(null);for(const[r,n]of d3(e))Ci(e,r)&&(Array.isArray(n)?t[r]=GU(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Ui(n):t[r]=n);return t}function Ru(e,t){for(;e!==null;){const n=HU(e,t);if(n){if(n.get)return Cn(n.get);if(typeof n.value=="function")return Cn(n.value)}e=PU(e)}function r(){return null}return r}const s5=Sn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),_y=Sn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ty=Sn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),XU=Sn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ey=Sn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),QU=Sn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),l5=Sn(["#text"]),o5=Sn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ny=Sn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),c5=Sn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Hf=Sn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ZU=mi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),KU=mi(/<%[\w\W]*|[\w\W]*%>/gm),JU=mi(/\$\{[\w\W]*/gm),eV=mi(/^data-[\-\w.\u00B7-\uFFFF]+$/),tV=mi(/^aria-[\-\w]+$/),h3=mi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),rV=mi(/^(?:\w+script|data):/i),nV=mi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),f3=mi(/^html$/i),iV=mi(/^[a-z][.\w]*(-[.\w]+)+$/i);var u5=Object.freeze({__proto__:null,ARIA_ATTR:tV,ATTR_WHITESPACE:nV,CUSTOM_ELEMENT:iV,DATA_ATTR:eV,DOCTYPE_NAME:f3,ERB_EXPR:KU,IS_ALLOWED_URI:h3,IS_SCRIPT_OR_DATA:rV,MUSTACHE_EXPR:ZU,TMPLIT_EXPR:JU});const Ou={element:1,text:3,progressingInstruction:7,comment:8,document:9},aV=function(){return typeof window>"u"?null:window},sV=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return t.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},d5=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function p3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:aV();const t=Be=>p3(Be);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==Ou.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,i=n.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:o,Element:u,NodeFilter:d,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:m,trustedTypes:x}=e,b=u.prototype,v=Ru(b,"cloneNode"),k=Ru(b,"remove"),w=Ru(b,"nextSibling"),C=Ru(b,"childNodes"),T=Ru(b,"parentNode");if(typeof s=="function"){const Be=r.createElement("template");Be.content&&Be.content.ownerDocument&&(r=Be.content.ownerDocument)}let j,L="";const{implementation:E,createNodeIterator:M,createDocumentFragment:I,getElementsByTagName:P}=r,{importNode:z}=n;let $=d5();t.isSupported=typeof d3=="function"&&typeof T=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:W,ERB_EXPR:Y,TMPLIT_EXPR:B,DATA_ATTR:U,ARIA_ATTR:R,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:Q}=u5;let{IS_ALLOWED_URI:A}=u5,D=null;const G=ht({},[...s5,..._y,...Ty,...Ey,...l5]);let q=null;const Z=ht({},[...o5,...Ny,...c5,...Hf]);let re=Object.seal(Lb(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),J=null,ie=null;const ne=Object.seal(Lb(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let oe=!0,fe=!0,xe=!1,de=!0,ge=!1,ke=!0,Te=!1,Ne=!1,Ke=!1,ut=!1,tt=!1,rt=!1,nt=!0,wt=!1;const xt="user-content-";let _e=!0,je=!1,le={},be=null;const Le=ht({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let We=null;const at=ht({},["audio","video","img","source","image","track"]);let Et=null;const Er=ht({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wt="http://www.w3.org/1998/Math/MathML",It="http://www.w3.org/2000/svg",Lt="http://www.w3.org/1999/xhtml";let dt=Lt,Kr=!1,xr=null;const As=ht({},[Wt,It,Lt],Sy);let Hn=ht({},["mi","mo","mn","ms","mtext"]),qn=ht({},["annotation-xml"]);const Xt=ht({},["title","style","font","a","script"]);let Bt=null;const lr=["application/xhtml+xml","text/html"],$r="text/html";let yt=null,Qt=null;const zr=r.createElement("form"),Ur=function(ee){return ee instanceof RegExp||ee instanceof Function},Zt=function(){let ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Qt&&Qt===ee)){if((!ee||typeof ee!="object")&&(ee={}),ee=Ui(ee),Bt=lr.indexOf(ee.PARSER_MEDIA_TYPE)===-1?$r:ee.PARSER_MEDIA_TYPE,yt=Bt==="application/xhtml+xml"?Sy:p0,D=Ci(ee,"ALLOWED_TAGS")?ht({},ee.ALLOWED_TAGS,yt):G,q=Ci(ee,"ALLOWED_ATTR")?ht({},ee.ALLOWED_ATTR,yt):Z,xr=Ci(ee,"ALLOWED_NAMESPACES")?ht({},ee.ALLOWED_NAMESPACES,Sy):As,Et=Ci(ee,"ADD_URI_SAFE_ATTR")?ht(Ui(Er),ee.ADD_URI_SAFE_ATTR,yt):Er,We=Ci(ee,"ADD_DATA_URI_TAGS")?ht(Ui(at),ee.ADD_DATA_URI_TAGS,yt):at,be=Ci(ee,"FORBID_CONTENTS")?ht({},ee.FORBID_CONTENTS,yt):Le,J=Ci(ee,"FORBID_TAGS")?ht({},ee.FORBID_TAGS,yt):Ui({}),ie=Ci(ee,"FORBID_ATTR")?ht({},ee.FORBID_ATTR,yt):Ui({}),le=Ci(ee,"USE_PROFILES")?ee.USE_PROFILES:!1,oe=ee.ALLOW_ARIA_ATTR!==!1,fe=ee.ALLOW_DATA_ATTR!==!1,xe=ee.ALLOW_UNKNOWN_PROTOCOLS||!1,de=ee.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ge=ee.SAFE_FOR_TEMPLATES||!1,ke=ee.SAFE_FOR_XML!==!1,Te=ee.WHOLE_DOCUMENT||!1,ut=ee.RETURN_DOM||!1,tt=ee.RETURN_DOM_FRAGMENT||!1,rt=ee.RETURN_TRUSTED_TYPE||!1,Ke=ee.FORCE_BODY||!1,nt=ee.SANITIZE_DOM!==!1,wt=ee.SANITIZE_NAMED_PROPS||!1,_e=ee.KEEP_CONTENT!==!1,je=ee.IN_PLACE||!1,A=ee.ALLOWED_URI_REGEXP||h3,dt=ee.NAMESPACE||Lt,Hn=ee.MATHML_TEXT_INTEGRATION_POINTS||Hn,qn=ee.HTML_INTEGRATION_POINTS||qn,re=ee.CUSTOM_ELEMENT_HANDLING||{},ee.CUSTOM_ELEMENT_HANDLING&&Ur(ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(re.tagNameCheck=ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ee.CUSTOM_ELEMENT_HANDLING&&Ur(ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(re.attributeNameCheck=ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ee.CUSTOM_ELEMENT_HANDLING&&typeof ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(re.allowCustomizedBuiltInElements=ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ge&&(fe=!1),tt&&(ut=!0),le&&(D=ht({},l5),q=[],le.html===!0&&(ht(D,s5),ht(q,o5)),le.svg===!0&&(ht(D,_y),ht(q,Ny),ht(q,Hf)),le.svgFilters===!0&&(ht(D,Ty),ht(q,Ny),ht(q,Hf)),le.mathMl===!0&&(ht(D,Ey),ht(q,c5),ht(q,Hf))),ee.ADD_TAGS&&(typeof ee.ADD_TAGS=="function"?ne.tagCheck=ee.ADD_TAGS:(D===G&&(D=Ui(D)),ht(D,ee.ADD_TAGS,yt))),ee.ADD_ATTR&&(typeof ee.ADD_ATTR=="function"?ne.attributeCheck=ee.ADD_ATTR:(q===Z&&(q=Ui(q)),ht(q,ee.ADD_ATTR,yt))),ee.ADD_URI_SAFE_ATTR&&ht(Et,ee.ADD_URI_SAFE_ATTR,yt),ee.FORBID_CONTENTS&&(be===Le&&(be=Ui(be)),ht(be,ee.FORBID_CONTENTS,yt)),ee.ADD_FORBID_CONTENTS&&(be===Le&&(be=Ui(be)),ht(be,ee.ADD_FORBID_CONTENTS,yt)),_e&&(D["#text"]=!0),Te&&ht(D,["html","head","body"]),D.table&&(ht(D,["tbody"]),delete J.tbody),ee.TRUSTED_TYPES_POLICY){if(typeof ee.TRUSTED_TYPES_POLICY.createHTML!="function")throw Du('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ee.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Du('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');j=ee.TRUSTED_TYPES_POLICY,L=j.createHTML("")}else j===void 0&&(j=sV(x,i)),j!==null&&typeof L=="string"&&(L=j.createHTML(""));Sn&&Sn(ee),Qt=ee}},Jr=ht({},[..._y,...Ty,...XU]),Ir=ht({},[...Ey,...QU]),en=function(ee){let Se=T(ee);(!Se||!Se.tagName)&&(Se={namespaceURI:dt,tagName:"template"});const Me=p0(ee.tagName),Tt=p0(Se.tagName);return xr[ee.namespaceURI]?ee.namespaceURI===It?Se.namespaceURI===Lt?Me==="svg":Se.namespaceURI===Wt?Me==="svg"&&(Tt==="annotation-xml"||Hn[Tt]):!!Jr[Me]:ee.namespaceURI===Wt?Se.namespaceURI===Lt?Me==="math":Se.namespaceURI===It?Me==="math"&&qn[Tt]:!!Ir[Me]:ee.namespaceURI===Lt?Se.namespaceURI===It&&!qn[Tt]||Se.namespaceURI===Wt&&!Hn[Tt]?!1:!Ir[Me]&&(Xt[Me]||!Jr[Me]):!!(Bt==="application/xhtml+xml"&&xr[ee.namespaceURI]):!1},or=function(ee){Mu(t.removed,{element:ee});try{T(ee).removeChild(ee)}catch{k(ee)}},Nr=function(ee,Se){try{Mu(t.removed,{attribute:Se.getAttributeNode(ee),from:Se})}catch{Mu(t.removed,{attribute:null,from:Se})}if(Se.removeAttribute(ee),ee==="is")if(ut||tt)try{or(Se)}catch{}else try{Se.setAttribute(ee,"")}catch{}},tn=function(ee){let Se=null,Me=null;if(Ke)ee="<remove></remove>"+ee;else{const lt=Cy(ee,/^[\r\n\t ]+/);Me=lt&&lt[0]}Bt==="application/xhtml+xml"&&dt===Lt&&(ee='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ee+"</body></html>");const Tt=j?j.createHTML(ee):ee;if(dt===Lt)try{Se=new m().parseFromString(Tt,Bt)}catch{}if(!Se||!Se.documentElement){Se=E.createDocument(dt,"template",null);try{Se.documentElement.innerHTML=Kr?L:Tt}catch{}}const Kt=Se.body||Se.documentElement;return ee&&Me&&Kt.insertBefore(r.createTextNode(Me),Kt.childNodes[0]||null),dt===Lt?P.call(Se,Te?"html":"body")[0]:Te?Se.documentElement:Kt},Un=function(ee){return M.call(ee.ownerDocument||ee,ee,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Fr=function(ee){return ee instanceof p&&(typeof ee.nodeName!="string"||typeof ee.textContent!="string"||typeof ee.removeChild!="function"||!(ee.attributes instanceof f)||typeof ee.removeAttribute!="function"||typeof ee.setAttribute!="function"||typeof ee.namespaceURI!="string"||typeof ee.insertBefore!="function"||typeof ee.hasChildNodes!="function")},cr=function(ee){return typeof o=="function"&&ee instanceof o};function Yt(Be,ee,Se){Pf(Be,Me=>{Me.call(t,ee,Se,Qt)})}const ni=function(ee){let Se=null;if(Yt($.beforeSanitizeElements,ee,null),Fr(ee))return or(ee),!0;const Me=yt(ee.nodeName);if(Yt($.uponSanitizeElement,ee,{tagName:Me,allowedTags:D}),ke&&ee.hasChildNodes()&&!cr(ee.firstElementChild)&&mn(/<[/\w!]/g,ee.innerHTML)&&mn(/<[/\w!]/g,ee.textContent)||ee.nodeType===Ou.progressingInstruction||ke&&ee.nodeType===Ou.comment&&mn(/<[/\w]/g,ee.data))return or(ee),!0;if(!(ne.tagCheck instanceof Function&&ne.tagCheck(Me))&&(!D[Me]||J[Me])){if(!J[Me]&&Ms(Me)&&(re.tagNameCheck instanceof RegExp&&mn(re.tagNameCheck,Me)||re.tagNameCheck instanceof Function&&re.tagNameCheck(Me)))return!1;if(_e&&!be[Me]){const Tt=T(ee)||ee.parentNode,Kt=C(ee)||ee.childNodes;if(Kt&&Tt){const lt=Kt.length;for(let jr=lt-1;jr>=0;--jr){const _n=v(Kt[jr],!0);_n.__removalCount=(ee.__removalCount||0)+1,Tt.insertBefore(_n,w(ee))}}}return or(ee),!0}return ee instanceof u&&!en(ee)||(Me==="noscript"||Me==="noembed"||Me==="noframes")&&mn(/<\/no(script|embed|frames)/i,ee.innerHTML)?(or(ee),!0):(ge&&ee.nodeType===Ou.text&&(Se=ee.textContent,Pf([W,Y,B],Tt=>{Se=Lu(Se,Tt," ")}),ee.textContent!==Se&&(Mu(t.removed,{element:ee.cloneNode()}),ee.textContent=Se)),Yt($.afterSanitizeElements,ee,null),!1)},aa=function(ee,Se,Me){if(nt&&(Se==="id"||Se==="name")&&(Me in r||Me in zr))return!1;if(!(fe&&!ie[Se]&&mn(U,Se))){if(!(oe&&mn(R,Se))){if(!(ne.attributeCheck instanceof Function&&ne.attributeCheck(Se,ee))){if(!q[Se]||ie[Se]){if(!(Ms(ee)&&(re.tagNameCheck instanceof RegExp&&mn(re.tagNameCheck,ee)||re.tagNameCheck instanceof Function&&re.tagNameCheck(ee))&&(re.attributeNameCheck instanceof RegExp&&mn(re.attributeNameCheck,Se)||re.attributeNameCheck instanceof Function&&re.attributeNameCheck(Se,ee))||Se==="is"&&re.allowCustomizedBuiltInElements&&(re.tagNameCheck instanceof RegExp&&mn(re.tagNameCheck,Me)||re.tagNameCheck instanceof Function&&re.tagNameCheck(Me))))return!1}else if(!Et[Se]){if(!mn(A,Lu(Me,V,""))){if(!((Se==="src"||Se==="xlink:href"||Se==="href")&&ee!=="script"&&VU(Me,"data:")===0&&We[ee])){if(!(xe&&!mn(H,Lu(Me,V,"")))){if(Me)return!1}}}}}}}return!0},Ms=function(ee){return ee!=="annotation-xml"&&Cy(ee,Q)},Ol=function(ee){Yt($.beforeSanitizeAttributes,ee,null);const{attributes:Se}=ee;if(!Se||Fr(ee))return;const Me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q,forceKeepAttr:void 0};let Tt=Se.length;for(;Tt--;){const Kt=Se[Tt],{name:lt,namespaceURI:jr,value:_n}=Kt,rn=yt(lt),ii=_n;let fr=lt==="value"?ii:WU(ii);if(Me.attrName=rn,Me.attrValue=fr,Me.keepAttr=!0,Me.forceKeepAttr=void 0,Yt($.uponSanitizeAttribute,ee,Me),fr=Me.attrValue,wt&&(rn==="id"||rn==="name")&&(Nr(lt,ee),fr=xt+fr),ke&&mn(/((--!?|])>)|<\/(style|title|textarea)/i,fr)){Nr(lt,ee);continue}if(rn==="attributename"&&Cy(fr,"href")){Nr(lt,ee);continue}if(Me.forceKeepAttr)continue;if(!Me.keepAttr){Nr(lt,ee);continue}if(!de&&mn(/\/>/i,fr)){Nr(lt,ee);continue}ge&&Pf([W,Y,B],Ls=>{fr=Lu(fr,Ls," ")});const $a=yt(ee.nodeName);if(!aa($a,rn,fr)){Nr(lt,ee);continue}if(j&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!jr)switch(x.getAttributeType($a,rn)){case"TrustedHTML":{fr=j.createHTML(fr);break}case"TrustedScriptURL":{fr=j.createScriptURL(fr);break}}if(fr!==ii)try{jr?ee.setAttributeNS(jr,lt,fr):ee.setAttribute(lt,fr),Fr(ee)?or(ee):a5(t.removed)}catch{Nr(lt,ee)}}Yt($.afterSanitizeAttributes,ee,null)},Bl=function Be(ee){let Se=null;const Me=Un(ee);for(Yt($.beforeSanitizeShadowDOM,ee,null);Se=Me.nextNode();)Yt($.uponSanitizeShadowNode,Se,null),ni(Se),Ol(Se),Se.content instanceof a&&Be(Se.content);Yt($.afterSanitizeShadowDOM,ee,null)};return t.sanitize=function(Be){let ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Se=null,Me=null,Tt=null,Kt=null;if(Kr=!Be,Kr&&(Be="<!-->"),typeof Be!="string"&&!cr(Be))if(typeof Be.toString=="function"){if(Be=Be.toString(),typeof Be!="string")throw Du("dirty is not a string, aborting")}else throw Du("toString is not a function");if(!t.isSupported)return Be;if(Ne||Zt(ee),t.removed=[],typeof Be=="string"&&(je=!1),je){if(Be.nodeName){const _n=yt(Be.nodeName);if(!D[_n]||J[_n])throw Du("root node is forbidden and cannot be sanitized in-place")}}else if(Be instanceof o)Se=tn("<!---->"),Me=Se.ownerDocument.importNode(Be,!0),Me.nodeType===Ou.element&&Me.nodeName==="BODY"||Me.nodeName==="HTML"?Se=Me:Se.appendChild(Me);else{if(!ut&&!ge&&!Te&&Be.indexOf("<")===-1)return j&&rt?j.createHTML(Be):Be;if(Se=tn(Be),!Se)return ut?null:rt?L:""}Se&&Ke&&or(Se.firstChild);const lt=Un(je?Be:Se);for(;Tt=lt.nextNode();)ni(Tt),Ol(Tt),Tt.content instanceof a&&Bl(Tt.content);if(je)return Be;if(ut){if(tt)for(Kt=I.call(Se.ownerDocument);Se.firstChild;)Kt.appendChild(Se.firstChild);else Kt=Se;return(q.shadowroot||q.shadowrootmode)&&(Kt=z.call(n,Kt,!0)),Kt}let jr=Te?Se.outerHTML:Se.innerHTML;return Te&&D["!doctype"]&&Se.ownerDocument&&Se.ownerDocument.doctype&&Se.ownerDocument.doctype.name&&mn(f3,Se.ownerDocument.doctype.name)&&(jr="<!DOCTYPE "+Se.ownerDocument.doctype.name+`>
151
- `+jr),ge&&Pf([W,Y,B],_n=>{jr=Lu(jr,_n," ")}),j&&rt?j.createHTML(jr):jr},t.setConfig=function(){let Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zt(Be),Ne=!0},t.clearConfig=function(){Qt=null,Ne=!1},t.isValidAttribute=function(Be,ee,Se){Qt||Zt({});const Me=yt(Be),Tt=yt(ee);return aa(Me,Tt,Se)},t.addHook=function(Be,ee){typeof ee=="function"&&Mu($[Be],ee)},t.removeHook=function(Be,ee){if(ee!==void 0){const Se=qU($[Be],ee);return Se===-1?void 0:UU($[Be],Se,1)[0]}return a5($[Be])},t.removeHooks=function(Be){$[Be]=[]},t.removeAllHooks=function(){$=d5()},t}var Ko=p3(),g3=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,ud=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,lV=/\s*%%.*\n/gm,Ho,m3=(Ho=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},O(Ho,"UnknownDiagramError"),Ho),ml={},Lv=O(function(e,t){e=e.replace(g3,"").replace(ud,"").replace(lV,`
152
- `);for(const[r,{detector:n}]of Object.entries(ml))if(n(e,t))return r;throw new m3(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Ob=O((...e)=>{for(const{id:t,detector:r,loader:n}of e)x3(t,r,n)},"registerLazyLoadedDiagrams"),x3=O((e,t,r)=>{ml[e]&&we.warn(`Detector with key ${e} already exists. Overwriting.`),ml[e]={detector:t,loader:r},we.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),oV=O(e=>ml[e].loader,"getDiagramLoader"),Bb=O((e,t,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(a=>Bb(e,a,i)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(a=>{e.includes(a)||e.push(a)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(a=>{typeof t[a]=="object"&&(e[a]===void 0||typeof e[a]=="object")?(e[a]===void 0&&(e[a]=Array.isArray(t[a])?[]:{}),e[a]=Bb(e[a],t[a],{depth:r-1,clobber:n})):(n||typeof e[a]!="object"&&typeof t[a]!="object")&&(e[a]=t[a])}),e)},"assignWithDepth"),Rr=Bb,Jp="#ffffff",eg="#f2f2f2",vn=O((e,t)=>t?se(e,{s:-40,l:10}):se(e,{s:-40,l:-10}),"mkBorder"),qo,cV=(qo=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){var r,n,i,a,s,o,u,d,f,p,m,x,b,v,k,w,C,T,j,L,E;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||se(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||se(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||vn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||vn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||vn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||vn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Ee(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Ee(this.tertiaryColor),this.lineColor=this.lineColor||Ee(this.background),this.arrowheadColor=this.arrowheadColor||Ee(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Ve(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Ve(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Ee(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Re(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||Ve(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Ve(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Re(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Re(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||se(this.primaryColor,{h:30}),this.cScale4=this.cScale4||se(this.primaryColor,{h:60}),this.cScale5=this.cScale5||se(this.primaryColor,{h:90}),this.cScale6=this.cScale6||se(this.primaryColor,{h:120}),this.cScale7=this.cScale7||se(this.primaryColor,{h:150}),this.cScale8=this.cScale8||se(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||se(this.primaryColor,{h:270}),this.cScale10=this.cScale10||se(this.primaryColor,{h:300}),this.cScale11=this.cScale11||se(this.primaryColor,{h:330}),this.darkMode)for(let M=0;M<this.THEME_COLOR_LIMIT;M++)this["cScale"+M]=Ve(this["cScale"+M],75);else for(let M=0;M<this.THEME_COLOR_LIMIT;M++)this["cScale"+M]=Ve(this["cScale"+M],25);for(let M=0;M<this.THEME_COLOR_LIMIT;M++)this["cScaleInv"+M]=this["cScaleInv"+M]||Ee(this["cScale"+M]);for(let M=0;M<this.THEME_COLOR_LIMIT;M++)this.darkMode?this["cScalePeer"+M]=this["cScalePeer"+M]||Re(this["cScale"+M],10):this["cScalePeer"+M]=this["cScalePeer"+M]||Ve(this["cScale"+M],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let M=0;M<this.THEME_COLOR_LIMIT;M++)this["cScaleLabel"+M]=this["cScaleLabel"+M]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let M=0;M<5;M++)this["surface"+M]=this["surface"+M]||se(this.mainBkg,{h:180,s:-15,l:t*(5+M*3)}),this["surfacePeer"+M]=this["surfacePeer"+M]||se(this.mainBkg,{h:180,s:-15,l:t*(8+M*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||se(this.primaryColor,{h:64}),this.fillType3=this.fillType3||se(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||se(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||se(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||se(this.primaryColor,{h:128}),this.fillType7=this.fillType7||se(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||se(this.primaryColor,{l:-10}),this.pie5=this.pie5||se(this.secondaryColor,{l:-10}),this.pie6=this.pie6||se(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||se(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||se(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||se(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||se(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||se(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||se(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.radar={axisColor:((r=this.radar)==null?void 0:r.axisColor)||this.lineColor,axisStrokeWidth:((n=this.radar)==null?void 0:n.axisStrokeWidth)||2,axisLabelFontSize:((i=this.radar)==null?void 0:i.axisLabelFontSize)||12,curveOpacity:((a=this.radar)==null?void 0:a.curveOpacity)||.5,curveStrokeWidth:((s=this.radar)==null?void 0:s.curveStrokeWidth)||2,graticuleColor:((o=this.radar)==null?void 0:o.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((u=this.radar)==null?void 0:u.graticuleStrokeWidth)||1,graticuleOpacity:((d=this.radar)==null?void 0:d.graticuleOpacity)||.3,legendBoxSize:((f=this.radar)==null?void 0:f.legendBoxSize)||12,legendFontSize:((p=this.radar)==null?void 0:p.legendFontSize)||12},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||se(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||se(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||se(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||se(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||se(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||se(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||sh(this.quadrant1Fill)?Re(this.quadrant1Fill):Ve(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((m=this.xyChart)==null?void 0:m.backgroundColor)||this.background,titleColor:((x=this.xyChart)==null?void 0:x.titleColor)||this.primaryTextColor,xAxisTitleColor:((b=this.xyChart)==null?void 0:b.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((v=this.xyChart)==null?void 0:v.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((k=this.xyChart)==null?void 0:k.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((w=this.xyChart)==null?void 0:w.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((C=this.xyChart)==null?void 0:C.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((T=this.xyChart)==null?void 0:T.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((j=this.xyChart)==null?void 0:j.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((L=this.xyChart)==null?void 0:L.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((E=this.xyChart)==null?void 0:E.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Ve(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||se(this.primaryColor,{h:-30}),this.git4=this.git4||se(this.primaryColor,{h:-60}),this.git5=this.git5||se(this.primaryColor,{h:-90}),this.git6=this.git6||se(this.primaryColor,{h:60}),this.git7=this.git7||se(this.primaryColor,{h:120}),this.darkMode?(this.git0=Re(this.git0,25),this.git1=Re(this.git1,25),this.git2=Re(this.git2,25),this.git3=Re(this.git3,25),this.git4=Re(this.git4,25),this.git5=Re(this.git5,25),this.git6=Re(this.git6,25),this.git7=Re(this.git7,25)):(this.git0=Ve(this.git0,25),this.git1=Ve(this.git1,25),this.git2=Ve(this.git2,25),this.git3=Ve(this.git3,25),this.git4=Ve(this.git4,25),this.git5=Ve(this.git5,25),this.git6=Ve(this.git6,25),this.git7=Ve(this.git7,25)),this.gitInv0=this.gitInv0||Ee(this.git0),this.gitInv1=this.gitInv1||Ee(this.git1),this.gitInv2=this.gitInv2||Ee(this.git2),this.gitInv3=this.gitInv3||Ee(this.git3),this.gitInv4=this.gitInv4||Ee(this.git4),this.gitInv5=this.gitInv5||Ee(this.git5),this.gitInv6=this.gitInv6||Ee(this.git6),this.gitInv7=this.gitInv7||Ee(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jp,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||eg}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},O(qo,"Theme"),qo),uV=O(e=>{const t=new cV;return t.calculate(e),t},"getThemeVariables"),Uo,dV=(Uo=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Re(this.primaryColor,16),this.tertiaryColor=se(this.primaryColor,{h:-160}),this.primaryBorderColor=Ee(this.background),this.secondaryBorderColor=vn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=vn(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ee(this.primaryColor),this.secondaryTextColor=Ee(this.secondaryColor),this.tertiaryTextColor=Ee(this.tertiaryColor),this.lineColor=Ee(this.background),this.textColor=Ee(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Re(Ee("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=cd(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=Ve("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Ve(this.sectionBkgColor,10),this.taskBorderColor=cd(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=cd(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Re(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Ve(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){var t,r,n,i,a,s,o,u,d,f,p,m,x,b,v,k,w,C,T,j,L;this.secondBkg=Re(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=Re(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=Re(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=se(this.primaryColor,{h:64}),this.fillType3=se(this.secondaryColor,{h:64}),this.fillType4=se(this.primaryColor,{h:-64}),this.fillType5=se(this.secondaryColor,{h:-64}),this.fillType6=se(this.primaryColor,{h:128}),this.fillType7=se(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||se(this.primaryColor,{h:30}),this.cScale4=this.cScale4||se(this.primaryColor,{h:60}),this.cScale5=this.cScale5||se(this.primaryColor,{h:90}),this.cScale6=this.cScale6||se(this.primaryColor,{h:120}),this.cScale7=this.cScale7||se(this.primaryColor,{h:150}),this.cScale8=this.cScale8||se(this.primaryColor,{h:210}),this.cScale9=this.cScale9||se(this.primaryColor,{h:270}),this.cScale10=this.cScale10||se(this.primaryColor,{h:300}),this.cScale11=this.cScale11||se(this.primaryColor,{h:330});for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleInv"+E]=this["cScaleInv"+E]||Ee(this["cScale"+E]);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScalePeer"+E]=this["cScalePeer"+E]||Re(this["cScale"+E],10);for(let E=0;E<5;E++)this["surface"+E]=this["surface"+E]||se(this.mainBkg,{h:30,s:-30,l:-(-10+E*4)}),this["surfacePeer"+E]=this["surfacePeer"+E]||se(this.mainBkg,{h:30,s:-30,l:-(-7+E*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleLabel"+E]=this["cScaleLabel"+E]||this.scaleLabelColor;for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["pie"+E]=this["cScale"+E];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||se(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||se(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||se(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||se(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||se(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||se(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||sh(this.quadrant1Fill)?Re(this.quadrant1Fill):Ve(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((r=this.xyChart)==null?void 0:r.titleColor)||this.primaryTextColor,xAxisTitleColor:((n=this.xyChart)==null?void 0:n.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((u=this.xyChart)==null?void 0:u.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((f=this.xyChart)==null?void 0:f.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((p=this.xyChart)==null?void 0:p.plotColorPalette)||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:((m=this.radar)==null?void 0:m.axisColor)||this.lineColor,axisStrokeWidth:((x=this.radar)==null?void 0:x.axisStrokeWidth)||2,axisLabelFontSize:((b=this.radar)==null?void 0:b.axisLabelFontSize)||12,curveOpacity:((v=this.radar)==null?void 0:v.curveOpacity)||.5,curveStrokeWidth:((k=this.radar)==null?void 0:k.curveStrokeWidth)||2,graticuleColor:((w=this.radar)==null?void 0:w.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((C=this.radar)==null?void 0:C.graticuleStrokeWidth)||1,graticuleOpacity:((T=this.radar)==null?void 0:T.graticuleOpacity)||.3,legendBoxSize:((j=this.radar)==null?void 0:j.legendBoxSize)||12,legendFontSize:((L=this.radar)==null?void 0:L.legendFontSize)||12},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Ve(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Re(this.secondaryColor,20),this.git1=Re(this.pie2||this.secondaryColor,20),this.git2=Re(this.pie3||this.tertiaryColor,20),this.git3=Re(this.pie4||se(this.primaryColor,{h:-30}),20),this.git4=Re(this.pie5||se(this.primaryColor,{h:-60}),20),this.git5=Re(this.pie6||se(this.primaryColor,{h:-90}),10),this.git6=Re(this.pie7||se(this.primaryColor,{h:60}),10),this.git7=Re(this.pie8||se(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||Ee(this.git0),this.gitInv1=this.gitInv1||Ee(this.git1),this.gitInv2=this.gitInv2||Ee(this.git2),this.gitInv3=this.gitInv3||Ee(this.git3),this.gitInv4=this.gitInv4||Ee(this.git4),this.gitInv5=this.gitInv5||Ee(this.git5),this.gitInv6=this.gitInv6||Ee(this.git6),this.gitInv7=this.gitInv7||Ee(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Ee(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Ee(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Re(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Re(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},O(Uo,"Theme"),Uo),hV=O(e=>{const t=new dV;return t.calculate(e),t},"getThemeVariables"),Vo,fV=(Vo=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=se(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=se(this.primaryColor,{h:-160}),this.primaryBorderColor=vn(this.primaryColor,this.darkMode),this.secondaryBorderColor=vn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=vn(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ee(this.primaryColor),this.secondaryTextColor=Ee(this.secondaryColor),this.tertiaryTextColor=Ee(this.tertiaryColor),this.lineColor=Ee(this.background),this.textColor=Ee(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=cd(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){var t,r,n,i,a,s,o,u,d,f,p,m,x,b,v,k,w,C,T,j,L;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||se(this.primaryColor,{h:30}),this.cScale4=this.cScale4||se(this.primaryColor,{h:60}),this.cScale5=this.cScale5||se(this.primaryColor,{h:90}),this.cScale6=this.cScale6||se(this.primaryColor,{h:120}),this.cScale7=this.cScale7||se(this.primaryColor,{h:150}),this.cScale8=this.cScale8||se(this.primaryColor,{h:210}),this.cScale9=this.cScale9||se(this.primaryColor,{h:270}),this.cScale10=this.cScale10||se(this.primaryColor,{h:300}),this.cScale11=this.cScale11||se(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Ve(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Ve(this.tertiaryColor,40);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScale"+E]=Ve(this["cScale"+E],10),this["cScalePeer"+E]=this["cScalePeer"+E]||Ve(this["cScale"+E],25);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleInv"+E]=this["cScaleInv"+E]||se(this["cScale"+E],{h:180});for(let E=0;E<5;E++)this["surface"+E]=this["surface"+E]||se(this.mainBkg,{h:30,l:-(5+E*5)}),this["surfacePeer"+E]=this["surfacePeer"+E]||se(this.mainBkg,{h:30,l:-(7+E*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||Ee(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||Ee(this.labelTextColor);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleLabel"+E]=this["cScaleLabel"+E]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=Re(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Re(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||Re(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=se(this.primaryColor,{h:64}),this.fillType3=se(this.secondaryColor,{h:64}),this.fillType4=se(this.primaryColor,{h:-64}),this.fillType5=se(this.secondaryColor,{h:-64}),this.fillType6=se(this.primaryColor,{h:128}),this.fillType7=se(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||se(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||se(this.primaryColor,{l:-10}),this.pie5=this.pie5||se(this.secondaryColor,{l:-30}),this.pie6=this.pie6||se(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||se(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||se(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||se(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||se(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||se(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||se(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||se(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||se(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||se(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||se(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||se(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||se(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||sh(this.quadrant1Fill)?Re(this.quadrant1Fill):Ve(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:((t=this.radar)==null?void 0:t.axisColor)||this.lineColor,axisStrokeWidth:((r=this.radar)==null?void 0:r.axisStrokeWidth)||2,axisLabelFontSize:((n=this.radar)==null?void 0:n.axisLabelFontSize)||12,curveOpacity:((i=this.radar)==null?void 0:i.curveOpacity)||.5,curveStrokeWidth:((a=this.radar)==null?void 0:a.curveStrokeWidth)||2,graticuleColor:((s=this.radar)==null?void 0:s.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((o=this.radar)==null?void 0:o.graticuleStrokeWidth)||1,graticuleOpacity:((u=this.radar)==null?void 0:u.graticuleOpacity)||.3,legendBoxSize:((d=this.radar)==null?void 0:d.legendBoxSize)||12,legendFontSize:((f=this.radar)==null?void 0:f.legendFontSize)||12},this.xyChart={backgroundColor:((p=this.xyChart)==null?void 0:p.backgroundColor)||this.background,titleColor:((m=this.xyChart)==null?void 0:m.titleColor)||this.primaryTextColor,xAxisTitleColor:((x=this.xyChart)==null?void 0:x.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((b=this.xyChart)==null?void 0:b.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((v=this.xyChart)==null?void 0:v.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((k=this.xyChart)==null?void 0:k.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((w=this.xyChart)==null?void 0:w.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((C=this.xyChart)==null?void 0:C.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((T=this.xyChart)==null?void 0:T.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((j=this.xyChart)==null?void 0:j.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((L=this.xyChart)==null?void 0:L.plotColorPalette)||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||se(this.primaryColor,{h:-30}),this.git4=this.git4||se(this.primaryColor,{h:-60}),this.git5=this.git5||se(this.primaryColor,{h:-90}),this.git6=this.git6||se(this.primaryColor,{h:60}),this.git7=this.git7||se(this.primaryColor,{h:120}),this.darkMode?(this.git0=Re(this.git0,25),this.git1=Re(this.git1,25),this.git2=Re(this.git2,25),this.git3=Re(this.git3,25),this.git4=Re(this.git4,25),this.git5=Re(this.git5,25),this.git6=Re(this.git6,25),this.git7=Re(this.git7,25)):(this.git0=Ve(this.git0,25),this.git1=Ve(this.git1,25),this.git2=Ve(this.git2,25),this.git3=Ve(this.git3,25),this.git4=Ve(this.git4,25),this.git5=Ve(this.git5,25),this.git6=Ve(this.git6,25),this.git7=Ve(this.git7,25)),this.gitInv0=this.gitInv0||Ve(Ee(this.git0),25),this.gitInv1=this.gitInv1||Ee(this.git1),this.gitInv2=this.gitInv2||Ee(this.git2),this.gitInv3=this.gitInv3||Ee(this.git3),this.gitInv4=this.gitInv4||Ee(this.git4),this.gitInv5=this.gitInv5||Ee(this.git5),this.gitInv6=this.gitInv6||Ee(this.git6),this.gitInv7=this.gitInv7||Ee(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Ee(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Ee(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jp,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||eg}calculate(t){if(Object.keys(this).forEach(n=>{this[n]==="calculated"&&(this[n]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},O(Vo,"Theme"),Vo),pV=O(e=>{const t=new fV;return t.calculate(e),t},"getThemeVariables"),Wo,gV=(Wo=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=Re("#cde498",10),this.primaryBorderColor=vn(this.primaryColor,this.darkMode),this.secondaryBorderColor=vn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=vn(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ee(this.primaryColor),this.secondaryTextColor=Ee(this.secondaryColor),this.tertiaryTextColor=Ee(this.primaryColor),this.lineColor=Ee(this.background),this.textColor=Ee(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,r,n,i,a,s,o,u,d,f,p,m,x,b,v,k,w,C,T,j,L;this.actorBorder=Ve(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||se(this.primaryColor,{h:30}),this.cScale4=this.cScale4||se(this.primaryColor,{h:60}),this.cScale5=this.cScale5||se(this.primaryColor,{h:90}),this.cScale6=this.cScale6||se(this.primaryColor,{h:120}),this.cScale7=this.cScale7||se(this.primaryColor,{h:150}),this.cScale8=this.cScale8||se(this.primaryColor,{h:210}),this.cScale9=this.cScale9||se(this.primaryColor,{h:270}),this.cScale10=this.cScale10||se(this.primaryColor,{h:300}),this.cScale11=this.cScale11||se(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Ve(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Ve(this.tertiaryColor,40);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScale"+E]=Ve(this["cScale"+E],10),this["cScalePeer"+E]=this["cScalePeer"+E]||Ve(this["cScale"+E],25);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleInv"+E]=this["cScaleInv"+E]||se(this["cScale"+E],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleLabel"+E]=this["cScaleLabel"+E]||this.scaleLabelColor;for(let E=0;E<5;E++)this["surface"+E]=this["surface"+E]||se(this.mainBkg,{h:30,s:-30,l:-(5+E*5)}),this["surfacePeer"+E]=this["surfacePeer"+E]||se(this.mainBkg,{h:30,s:-30,l:-(8+E*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Re(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Re(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=se(this.primaryColor,{h:64}),this.fillType3=se(this.secondaryColor,{h:64}),this.fillType4=se(this.primaryColor,{h:-64}),this.fillType5=se(this.secondaryColor,{h:-64}),this.fillType6=se(this.primaryColor,{h:128}),this.fillType7=se(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||se(this.primaryColor,{l:-30}),this.pie5=this.pie5||se(this.secondaryColor,{l:-30}),this.pie6=this.pie6||se(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||se(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||se(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||se(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||se(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||se(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||se(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||se(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||se(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||se(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||se(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||se(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||se(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||sh(this.quadrant1Fill)?Re(this.quadrant1Fill):Ve(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:((t=this.radar)==null?void 0:t.axisColor)||this.lineColor,axisStrokeWidth:((r=this.radar)==null?void 0:r.axisStrokeWidth)||2,axisLabelFontSize:((n=this.radar)==null?void 0:n.axisLabelFontSize)||12,curveOpacity:((i=this.radar)==null?void 0:i.curveOpacity)||.5,curveStrokeWidth:((a=this.radar)==null?void 0:a.curveStrokeWidth)||2,graticuleColor:((s=this.radar)==null?void 0:s.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((o=this.radar)==null?void 0:o.graticuleStrokeWidth)||1,graticuleOpacity:((u=this.radar)==null?void 0:u.graticuleOpacity)||.3,legendBoxSize:((d=this.radar)==null?void 0:d.legendBoxSize)||12,legendFontSize:((f=this.radar)==null?void 0:f.legendFontSize)||12},this.xyChart={backgroundColor:((p=this.xyChart)==null?void 0:p.backgroundColor)||this.background,titleColor:((m=this.xyChart)==null?void 0:m.titleColor)||this.primaryTextColor,xAxisTitleColor:((x=this.xyChart)==null?void 0:x.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((b=this.xyChart)==null?void 0:b.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((v=this.xyChart)==null?void 0:v.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((k=this.xyChart)==null?void 0:k.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((w=this.xyChart)==null?void 0:w.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((C=this.xyChart)==null?void 0:C.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((T=this.xyChart)==null?void 0:T.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((j=this.xyChart)==null?void 0:j.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((L=this.xyChart)==null?void 0:L.plotColorPalette)||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||se(this.primaryColor,{h:-30}),this.git4=this.git4||se(this.primaryColor,{h:-60}),this.git5=this.git5||se(this.primaryColor,{h:-90}),this.git6=this.git6||se(this.primaryColor,{h:60}),this.git7=this.git7||se(this.primaryColor,{h:120}),this.darkMode?(this.git0=Re(this.git0,25),this.git1=Re(this.git1,25),this.git2=Re(this.git2,25),this.git3=Re(this.git3,25),this.git4=Re(this.git4,25),this.git5=Re(this.git5,25),this.git6=Re(this.git6,25),this.git7=Re(this.git7,25)):(this.git0=Ve(this.git0,25),this.git1=Ve(this.git1,25),this.git2=Ve(this.git2,25),this.git3=Ve(this.git3,25),this.git4=Ve(this.git4,25),this.git5=Ve(this.git5,25),this.git6=Ve(this.git6,25),this.git7=Ve(this.git7,25)),this.gitInv0=this.gitInv0||Ee(this.git0),this.gitInv1=this.gitInv1||Ee(this.git1),this.gitInv2=this.gitInv2||Ee(this.git2),this.gitInv3=this.gitInv3||Ee(this.git3),this.gitInv4=this.gitInv4||Ee(this.git4),this.gitInv5=this.gitInv5||Ee(this.git5),this.gitInv6=this.gitInv6||Ee(this.git6),this.gitInv7=this.gitInv7||Ee(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Ee(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Ee(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jp,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||eg}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},O(Wo,"Theme"),Wo),mV=O(e=>{const t=new gV;return t.calculate(e),t},"getThemeVariables"),Yo,xV=(Yo=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Re(this.contrast,55),this.background="#ffffff",this.tertiaryColor=se(this.primaryColor,{h:-160}),this.primaryBorderColor=vn(this.primaryColor,this.darkMode),this.secondaryBorderColor=vn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=vn(this.tertiaryColor,this.darkMode),this.primaryTextColor=Ee(this.primaryColor),this.secondaryTextColor=Ee(this.secondaryColor),this.tertiaryTextColor=Ee(this.tertiaryColor),this.lineColor=Ee(this.background),this.textColor=Ee(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Re(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,r,n,i,a,s,o,u,d,f,p,m,x,b,v,k,w,C,T,j,L;this.secondBkg=Re(this.contrast,55),this.border2=this.contrast,this.actorBorder=Re(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleInv"+E]=this["cScaleInv"+E]||Ee(this["cScale"+E]);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this.darkMode?this["cScalePeer"+E]=this["cScalePeer"+E]||Re(this["cScale"+E],10):this["cScalePeer"+E]=this["cScalePeer"+E]||Ve(this["cScale"+E],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleLabel"+E]=this["cScaleLabel"+E]||this.scaleLabelColor;for(let E=0;E<5;E++)this["surface"+E]=this["surface"+E]||se(this.mainBkg,{l:-(5+E*5)}),this["surfacePeer"+E]=this["surfacePeer"+E]||se(this.mainBkg,{l:-(8+E*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=Re(this.contrast,30),this.sectionBkgColor2=Re(this.contrast,30),this.taskBorderColor=Ve(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=Re(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=Ve(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=se(this.primaryColor,{h:64}),this.fillType3=se(this.secondaryColor,{h:64}),this.fillType4=se(this.primaryColor,{h:-64}),this.fillType5=se(this.secondaryColor,{h:-64}),this.fillType6=se(this.primaryColor,{h:128}),this.fillType7=se(this.secondaryColor,{h:128});for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["pie"+E]=this["cScale"+E];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||se(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||se(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||se(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||se(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||se(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||se(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||sh(this.quadrant1Fill)?Re(this.quadrant1Fill):Ve(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((r=this.xyChart)==null?void 0:r.titleColor)||this.primaryTextColor,xAxisTitleColor:((n=this.xyChart)==null?void 0:n.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((u=this.xyChart)==null?void 0:u.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((f=this.xyChart)==null?void 0:f.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((p=this.xyChart)==null?void 0:p.plotColorPalette)||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:((m=this.radar)==null?void 0:m.axisColor)||this.lineColor,axisStrokeWidth:((x=this.radar)==null?void 0:x.axisStrokeWidth)||2,axisLabelFontSize:((b=this.radar)==null?void 0:b.axisLabelFontSize)||12,curveOpacity:((v=this.radar)==null?void 0:v.curveOpacity)||.5,curveStrokeWidth:((k=this.radar)==null?void 0:k.curveStrokeWidth)||2,graticuleColor:((w=this.radar)==null?void 0:w.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((C=this.radar)==null?void 0:C.graticuleStrokeWidth)||1,graticuleOpacity:((T=this.radar)==null?void 0:T.graticuleOpacity)||.3,legendBoxSize:((j=this.radar)==null?void 0:j.legendBoxSize)||12,legendFontSize:((L=this.radar)==null?void 0:L.legendFontSize)||12},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Ve(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||se(this.primaryColor,{h:-30}),this.git4=this.pie5||se(this.primaryColor,{h:-60}),this.git5=this.pie6||se(this.primaryColor,{h:-90}),this.git6=this.pie7||se(this.primaryColor,{h:60}),this.git7=this.pie8||se(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||Ee(this.git0),this.gitInv1=this.gitInv1||Ee(this.git1),this.gitInv2=this.gitInv2||Ee(this.git2),this.gitInv3=this.gitInv3||Ee(this.git3),this.gitInv4=this.gitInv4||Ee(this.git4),this.gitInv5=this.gitInv5||Ee(this.git5),this.gitInv6=this.gitInv6||Ee(this.git6),this.gitInv7=this.gitInv7||Ee(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jp,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||eg}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},O(Yo,"Theme"),Yo),yV=O(e=>{const t=new xV;return t.calculate(e),t},"getThemeVariables"),ja={base:{getThemeVariables:uV},dark:{getThemeVariables:hV},default:{getThemeVariables:pV},forest:{getThemeVariables:mV},neutral:{getThemeVariables:yV}},qi={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},y3={...qi,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:ja.default.getThemeVariables(),sequence:{...qi.sequence,messageFont:O(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:O(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:O(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...qi.gantt,tickInterval:void 0,useWidth:void 0},c4:{...qi.c4,useWidth:void 0,personFont:O(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...qi.flowchart,inheritDir:!1},external_personFont:O(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:O(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:O(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:O(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:O(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:O(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:O(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:O(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:O(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:O(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:O(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:O(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:O(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:O(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:O(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:O(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:O(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:O(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:O(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:O(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:O(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...qi.pie,useWidth:984},xyChart:{...qi.xyChart,useWidth:void 0},requirement:{...qi.requirement,useWidth:void 0},packet:{...qi.packet},radar:{...qi.radar},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","}},b3=O((e,t="")=>Object.keys(e).reduce((r,n)=>Array.isArray(e[n])?r:typeof e[n]=="object"&&e[n]!==null?[...r,t+n,...b3(e[n],"")]:[...r,t+n],[]),"keyify"),bV=new Set(b3(y3,"")),v3=y3,X0=O(e=>{if(we.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>X0(t));return}for(const t of Object.keys(e)){if(we.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!bV.has(t)||e[t]==null){we.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){we.debug("sanitizing object",t),X0(e[t]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)t.includes(n)&&(we.debug("sanitizing css option",t),e[t]=vV(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}we.debug("After sanitization",e)}},"sanitizeDirective"),vV=O(e=>{let t=0,r=0;for(const n of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";n==="{"?t++:n==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),Jo=Object.freeze(v3),Bn=Rr({},Jo),Q0,xl=[],dd=Rr({},Jo),tg=O((e,t)=>{let r=Rr({},e),n={};for(const i of t)S3(i),n=Rr(n,i);if(r=Rr(r,n),n.theme&&n.theme in ja){const i=Rr({},Q0),a=Rr(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in ja&&(r.themeVariables=ja[r.theme].getThemeVariables(a))}return dd=r,C3(dd),dd},"updateCurrentConfig"),wV=O(e=>(Bn=Rr({},Jo),Bn=Rr(Bn,e),e.theme&&ja[e.theme]&&(Bn.themeVariables=ja[e.theme].getThemeVariables(e.themeVariables)),tg(Bn,xl),Bn),"setSiteConfig"),kV=O(e=>{Q0=Rr({},e)},"saveConfigFromInitialize"),SV=O(e=>(Bn=Rr(Bn,e),tg(Bn,xl),Bn),"updateSiteConfig"),w3=O(()=>Rr({},Bn),"getSiteConfig"),k3=O(e=>(C3(e),Rr(dd,e),cn()),"setConfig"),cn=O(()=>Rr({},dd),"getConfig"),S3=O(e=>{e&&(["secure",...Bn.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(we.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&S3(e[t])}))},"sanitize"),CV=O(e=>{var t;X0(e),e.fontFamily&&!((t=e.themeVariables)!=null&&t.fontFamily)&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),xl.push(e),tg(Bn,xl)},"addDirective"),Z0=O((e=Bn)=>{xl=[],tg(e,xl)},"reset"),_V={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},h5={},TV=O(e=>{h5[e]||(we.warn(_V[e]),h5[e]=!0)},"issueWarning"),C3=O(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&TV("LAZY_LOAD_DEPRECATED")},"checkConfig"),Afe=O(()=>{let e={};Q0&&(e=Rr(e,Q0));for(const t of xl)e=Rr(e,t);return e},"getUserDefinedConfig"),lh=/<br\s*\/?>/gi,EV=O(e=>e?E3(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),NV=(()=>{let e=!1;return()=>{e||(_3(),e=!0)}})();function _3(){const e="data-temp-href-target";Ko.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Ko.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}O(_3,"setupDompurifyHooks");var T3=O(e=>(NV(),Ko.sanitize(e)),"removeScript"),f5=O((e,t)=>{var r;if(((r=t.flowchart)==null?void 0:r.htmlLabels)!==!1){const n=t.securityLevel;n==="antiscript"||n==="strict"?e=T3(e):n!=="loose"&&(e=E3(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=LV(e))}return e},"sanitizeMore"),xi=O((e,t)=>e&&(t.dompurifyConfig?e=Ko.sanitize(f5(e,t),t.dompurifyConfig).toString():e=Ko.sanitize(f5(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),jV=O((e,t)=>typeof e=="string"?xi(e,t):e.flat().map(r=>xi(r,t)),"sanitizeTextOrArray"),AV=O(e=>lh.test(e),"hasBreaks"),MV=O(e=>e.split(lh),"splitBreaks"),LV=O(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),E3=O(e=>e.replace(lh,"#br#"),"breakToPlaceholder"),DV=O(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),Br=O(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),RV=O(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),OV=O(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),p5=O(function(e){const t=e.split(/(,)/),r=[];for(let n=0;n<t.length;n++){let i=t[n];if(i===","&&n>0&&n+1<t.length){const a=t[n-1],s=t[n+1];BV(a,s)&&(i=a+","+s,n++,r.pop())}r.push($V(i))}return r.join("")},"parseGenericTypes"),$b=O((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),BV=O((e,t)=>{const r=$b(e,"~"),n=$b(t,"~");return r===1&&n===1},"shouldCombineSets"),$V=O(e=>{const t=$b(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const n=[...e];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),g5=O(()=>window.MathMLElement!==void 0,"isMathMLSupported"),zb=/\$\$(.*)\$\$/g,ec=O(e=>{var t;return(((t=e.match(zb))==null?void 0:t.length)??0)>0},"hasKatex"),Mfe=O(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Dv(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),zV=O(async(e,t)=>{if(!ec(e))return e;if(!(g5()||t.legacyMathML||t.forceLegacyMathML))return e.replace(zb,"MathML is unsupported in this environment.");{const{default:r}=await Ot(async()=>{const{default:i}=await import("./katex.js");return{default:i}},[]),n=t.forceLegacyMathML||!g5()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(lh).map(i=>ec(i)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${i}</div>`:`<div>${i}</div>`).join("").replace(zb,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Dv=O(async(e,t)=>xi(await zV(e,t),t),"renderKatexSanitized"),Tc={getRows:EV,sanitizeText:xi,sanitizeTextOrArray:jV,hasBreaks:AV,splitBreaks:MV,lineBreakRegex:lh,removeScript:T3,getUrl:DV,evaluate:Br,getMax:RV,getMin:OV},IV=O(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),FV=O(function(e,t,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${t}px;`)):(n.set("height",e),n.set("width",t)),n},"calculateSvgSizeAttrs"),N3=O(function(e,t,r,n){const i=FV(t,r,n);IV(e,i)},"configureSvgSize"),PV=O(function(e,t,r,n){const i=t.node().getBBox(),a=i.width,s=i.height;we.info(`SVG bounds: ${a}x${s}`,i);let o=0,u=0;we.info(`Graph bounds: ${o}x${u}`,e),o=a+r*2,u=s+r*2,we.info(`Calculated bounds: ${o}x${u}`),N3(t,u,o,n);const d=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;t.attr("viewBox",d)},"setupGraphViewbox"),g0={},HV=O((e,t,r)=>{let n="";return e in g0&&g0[e]?n=g0[e](r):we.warn(`No theme found for ${e}`),` & {
153
- font-family: ${r.fontFamily};
154
- font-size: ${r.fontSize};
155
- fill: ${r.textColor}
156
- }
157
- @keyframes edge-animation-frame {
158
- from {
159
- stroke-dashoffset: 0;
160
- }
161
- }
162
- @keyframes dash {
163
- to {
164
- stroke-dashoffset: 0;
165
- }
166
- }
167
- & .edge-animation-slow {
168
- stroke-dasharray: 9,5 !important;
169
- stroke-dashoffset: 900;
170
- animation: dash 50s linear infinite;
171
- stroke-linecap: round;
172
- }
173
- & .edge-animation-fast {
174
- stroke-dasharray: 9,5 !important;
175
- stroke-dashoffset: 900;
176
- animation: dash 20s linear infinite;
177
- stroke-linecap: round;
178
- }
179
- /* Classes common for multiple diagrams */
180
-
181
- & .error-icon {
182
- fill: ${r.errorBkgColor};
183
- }
184
- & .error-text {
185
- fill: ${r.errorTextColor};
186
- stroke: ${r.errorTextColor};
187
- }
188
-
189
- & .edge-thickness-normal {
190
- stroke-width: 1px;
191
- }
192
- & .edge-thickness-thick {
193
- stroke-width: 3.5px
194
- }
195
- & .edge-pattern-solid {
196
- stroke-dasharray: 0;
197
- }
198
- & .edge-thickness-invisible {
199
- stroke-width: 0;
200
- fill: none;
201
- }
202
- & .edge-pattern-dashed{
203
- stroke-dasharray: 3;
204
- }
205
- .edge-pattern-dotted {
206
- stroke-dasharray: 2;
207
- }
208
-
209
- & .marker {
210
- fill: ${r.lineColor};
211
- stroke: ${r.lineColor};
212
- }
213
- & .marker.cross {
214
- stroke: ${r.lineColor};
215
- }
216
-
217
- & svg {
218
- font-family: ${r.fontFamily};
219
- font-size: ${r.fontSize};
220
- }
221
- & p {
222
- margin: 0
223
- }
224
-
225
- ${n}
226
-
227
- ${t}
228
- `},"getStyles"),qV=O((e,t)=>{t!==void 0&&(g0[e]=t)},"addStylesForDiagram"),UV=HV,j3={};LU(j3,{clear:()=>VV,getAccDescription:()=>XV,getAccTitle:()=>YV,getDiagramTitle:()=>ZV,setAccDescription:()=>GV,setAccTitle:()=>WV,setDiagramTitle:()=>QV});var Rv="",Ov="",Bv="",$v=O(e=>xi(e,cn()),"sanitizeText"),VV=O(()=>{Rv="",Bv="",Ov=""},"clear"),WV=O(e=>{Rv=$v(e).replace(/^\s+/g,"")},"setAccTitle"),YV=O(()=>Rv,"getAccTitle"),GV=O(e=>{Bv=$v(e).replace(/\n\s+/g,`
229
- `)},"setAccDescription"),XV=O(()=>Bv,"getAccDescription"),QV=O(e=>{Ov=$v(e)},"setDiagramTitle"),ZV=O(()=>Ov,"getDiagramTitle"),m5=we,KV=Mv,Dt=cn,Lfe=k3,Dfe=Jo,zv=O(e=>xi(e,Dt()),"sanitizeText"),JV=PV,eW=O(()=>j3,"getCommonDb"),K0={},J0=O((e,t,r)=>{var n;K0[e]&&m5.warn(`Diagram with id ${e} already registered. Overwriting.`),K0[e]=t,r&&x3(e,r),qV(e,t.styles),(n=t.injectUtils)==null||n.call(t,m5,KV,Dt,zv,JV,eW(),()=>{})},"registerDiagram"),Ib=O(e=>{if(e in K0)return K0[e];throw new tW(e)},"getDiagram"),Go,tW=(Go=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},O(Go,"DiagramNotFoundError"),Go),rW={value:()=>{}};function rg(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new m0(r)}function m0(e){this._=e}function nW(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}m0.prototype=rg.prototype={constructor:m0,on:function(e,t){var r=this._,n=nW(e+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a<s;)if((i=(e=n[a]).type)&&(i=iW(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=n[a]).type)r[i]=x5(r[i],e.name,t);else if(t==null)for(i in r)r[i]=x5(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new m0(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,a;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],n=0,i=a.length;n<i;++n)a[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,a=n.length;i<a;++i)n[i].value.apply(t,r)}};function iW(e,t){for(var r=0,n=e.length,i;r<n;++r)if((i=e[r]).name===t)return i.value}function x5(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=rW,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var Fb="http://www.w3.org/1999/xhtml";const y5={svg:"http://www.w3.org/2000/svg",xhtml:Fb,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ng(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),y5.hasOwnProperty(t)?{space:y5[t],local:e}:e}function aW(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Fb&&t.documentElement.namespaceURI===Fb?t.createElement(e):t.createElementNS(r,e)}}function sW(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function A3(e){var t=ng(e);return(t.local?sW:aW)(t)}function lW(){}function Iv(e){return e==null?lW:function(){return this.querySelector(e)}}function oW(e){typeof e!="function"&&(e=Iv(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],s=a.length,o=n[i]=new Array(s),u,d,f=0;f<s;++f)(u=a[f])&&(d=e.call(u,u.__data__,f,a))&&("__data__"in u&&(d.__data__=u.__data__),o[f]=d);return new ri(n,this._parents)}function cW(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function uW(){return[]}function M3(e){return e==null?uW:function(){return this.querySelectorAll(e)}}function dW(e){return function(){return cW(e.apply(this,arguments))}}function hW(e){typeof e=="function"?e=dW(e):e=M3(e);for(var t=this._groups,r=t.length,n=[],i=[],a=0;a<r;++a)for(var s=t[a],o=s.length,u,d=0;d<o;++d)(u=s[d])&&(n.push(e.call(u,u.__data__,d,s)),i.push(u));return new ri(n,i)}function L3(e){return function(){return this.matches(e)}}function D3(e){return function(t){return t.matches(e)}}var fW=Array.prototype.find;function pW(e){return function(){return fW.call(this.children,e)}}function gW(){return this.firstElementChild}function mW(e){return this.select(e==null?gW:pW(typeof e=="function"?e:D3(e)))}var xW=Array.prototype.filter;function yW(){return Array.from(this.children)}function bW(e){return function(){return xW.call(this.children,e)}}function vW(e){return this.selectAll(e==null?yW:bW(typeof e=="function"?e:D3(e)))}function wW(e){typeof e!="function"&&(e=L3(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],s=a.length,o=n[i]=[],u,d=0;d<s;++d)(u=a[d])&&e.call(u,u.__data__,d,a)&&o.push(u);return new ri(n,this._parents)}function R3(e){return new Array(e.length)}function kW(){return new ri(this._enter||this._groups.map(R3),this._parents)}function ep(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ep.prototype={constructor:ep,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function SW(e){return function(){return e}}function CW(e,t,r,n,i,a){for(var s=0,o,u=t.length,d=a.length;s<d;++s)(o=t[s])?(o.__data__=a[s],n[s]=o):r[s]=new ep(e,a[s]);for(;s<u;++s)(o=t[s])&&(i[s]=o)}function _W(e,t,r,n,i,a,s){var o,u,d=new Map,f=t.length,p=a.length,m=new Array(f),x;for(o=0;o<f;++o)(u=t[o])&&(m[o]=x=s.call(u,u.__data__,o,t)+"",d.has(x)?i[o]=u:d.set(x,u));for(o=0;o<p;++o)x=s.call(e,a[o],o,a)+"",(u=d.get(x))?(n[o]=u,u.__data__=a[o],d.delete(x)):r[o]=new ep(e,a[o]);for(o=0;o<f;++o)(u=t[o])&&d.get(m[o])===u&&(i[o]=u)}function TW(e){return e.__data__}function EW(e,t){if(!arguments.length)return Array.from(this,TW);var r=t?_W:CW,n=this._parents,i=this._groups;typeof e!="function"&&(e=SW(e));for(var a=i.length,s=new Array(a),o=new Array(a),u=new Array(a),d=0;d<a;++d){var f=n[d],p=i[d],m=p.length,x=NW(e.call(f,f&&f.__data__,d,n)),b=x.length,v=o[d]=new Array(b),k=s[d]=new Array(b),w=u[d]=new Array(m);r(f,p,v,k,w,x,t);for(var C=0,T=0,j,L;C<b;++C)if(j=v[C]){for(C>=T&&(T=C+1);!(L=k[T])&&++T<b;);j._next=L||null}}return s=new ri(s,n),s._enter=o,s._exit=u,s}function NW(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jW(){return new ri(this._exit||this._groups.map(R3),this._parents)}function AW(e,t,r){var n=this.enter(),i=this,a=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}function MW(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,a=n.length,s=Math.min(i,a),o=new Array(i),u=0;u<s;++u)for(var d=r[u],f=n[u],p=d.length,m=o[u]=new Array(p),x,b=0;b<p;++b)(x=d[b]||f[b])&&(m[b]=x);for(;u<i;++u)o[u]=r[u];return new ri(o,this._parents)}function LW(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],i=n.length-1,a=n[i],s;--i>=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function DW(e){e||(e=RW);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var r=this._groups,n=r.length,i=new Array(n),a=0;a<n;++a){for(var s=r[a],o=s.length,u=i[a]=new Array(o),d,f=0;f<o;++f)(d=s[f])&&(u[f]=d);u.sort(t)}return new ri(i,this._parents).order()}function RW(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function OW(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function BW(){return Array.from(this)}function $W(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length;i<a;++i){var s=n[i];if(s)return s}return null}function zW(){let e=0;for(const t of this)++e;return e}function IW(){return!this.node()}function FW(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,s=i.length,o;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this}function PW(e){return function(){this.removeAttribute(e)}}function HW(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qW(e,t){return function(){this.setAttribute(e,t)}}function UW(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function VW(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function WW(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function YW(e,t){var r=ng(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?HW:PW:typeof t=="function"?r.local?WW:VW:r.local?UW:qW)(r,t))}function O3(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function GW(e){return function(){this.style.removeProperty(e)}}function XW(e,t,r){return function(){this.style.setProperty(e,t,r)}}function QW(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function ZW(e,t,r){return arguments.length>1?this.each((t==null?GW:typeof t=="function"?QW:XW)(e,t,r??"")):tc(this.node(),e)}function tc(e,t){return e.style.getPropertyValue(t)||O3(e).getComputedStyle(e,null).getPropertyValue(t)}function KW(e){return function(){delete this[e]}}function JW(e,t){return function(){this[e]=t}}function eY(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function tY(e,t){return arguments.length>1?this.each((t==null?KW:typeof t=="function"?eY:JW)(e,t)):this.node()[e]}function B3(e){return e.trim().split(/^|\s+/)}function Fv(e){return e.classList||new $3(e)}function $3(e){this._node=e,this._names=B3(e.getAttribute("class")||"")}$3.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function z3(e,t){for(var r=Fv(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function I3(e,t){for(var r=Fv(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function rY(e){return function(){z3(this,e)}}function nY(e){return function(){I3(this,e)}}function iY(e,t){return function(){(t.apply(this,arguments)?z3:I3)(this,e)}}function aY(e,t){var r=B3(e+"");if(arguments.length<2){for(var n=Fv(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?iY:t?rY:nY)(r,t))}function sY(){this.textContent=""}function lY(e){return function(){this.textContent=e}}function oY(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function cY(e){return arguments.length?this.each(e==null?sY:(typeof e=="function"?oY:lY)(e)):this.node().textContent}function uY(){this.innerHTML=""}function dY(e){return function(){this.innerHTML=e}}function hY(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function fY(e){return arguments.length?this.each(e==null?uY:(typeof e=="function"?hY:dY)(e)):this.node().innerHTML}function pY(){this.nextSibling&&this.parentNode.appendChild(this)}function gY(){return this.each(pY)}function mY(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xY(){return this.each(mY)}function yY(e){var t=typeof e=="function"?e:A3(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function bY(){return null}function vY(e,t){var r=typeof e=="function"?e:A3(e),n=t==null?bY:typeof t=="function"?t:Iv(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function wY(){var e=this.parentNode;e&&e.removeChild(this)}function kY(){return this.each(wY)}function SY(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function CY(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function _Y(e){return this.select(e?CY:SY)}function TY(e){return arguments.length?this.property("__data__",e):this.node().__data__}function EY(e){return function(t){e.call(this,t,this.__data__)}}function NY(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function jY(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,a;r<i;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++n]=a;++n?t.length=n:delete this.__on}}}function AY(e,t,r){return function(){var n=this.__on,i,a=EY(t);if(n){for(var s=0,o=n.length;s<o;++s)if((i=n[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=r),i.value=t;return}}this.addEventListener(e.type,a,r),i={type:e.type,name:e.name,value:t,listener:a,options:r},n?n.push(i):this.__on=[i]}}function MY(e,t,r){var n=NY(e+""),i,a=n.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var u=0,d=o.length,f;u<d;++u)for(i=0,f=o[u];i<a;++i)if((s=n[i]).type===f.type&&s.name===f.name)return f.value}return}for(o=t?AY:jY,i=0;i<a;++i)this.each(o(n[i],t,r));return this}function F3(e,t,r){var n=O3(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function LY(e,t){return function(){return F3(this,e,t)}}function DY(e,t){return function(){return F3(this,e,t.apply(this,arguments))}}function RY(e,t){return this.each((typeof t=="function"?DY:LY)(e,t))}function*OY(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length,s;i<a;++i)(s=n[i])&&(yield s)}var P3=[null];function ri(e,t){this._groups=e,this._parents=t}function oh(){return new ri([[document.documentElement]],P3)}function BY(){return this}ri.prototype=oh.prototype={constructor:ri,select:oW,selectAll:hW,selectChild:mW,selectChildren:vW,filter:wW,data:EW,enter:kW,exit:jW,join:AW,merge:MW,selection:BY,order:LW,sort:DW,call:OW,nodes:BW,node:$W,size:zW,empty:IW,each:FW,attr:YW,style:ZW,property:tY,classed:aY,text:cY,html:fY,raise:gY,lower:xY,append:yY,insert:vY,remove:kY,clone:_Y,datum:TY,on:MY,dispatch:RY,[Symbol.iterator]:OY};function et(e){return typeof e=="string"?new ri([[document.querySelector(e)]],[document.documentElement]):new ri([[e]],P3)}function $Y(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _i(e,t){if(e=$Y(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const zY={passive:!1},Ad={capture:!0,passive:!1};function jy(e){e.stopImmediatePropagation()}function $o(e){e.preventDefault(),e.stopImmediatePropagation()}function H3(e){var t=e.document.documentElement,r=et(e).on("dragstart.drag",$o,Ad);"onselectstart"in t?r.on("selectstart.drag",$o,Ad):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function q3(e,t){var r=e.document.documentElement,n=et(e).on("dragstart.drag",null);t&&(n.on("click.drag",$o,Ad),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const qf=e=>()=>e;function Pb(e,{sourceEvent:t,subject:r,target:n,identifier:i,active:a,x:s,y:o,dx:u,dy:d,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:f}})}Pb.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function IY(e){return!e.ctrlKey&&!e.button}function FY(){return this.parentNode}function PY(e,t){return t??{x:e.x,y:e.y}}function HY(){return navigator.maxTouchPoints||"ontouchstart"in this}function U3(){var e=IY,t=FY,r=PY,n=HY,i={},a=rg("start","drag","end"),s=0,o,u,d,f,p=0;function m(j){j.on("mousedown.drag",x).filter(n).on("touchstart.drag",k).on("touchmove.drag",w,zY).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(j,L){if(!(f||!e.call(this,j,L))){var E=T(this,t.call(this,j,L),j,L,"mouse");E&&(et(j.view).on("mousemove.drag",b,Ad).on("mouseup.drag",v,Ad),H3(j.view),jy(j),d=!1,o=j.clientX,u=j.clientY,E("start",j))}}function b(j){if($o(j),!d){var L=j.clientX-o,E=j.clientY-u;d=L*L+E*E>p}i.mouse("drag",j)}function v(j){et(j.view).on("mousemove.drag mouseup.drag",null),q3(j.view,d),$o(j),i.mouse("end",j)}function k(j,L){if(e.call(this,j,L)){var E=j.changedTouches,M=t.call(this,j,L),I=E.length,P,z;for(P=0;P<I;++P)(z=T(this,M,j,L,E[P].identifier,E[P]))&&(jy(j),z("start",j,E[P]))}}function w(j){var L=j.changedTouches,E=L.length,M,I;for(M=0;M<E;++M)(I=i[L[M].identifier])&&($o(j),I("drag",j,L[M]))}function C(j){var L=j.changedTouches,E=L.length,M,I;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),M=0;M<E;++M)(I=i[L[M].identifier])&&(jy(j),I("end",j,L[M]))}function T(j,L,E,M,I,P){var z=a.copy(),$=_i(P||E,L),W,Y,B;if((B=r.call(j,new Pb("beforestart",{sourceEvent:E,target:m,identifier:I,active:s,x:$[0],y:$[1],dx:0,dy:0,dispatch:z}),M))!=null)return W=B.x-$[0]||0,Y=B.y-$[1]||0,function U(R,H,V){var Q=$,A;switch(R){case"start":i[I]=U,A=s++;break;case"end":delete i[I],--s;case"drag":$=_i(V||H,L),A=s;break}z.call(R,j,new Pb(R,{sourceEvent:H,subject:B,target:m,identifier:I,active:A,x:$[0]+W,y:$[1]+Y,dx:$[0]-Q[0],dy:$[1]-Q[1],dispatch:z}),M)}}return m.filter=function(j){return arguments.length?(e=typeof j=="function"?j:qf(!!j),m):e},m.container=function(j){return arguments.length?(t=typeof j=="function"?j:qf(j),m):t},m.subject=function(j){return arguments.length?(r=typeof j=="function"?j:qf(j),m):r},m.touchable=function(j){return arguments.length?(n=typeof j=="function"?j:qf(!!j),m):n},m.on=function(){var j=a.on.apply(a,arguments);return j===a?m:j},m.clickDistance=function(j){return arguments.length?(p=(j=+j)*j,m):Math.sqrt(p)},m}function Pv(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function V3(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function ch(){}var Md=.7,tp=1/Md,zo="\\s*([+-]?\\d+)\\s*",Ld="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qY=/^#([0-9a-f]{3,8})$/,UY=new RegExp(`^rgb\\(${zo},${zo},${zo}\\)$`),VY=new RegExp(`^rgb\\(${Zi},${Zi},${Zi}\\)$`),WY=new RegExp(`^rgba\\(${zo},${zo},${zo},${Ld}\\)$`),YY=new RegExp(`^rgba\\(${Zi},${Zi},${Zi},${Ld}\\)$`),GY=new RegExp(`^hsl\\(${Ld},${Zi},${Zi}\\)$`),XY=new RegExp(`^hsla\\(${Ld},${Zi},${Zi},${Ld}\\)$`),b5={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Pv(ch,yl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:v5,formatHex:v5,formatHex8:QY,formatHsl:ZY,formatRgb:w5,toString:w5});function v5(){return this.rgb().formatHex()}function QY(){return this.rgb().formatHex8()}function ZY(){return W3(this).formatHsl()}function w5(){return this.rgb().formatRgb()}function yl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=qY.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?k5(t):r===3?new In(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Uf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Uf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=UY.exec(e))?new In(t[1],t[2],t[3],1):(t=VY.exec(e))?new In(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=WY.exec(e))?Uf(t[1],t[2],t[3],t[4]):(t=YY.exec(e))?Uf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=GY.exec(e))?_5(t[1],t[2]/100,t[3]/100,1):(t=XY.exec(e))?_5(t[1],t[2]/100,t[3]/100,t[4]):b5.hasOwnProperty(e)?k5(b5[e]):e==="transparent"?new In(NaN,NaN,NaN,0):null}function k5(e){return new In(e>>16&255,e>>8&255,e&255,1)}function Uf(e,t,r,n){return n<=0&&(e=t=r=NaN),new In(e,t,r,n)}function KY(e){return e instanceof ch||(e=yl(e)),e?(e=e.rgb(),new In(e.r,e.g,e.b,e.opacity)):new In}function Hb(e,t,r,n){return arguments.length===1?KY(e):new In(e,t,r,n??1)}function In(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Pv(In,Hb,V3(ch,{brighter(e){return e=e==null?tp:Math.pow(tp,e),new In(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Md:Math.pow(Md,e),new In(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new In(hl(this.r),hl(this.g),hl(this.b),rp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:S5,formatHex:S5,formatHex8:JY,formatRgb:C5,toString:C5}));function S5(){return`#${sl(this.r)}${sl(this.g)}${sl(this.b)}`}function JY(){return`#${sl(this.r)}${sl(this.g)}${sl(this.b)}${sl((isNaN(this.opacity)?1:this.opacity)*255)}`}function C5(){const e=rp(this.opacity);return`${e===1?"rgb(":"rgba("}${hl(this.r)}, ${hl(this.g)}, ${hl(this.b)}${e===1?")":`, ${e})`}`}function rp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function sl(e){return e=hl(e),(e<16?"0":"")+e.toString(16)}function _5(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ni(e,t,r,n)}function W3(e){if(e instanceof Ni)return new Ni(e.h,e.s,e.l,e.opacity);if(e instanceof ch||(e=yl(e)),!e)return new Ni;if(e instanceof Ni)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),s=NaN,o=a-i,u=(a+i)/2;return o?(t===a?s=(r-n)/o+(r<n)*6:r===a?s=(n-t)/o+2:s=(t-r)/o+4,o/=u<.5?a+i:2-a-i,s*=60):o=u>0&&u<1?0:s,new Ni(s,o,u,e.opacity)}function eG(e,t,r,n){return arguments.length===1?W3(e):new Ni(e,t,r,n??1)}function Ni(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Pv(Ni,eG,V3(ch,{brighter(e){return e=e==null?tp:Math.pow(tp,e),new Ni(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Md:Math.pow(Md,e),new Ni(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new In(Ay(e>=240?e-240:e+120,i,n),Ay(e,i,n),Ay(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Ni(T5(this.h),Vf(this.s),Vf(this.l),rp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=rp(this.opacity);return`${e===1?"hsl(":"hsla("}${T5(this.h)}, ${Vf(this.s)*100}%, ${Vf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function T5(e){return e=(e||0)%360,e<0?e+360:e}function Vf(e){return Math.max(0,Math.min(1,e||0))}function Ay(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const ig=e=>()=>e;function Y3(e,t){return function(r){return e+r*t}}function tG(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Rfe(e,t){var r=t-e;return r?Y3(e,r>180||r<-180?r-360*Math.round(r/360):r):ig(isNaN(e)?t:e)}function rG(e){return(e=+e)==1?G3:function(t,r){return r-t?tG(t,r,e):ig(isNaN(t)?r:t)}}function G3(e,t){var r=t-e;return r?Y3(e,r):ig(isNaN(e)?t:e)}const np=(function e(t){var r=rG(t);function n(i,a){var s=r((i=Hb(i)).r,(a=Hb(a)).r),o=r(i.g,a.g),u=r(i.b,a.b),d=G3(i.opacity,a.opacity);return function(f){return i.r=s(f),i.g=o(f),i.b=u(f),i.opacity=d(f),i+""}}return n.gamma=e,n})(1);function nG(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function iG(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function aG(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),s;for(s=0;s<n;++s)i[s]=hd(e[s],t[s]);for(;s<r;++s)a[s]=t[s];return function(o){for(s=0;s<n;++s)a[s]=i[s](o);return a}}function sG(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Xi(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function lG(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=hd(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var qb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,My=new RegExp(qb.source,"g");function oG(e){return function(){return e}}function cG(e){return function(t){return e(t)+""}}function X3(e,t){var r=qb.lastIndex=My.lastIndex=0,n,i,a,s=-1,o=[],u=[];for(e=e+"",t=t+"";(n=qb.exec(e))&&(i=My.exec(t));)(a=i.index)>r&&(a=t.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,u.push({i:s,x:Xi(n,i)})),r=My.lastIndex;return r<t.length&&(a=t.slice(r),o[s]?o[s]+=a:o[++s]=a),o.length<2?u[0]?cG(u[0].x):oG(t):(t=u.length,function(d){for(var f=0,p;f<t;++f)o[(p=u[f]).i]=p.x(d);return o.join("")})}function hd(e,t){var r=typeof t,n;return t==null||r==="boolean"?ig(t):(r==="number"?Xi:r==="string"?(n=yl(t))?(t=n,np):X3:t instanceof yl?np:t instanceof Date?sG:iG(t)?nG:Array.isArray(t)?aG:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?lG:Xi)(e,t)}var E5=180/Math.PI,Ub={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Q3(e,t,r,n,i,a){var s,o,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*r+t*n)&&(r-=e*u,n-=t*u),(o=Math.sqrt(r*r+n*n))&&(r/=o,n/=o,u/=o),e*n<t*r&&(e=-e,t=-t,u=-u,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*E5,skewX:Math.atan(u)*E5,scaleX:s,scaleY:o}}var Wf;function uG(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ub:Q3(t.a,t.b,t.c,t.d,t.e,t.f)}function dG(e){return e==null||(Wf||(Wf=document.createElementNS("http://www.w3.org/2000/svg","g")),Wf.setAttribute("transform",e),!(e=Wf.transform.baseVal.consolidate()))?Ub:(e=e.matrix,Q3(e.a,e.b,e.c,e.d,e.e,e.f))}function Z3(e,t,r,n){function i(d){return d.length?d.pop()+" ":""}function a(d,f,p,m,x,b){if(d!==p||f!==m){var v=x.push("translate(",null,t,null,r);b.push({i:v-4,x:Xi(d,p)},{i:v-2,x:Xi(f,m)})}else(p||m)&&x.push("translate("+p+t+m+r)}function s(d,f,p,m){d!==f?(d-f>180?f+=360:f-d>180&&(d+=360),m.push({i:p.push(i(p)+"rotate(",null,n)-2,x:Xi(d,f)})):f&&p.push(i(p)+"rotate("+f+n)}function o(d,f,p,m){d!==f?m.push({i:p.push(i(p)+"skewX(",null,n)-2,x:Xi(d,f)}):f&&p.push(i(p)+"skewX("+f+n)}function u(d,f,p,m,x,b){if(d!==p||f!==m){var v=x.push(i(x)+"scale(",null,",",null,")");b.push({i:v-4,x:Xi(d,p)},{i:v-2,x:Xi(f,m)})}else(p!==1||m!==1)&&x.push(i(x)+"scale("+p+","+m+")")}return function(d,f){var p=[],m=[];return d=e(d),f=e(f),a(d.translateX,d.translateY,f.translateX,f.translateY,p,m),s(d.rotate,f.rotate,p,m),o(d.skewX,f.skewX,p,m),u(d.scaleX,d.scaleY,f.scaleX,f.scaleY,p,m),d=f=null,function(x){for(var b=-1,v=m.length,k;++b<v;)p[(k=m[b]).i]=k.x(x);return p.join("")}}}var hG=Z3(uG,"px, ","px)","deg)"),fG=Z3(dG,", ",")",")"),pG=1e-12;function N5(e){return((e=Math.exp(e))+1/e)/2}function gG(e){return((e=Math.exp(e))-1/e)/2}function mG(e){return((e=Math.exp(2*e))-1)/(e+1)}const x0=(function e(t,r,n){function i(a,s){var o=a[0],u=a[1],d=a[2],f=s[0],p=s[1],m=s[2],x=f-o,b=p-u,v=x*x+b*b,k,w;if(v<pG)w=Math.log(m/d)/t,k=function(M){return[o+M*x,u+M*b,d*Math.exp(t*M*w)]};else{var C=Math.sqrt(v),T=(m*m-d*d+n*v)/(2*d*r*C),j=(m*m-d*d-n*v)/(2*m*r*C),L=Math.log(Math.sqrt(T*T+1)-T),E=Math.log(Math.sqrt(j*j+1)-j);w=(E-L)/t,k=function(M){var I=M*w,P=N5(L),z=d/(r*C)*(P*mG(t*I+L)-gG(L));return[o+z*x,u+z*b,d*P/N5(t*I+L)]}}return k.duration=w*1e3*t/Math.SQRT2,k}return i.rho=function(a){var s=Math.max(.001,+a),o=s*s,u=o*o;return e(s,o,u)},i})(Math.SQRT2,2,4);var rc=0,Qu=0,Bu=0,K3=1e3,ip,Zu,ap=0,bl=0,ag=0,Dd=typeof performance=="object"&&performance.now?performance:Date,J3=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Hv(){return bl||(J3(xG),bl=Dd.now()+ag)}function xG(){bl=0}function sp(){this._call=this._time=this._next=null}sp.prototype=ej.prototype={constructor:sp,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Hv():+r)+(t==null?0:+t),!this._next&&Zu!==this&&(Zu?Zu._next=this:ip=this,Zu=this),this._call=e,this._time=r,Vb()},stop:function(){this._call&&(this._call=null,this._time=1/0,Vb())}};function ej(e,t,r){var n=new sp;return n.restart(e,t,r),n}function yG(){Hv(),++rc;for(var e=ip,t;e;)(t=bl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--rc}function j5(){bl=(ap=Dd.now())+ag,rc=Qu=0;try{yG()}finally{rc=0,vG(),bl=0}}function bG(){var e=Dd.now(),t=e-ap;t>K3&&(ag-=t,ap=e)}function vG(){for(var e,t=ip,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:ip=r);Zu=e,Vb(n)}function Vb(e){if(!rc){Qu&&(Qu=clearTimeout(Qu));var t=e-bl;t>24?(e<1/0&&(Qu=setTimeout(j5,e-Dd.now()-ag)),Bu&&(Bu=clearInterval(Bu))):(Bu||(ap=Dd.now(),Bu=setInterval(bG,K3)),rc=1,J3(j5))}}function A5(e,t,r){var n=new sp;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var wG=rg("start","end","cancel","interrupt"),kG=[],tj=0,M5=1,Wb=2,y0=3,L5=4,Yb=5,b0=6;function sg(e,t,r,n,i,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;SG(e,r,{name:t,index:n,group:i,on:wG,tween:kG,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:tj})}function qv(e,t){var r=zi(e,t);if(r.state>tj)throw new Error("too late; already scheduled");return r}function na(e,t){var r=zi(e,t);if(r.state>y0)throw new Error("too late; already running");return r}function zi(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function SG(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=ej(a,0,r.time);function a(d){r.state=M5,r.timer.restart(s,r.delay,r.time),r.delay<=d&&s(d-r.delay)}function s(d){var f,p,m,x;if(r.state!==M5)return u();for(f in n)if(x=n[f],x.name===r.name){if(x.state===y0)return A5(s);x.state===L5?(x.state=b0,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete n[f]):+f<t&&(x.state=b0,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete n[f])}if(A5(function(){r.state===y0&&(r.state=L5,r.timer.restart(o,r.delay,r.time),o(d))}),r.state=Wb,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Wb){for(r.state=y0,i=new Array(m=r.tween.length),f=0,p=-1;f<m;++f)(x=r.tween[f].value.call(e,e.__data__,r.index,r.group))&&(i[++p]=x);i.length=p+1}}function o(d){for(var f=d<r.duration?r.ease.call(null,d/r.duration):(r.timer.restart(u),r.state=Yb,1),p=-1,m=i.length;++p<m;)i[p].call(e,f);r.state===Yb&&(r.on.call("end",e,e.__data__,r.index,r.group),u())}function u(){r.state=b0,r.timer.stop(),delete n[t];for(var d in n)return;delete e.__transition}}function v0(e,t){var r=e.__transition,n,i,a=!0,s;if(r){t=t==null?null:t+"";for(s in r){if((n=r[s]).name!==t){a=!1;continue}i=n.state>Wb&&n.state<Yb,n.state=b0,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[s]}a&&delete e.__transition}}function CG(e){return this.each(function(){v0(this,e)})}function _G(e,t){var r,n;return function(){var i=na(this,e),a=i.tween;if(a!==r){n=r=a;for(var s=0,o=n.length;s<o;++s)if(n[s].name===t){n=n.slice(),n.splice(s,1);break}}i.tween=n}}function TG(e,t,r){var n,i;if(typeof r!="function")throw new Error;return function(){var a=na(this,e),s=a.tween;if(s!==n){i=(n=s).slice();for(var o={name:t,value:r},u=0,d=i.length;u<d;++u)if(i[u].name===t){i[u]=o;break}u===d&&i.push(o)}a.tween=i}}function EG(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=zi(this.node(),r).tween,i=0,a=n.length,s;i<a;++i)if((s=n[i]).name===e)return s.value;return null}return this.each((t==null?_G:TG)(r,e,t))}function Uv(e,t,r){var n=e._id;return e.each(function(){var i=na(this,n);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return zi(i,n).value[t]}}function rj(e,t){var r;return(typeof t=="number"?Xi:t instanceof yl?np:(r=yl(t))?(t=r,np):X3)(e,t)}function NG(e){return function(){this.removeAttribute(e)}}function jG(e){return function(){this.removeAttributeNS(e.space,e.local)}}function AG(e,t,r){var n,i=r+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===n?a:a=t(n=s,r)}}function MG(e,t,r){var n,i=r+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===n?a:a=t(n=s,r)}}function LG(e,t,r){var n,i,a;return function(){var s,o=r(this),u;return o==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=o+"",s===u?null:s===n&&u===i?a:(i=u,a=t(n=s,o)))}}function DG(e,t,r){var n,i,a;return function(){var s,o=r(this),u;return o==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=o+"",s===u?null:s===n&&u===i?a:(i=u,a=t(n=s,o)))}}function RG(e,t){var r=ng(e),n=r==="transform"?fG:rj;return this.attrTween(e,typeof t=="function"?(r.local?DG:LG)(r,n,Uv(this,"attr."+e,t)):t==null?(r.local?jG:NG)(r):(r.local?MG:AG)(r,n,t))}function OG(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function BG(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function $G(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&BG(e,a)),r}return i._value=t,i}function zG(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&OG(e,a)),r}return i._value=t,i}function IG(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=ng(e);return this.tween(r,(n.local?$G:zG)(n,t))}function FG(e,t){return function(){qv(this,e).delay=+t.apply(this,arguments)}}function PG(e,t){return t=+t,function(){qv(this,e).delay=t}}function HG(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?FG:PG)(t,e)):zi(this.node(),t).delay}function qG(e,t){return function(){na(this,e).duration=+t.apply(this,arguments)}}function UG(e,t){return t=+t,function(){na(this,e).duration=t}}function VG(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qG:UG)(t,e)):zi(this.node(),t).duration}function WG(e,t){if(typeof t!="function")throw new Error;return function(){na(this,e).ease=t}}function YG(e){var t=this._id;return arguments.length?this.each(WG(t,e)):zi(this.node(),t).ease}function GG(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;na(this,e).ease=r}}function XG(e){if(typeof e!="function")throw new Error;return this.each(GG(this._id,e))}function QG(e){typeof e!="function"&&(e=L3(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],s=a.length,o=n[i]=[],u,d=0;d<s;++d)(u=a[d])&&e.call(u,u.__data__,d,a)&&o.push(u);return new La(n,this._parents,this._name,this._id)}function ZG(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,a=Math.min(n,i),s=new Array(n),o=0;o<a;++o)for(var u=t[o],d=r[o],f=u.length,p=s[o]=new Array(f),m,x=0;x<f;++x)(m=u[x]||d[x])&&(p[x]=m);for(;o<n;++o)s[o]=t[o];return new La(s,this._parents,this._name,this._id)}function KG(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function JG(e,t,r){var n,i,a=KG(t)?qv:na;return function(){var s=a(this,e),o=s.on;o!==n&&(i=(n=o).copy()).on(t,r),s.on=i}}function eX(e,t){var r=this._id;return arguments.length<2?zi(this.node(),r).on.on(e):this.each(JG(r,e,t))}function tX(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function rX(){return this.on("end.remove",tX(this._id))}function nX(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Iv(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],u=o.length,d=a[s]=new Array(u),f,p,m=0;m<u;++m)(f=o[m])&&(p=e.call(f,f.__data__,m,o))&&("__data__"in f&&(p.__data__=f.__data__),d[m]=p,sg(d[m],t,r,m,d,zi(f,r)));return new La(a,this._parents,t,r)}function iX(e){var t=this._name,r=this._id;typeof e!="function"&&(e=M3(e));for(var n=this._groups,i=n.length,a=[],s=[],o=0;o<i;++o)for(var u=n[o],d=u.length,f,p=0;p<d;++p)if(f=u[p]){for(var m=e.call(f,f.__data__,p,u),x,b=zi(f,r),v=0,k=m.length;v<k;++v)(x=m[v])&&sg(x,t,r,v,m,b);a.push(m),s.push(f)}return new La(a,s,t,r)}var aX=oh.prototype.constructor;function sX(){return new aX(this._groups,this._parents)}function lX(e,t){var r,n,i;return function(){var a=tc(this,e),s=(this.style.removeProperty(e),tc(this,e));return a===s?null:a===r&&s===n?i:i=t(r=a,n=s)}}function nj(e){return function(){this.style.removeProperty(e)}}function oX(e,t,r){var n,i=r+"",a;return function(){var s=tc(this,e);return s===i?null:s===n?a:a=t(n=s,r)}}function cX(e,t,r){var n,i,a;return function(){var s=tc(this,e),o=r(this),u=o+"";return o==null&&(u=o=(this.style.removeProperty(e),tc(this,e))),s===u?null:s===n&&u===i?a:(i=u,a=t(n=s,o))}}function uX(e,t){var r,n,i,a="style."+t,s="end."+a,o;return function(){var u=na(this,e),d=u.on,f=u.value[a]==null?o||(o=nj(t)):void 0;(d!==r||i!==f)&&(n=(r=d).copy()).on(s,i=f),u.on=n}}function dX(e,t,r){var n=(e+="")=="transform"?hG:rj;return t==null?this.styleTween(e,lX(e,n)).on("end.style."+e,nj(e)):typeof t=="function"?this.styleTween(e,cX(e,n,Uv(this,"style."+e,t))).each(uX(this._id,e)):this.styleTween(e,oX(e,n,t),r).on("end.style."+e,null)}function hX(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function fX(e,t,r){var n,i;function a(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&hX(e,s,r)),n}return a._value=t,a}function pX(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,fX(e,t,r??""))}function gX(e){return function(){this.textContent=e}}function mX(e){return function(){var t=e(this);this.textContent=t??""}}function xX(e){return this.tween("text",typeof e=="function"?mX(Uv(this,"text",e)):gX(e==null?"":e+""))}function yX(e){return function(t){this.textContent=e.call(this,t)}}function bX(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&yX(i)),t}return n._value=e,n}function vX(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,bX(e))}function wX(){for(var e=this._name,t=this._id,r=ij(),n=this._groups,i=n.length,a=0;a<i;++a)for(var s=n[a],o=s.length,u,d=0;d<o;++d)if(u=s[d]){var f=zi(u,t);sg(u,e,r,d,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new La(n,this._parents,e,r)}function kX(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(a,s){var o={value:s},u={value:function(){--i===0&&a()}};r.each(function(){var d=na(this,n),f=d.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(u)),d.on=t}),i===0&&a()})}var SX=0;function La(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function ij(){return++SX}var _a=oh.prototype;La.prototype={constructor:La,select:nX,selectAll:iX,selectChild:_a.selectChild,selectChildren:_a.selectChildren,filter:QG,merge:ZG,selection:sX,transition:wX,call:_a.call,nodes:_a.nodes,node:_a.node,size:_a.size,empty:_a.empty,each:_a.each,on:eX,attr:RG,attrTween:IG,style:dX,styleTween:pX,text:xX,textTween:vX,remove:rX,tween:EG,delay:HG,duration:VG,ease:YG,easeVarying:XG,end:kX,[Symbol.iterator]:_a[Symbol.iterator]};function CX(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var _X={time:null,delay:0,duration:250,ease:CX};function TX(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function EX(e){var t,r;e instanceof La?(t=e._id,e=e._name):(t=ij(),(r=_X).time=Hv(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,a=0;a<i;++a)for(var s=n[a],o=s.length,u,d=0;d<o;++d)(u=s[d])&&sg(u,e,t,d,s,r||TX(u,t));return new La(n,this._parents,e,t)}oh.prototype.interrupt=CG;oh.prototype.transition=EX;const Gb=Math.PI,Xb=2*Gb,el=1e-6,NX=Xb-el;function aj(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function jX(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return aj;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class AX{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?aj:jX(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,s){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,u=n-t,d=i-r,f=s-t,p=o-r,m=f*f+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(m>el)if(!(Math.abs(p*u-d*f)>el)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let x=n-s,b=i-o,v=u*u+d*d,k=x*x+b*b,w=Math.sqrt(v),C=Math.sqrt(m),T=a*Math.tan((Gb-Math.acos((v+m-k)/(2*w*C)))/2),j=T/C,L=T/w;Math.abs(j-1)>el&&this._append`L${t+j*f},${r+j*p}`,this._append`A${a},${a},0,0,${+(p*x>f*b)},${this._x1=t+L*u},${this._y1=r+L*d}`}}arc(t,r,n,i,a,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),u=n*Math.sin(i),d=t+o,f=r+u,p=1^s,m=s?i-a:a-i;this._x1===null?this._append`M${d},${f}`:(Math.abs(this._x1-d)>el||Math.abs(this._y1-f)>el)&&this._append`L${d},${f}`,n&&(m<0&&(m=m%Xb+Xb),m>NX?this._append`A${n},${n},0,1,${p},${t-o},${r-u}A${n},${n},0,1,${p},${this._x1=d},${this._y1=f}`:m>el&&this._append`A${n},${n},0,${+(m>=Gb)},${p},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function wo(e){return function(){return e}}const Ofe=Math.abs,Bfe=Math.atan2,$fe=Math.cos,zfe=Math.max,Ife=Math.min,Ffe=Math.sin,Pfe=Math.sqrt,D5=1e-12,Vv=Math.PI,R5=Vv/2,Hfe=2*Vv;function qfe(e){return e>1?0:e<-1?Vv:Math.acos(e)}function Ufe(e){return e>=1?R5:e<=-1?-R5:Math.asin(e)}function MX(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new AX(t)}function LX(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sj(e){this._context=e}sj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function lp(e){return new sj(e)}function DX(e){return e[0]}function RX(e){return e[1]}function OX(e,t){var r=wo(!0),n=null,i=lp,a=null,s=MX(o);e=typeof e=="function"?e:e===void 0?DX:wo(e),t=typeof t=="function"?t:t===void 0?RX:wo(t);function o(u){var d,f=(u=LX(u)).length,p,m=!1,x;for(n==null&&(a=i(x=s())),d=0;d<=f;++d)!(d<f&&r(p=u[d],d,u))===m&&((m=!m)?a.lineStart():a.lineEnd()),m&&a.point(+e(p,d,u),+t(p,d,u));if(x)return a=null,x+""||null}return o.x=function(u){return arguments.length?(e=typeof u=="function"?u:wo(+u),o):e},o.y=function(u){return arguments.length?(t=typeof u=="function"?u:wo(+u),o):t},o.defined=function(u){return arguments.length?(r=typeof u=="function"?u:wo(!!u),o):r},o.curve=function(u){return arguments.length?(i=u,n!=null&&(a=i(n)),o):i},o.context=function(u){return arguments.length?(u==null?n=a=null:a=i(n=u),o):n},o}class lj{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function oj(e){return new lj(e,!0)}function cj(e){return new lj(e,!1)}function ws(){}function op(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function lg(e){this._context=e}lg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:op(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:op(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function w0(e){return new lg(e)}function uj(e){this._context=e}uj.prototype={areaStart:ws,areaEnd:ws,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:op(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function BX(e){return new uj(e)}function dj(e){this._context=e}dj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:op(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $X(e){return new dj(e)}function hj(e,t){this._basis=new lg(e),this._beta=t}hj.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],a=e[r]-n,s=t[r]-i,o=-1,u;++o<=r;)u=o/r,this._basis.point(this._beta*e[o]+(1-this._beta)*(n+u*a),this._beta*t[o]+(1-this._beta)*(i+u*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const zX=(function e(t){function r(n){return t===1?new lg(n):new hj(n,t)}return r.beta=function(n){return e(+n)},r})(.85);function cp(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Wv(e,t){this._context=e,this._k=(1-t)/6}Wv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:cp(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:cp(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const fj=(function e(t){function r(n){return new Wv(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Yv(e,t){this._context=e,this._k=(1-t)/6}Yv.prototype={areaStart:ws,areaEnd:ws,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:cp(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const IX=(function e(t){function r(n){return new Yv(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Gv(e,t){this._context=e,this._k=(1-t)/6}Gv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:cp(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const FX=(function e(t){function r(n){return new Gv(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Xv(e,t,r){var n=e._x1,i=e._y1,a=e._x2,s=e._y2;if(e._l01_a>D5){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>D5){var d=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,f=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*d+e._x1*e._l23_2a-t*e._l12_2a)/f,s=(s*d+e._y1*e._l23_2a-r*e._l12_2a)/f}e._context.bezierCurveTo(n,i,a,s,e._x2,e._y2)}function pj(e,t){this._context=e,this._alpha=t}pj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Xv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const gj=(function e(t){function r(n){return t?new pj(n,t):new Wv(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function mj(e,t){this._context=e,this._alpha=t}mj.prototype={areaStart:ws,areaEnd:ws,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Xv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const PX=(function e(t){function r(n){return t?new mj(n,t):new Yv(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function xj(e,t){this._context=e,this._alpha=t}xj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const HX=(function e(t){function r(n){return t?new xj(n,t):new Gv(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function yj(e){this._context=e}yj.prototype={areaStart:ws,areaEnd:ws,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function qX(e){return new yj(e)}function O5(e){return e<0?-1:1}function B5(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),s=(r-e._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(O5(a)+O5(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function $5(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ly(e,t,r){var n=e._x0,i=e._y0,a=e._x1,s=e._y1,o=(a-n)/3;e._context.bezierCurveTo(n+o,i+o*t,a-o,s-o*r,a,s)}function up(e){this._context=e}up.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ly(this,this._t0,$5(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ly(this,$5(this,r=B5(this,e,t)),r);break;default:Ly(this,this._t0,r=B5(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function bj(e){this._context=new vj(e)}(bj.prototype=Object.create(up.prototype)).point=function(e,t){up.prototype.point.call(this,t,e)};function vj(e){this._context=e}vj.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function wj(e){return new up(e)}function kj(e){return new bj(e)}function Sj(e){this._context=e}Sj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=z5(e),i=z5(t),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function z5(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),s=new Array(r);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,s[t]-=n*s[t-1];for(i[r-1]=s[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Cj(e){return new Sj(e)}function og(e,t){this._context=e,this._t=t}og.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function _j(e){return new og(e,.5)}function Tj(e){return new og(e,0)}function Ej(e){return new og(e,1)}const Yf=e=>()=>e;function UX(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}function Na(e,t,r){this.k=e,this.x=t,this.y=r}Na.prototype={constructor:Na,scale:function(e){return e===1?this:new Na(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Na(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var cg=new Na(1,0,0);Nj.prototype=Na.prototype;function Nj(e){for(;!e.__zoom;)if(!(e=e.parentNode))return cg;return e.__zoom}function Dy(e){e.stopImmediatePropagation()}function $u(e){e.preventDefault(),e.stopImmediatePropagation()}function VX(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function WX(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function I5(){return this.__zoom||cg}function YX(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function GX(){return navigator.maxTouchPoints||"ontouchstart"in this}function XX(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],a=e.invertY(t[0][1])-r[0][1],s=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function jj(){var e=VX,t=WX,r=XX,n=YX,i=GX,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],o=250,u=x0,d=rg("start","zoom","end"),f,p,m,x=500,b=150,v=0,k=10;function w(B){B.property("__zoom",I5).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",z).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",W).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(B,U,R,H){var V=B.selection?B.selection():B;V.property("__zoom",I5),B!==V?L(B,U,R,H):V.interrupt().each(function(){E(this,arguments).event(H).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},w.scaleBy=function(B,U,R,H){w.scaleTo(B,function(){var V=this.__zoom.k,Q=typeof U=="function"?U.apply(this,arguments):U;return V*Q},R,H)},w.scaleTo=function(B,U,R,H){w.transform(B,function(){var V=t.apply(this,arguments),Q=this.__zoom,A=R==null?j(V):typeof R=="function"?R.apply(this,arguments):R,D=Q.invert(A),G=typeof U=="function"?U.apply(this,arguments):U;return r(T(C(Q,G),A,D),V,s)},R,H)},w.translateBy=function(B,U,R,H){w.transform(B,function(){return r(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),s)},null,H)},w.translateTo=function(B,U,R,H,V){w.transform(B,function(){var Q=t.apply(this,arguments),A=this.__zoom,D=H==null?j(Q):typeof H=="function"?H.apply(this,arguments):H;return r(cg.translate(D[0],D[1]).scale(A.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof R=="function"?-R.apply(this,arguments):-R),Q,s)},H,V)};function C(B,U){return U=Math.max(a[0],Math.min(a[1],U)),U===B.k?B:new Na(U,B.x,B.y)}function T(B,U,R){var H=U[0]-R[0]*B.k,V=U[1]-R[1]*B.k;return H===B.x&&V===B.y?B:new Na(B.k,H,V)}function j(B){return[(+B[0][0]+ +B[1][0])/2,(+B[0][1]+ +B[1][1])/2]}function L(B,U,R,H){B.on("start.zoom",function(){E(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(H).end()}).tween("zoom",function(){var V=this,Q=arguments,A=E(V,Q).event(H),D=t.apply(V,Q),G=R==null?j(D):typeof R=="function"?R.apply(V,Q):R,q=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),Z=V.__zoom,re=typeof U=="function"?U.apply(V,Q):U,J=u(Z.invert(G).concat(q/Z.k),re.invert(G).concat(q/re.k));return function(ie){if(ie===1)ie=re;else{var ne=J(ie),oe=q/ne[2];ie=new Na(oe,G[0]-ne[0]*oe,G[1]-ne[1]*oe)}A.zoom(null,ie)}})}function E(B,U,R){return!R&&B.__zooming||new M(B,U)}function M(B,U){this.that=B,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(B,U),this.taps=0}M.prototype={event:function(B){return B&&(this.sourceEvent=B),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(B,U){return this.mouse&&B!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&B!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&B!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(B){var U=et(this.that).datum();d.call(B,this.that,new UX(B,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:d}),U)}};function I(B,...U){if(!e.apply(this,arguments))return;var R=E(this,U).event(B),H=this.__zoom,V=Math.max(a[0],Math.min(a[1],H.k*Math.pow(2,n.apply(this,arguments)))),Q=_i(B);if(R.wheel)(R.mouse[0][0]!==Q[0]||R.mouse[0][1]!==Q[1])&&(R.mouse[1]=H.invert(R.mouse[0]=Q)),clearTimeout(R.wheel);else{if(H.k===V)return;R.mouse=[Q,H.invert(Q)],v0(this),R.start()}$u(B),R.wheel=setTimeout(A,b),R.zoom("mouse",r(T(C(H,V),R.mouse[0],R.mouse[1]),R.extent,s));function A(){R.wheel=null,R.end()}}function P(B,...U){if(m||!e.apply(this,arguments))return;var R=B.currentTarget,H=E(this,U,!0).event(B),V=et(B.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",q,!0),Q=_i(B,R),A=B.clientX,D=B.clientY;H3(B.view),Dy(B),H.mouse=[Q,this.__zoom.invert(Q)],v0(this),H.start();function G(Z){if($u(Z),!H.moved){var re=Z.clientX-A,J=Z.clientY-D;H.moved=re*re+J*J>v}H.event(Z).zoom("mouse",r(T(H.that.__zoom,H.mouse[0]=_i(Z,R),H.mouse[1]),H.extent,s))}function q(Z){V.on("mousemove.zoom mouseup.zoom",null),q3(Z.view,H.moved),$u(Z),H.event(Z).end()}}function z(B,...U){if(e.apply(this,arguments)){var R=this.__zoom,H=_i(B.changedTouches?B.changedTouches[0]:B,this),V=R.invert(H),Q=R.k*(B.shiftKey?.5:2),A=r(T(C(R,Q),H,V),t.apply(this,U),s);$u(B),o>0?et(this).transition().duration(o).call(L,A,H,B):et(this).call(w.transform,A,H,B)}}function $(B,...U){if(e.apply(this,arguments)){var R=B.touches,H=R.length,V=E(this,U,B.changedTouches.length===H).event(B),Q,A,D,G;for(Dy(B),A=0;A<H;++A)D=R[A],G=_i(D,this),G=[G,this.__zoom.invert(G),D.identifier],V.touch0?!V.touch1&&V.touch0[2]!==G[2]&&(V.touch1=G,V.taps=0):(V.touch0=G,Q=!0,V.taps=1+!!f);f&&(f=clearTimeout(f)),Q&&(V.taps<2&&(p=G[0],f=setTimeout(function(){f=null},x)),v0(this),V.start())}}function W(B,...U){if(this.__zooming){var R=E(this,U).event(B),H=B.changedTouches,V=H.length,Q,A,D,G;for($u(B),Q=0;Q<V;++Q)A=H[Q],D=_i(A,this),R.touch0&&R.touch0[2]===A.identifier?R.touch0[0]=D:R.touch1&&R.touch1[2]===A.identifier&&(R.touch1[0]=D);if(A=R.that.__zoom,R.touch1){var q=R.touch0[0],Z=R.touch0[1],re=R.touch1[0],J=R.touch1[1],ie=(ie=re[0]-q[0])*ie+(ie=re[1]-q[1])*ie,ne=(ne=J[0]-Z[0])*ne+(ne=J[1]-Z[1])*ne;A=C(A,Math.sqrt(ie/ne)),D=[(q[0]+re[0])/2,(q[1]+re[1])/2],G=[(Z[0]+J[0])/2,(Z[1]+J[1])/2]}else if(R.touch0)D=R.touch0[0],G=R.touch0[1];else return;R.zoom("touch",r(T(A,D,G),R.extent,s))}}function Y(B,...U){if(this.__zooming){var R=E(this,U).event(B),H=B.changedTouches,V=H.length,Q,A;for(Dy(B),m&&clearTimeout(m),m=setTimeout(function(){m=null},x),Q=0;Q<V;++Q)A=H[Q],R.touch0&&R.touch0[2]===A.identifier?delete R.touch0:R.touch1&&R.touch1[2]===A.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(A=_i(A,this),Math.hypot(p[0]-A[0],p[1]-A[1])<k)){var D=et(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return w.wheelDelta=function(B){return arguments.length?(n=typeof B=="function"?B:Yf(+B),w):n},w.filter=function(B){return arguments.length?(e=typeof B=="function"?B:Yf(!!B),w):e},w.touchable=function(B){return arguments.length?(i=typeof B=="function"?B:Yf(!!B),w):i},w.extent=function(B){return arguments.length?(t=typeof B=="function"?B:Yf([[+B[0][0],+B[0][1]],[+B[1][0],+B[1][1]]]),w):t},w.scaleExtent=function(B){return arguments.length?(a[0]=+B[0],a[1]=+B[1],w):[a[0],a[1]]},w.translateExtent=function(B){return arguments.length?(s[0][0]=+B[0][0],s[1][0]=+B[1][0],s[0][1]=+B[0][1],s[1][1]=+B[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(B){return arguments.length?(r=B,w):r},w.duration=function(B){return arguments.length?(o=+B,w):o},w.interpolate=function(B){return arguments.length?(u=B,w):u},w.on=function(){var B=d.on.apply(d,arguments);return B===d?w:B},w.clickDistance=function(B){return arguments.length?(v=(B=+B)*B,w):Math.sqrt(v)},w.tapDistance=function(B){return arguments.length?(k=+B,w):k},w}var QX=O(e=>{var i;const{securityLevel:t}=Dt();let r=et("body");if(t==="sandbox"){const s=((i=et(`#i${e}`).node())==null?void 0:i.contentDocument)??document;r=et(s.body)}return r.select(`#${e}`)},"selectSvgElement");function Qv(e){return typeof e>"u"||e===null}O(Qv,"isNothing");function Aj(e){return typeof e=="object"&&e!==null}O(Aj,"isObject");function Mj(e){return Array.isArray(e)?e:Qv(e)?[]:[e]}O(Mj,"toArray");function Lj(e,t){var r,n,i,a;if(t)for(a=Object.keys(t),r=0,n=a.length;r<n;r+=1)i=a[r],e[i]=t[i];return e}O(Lj,"extend");function Dj(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}O(Dj,"repeat");function Rj(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}O(Rj,"isNegativeZero");var ZX=Qv,KX=Aj,JX=Mj,eQ=Dj,tQ=Rj,rQ=Lj,Or={isNothing:ZX,isObject:KX,toArray:JX,repeat:eQ,isNegativeZero:tQ,extend:rQ};function Zv(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
230
-
231
- `+e.mark.snippet),n+" "+r):n}O(Zv,"formatError");function nc(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Zv(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}O(nc,"YAMLException$1");nc.prototype=Object.create(Error.prototype);nc.prototype.constructor=nc;nc.prototype.toString=O(function(t){return this.name+": "+Zv(this,t)},"toString");var $n=nc;function k0(e,t,r,n,i){var a="",s="",o=Math.floor(i/2)-1;return n-t>o&&(a=" ... ",t=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+e.slice(t,r).replace(/\t/g,"→")+s,pos:n-t+a.length}}O(k0,"getLine");function S0(e,t){return Or.repeat(" ",t-e.length)+e}O(S0,"padStart");function Oj(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(e.buffer);)i.push(a.index),n.push(a.index+a[0].length),e.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",u,d,f=Math.min(e.line+t.linesAfter,i.length).toString().length,p=t.maxLength-(t.indent+f+3);for(u=1;u<=t.linesBefore&&!(s-u<0);u++)d=k0(e.buffer,n[s-u],i[s-u],e.position-(n[s]-n[s-u]),p),o=Or.repeat(" ",t.indent)+S0((e.line-u+1).toString(),f)+" | "+d.str+`
232
- `+o;for(d=k0(e.buffer,n[s],i[s],e.position,p),o+=Or.repeat(" ",t.indent)+S0((e.line+1).toString(),f)+" | "+d.str+`
233
- `,o+=Or.repeat("-",t.indent+f+3+d.pos)+`^
234
- `,u=1;u<=t.linesAfter&&!(s+u>=i.length);u++)d=k0(e.buffer,n[s+u],i[s+u],e.position-(n[s]-n[s+u]),p),o+=Or.repeat(" ",t.indent)+S0((e.line+u+1).toString(),f)+" | "+d.str+`
235
- `;return o.replace(/\n$/,"")}O(Oj,"makeSnippet");var nQ=Oj,iQ=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],aQ=["scalar","sequence","mapping"];function Bj(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}O(Bj,"compileStyleAliases");function $j(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(iQ.indexOf(r)===-1)throw new $n('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Bj(t.styleAliases||null),aQ.indexOf(this.kind)===-1)throw new $n('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}O($j,"Type$1");var un=$j;function Qb(e,t){var r=[];return e[t].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}O(Qb,"compileList");function zj(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(O(n,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}O(zj,"compileMap");function dp(e){return this.extend(e)}O(dp,"Schema$1");dp.prototype.extend=O(function(t){var r=[],n=[];if(t instanceof un)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new $n("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(a){if(!(a instanceof un))throw new $n("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new $n("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new $n("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(a){if(!(a instanceof un))throw new $n("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(dp.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=Qb(i,"implicit"),i.compiledExplicit=Qb(i,"explicit"),i.compiledTypeMap=zj(i.compiledImplicit,i.compiledExplicit),i},"extend");var sQ=dp,lQ=new un("tag:yaml.org,2002:str",{kind:"scalar",construct:O(function(e){return e!==null?e:""},"construct")}),oQ=new un("tag:yaml.org,2002:seq",{kind:"sequence",construct:O(function(e){return e!==null?e:[]},"construct")}),cQ=new un("tag:yaml.org,2002:map",{kind:"mapping",construct:O(function(e){return e!==null?e:{}},"construct")}),uQ=new sQ({explicit:[lQ,oQ,cQ]});function Ij(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}O(Ij,"resolveYamlNull");function Fj(){return null}O(Fj,"constructYamlNull");function Pj(e){return e===null}O(Pj,"isNull");var dQ=new un("tag:yaml.org,2002:null",{kind:"scalar",resolve:Ij,construct:Fj,predicate:Pj,represent:{canonical:O(function(){return"~"},"canonical"),lowercase:O(function(){return"null"},"lowercase"),uppercase:O(function(){return"NULL"},"uppercase"),camelcase:O(function(){return"Null"},"camelcase"),empty:O(function(){return""},"empty")},defaultStyle:"lowercase"});function Hj(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}O(Hj,"resolveYamlBoolean");function qj(e){return e==="true"||e==="True"||e==="TRUE"}O(qj,"constructYamlBoolean");function Uj(e){return Object.prototype.toString.call(e)==="[object Boolean]"}O(Uj,"isBoolean");var hQ=new un("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Hj,construct:qj,predicate:Uj,represent:{lowercase:O(function(e){return e?"true":"false"},"lowercase"),uppercase:O(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:O(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function Vj(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}O(Vj,"isHexCode");function Wj(e){return 48<=e&&e<=55}O(Wj,"isOctCode");function Yj(e){return 48<=e&&e<=57}O(Yj,"isDecCode");function Gj(e){if(e===null)return!1;var t=e.length,r=0,n=!1,i;if(!t)return!1;if(i=e[r],(i==="-"||i==="+")&&(i=e[++r]),i==="0"){if(r+1===t)return!0;if(i=e[++r],i==="b"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;n=!0}return n&&i!=="_"}if(i==="x"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!Vj(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}if(i==="o"){for(r++;r<t;r++)if(i=e[r],i!=="_"){if(!Wj(e.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}}if(i==="_")return!1;for(;r<t;r++)if(i=e[r],i!=="_"){if(!Yj(e.charCodeAt(r)))return!1;n=!0}return!(!n||i==="_")}O(Gj,"resolveYamlInteger");function Xj(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}O(Xj,"constructYamlInteger");function Qj(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Or.isNegativeZero(e)}O(Qj,"isInteger");var fQ=new un("tag:yaml.org,2002:int",{kind:"scalar",resolve:Gj,construct:Xj,predicate:Qj,represent:{binary:O(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:O(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:O(function(e){return e.toString(10)},"decimal"),hexadecimal:O(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),pQ=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Zj(e){return!(e===null||!pQ.test(e)||e[e.length-1]==="_")}O(Zj,"resolveYamlFloat");function Kj(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}O(Kj,"constructYamlFloat");var gQ=/^[-+]?[0-9]+e/;function Jj(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Or.isNegativeZero(e))return"-0.0";return r=e.toString(10),gQ.test(r)?r.replace("e",".e"):r}O(Jj,"representYamlFloat");function eA(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Or.isNegativeZero(e))}O(eA,"isFloat");var mQ=new un("tag:yaml.org,2002:float",{kind:"scalar",resolve:Zj,construct:Kj,predicate:eA,represent:Jj,defaultStyle:"lowercase"}),tA=uQ.extend({implicit:[dQ,hQ,fQ,mQ]}),xQ=tA,rA=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),nA=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function iA(e){return e===null?!1:rA.exec(e)!==null||nA.exec(e)!==null}O(iA,"resolveYamlTimestamp");function aA(e){var t,r,n,i,a,s,o,u=0,d=null,f,p,m;if(t=rA.exec(e),t===null&&(t=nA.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(r,n,i));if(a=+t[4],s=+t[5],o=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(f=+t[10],p=+(t[11]||0),d=(f*60+p)*6e4,t[9]==="-"&&(d=-d)),m=new Date(Date.UTC(r,n,i,a,s,o,u)),d&&m.setTime(m.getTime()-d),m}O(aA,"constructYamlTimestamp");function sA(e){return e.toISOString()}O(sA,"representYamlTimestamp");var yQ=new un("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:iA,construct:aA,instanceOf:Date,represent:sA});function lA(e){return e==="<<"||e===null}O(lA,"resolveYamlMerge");var bQ=new un("tag:yaml.org,2002:merge",{kind:"scalar",resolve:lA}),Kv=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
236
- \r`;function oA(e){if(e===null)return!1;var t,r,n=0,i=e.length,a=Kv;for(r=0;r<i;r++)if(t=a.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}O(oA,"resolveYamlBinary");function cA(e){var t,r,n=e.replace(/[\r\n=]/g,""),i=n.length,a=Kv,s=0,o=[];for(t=0;t<i;t++)t%4===0&&t&&(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(t));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}O(cA,"constructYamlBinary");function uA(e){var t="",r=0,n,i,a=e.length,s=Kv;for(n=0;n<a;n++)n%3===0&&n&&(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[n];return i=a%3,i===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):i===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):i===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}O(uA,"representYamlBinary");function dA(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}O(dA,"isBinary");var vQ=new un("tag:yaml.org,2002:binary",{kind:"scalar",resolve:oA,construct:cA,predicate:dA,represent:uA}),wQ=Object.prototype.hasOwnProperty,kQ=Object.prototype.toString;function hA(e){if(e===null)return!0;var t=[],r,n,i,a,s,o=e;for(r=0,n=o.length;r<n;r+=1){if(i=o[r],s=!1,kQ.call(i)!=="[object Object]")return!1;for(a in i)if(wQ.call(i,a))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}O(hA,"resolveYamlOmap");function fA(e){return e!==null?e:[]}O(fA,"constructYamlOmap");var SQ=new un("tag:yaml.org,2002:omap",{kind:"sequence",resolve:hA,construct:fA}),CQ=Object.prototype.toString;function pA(e){if(e===null)return!0;var t,r,n,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(n=s[t],CQ.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;a[t]=[i[0],n[i[0]]]}return!0}O(pA,"resolveYamlPairs");function gA(e){if(e===null)return[];var t,r,n,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1)n=s[t],i=Object.keys(n),a[t]=[i[0],n[i[0]]];return a}O(gA,"constructYamlPairs");var _Q=new un("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:pA,construct:gA}),TQ=Object.prototype.hasOwnProperty;function mA(e){if(e===null)return!0;var t,r=e;for(t in r)if(TQ.call(r,t)&&r[t]!==null)return!1;return!0}O(mA,"resolveYamlSet");function xA(e){return e!==null?e:{}}O(xA,"constructYamlSet");var EQ=new un("tag:yaml.org,2002:set",{kind:"mapping",resolve:mA,construct:xA}),yA=xQ.extend({implicit:[yQ,bQ],explicit:[vQ,SQ,_Q,EQ]}),ks=Object.prototype.hasOwnProperty,hp=1,bA=2,vA=3,fp=4,Ry=1,NQ=2,F5=3,jQ=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,AQ=/[\x85\u2028\u2029]/,MQ=/[,\[\]\{\}]/,wA=/^(?:!|!!|![a-z\-]+!)$/i,kA=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Zb(e){return Object.prototype.toString.call(e)}O(Zb,"_class");function Di(e){return e===10||e===13}O(Di,"is_EOL");function ms(e){return e===9||e===32}O(ms,"is_WHITE_SPACE");function wn(e){return e===9||e===32||e===10||e===13}O(wn,"is_WS_OR_EOL");function ll(e){return e===44||e===91||e===93||e===123||e===125}O(ll,"is_FLOW_INDICATOR");function SA(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}O(SA,"fromHexCode");function CA(e){return e===120?2:e===117?4:e===85?8:0}O(CA,"escapedHexLen");function _A(e){return 48<=e&&e<=57?e-48:-1}O(_A,"fromDecimalCode");function Kb(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
237
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}O(Kb,"simpleEscapeSequence");function TA(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}O(TA,"charFromCodepoint");var EA=new Array(256),NA=new Array(256);for(Ks=0;Ks<256;Ks++)EA[Ks]=Kb(Ks)?1:0,NA[Ks]=Kb(Ks);var Ks;function jA(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||yA,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}O(jA,"State$1");function Jv(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=nQ(r),new $n(t,r)}O(Jv,"generateError");function Pe(e,t){throw Jv(e,t)}O(Pe,"throwError");function Rd(e,t){e.onWarning&&e.onWarning.call(null,Jv(e,t))}O(Rd,"throwWarning");var P5={YAML:O(function(t,r,n){var i,a,s;t.version!==null&&Pe(t,"duplication of %YAML directive"),n.length!==1&&Pe(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Pe(t,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&Pe(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Rd(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:O(function(t,r,n){var i,a;n.length!==2&&Pe(t,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],wA.test(i)||Pe(t,"ill-formed tag handle (first argument) of the TAG directive"),ks.call(t.tagMap,i)&&Pe(t,'there is a previously declared suffix for "'+i+'" tag handle'),kA.test(a)||Pe(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Pe(t,"tag prefix is malformed: "+a)}t.tagMap[i]=a},"handleTagDirective")};function Aa(e,t,r,n){var i,a,s,o;if(t<r){if(o=e.input.slice(t,r),n)for(i=0,a=o.length;i<a;i+=1)s=o.charCodeAt(i),s===9||32<=s&&s<=1114111||Pe(e,"expected valid JSON character");else jQ.test(o)&&Pe(e,"the stream contains non-printable characters");e.result+=o}}O(Aa,"captureSegment");function Jb(e,t,r,n){var i,a,s,o;for(Or.isObject(r)||Pe(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),s=0,o=i.length;s<o;s+=1)a=i[s],ks.call(t,a)||(t[a]=r[a],n[a]=!0)}O(Jb,"mergeMappings");function ol(e,t,r,n,i,a,s,o,u){var d,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),d=0,f=i.length;d<f;d+=1)Array.isArray(i[d])&&Pe(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Zb(i[d])==="[object Object]"&&(i[d]="[object Object]");if(typeof i=="object"&&Zb(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(d=0,f=a.length;d<f;d+=1)Jb(e,t,a[d],r);else Jb(e,t,a,r);else!e.json&&!ks.call(r,i)&&ks.call(t,i)&&(e.line=s||e.line,e.lineStart=o||e.lineStart,e.position=u||e.position,Pe(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:a}):t[i]=a,delete r[i];return t}O(ol,"storeMappingPair");function ug(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Pe(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}O(ug,"readLineBreak");function mr(e,t,r){for(var n=0,i=e.input.charCodeAt(e.position);i!==0;){for(;ms(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Di(i))for(ug(e),i=e.input.charCodeAt(e.position),n++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&Rd(e,"deficient indentation"),n}O(mr,"skipSeparationSpace");function uh(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||wn(r)))}O(uh,"testDocumentSeparator");function dg(e,t){t===1?e.result+=" ":t>1&&(e.result+=Or.repeat(`
238
- `,t-1))}O(dg,"writeFoldedLines");function AA(e,t,r){var n,i,a,s,o,u,d,f,p=e.kind,m=e.result,x;if(x=e.input.charCodeAt(e.position),wn(x)||ll(x)||x===35||x===38||x===42||x===33||x===124||x===62||x===39||x===34||x===37||x===64||x===96||(x===63||x===45)&&(i=e.input.charCodeAt(e.position+1),wn(i)||r&&ll(i)))return!1;for(e.kind="scalar",e.result="",a=s=e.position,o=!1;x!==0;){if(x===58){if(i=e.input.charCodeAt(e.position+1),wn(i)||r&&ll(i))break}else if(x===35){if(n=e.input.charCodeAt(e.position-1),wn(n))break}else{if(e.position===e.lineStart&&uh(e)||r&&ll(x))break;if(Di(x))if(u=e.line,d=e.lineStart,f=e.lineIndent,mr(e,!1,-1),e.lineIndent>=t){o=!0,x=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=u,e.lineStart=d,e.lineIndent=f;break}}o&&(Aa(e,a,s,!1),dg(e,e.line-u),a=s=e.position,o=!1),ms(x)||(s=e.position+1),x=e.input.charCodeAt(++e.position)}return Aa(e,a,s,!1),e.result?!0:(e.kind=p,e.result=m,!1)}O(AA,"readPlainScalar");function MA(e,t){var r,n,i;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Aa(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,i=e.position;else return!0;else Di(r)?(Aa(e,n,i,!0),dg(e,mr(e,!1,t)),n=i=e.position):e.position===e.lineStart&&uh(e)?Pe(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);Pe(e,"unexpected end of the stream within a single quoted scalar")}O(MA,"readSingleQuotedScalar");function LA(e,t){var r,n,i,a,s,o;if(o=e.input.charCodeAt(e.position),o!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(o=e.input.charCodeAt(e.position))!==0;){if(o===34)return Aa(e,r,e.position,!0),e.position++,!0;if(o===92){if(Aa(e,r,e.position,!0),o=e.input.charCodeAt(++e.position),Di(o))mr(e,!1,t);else if(o<256&&EA[o])e.result+=NA[o],e.position++;else if((s=CA(o))>0){for(i=s,a=0;i>0;i--)o=e.input.charCodeAt(++e.position),(s=SA(o))>=0?a=(a<<4)+s:Pe(e,"expected hexadecimal character");e.result+=TA(a),e.position++}else Pe(e,"unknown escape sequence");r=n=e.position}else Di(o)?(Aa(e,r,n,!0),dg(e,mr(e,!1,t)),r=n=e.position):e.position===e.lineStart&&uh(e)?Pe(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Pe(e,"unexpected end of the stream within a double quoted scalar")}O(LA,"readDoubleQuotedScalar");function DA(e,t){var r=!0,n,i,a,s=e.tag,o,u=e.anchor,d,f,p,m,x,b=Object.create(null),v,k,w,C;if(C=e.input.charCodeAt(e.position),C===91)f=93,x=!1,o=[];else if(C===123)f=125,x=!0,o={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),C=e.input.charCodeAt(++e.position);C!==0;){if(mr(e,!0,t),C=e.input.charCodeAt(e.position),C===f)return e.position++,e.tag=s,e.anchor=u,e.kind=x?"mapping":"sequence",e.result=o,!0;r?C===44&&Pe(e,"expected the node content, but found ','"):Pe(e,"missed comma between flow collection entries"),k=v=w=null,p=m=!1,C===63&&(d=e.input.charCodeAt(e.position+1),wn(d)&&(p=m=!0,e.position++,mr(e,!0,t))),n=e.line,i=e.lineStart,a=e.position,vl(e,t,hp,!1,!0),k=e.tag,v=e.result,mr(e,!0,t),C=e.input.charCodeAt(e.position),(m||e.line===n)&&C===58&&(p=!0,C=e.input.charCodeAt(++e.position),mr(e,!0,t),vl(e,t,hp,!1,!0),w=e.result),x?ol(e,o,b,k,v,w,n,i,a):p?o.push(ol(e,null,b,k,v,w,n,i,a)):o.push(v),mr(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(r=!0,C=e.input.charCodeAt(++e.position)):r=!1}Pe(e,"unexpected end of the stream within a flow collection")}O(DA,"readFlowCollection");function RA(e,t){var r,n,i=Ry,a=!1,s=!1,o=t,u=0,d=!1,f,p;if(p=e.input.charCodeAt(e.position),p===124)n=!1;else if(p===62)n=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)Ry===i?i=p===43?F5:NQ:Pe(e,"repeat of a chomping mode identifier");else if((f=_A(p))>=0)f===0?Pe(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Pe(e,"repeat of an indentation width identifier"):(o=t+f-1,s=!0);else break;if(ms(p)){do p=e.input.charCodeAt(++e.position);while(ms(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!Di(p)&&p!==0)}for(;p!==0;){for(ug(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!s||e.lineIndent<o)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>o&&(o=e.lineIndent),Di(p)){u++;continue}if(e.lineIndent<o){i===F5?e.result+=Or.repeat(`
239
- `,a?1+u:u):i===Ry&&a&&(e.result+=`
240
- `);break}for(n?ms(p)?(d=!0,e.result+=Or.repeat(`
241
- `,a?1+u:u)):d?(d=!1,e.result+=Or.repeat(`
242
- `,u+1)):u===0?a&&(e.result+=" "):e.result+=Or.repeat(`
243
- `,u):e.result+=Or.repeat(`
244
- `,a?1+u:u),a=!0,s=!0,u=0,r=e.position;!Di(p)&&p!==0;)p=e.input.charCodeAt(++e.position);Aa(e,r,e.position,!1)}return!0}O(RA,"readBlockScalar");function e1(e,t){var r,n=e.tag,i=e.anchor,a=[],s,o=!1,u;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),u=e.input.charCodeAt(e.position);u!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Pe(e,"tab characters must not be used in indentation")),!(u!==45||(s=e.input.charCodeAt(e.position+1),!wn(s))));){if(o=!0,e.position++,mr(e,!0,-1)&&e.lineIndent<=t){a.push(null),u=e.input.charCodeAt(e.position);continue}if(r=e.line,vl(e,t,vA,!1,!0),a.push(e.result),mr(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&u!==0)Pe(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return o?(e.tag=n,e.anchor=i,e.kind="sequence",e.result=a,!0):!1}O(e1,"readBlockSequence");function OA(e,t,r){var n,i,a,s,o,u,d=e.tag,f=e.anchor,p={},m=Object.create(null),x=null,b=null,v=null,k=!1,w=!1,C;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),C=e.input.charCodeAt(e.position);C!==0;){if(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Pe(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),a=e.line,(C===63||C===58)&&wn(n))C===63?(k&&(ol(e,p,m,x,b,null,s,o,u),x=b=v=null),w=!0,k=!0,i=!0):k?(k=!1,i=!0):Pe(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,C=n;else{if(s=e.line,o=e.lineStart,u=e.position,!vl(e,r,bA,!1,!0))break;if(e.line===a){for(C=e.input.charCodeAt(e.position);ms(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),wn(C)||Pe(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(ol(e,p,m,x,b,null,s,o,u),x=b=v=null),w=!0,k=!1,i=!1,x=e.tag,b=e.result;else if(w)Pe(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=f,!0}else if(w)Pe(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=f,!0}if((e.line===a||e.lineIndent>t)&&(k&&(s=e.line,o=e.lineStart,u=e.position),vl(e,t,fp,!0,i)&&(k?b=e.result:v=e.result),k||(ol(e,p,m,x,b,v,s,o,u),x=b=v=null),mr(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&C!==0)Pe(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&ol(e,p,m,x,b,null,s,o,u),w&&(e.tag=d,e.anchor=f,e.kind="mapping",e.result=p),w}O(OA,"readBlockMapping");function BA(e){var t,r=!1,n=!1,i,a,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&Pe(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(r=!0,s=e.input.charCodeAt(++e.position)):s===33?(n=!0,i="!!",s=e.input.charCodeAt(++e.position)):i="!",t=e.position,r){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(a=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):Pe(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!wn(s);)s===33&&(n?Pe(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),wA.test(i)||Pe(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),MQ.test(a)&&Pe(e,"tag suffix cannot contain flow indicator characters")}a&&!kA.test(a)&&Pe(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{Pe(e,"tag name is malformed: "+a)}return r?e.tag=a:ks.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i==="!"?e.tag="!"+a:i==="!!"?e.tag="tag:yaml.org,2002:"+a:Pe(e,'undeclared tag handle "'+i+'"'),!0}O(BA,"readTagProperty");function $A(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Pe(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!wn(r)&&!ll(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Pe(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}O($A,"readAnchorProperty");function zA(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!wn(n)&&!ll(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Pe(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),ks.call(e.anchorMap,r)||Pe(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],mr(e,!0,-1),!0}O(zA,"readAlias");function vl(e,t,r,n,i){var a,s,o,u=1,d=!1,f=!1,p,m,x,b,v,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=s=o=fp===r||vA===r,n&&mr(e,!0,-1)&&(d=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;BA(e)||$A(e);)mr(e,!0,-1)?(d=!0,o=a,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)):o=!1;if(o&&(o=d||i),(u===1||fp===r)&&(hp===r||bA===r?v=t:v=t+1,k=e.position-e.lineStart,u===1?o&&(e1(e,k)||OA(e,k,v))||DA(e,v)?f=!0:(s&&RA(e,v)||MA(e,v)||LA(e,v)?f=!0:zA(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&Pe(e,"alias node should not have any properties")):AA(e,v,hp===r)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(f=o&&e1(e,k))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Pe(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,m=e.implicitTypes.length;p<m;p+=1)if(b=e.implicitTypes[p],b.resolve(e.result)){e.result=b.construct(e.result),e.tag=b.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(ks.call(e.typeMap[e.kind||"fallback"],e.tag))b=e.typeMap[e.kind||"fallback"][e.tag];else for(b=null,x=e.typeMap.multi[e.kind||"fallback"],p=0,m=x.length;p<m;p+=1)if(e.tag.slice(0,x[p].tag.length)===x[p].tag){b=x[p];break}b||Pe(e,"unknown tag !<"+e.tag+">"),e.result!==null&&b.kind!==e.kind&&Pe(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result,e.tag)?(e.result=b.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Pe(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}O(vl,"composeNode");function IA(e){var t=e.position,r,n,i,a=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(mr(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(a=!0,s=e.input.charCodeAt(++e.position),r=e.position;s!==0&&!wn(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),i=[],n.length<1&&Pe(e,"directive name must not be less than one character in length");s!==0;){for(;ms(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Di(s));break}if(Di(s))break;for(r=e.position;s!==0&&!wn(s);)s=e.input.charCodeAt(++e.position);i.push(e.input.slice(r,e.position))}s!==0&&ug(e),ks.call(P5,n)?P5[n](e,n,i):Rd(e,'unknown document directive "'+n+'"')}if(mr(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,mr(e,!0,-1)):a&&Pe(e,"directives end mark is expected"),vl(e,e.lineIndent-1,fp,!1,!0),mr(e,!0,-1),e.checkLineBreaks&&AQ.test(e.input.slice(t,e.position))&&Rd(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&uh(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,mr(e,!0,-1));return}if(e.position<e.length-1)Pe(e,"end of the stream or a document separator is expected");else return}O(IA,"readDocument");function e2(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
245
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new jA(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,Pe(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)IA(r);return r.documents}O(e2,"loadDocuments");function LQ(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=e2(e,r);if(typeof t!="function")return n;for(var i=0,a=n.length;i<a;i+=1)t(n[i])}O(LQ,"loadAll$1");function FA(e,t){var r=e2(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new $n("expected a single document in the stream, but found more")}}O(FA,"load$1");var DQ=FA,RQ={load:DQ},PA=Object.prototype.toString,HA=Object.prototype.hasOwnProperty,t2=65279,OQ=9,Od=10,BQ=13,$Q=32,zQ=33,IQ=34,t1=35,FQ=37,PQ=38,HQ=39,qQ=42,qA=44,UQ=45,pp=58,VQ=61,WQ=62,YQ=63,GQ=64,UA=91,VA=93,XQ=96,WA=123,QQ=124,YA=125,pn={};pn[0]="\\0";pn[7]="\\a";pn[8]="\\b";pn[9]="\\t";pn[10]="\\n";pn[11]="\\v";pn[12]="\\f";pn[13]="\\r";pn[27]="\\e";pn[34]='\\"';pn[92]="\\\\";pn[133]="\\N";pn[160]="\\_";pn[8232]="\\L";pn[8233]="\\P";var ZQ=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],KQ=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function GA(e,t){var r,n,i,a,s,o,u;if(t===null)return{};for(r={},n=Object.keys(t),i=0,a=n.length;i<a;i+=1)s=n[i],o=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),u=e.compiledTypeMap.fallback[s],u&&HA.call(u.styleAliases,o)&&(o=u.styleAliases[o]),r[s]=o;return r}O(GA,"compileStyleMap");function XA(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new $n("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Or.repeat("0",n-t.length)+t}O(XA,"encodeHex");var JQ=1,Bd=2;function QA(e){this.schema=e.schema||yA,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Or.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=GA(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Bd:JQ,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}O(QA,"State");function r1(e,t){for(var r=Or.repeat(" ",t),n=0,i=-1,a="",s,o=e.length;n<o;)i=e.indexOf(`
246
- `,n),i===-1?(s=e.slice(n),n=o):(s=e.slice(n,i+1),n=i+1),s.length&&s!==`
247
- `&&(a+=r),a+=s;return a}O(r1,"indentString");function gp(e,t){return`
248
- `+Or.repeat(" ",e.indent*t)}O(gp,"generateNextLine");function ZA(e,t){var r,n,i;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(i=e.implicitTypes[r],i.resolve(t))return!0;return!1}O(ZA,"testImplicitResolving");function $d(e){return e===$Q||e===OQ}O($d,"isWhitespace");function ic(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==t2||65536<=e&&e<=1114111}O(ic,"isPrintable");function n1(e){return ic(e)&&e!==t2&&e!==BQ&&e!==Od}O(n1,"isNsCharOrWhitespace");function i1(e,t,r){var n=n1(e),i=n&&!$d(e);return(r?n:n&&e!==qA&&e!==UA&&e!==VA&&e!==WA&&e!==YA)&&e!==t1&&!(t===pp&&!i)||n1(t)&&!$d(t)&&e===t1||t===pp&&i}O(i1,"isPlainSafe");function KA(e){return ic(e)&&e!==t2&&!$d(e)&&e!==UQ&&e!==YQ&&e!==pp&&e!==qA&&e!==UA&&e!==VA&&e!==WA&&e!==YA&&e!==t1&&e!==PQ&&e!==qQ&&e!==zQ&&e!==QQ&&e!==VQ&&e!==WQ&&e!==HQ&&e!==IQ&&e!==FQ&&e!==GQ&&e!==XQ}O(KA,"isPlainSafeFirst");function JA(e){return!$d(e)&&e!==pp}O(JA,"isPlainSafeLast");function Lo(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}O(Lo,"codePointAt");function r2(e){var t=/^\n* /;return t.test(e)}O(r2,"needIndentIndicator");var eM=1,a1=2,tM=3,rM=4,Eo=5;function nM(e,t,r,n,i,a,s,o){var u,d=0,f=null,p=!1,m=!1,x=n!==-1,b=-1,v=KA(Lo(e,0))&&JA(Lo(e,e.length-1));if(t||s)for(u=0;u<e.length;d>=65536?u+=2:u++){if(d=Lo(e,u),!ic(d))return Eo;v=v&&i1(d,f,o),f=d}else{for(u=0;u<e.length;d>=65536?u+=2:u++){if(d=Lo(e,u),d===Od)p=!0,x&&(m=m||u-b-1>n&&e[b+1]!==" ",b=u);else if(!ic(d))return Eo;v=v&&i1(d,f,o),f=d}m=m||x&&u-b-1>n&&e[b+1]!==" "}return!p&&!m?v&&!s&&!i(e)?eM:a===Bd?Eo:a1:r>9&&r2(e)?Eo:s?a===Bd?Eo:a1:m?rM:tM}O(nM,"chooseScalarStyle");function iM(e,t,r,n,i){e.dump=(function(){if(t.length===0)return e.quotingType===Bd?'""':"''";if(!e.noCompatMode&&(ZQ.indexOf(t)!==-1||KQ.test(t)))return e.quotingType===Bd?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,r),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),o=n||e.flowLevel>-1&&r>=e.flowLevel;function u(d){return ZA(e,d)}switch(O(u,"testAmbiguity"),nM(t,o,e.indent,s,u,e.quotingType,e.forceQuotes&&!n,i)){case eM:return t;case a1:return"'"+t.replace(/'/g,"''")+"'";case tM:return"|"+s1(t,e.indent)+l1(r1(t,a));case rM:return">"+s1(t,e.indent)+l1(r1(aM(t,s),a));case Eo:return'"'+sM(t)+'"';default:throw new $n("impossible error: invalid scalar style")}})()}O(iM,"writeScalar");function s1(e,t){var r=r2(e)?String(t):"",n=e[e.length-1]===`
249
- `,i=n&&(e[e.length-2]===`
250
- `||e===`
251
- `),a=i?"+":n?"":"-";return r+a+`
252
- `}O(s1,"blockHeader");function l1(e){return e[e.length-1]===`
253
- `?e.slice(0,-1):e}O(l1,"dropEndingNewline");function aM(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var d=e.indexOf(`
254
- `);return d=d!==-1?d:e.length,r.lastIndex=d,o1(e.slice(0,d),t)})(),i=e[0]===`
255
- `||e[0]===" ",a,s;s=r.exec(e);){var o=s[1],u=s[2];a=u[0]===" ",n+=o+(!i&&!a&&u!==""?`
256
- `:"")+o1(u,t),i=a}return n}O(aM,"foldString");function o1(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,u="";n=r.exec(e);)o=n.index,o-i>t&&(a=s>i?s:o,u+=`
257
- `+e.slice(i,a),i=a+1),s=o;return u+=`
258
- `,e.length-i>t&&s>i?u+=e.slice(i,s)+`
259
- `+e.slice(s+1):u+=e.slice(i),u.slice(1)}O(o1,"foldLine");function sM(e){for(var t="",r=0,n,i=0;i<e.length;r>=65536?i+=2:i++)r=Lo(e,i),n=pn[r],!n&&ic(r)?(t+=e[i],r>=65536&&(t+=e[i+1])):t+=n||XA(r);return t}O(sM,"escapeString");function lM(e,t,r){var n="",i=e.tag,a,s,o;for(a=0,s=r.length;a<s;a+=1)o=r[a],e.replacer&&(o=e.replacer.call(r,String(a),o)),(Ji(e,t,o,!1,!1)||typeof o>"u"&&Ji(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=i,e.dump="["+n+"]"}O(lM,"writeFlowSequence");function c1(e,t,r,n){var i="",a=e.tag,s,o,u;for(s=0,o=r.length;s<o;s+=1)u=r[s],e.replacer&&(u=e.replacer.call(r,String(s),u)),(Ji(e,t+1,u,!0,!0,!1,!0)||typeof u>"u"&&Ji(e,t+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=gp(e,t)),e.dump&&Od===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=a,e.dump=i||"[]"}O(c1,"writeBlockSequence");function oM(e,t,r){var n="",i=e.tag,a=Object.keys(r),s,o,u,d,f;for(s=0,o=a.length;s<o;s+=1)f="",n!==""&&(f+=", "),e.condenseFlow&&(f+='"'),u=a[s],d=r[u],e.replacer&&(d=e.replacer.call(r,u,d)),Ji(e,t,u,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ji(e,t,d,!1,!1)&&(f+=e.dump,n+=f));e.tag=i,e.dump="{"+n+"}"}O(oM,"writeFlowMapping");function cM(e,t,r,n){var i="",a=e.tag,s=Object.keys(r),o,u,d,f,p,m;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new $n("sortKeys must be a boolean or a function");for(o=0,u=s.length;o<u;o+=1)m="",(!n||i!=="")&&(m+=gp(e,t)),d=s[o],f=r[d],e.replacer&&(f=e.replacer.call(r,d,f)),Ji(e,t+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Od===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,p&&(m+=gp(e,t)),Ji(e,t+1,f,!0,p)&&(e.dump&&Od===e.dump.charCodeAt(0)?m+=":":m+=": ",m+=e.dump,i+=m));e.tag=a,e.dump=i||"{}"}O(cM,"writeBlockMapping");function u1(e,t,r){var n,i,a,s,o,u;for(i=r?e.explicitTypes:e.implicitTypes,a=0,s=i.length;a<s;a+=1)if(o=i[a],(o.instanceOf||o.predicate)&&(!o.instanceOf||typeof t=="object"&&t instanceof o.instanceOf)&&(!o.predicate||o.predicate(t))){if(r?o.multi&&o.representName?e.tag=o.representName(t):e.tag=o.tag:e.tag="?",o.represent){if(u=e.styleMap[o.tag]||o.defaultStyle,PA.call(o.represent)==="[object Function]")n=o.represent(t,u);else if(HA.call(o.represent,u))n=o.represent[u](t,u);else throw new $n("!<"+o.tag+'> tag resolver accepts not "'+u+'" style');e.dump=n}return!0}return!1}O(u1,"detectType");function Ji(e,t,r,n,i,a,s){e.tag=null,e.dump=r,u1(e,r,!1)||u1(e,r,!0);var o=PA.call(e.dump),u=n,d;n&&(n=e.flowLevel<0||e.flowLevel>t);var f=o==="[object Object]"||o==="[object Array]",p,m;if(f&&(p=e.duplicates.indexOf(r),m=p!==-1),(e.tag!==null&&e.tag!=="?"||m||e.indent!==2&&t>0)&&(i=!1),m&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(f&&m&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),o==="[object Object]")n&&Object.keys(e.dump).length!==0?(cM(e,t,e.dump,i),m&&(e.dump="&ref_"+p+e.dump)):(oM(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if(o==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?c1(e,t-1,e.dump,i):c1(e,t,e.dump,i),m&&(e.dump="&ref_"+p+e.dump)):(lM(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if(o==="[object String]")e.tag!=="?"&&iM(e,e.dump,t,a,u);else{if(o==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new $n("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}O(Ji,"writeNode");function uM(e,t){var r=[],n=[],i,a;for(mp(e,r,n),i=0,a=n.length;i<a;i+=1)t.duplicates.push(r[n[i]]);t.usedDuplicates=new Array(a)}O(uM,"getDuplicateReferences");function mp(e,t,r){var n,i,a;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)mp(e[i],t,r);else for(n=Object.keys(e),i=0,a=n.length;i<a;i+=1)mp(e[n[i]],t,r)}O(mp,"inspectNode");function eZ(e,t){t=t||{};var r=new QA(t);r.noRefs||uM(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Ji(r,0,n,!0,!0)?r.dump+`
260
- `:""}O(eZ,"dump$1");function tZ(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}O(tZ,"renamed");var rZ=tA,nZ=RQ.load;/*! Bundled license information:
261
-
262
- js-yaml/dist/js-yaml.mjs:
263
- (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
264
- */var sn={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},H5={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function Ku(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=ir(e),t=ir(t);const[r,n]=[e.x,e.y],[i,a]=[t.x,t.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}O(Ku,"calculateDeltaAndAngle");var ir=O(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),iZ=O(e=>({x:O(function(t,r,n){let i=0;const a=ir(n[0]).x<ir(n[n.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(sn,e.arrowTypeStart)){const{angle:x,deltaX:b}=Ku(n[0],n[1]);i=sn[e.arrowTypeStart]*Math.cos(x)*(b>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(sn,e.arrowTypeEnd)){const{angle:x,deltaX:b}=Ku(n[n.length-1],n[n.length-2]);i=sn[e.arrowTypeEnd]*Math.cos(x)*(b>=0?1:-1)}const s=Math.abs(ir(t).x-ir(n[n.length-1]).x),o=Math.abs(ir(t).y-ir(n[n.length-1]).y),u=Math.abs(ir(t).x-ir(n[0]).x),d=Math.abs(ir(t).y-ir(n[0]).y),f=sn[e.arrowTypeStart],p=sn[e.arrowTypeEnd],m=1;if(s<p&&s>0&&o<p){let x=p+m-s;x*=a==="right"?-1:1,i-=x}if(u<f&&u>0&&d<f){let x=f+m-u;x*=a==="right"?-1:1,i+=x}return ir(t).x+i},"x"),y:O(function(t,r,n){let i=0;const a=ir(n[0]).y<ir(n[n.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(sn,e.arrowTypeStart)){const{angle:x,deltaY:b}=Ku(n[0],n[1]);i=sn[e.arrowTypeStart]*Math.abs(Math.sin(x))*(b>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(sn,e.arrowTypeEnd)){const{angle:x,deltaY:b}=Ku(n[n.length-1],n[n.length-2]);i=sn[e.arrowTypeEnd]*Math.abs(Math.sin(x))*(b>=0?1:-1)}const s=Math.abs(ir(t).y-ir(n[n.length-1]).y),o=Math.abs(ir(t).x-ir(n[n.length-1]).x),u=Math.abs(ir(t).y-ir(n[0]).y),d=Math.abs(ir(t).x-ir(n[0]).x),f=sn[e.arrowTypeStart],p=sn[e.arrowTypeEnd],m=1;if(s<p&&s>0&&o<p){let x=p+m-s;x*=a==="up"?-1:1,i-=x}if(u<f&&u>0&&d<f){let x=f+m-u;x*=a==="up"?-1:1,i+=x}return ir(t).y+i},"y")}),"getLineFunctionsWithOffset"),n2=O(({flowchart:e})=>{var i,a;const t=((i=e==null?void 0:e.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=e==null?void 0:e.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins"),aZ=O(e=>{const{handDrawnSeed:t}=Dt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Ec=O(e=>{const t=sZ([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),sZ=O(e=>{const t=new Map;return e.forEach(r=>{const[n,i]=r.split(":");t.set(n.trim(),i==null?void 0:i.trim())}),t},"styles2Map"),dM=O(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),ze=O(e=>{const{stylesArray:t}=Ec(e),r=[],n=[],i=[],a=[];return t.forEach(s=>{const o=s[0];dM(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:t,borderStyles:i,backgroundStyles:a}},"styles2String"),$e=O((e,t)=>{var u;const{themeVariables:r,handDrawnSeed:n}=Dt(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=Ec(e);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((u=s.get("stroke-width"))==null?void 0:u.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:lZ(s.get("stroke-dasharray"))},t)},"userNodeOverrides"),lZ=O(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const i=isNaN(t[0])?0:t[0];return[i,i]}const r=isNaN(t[0])?0:t[0],n=isNaN(t[1])?0:t[1];return[r,n]},"getStrokeDashArray"),zu={},Mr={},q5;function oZ(){return q5||(q5=1,Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.BLANK_URL=Mr.relativeFirstCharacters=Mr.whitespaceEscapeCharsRegex=Mr.urlSchemeRegex=Mr.ctrlCharactersRegex=Mr.htmlCtrlEntityRegex=Mr.htmlEntitiesRegex=Mr.invalidProtocolRegex=void 0,Mr.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Mr.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Mr.htmlCtrlEntityRegex=/&(newline|tab);/gi,Mr.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Mr.urlSchemeRegex=/^.+(:|&colon;)/gim,Mr.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Mr.relativeFirstCharacters=[".","/"],Mr.BLANK_URL="about:blank"),Mr}var U5;function cZ(){if(U5)return zu;U5=1,Object.defineProperty(zu,"__esModule",{value:!0}),zu.sanitizeUrl=void 0;var e=oZ();function t(s){return e.relativeFirstCharacters.indexOf(s[0])>-1}function r(s){var o=s.replace(e.ctrlCharactersRegex,"");return o.replace(e.htmlEntitiesRegex,function(u,d){return String.fromCharCode(d)})}function n(s){return URL.canParse(s)}function i(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return e.BLANK_URL;var o,u=i(s.trim());do u=r(u).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),u=i(u),o=u.match(e.ctrlCharactersRegex)||u.match(e.htmlEntitiesRegex)||u.match(e.htmlCtrlEntityRegex)||u.match(e.whitespaceEscapeCharsRegex);while(o&&o.length>0);var d=u;if(!d)return e.BLANK_URL;if(t(d))return d;var f=d.trimStart(),p=f.match(e.urlSchemeRegex);if(!p)return d;var m=p[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(m))return e.BLANK_URL;var x=f.replace(/\\/g,"/");if(m==="mailto:"||m.includes("://"))return x;if(m==="http:"||m==="https:"){if(!n(x))return e.BLANK_URL;var b=new URL(x);return b.protocol=b.protocol.toLowerCase(),b.hostname=b.hostname.toLowerCase(),b.toString()}return x}return zu.sanitizeUrl=a,zu}var uZ=cZ(),hM=typeof global=="object"&&global&&global.Object===Object&&global,dZ=typeof self=="object"&&self&&self.Object===Object&&self,ia=hM||dZ||Function("return this")(),xp=ia.Symbol,fM=Object.prototype,hZ=fM.hasOwnProperty,fZ=fM.toString,Iu=xp?xp.toStringTag:void 0;function pZ(e){var t=hZ.call(e,Iu),r=e[Iu];try{e[Iu]=void 0;var n=!0}catch{}var i=fZ.call(e);return n&&(t?e[Iu]=r:delete e[Iu]),i}var gZ=Object.prototype,mZ=gZ.toString;function xZ(e){return mZ.call(e)}var yZ="[object Null]",bZ="[object Undefined]",V5=xp?xp.toStringTag:void 0;function Nc(e){return e==null?e===void 0?bZ:yZ:V5&&V5 in Object(e)?pZ(e):xZ(e)}function jl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var vZ="[object AsyncFunction]",wZ="[object Function]",kZ="[object GeneratorFunction]",SZ="[object Proxy]";function i2(e){if(!jl(e))return!1;var t=Nc(e);return t==wZ||t==kZ||t==vZ||t==SZ}var Oy=ia["__core-js_shared__"],W5=(function(){var e=/[^.]+$/.exec(Oy&&Oy.keys&&Oy.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function CZ(e){return!!W5&&W5 in e}var _Z=Function.prototype,TZ=_Z.toString;function Al(e){if(e!=null){try{return TZ.call(e)}catch{}try{return e+""}catch{}}return""}var EZ=/[\\^$.*+?()[\]{}|]/g,NZ=/^\[object .+?Constructor\]$/,jZ=Function.prototype,AZ=Object.prototype,MZ=jZ.toString,LZ=AZ.hasOwnProperty,DZ=RegExp("^"+MZ.call(LZ).replace(EZ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function RZ(e){if(!jl(e)||CZ(e))return!1;var t=i2(e)?DZ:NZ;return t.test(Al(e))}function OZ(e,t){return e==null?void 0:e[t]}function Ml(e,t){var r=OZ(e,t);return RZ(r)?r:void 0}var zd=Ml(Object,"create");function BZ(){this.__data__=zd?zd(null):{},this.size=0}function $Z(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var zZ="__lodash_hash_undefined__",IZ=Object.prototype,FZ=IZ.hasOwnProperty;function PZ(e){var t=this.__data__;if(zd){var r=t[e];return r===zZ?void 0:r}return FZ.call(t,e)?t[e]:void 0}var HZ=Object.prototype,qZ=HZ.hasOwnProperty;function UZ(e){var t=this.__data__;return zd?t[e]!==void 0:qZ.call(t,e)}var VZ="__lodash_hash_undefined__";function WZ(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=zd&&t===void 0?VZ:t,this}function wl(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}wl.prototype.clear=BZ;wl.prototype.delete=$Z;wl.prototype.get=PZ;wl.prototype.has=UZ;wl.prototype.set=WZ;function YZ(){this.__data__=[],this.size=0}function hg(e,t){return e===t||e!==e&&t!==t}function fg(e,t){for(var r=e.length;r--;)if(hg(e[r][0],t))return r;return-1}var GZ=Array.prototype,XZ=GZ.splice;function QZ(e){var t=this.__data__,r=fg(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():XZ.call(t,r,1),--this.size,!0}function ZZ(e){var t=this.__data__,r=fg(t,e);return r<0?void 0:t[r][1]}function KZ(e){return fg(this.__data__,e)>-1}function JZ(e,t){var r=this.__data__,n=fg(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Oa(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Oa.prototype.clear=YZ;Oa.prototype.delete=QZ;Oa.prototype.get=ZZ;Oa.prototype.has=KZ;Oa.prototype.set=JZ;var Id=Ml(ia,"Map");function eK(){this.size=0,this.__data__={hash:new wl,map:new(Id||Oa),string:new wl}}function tK(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function pg(e,t){var r=e.__data__;return tK(t)?r[typeof t=="string"?"string":"hash"]:r.map}function rK(e){var t=pg(this,e).delete(e);return this.size-=t?1:0,t}function nK(e){return pg(this,e).get(e)}function iK(e){return pg(this,e).has(e)}function aK(e,t){var r=pg(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function Ts(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ts.prototype.clear=eK;Ts.prototype.delete=rK;Ts.prototype.get=nK;Ts.prototype.has=iK;Ts.prototype.set=aK;var sK="Expected a function";function dh(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(sK);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=e.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(dh.Cache||Ts),r}dh.Cache=Ts;function lK(){this.__data__=new Oa,this.size=0}function oK(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function cK(e){return this.__data__.get(e)}function uK(e){return this.__data__.has(e)}var dK=200;function hK(e,t){var r=this.__data__;if(r instanceof Oa){var n=r.__data__;if(!Id||n.length<dK-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ts(n)}return r.set(e,t),this.size=r.size,this}function jc(e){var t=this.__data__=new Oa(e);this.size=t.size}jc.prototype.clear=lK;jc.prototype.delete=oK;jc.prototype.get=cK;jc.prototype.has=uK;jc.prototype.set=hK;var yp=(function(){try{var e=Ml(Object,"defineProperty");return e({},"",{}),e}catch{}})();function a2(e,t,r){t=="__proto__"&&yp?yp(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function d1(e,t,r){(r!==void 0&&!hg(e[t],r)||r===void 0&&!(t in e))&&a2(e,t,r)}function fK(e){return function(t,r,n){for(var i=-1,a=Object(t),s=n(t),o=s.length;o--;){var u=s[++i];if(r(a[u],u,a)===!1)break}return t}}var pK=fK(),pM=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Y5=pM&&typeof module=="object"&&module&&!module.nodeType&&module,gK=Y5&&Y5.exports===pM,G5=gK?ia.Buffer:void 0,X5=G5?G5.allocUnsafe:void 0;function mK(e,t){if(t)return e.slice();var r=e.length,n=X5?X5(r):new e.constructor(r);return e.copy(n),n}var Q5=ia.Uint8Array;function xK(e){var t=new e.constructor(e.byteLength);return new Q5(t).set(new Q5(e)),t}function yK(e,t){var r=t?xK(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function bK(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Z5=Object.create,vK=(function(){function e(){}return function(t){if(!jl(t))return{};if(Z5)return Z5(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})();function gM(e,t){return function(r){return e(t(r))}}var mM=gM(Object.getPrototypeOf,Object),wK=Object.prototype;function gg(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||wK;return e===r}function kK(e){return typeof e.constructor=="function"&&!gg(e)?vK(mM(e)):{}}function hh(e){return e!=null&&typeof e=="object"}var SK="[object Arguments]";function K5(e){return hh(e)&&Nc(e)==SK}var xM=Object.prototype,CK=xM.hasOwnProperty,_K=xM.propertyIsEnumerable,bp=K5((function(){return arguments})())?K5:function(e){return hh(e)&&CK.call(e,"callee")&&!_K.call(e,"callee")},vp=Array.isArray,TK=9007199254740991;function yM(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=TK}function mg(e){return e!=null&&yM(e.length)&&!i2(e)}function EK(e){return hh(e)&&mg(e)}function NK(){return!1}var bM=typeof exports=="object"&&exports&&!exports.nodeType&&exports,J5=bM&&typeof module=="object"&&module&&!module.nodeType&&module,jK=J5&&J5.exports===bM,e4=jK?ia.Buffer:void 0,AK=e4?e4.isBuffer:void 0,s2=AK||NK,MK="[object Object]",LK=Function.prototype,DK=Object.prototype,vM=LK.toString,RK=DK.hasOwnProperty,OK=vM.call(Object);function BK(e){if(!hh(e)||Nc(e)!=MK)return!1;var t=mM(e);if(t===null)return!0;var r=RK.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&vM.call(r)==OK}var $K="[object Arguments]",zK="[object Array]",IK="[object Boolean]",FK="[object Date]",PK="[object Error]",HK="[object Function]",qK="[object Map]",UK="[object Number]",VK="[object Object]",WK="[object RegExp]",YK="[object Set]",GK="[object String]",XK="[object WeakMap]",QK="[object ArrayBuffer]",ZK="[object DataView]",KK="[object Float32Array]",JK="[object Float64Array]",eJ="[object Int8Array]",tJ="[object Int16Array]",rJ="[object Int32Array]",nJ="[object Uint8Array]",iJ="[object Uint8ClampedArray]",aJ="[object Uint16Array]",sJ="[object Uint32Array]",tr={};tr[KK]=tr[JK]=tr[eJ]=tr[tJ]=tr[rJ]=tr[nJ]=tr[iJ]=tr[aJ]=tr[sJ]=!0;tr[$K]=tr[zK]=tr[QK]=tr[IK]=tr[ZK]=tr[FK]=tr[PK]=tr[HK]=tr[qK]=tr[UK]=tr[VK]=tr[WK]=tr[YK]=tr[GK]=tr[XK]=!1;function lJ(e){return hh(e)&&yM(e.length)&&!!tr[Nc(e)]}function oJ(e){return function(t){return e(t)}}var wM=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fd=wM&&typeof module=="object"&&module&&!module.nodeType&&module,cJ=fd&&fd.exports===wM,By=cJ&&hM.process,t4=(function(){try{var e=fd&&fd.require&&fd.require("util").types;return e||By&&By.binding&&By.binding("util")}catch{}})(),r4=t4&&t4.isTypedArray,l2=r4?oJ(r4):lJ;function h1(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var uJ=Object.prototype,dJ=uJ.hasOwnProperty;function hJ(e,t,r){var n=e[t];(!(dJ.call(e,t)&&hg(n,r))||r===void 0&&!(t in e))&&a2(e,t,r)}function fJ(e,t,r,n){var i=!r;r||(r={});for(var a=-1,s=t.length;++a<s;){var o=t[a],u=void 0;u===void 0&&(u=e[o]),i?a2(r,o,u):hJ(r,o,u)}return r}function pJ(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var gJ=9007199254740991,mJ=/^(?:0|[1-9]\d*)$/;function kM(e,t){var r=typeof e;return t=t??gJ,!!t&&(r=="number"||r!="symbol"&&mJ.test(e))&&e>-1&&e%1==0&&e<t}var xJ=Object.prototype,yJ=xJ.hasOwnProperty;function bJ(e,t){var r=vp(e),n=!r&&bp(e),i=!r&&!n&&s2(e),a=!r&&!n&&!i&&l2(e),s=r||n||i||a,o=s?pJ(e.length,String):[],u=o.length;for(var d in e)(t||yJ.call(e,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||kM(d,u)))&&o.push(d);return o}function vJ(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var wJ=Object.prototype,kJ=wJ.hasOwnProperty;function SJ(e){if(!jl(e))return vJ(e);var t=gg(e),r=[];for(var n in e)n=="constructor"&&(t||!kJ.call(e,n))||r.push(n);return r}function SM(e){return mg(e)?bJ(e,!0):SJ(e)}function CJ(e){return fJ(e,SM(e))}function _J(e,t,r,n,i,a,s){var o=h1(e,r),u=h1(t,r),d=s.get(u);if(d){d1(e,r,d);return}var f=a?a(o,u,r+"",e,t,s):void 0,p=f===void 0;if(p){var m=vp(u),x=!m&&s2(u),b=!m&&!x&&l2(u);f=u,m||x||b?vp(o)?f=o:EK(o)?f=bK(o):x?(p=!1,f=mK(u,!0)):b?(p=!1,f=yK(u,!0)):f=[]:BK(u)||bp(u)?(f=o,bp(o)?f=CJ(o):(!jl(o)||i2(o))&&(f=kK(u))):p=!1}p&&(s.set(u,f),i(f,u,n,a,s),s.delete(u)),d1(e,r,f)}function CM(e,t,r,n,i){e!==t&&pK(t,function(a,s){if(i||(i=new jc),jl(a))_J(e,t,s,r,CM,n,i);else{var o=n?n(h1(e,s),a,s+"",e,t,i):void 0;o===void 0&&(o=a),d1(e,s,o)}},SM)}function _M(e){return e}function TJ(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var n4=Math.max;function EJ(e,t,r){return t=n4(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=n4(n.length-t,0),s=Array(a);++i<a;)s[i]=n[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=n[i];return o[t]=r(s),TJ(e,this,o)}}function NJ(e){return function(){return e}}var jJ=yp?function(e,t){return yp(e,"toString",{configurable:!0,enumerable:!1,value:NJ(t),writable:!0})}:_M,AJ=800,MJ=16,LJ=Date.now;function DJ(e){var t=0,r=0;return function(){var n=LJ(),i=MJ-(n-r);if(r=n,i>0){if(++t>=AJ)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var RJ=DJ(jJ);function OJ(e,t){return RJ(EJ(e,t,_M),e+"")}function BJ(e,t,r){if(!jl(r))return!1;var n=typeof t;return(n=="number"?mg(r)&&kM(t,r.length):n=="string"&&t in r)?hg(r[t],e):!1}function $J(e){return OJ(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,s&&BJ(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var o=r[n];o&&e(t,o,n,a)}return t})}var zJ=$J(function(e,t,r){CM(e,t,r)}),IJ="​",FJ={curveBasis:w0,curveBasisClosed:BX,curveBasisOpen:$X,curveBumpX:oj,curveBumpY:cj,curveBundle:zX,curveCardinalClosed:IX,curveCardinalOpen:FX,curveCardinal:fj,curveCatmullRomClosed:PX,curveCatmullRomOpen:HX,curveCatmullRom:gj,curveLinear:lp,curveLinearClosed:qX,curveMonotoneX:wj,curveMonotoneY:kj,curveNatural:Cj,curveStep:_j,curveStepAfter:Ej,curveStepBefore:Tj},PJ=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,HJ=O(function(e,t){const r=TM(e,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);X0(s),n=Rr(n,[...s])}else n=r.args;if(!n)return;let i=Lv(e,t);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),TM=O(function(e,t=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${PJ.source})(?=[}][%]{2}).*
265
- `,"ig");e=e.trim().replace(i,"").replace(/'/gm,'"'),we.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let a;const s=[];for(;(a=ud.exec(e))!==null;)if(a.index===ud.lastIndex&&ud.lastIndex++,a&&!t||t&&((r=a[1])!=null&&r.match(t))||t&&((n=a[2])!=null&&n.match(t))){const o=a[1]?a[1]:a[2],u=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:u})}return s.length===0?{type:e,args:null}:s.length===1?s[0]:s}catch(i){return we.error(`ERROR: ${i.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),qJ=O(function(e){return e.replace(ud,"")},"removeDirectives"),UJ=O(function(e,t){for(const[r,n]of t.entries())if(n.match(e))return r;return-1},"isSubstringInArray");function o2(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return FJ[r]??t}O(o2,"interpolateToCurve");function EM(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?uZ.sanitizeUrl(r):r}O(EM,"formatUrl");var VJ=O((e,...t)=>{const r=e.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s<n;s++)if(a=a[r[s]],!a){we.error(`Function name: ${e} not found in window`);return}a[i](...t)},"runFunc");function c2(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}O(c2,"distance");function NM(e){let t,r=0;e.forEach(i=>{r+=c2(i,t),t=i});const n=r/2;return u2(e,n)}O(NM,"traverseEdge");function jM(e){return e.length===1?e[0]:NM(e)}O(jM,"calcLabelPosition");var i4=O((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),u2=O((e,t)=>{let r,n=t;for(const i of e){if(r){const a=c2(i,r);if(a===0)return r;if(a<n)n-=a;else{const s=n/a;if(s<=0)return r;if(s>=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:i4((1-s)*r.x+s*i.x,5),y:i4((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),WJ=O((e,t,r)=>{we.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const i=u2(t,25),a=e?10:5,s=Math.atan2(t[0].y-i.y,t[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(t[0].x+i.x)/2,o.y=-Math.cos(s)*a+(t[0].y+i.y)/2,o},"calcCardinalityPosition");function AM(e,t,r){const n=structuredClone(r);we.info("our points",n),t!=="start_left"&&t!=="start_right"&&n.reverse();const i=25+e,a=u2(n,i),s=10+e*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),u={x:0,y:0};return t==="start_left"?(u.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,u.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):t==="end_right"?(u.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,u.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):t==="end_left"?(u.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,u.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(u.x=Math.sin(o)*s+(n[0].x+a.x)/2,u.y=-Math.cos(o)*s+(n[0].y+a.y)/2),u}O(AM,"calcTerminalLabelPosition");function MM(e){let t="",r="";for(const n of e)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":t=t+n+";");return{style:t,labelStyle:r}}O(MM,"getStylesFromArray");var a4=0,YJ=O(()=>(a4++,"id-"+Math.random().toString(36).substr(2,12)+"-"+a4),"generateId");function LM(e){let t="";const r="0123456789abcdef",n=r.length;for(let i=0;i<e;i++)t+=r.charAt(Math.floor(Math.random()*n));return t}O(LM,"makeRandomHex");var GJ=O(e=>LM(e.length),"random"),XJ=O(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),QJ=O(function(e,t){const r=t.text.replace(Tc.lineBreakRegex," "),[,n]=xg(t.fontSize),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.style("text-anchor",t.anchor),i.style("font-family",t.fontFamily),i.style("font-size",n),i.style("font-weight",t.fontWeight),i.attr("fill",t.fill),t.class!==void 0&&i.attr("class",t.class);const a=i.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.attr("fill",t.fill),a.text(r),i},"drawSimpleText"),ZJ=dh((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Tc.lineBreakRegex.test(e)))return e;const n=e.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const u=Da(`${s} `,r),d=Da(a,r);if(u>t){const{hyphenatedStrings:m,remainingWord:x}=KJ(s,t,"-",r);i.push(a,...m),a=x}else d+u>=t?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),KJ=dh((e,t,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...e],a=[];let s="";return i.forEach((o,u)=>{const d=`${s}${o}`;if(Da(d,n)>=t){const p=u+1,m=i.length===p,x=`${d}${r}`;a.push(m?d:x),s=""}else s=d}),{hyphenatedStrings:a,remainingWord:s}},(e,t,r="-",n)=>`${e}${t}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function DM(e,t){return d2(e,t).height}O(DM,"calculateTextHeight");function Da(e,t){return d2(e,t).width}O(Da,"calculateTextWidth");var d2=dh((e,t)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=t;if(!e)return{width:0,height:0};const[,a]=xg(r),s=["sans-serif",n],o=e.split(Tc.lineBreakRegex),u=[],d=et("body");if(!d.remove)return{width:0,height:0,lineHeight:0};const f=d.append("svg");for(const m of s){let x=0;const b={width:0,height:0,lineHeight:0};for(const v of o){const k=XJ();k.text=v||IJ;const w=QJ(f,k).style("font-size",a).style("font-weight",i).style("font-family",m),C=(w._groups||w)[0][0].getBBox();if(C.width===0&&C.height===0)throw new Error("svg element not in render tree");b.width=Math.round(Math.max(b.width,C.width)),x=Math.round(C.height),b.height+=x,b.lineHeight=Math.round(Math.max(b.lineHeight,x))}u.push(b)}f.remove();const p=isNaN(u[1].height)||isNaN(u[1].width)||isNaN(u[1].lineHeight)||u[0].height>u[1].height&&u[0].width>u[1].width&&u[0].lineHeight>u[1].lineHeight?0:1;return u[p]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),Xo,JJ=(Xo=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},O(Xo,"InitIDGenerator"),Xo),Gf,eee=O(function(e){return Gf=Gf||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Gf.innerHTML=e,unescape(Gf.textContent)},"entityDecode");function h2(e){return"str"in e}O(h2,"isDetailedError");var tee=O((e,t,r,n)=>{var a;if(!n)return;const i=(a=e.node())==null?void 0:a.getBBox();i&&e.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",t)},"insertTitle"),xg=O(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function f2(e,t){return zJ({},e,t)}O(f2,"cleanAndMerge");var ji={assignWithDepth:Rr,wrapLabel:ZJ,calculateTextHeight:DM,calculateTextWidth:Da,calculateTextDimensions:d2,cleanAndMerge:f2,detectInit:HJ,detectDirective:TM,isSubstringInArray:UJ,interpolateToCurve:o2,calcLabelPosition:jM,calcCardinalityPosition:WJ,calcTerminalLabelPosition:AM,formatUrl:EM,getStylesFromArray:MM,generateId:YJ,random:GJ,runFunc:VJ,entityDecode:eee,insertTitle:tee,isLabelCoordinateInPath:RM,parseFontSize:xg,InitIDGenerator:JJ},ree=O(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),t},"encodeEntities"),Ll=O(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Vfe=O((e,t,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${e}_${t}_${r}${i?`_${i}`:""}`,"getEdgeId");function dn(e){return e??null}O(dn,"handleUndefinedAttr");function RM(e,t){const r=Math.round(e.x),n=Math.round(e.y),i=t.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}O(RM,"isLabelCoordinateInPath");const nee=Object.freeze({left:0,top:0,width:16,height:16}),wp=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),OM=Object.freeze({...nee,...wp}),iee=Object.freeze({...OM,body:"",hidden:!1}),aee=Object.freeze({width:null,height:null}),see=Object.freeze({...aee,...wp}),lee=(e,t,r,n="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),u=i.pop(),d={provider:i.length>0?i[0]:n,prefix:u,name:o};return $y(d)?d:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return $y(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return $y(o,r)?o:null}return null},$y=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function oee(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const n=((e.rotate||0)+(t.rotate||0))%4;return n&&(r.rotate=n),r}function s4(e,t){const r=oee(e,t);for(const n in iee)n in wp?n in e&&!(n in r)&&(r[n]=wp[n]):n in t?r[n]=t[n]:n in e&&(r[n]=e[n]);return r}function cee(e,t){const r=e.icons,n=e.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,u=o&&a(o);u&&(i[s]=[o].concat(u))}return i[s]}return(t||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function l4(e,t,r){const n=e.icons,i=e.aliases||Object.create(null);let a={};function s(o){a=s4(n[o]||i[o],a)}return s(t),r.forEach(s),s4(e,a)}function uee(e,t){if(e.icons[t])return l4(e,t,[]);const r=cee(e,[t])[t];return r?l4(e,t,r):null}const dee=/(-?[0-9.]*[0-9]+[0-9.]*)/g,hee=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function o4(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const n=e.split(dee);if(n===null||!n.length)return e;const i=[];let a=n.shift(),s=hee.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*t*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function fee(e,t="defs"){let r="";const n=e.indexOf("<"+t);for(;n>=0;){const i=e.indexOf(">",n),a=e.indexOf("</"+t);if(i===-1||a===-1)break;const s=e.indexOf(">",a);if(s===-1)break;r+=e.slice(i+1,a).trim(),e=e.slice(0,n).trim()+e.slice(s+1)}return{defs:r,content:e}}function pee(e,t){return e?"<defs>"+e+"</defs>"+t:t}function gee(e,t,r){const n=fee(e);return pee(n.defs,t+n.content+r)}const mee=e=>e==="unset"||e==="undefined"||e==="none";function xee(e,t){const r={...OM,...e},n={...see,...t},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(v=>{const k=[],w=v.hFlip,C=v.vFlip;let T=v.rotate;w?C?T+=2:(k.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),k.push("scale(-1 1)"),i.top=i.left=0):C&&(k.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),k.push("scale(1 -1)"),i.top=i.left=0);let j;switch(T<0&&(T-=Math.floor(T/4)*4),T=T%4,T){case 1:j=i.height/2+i.top,k.unshift("rotate(90 "+j.toString()+" "+j.toString()+")");break;case 2:k.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:j=i.width/2+i.left,k.unshift("rotate(-90 "+j.toString()+" "+j.toString()+")");break}T%2===1&&(i.left!==i.top&&(j=i.left,i.left=i.top,i.top=j),i.width!==i.height&&(j=i.width,i.width=i.height,i.height=j)),k.length&&(a=gee(a,'<g transform="'+k.join(" ")+'">',"</g>"))});const s=n.width,o=n.height,u=i.width,d=i.height;let f,p;s===null?(p=o===null?"1em":o==="auto"?d:o,f=o4(p,u/d)):(f=s==="auto"?u:s,p=o===null?o4(f,d/u):o==="auto"?d:o);const m={},x=(v,k)=>{mee(k)||(m[v]=k.toString())};x("width",f),x("height",p);const b=[i.left,i.top,u,d];return m.viewBox=b.join(" "),{attributes:m,viewBox:b,body:a}}const yee=/\sid="(\S+)"/g,c4=new Map;function bee(e){e=e.replace(/[0-9]+$/,"")||"a";const t=c4.get(e)||0;return c4.set(e,t+1),t?`${e}${t}`:e}function vee(e){const t=[];let r;for(;r=yee.exec(e);)t.push(r[1]);if(!t.length)return e;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(i=>{const a=bee(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),e=e.replace(new RegExp(n,"g"),""),e}function wee(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in t)r+=" "+n+'="'+t[n]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}function p2(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Dl=p2();function BM(e){Dl=e}var pd={exec:()=>null};function At(e,t=""){let r=typeof e=="string"?e:e.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(kn.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,t)};return n}var kee=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),kn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},See=/^(?:[ \t]*(?:\n|$))+/,Cee=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,_ee=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fh=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Tee=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,g2=/(?:[*+-]|\d{1,9}[.)])/,$M=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zM=At($M).replace(/bull/g,g2).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Eee=At($M).replace(/bull/g,g2).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),m2=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Nee=/^[^\n]+/,x2=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,jee=At(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",x2).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Aee=At(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,g2).getRegex(),yg="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",y2=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Mee=At("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",y2).replace("tag",yg).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),IM=At(m2).replace("hr",fh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yg).getRegex(),Lee=At(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",IM).getRegex(),b2={blockquote:Lee,code:Cee,def:jee,fences:_ee,heading:Tee,hr:fh,html:Mee,lheading:zM,list:Aee,newline:See,paragraph:IM,table:pd,text:Nee},u4=At("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yg).getRegex(),Dee={...b2,lheading:Eee,table:u4,paragraph:At(m2).replace("hr",fh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",u4).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yg).getRegex()},Ree={...b2,html:At(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",y2).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:pd,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:At(m2).replace("hr",fh).replace("heading",` *#{1,6} *[^
266
- ]`).replace("lheading",zM).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Oee=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Bee=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,FM=/^( {2,}|\\)\n(?!\s*$)/,$ee=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,bg=/[\p{P}\p{S}]/u,v2=/[\s\p{P}\p{S}]/u,PM=/[^\s\p{P}\p{S}]/u,zee=At(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,v2).getRegex(),HM=/(?!~)[\p{P}\p{S}]/u,Iee=/(?!~)[\s\p{P}\p{S}]/u,Fee=/(?:[^\s\p{P}\p{S}]|~)/u,Pee=At(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",kee?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),qM=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Hee=At(qM,"u").replace(/punct/g,bg).getRegex(),qee=At(qM,"u").replace(/punct/g,HM).getRegex(),UM="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Uee=At(UM,"gu").replace(/notPunctSpace/g,PM).replace(/punctSpace/g,v2).replace(/punct/g,bg).getRegex(),Vee=At(UM,"gu").replace(/notPunctSpace/g,Fee).replace(/punctSpace/g,Iee).replace(/punct/g,HM).getRegex(),Wee=At("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,PM).replace(/punctSpace/g,v2).replace(/punct/g,bg).getRegex(),Yee=At(/\\(punct)/,"gu").replace(/punct/g,bg).getRegex(),Gee=At(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Xee=At(y2).replace("(?:-->|$)","-->").getRegex(),Qee=At("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Xee).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),kp=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Zee=At(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",kp).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),VM=At(/^!?\[(label)\]\[(ref)\]/).replace("label",kp).replace("ref",x2).getRegex(),WM=At(/^!?\[(ref)\](?:\[\])?/).replace("ref",x2).getRegex(),Kee=At("reflink|nolink(?!\\()","g").replace("reflink",VM).replace("nolink",WM).getRegex(),d4=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,w2={_backpedal:pd,anyPunctuation:Yee,autolink:Gee,blockSkip:Pee,br:FM,code:Bee,del:pd,emStrongLDelim:Hee,emStrongRDelimAst:Uee,emStrongRDelimUnd:Wee,escape:Oee,link:Zee,nolink:WM,punctuation:zee,reflink:VM,reflinkSearch:Kee,tag:Qee,text:$ee,url:pd},Jee={...w2,link:At(/^!?\[(label)\]\((.*?)\)/).replace("label",kp).getRegex(),reflink:At(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",kp).getRegex()},f1={...w2,emStrongRDelimAst:Vee,emStrongLDelim:qee,url:At(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",d4).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:At(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",d4).getRegex()},ete={...f1,br:At(FM).replace("{2,}","*").getRegex(),text:At(f1.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xf={normal:b2,gfm:Dee,pedantic:Ree},Fu={normal:w2,gfm:f1,breaks:ete,pedantic:Jee},tte={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},h4=e=>tte[e];function Vi(e,t){if(t){if(kn.escapeTest.test(e))return e.replace(kn.escapeReplace,h4)}else if(kn.escapeTestNoEncode.test(e))return e.replace(kn.escapeReplaceNoEncode,h4);return e}function f4(e){try{e=encodeURI(e).replace(kn.percentDecode,"%")}catch{return null}return e}function p4(e,t){var a;let r=e.replace(kn.findPipe,(s,o,u)=>{let d=!1,f=o;for(;--f>=0&&u[f]==="\\";)d=!d;return d?"|":" |"}),n=r.split(kn.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(kn.slashPipe,"|");return n}function Pu(e,t,r){let n=e.length;if(n===0)return"";let i=0;for(;i<n&&e.charAt(n-i-1)===t;)i++;return e.slice(0,n-i)}function rte(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function g4(e,t,r,n,i){let a=t.href,s=t.title||null,o=e[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,u}function nte(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(n===null)return t;let i=n[1];return t.split(`
267
- `).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[o]=s;return o.length>=i.length?a.slice(i.length):a}).join(`
268
- `)}var Sp=class{constructor(t){qt(this,"options");qt(this,"rules");qt(this,"lexer");this.options=t||Dl}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Pu(n,`
269
- `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let n=r[0],i=nte(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=Pu(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Pu(r[0],`
270
- `)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let n=Pu(r[0],`
271
- `).split(`
272
- `),i="",a="",s=[];for(;n.length>0;){let o=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),o=!0;else if(!o)u.push(n[d]);else break;n=n.slice(d);let f=u.join(`
273
- `),p=f.replace(this.rules.other.blockquoteSetextReplace,`
274
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
275
- ${f}`:f,a=a?`${a}
276
- ${p}`:p;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=m,n.length===0)break;let x=s.at(-1);if((x==null?void 0:x.type)==="code")break;if((x==null?void 0:x.type)==="blockquote"){let b=x,v=b.raw+`
277
- `+n.join(`
278
- `),k=this.blockquote(v);s[s.length-1]=k,i=i.substring(0,i.length-b.raw.length)+k.raw,a=a.substring(0,a.length-b.text.length)+k.text;break}else if((x==null?void 0:x.type)==="list"){let b=x,v=b.raw+`
279
- `+n.join(`
280
- `),k=this.list(v);s[s.length-1]=k,i=i.substring(0,i.length-x.raw.length)+k.raw,a=a.substring(0,a.length-b.raw.length)+k.raw,n=v.substring(s.at(-1).raw.length).split(`
281
- `);continue}}return{type:"blockquote",raw:i,tokens:s,text:a}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n=r[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;t;){let d=!1,f="",p="";if(!(r=s.exec(t))||this.rules.block.hr.test(t))break;f=r[0],t=t.substring(f.length);let m=r[2].split(`
282
- `,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),x=t.split(`
283
- `,1)[0],b=!m.trim(),v=0;if(this.options.pedantic?(v=2,p=m.trimStart()):b?v=r[1].length+1:(v=r[2].search(this.rules.other.nonSpaceChar),v=v>4?1:v,p=m.slice(v),v+=r[1].length),b&&this.rules.other.blankLine.test(x)&&(f+=x+`
284
- `,t=t.substring(x.length+1),d=!0),!d){let C=this.rules.other.nextBulletRegex(v),T=this.rules.other.hrRegex(v),j=this.rules.other.fencesBeginRegex(v),L=this.rules.other.headingBeginRegex(v),E=this.rules.other.htmlBeginRegex(v);for(;t;){let M=t.split(`
285
- `,1)[0],I;if(x=M,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),I=x):I=x.replace(this.rules.other.tabCharGlobal," "),j.test(x)||L.test(x)||E.test(x)||C.test(x)||T.test(x))break;if(I.search(this.rules.other.nonSpaceChar)>=v||!x.trim())p+=`
286
- `+I.slice(v);else{if(b||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||j.test(m)||L.test(m)||T.test(m))break;p+=`
287
- `+x}!b&&!x.trim()&&(b=!0),f+=M+`
288
- `,t=t.substring(M.length+1),m=I.slice(v)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(o=!0));let k=null,w;this.options.gfm&&(k=this.rules.other.listIsTask.exec(p),k&&(w=k[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:f,task:!!k,checked:w,loose:!1,text:p,tokens:[]}),a.raw+=f}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let d=0;d<a.items.length;d++)if(this.lexer.state.top=!1,a.items[d].tokens=this.lexer.blockTokens(a.items[d].text,[]),!a.loose){let f=a.items[d].tokens.filter(m=>m.type==="space"),p=f.length>0&&f.some(m=>this.rules.other.anyLine.test(m.raw));a.loose=p}if(a.loose)for(let d=0;d<a.items.length;d++)a.items[d].loose=!0;return a}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let n=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:a}}}table(t){var o;let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let n=p4(r[1]),i=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(o=r[3])!=null&&o.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
289
- `):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?s.align.push("right"):this.rules.other.tableAlignCenter.test(u)?s.align.push("center"):this.rules.other.tableAlignLeft.test(u)?s.align.push("left"):s.align.push(null);for(let u=0;u<n.length;u++)s.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:s.align[u]});for(let u of a)s.rows.push(p4(u,s.header.length).map((d,f)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:s.align[f]})));return s}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let n=r[1].charAt(r[1].length-1)===`
290
- `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Pu(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=rte(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),g4(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return g4(n,a,n[0],this.lexer,this.rules)}}emStrong(t,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,u=a,d=0,f=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,r=r.slice(-1*t.length+a);(i=f.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){u+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){d+=o;continue}if(u-=o,u>0)continue;o=Math.min(o,o+u+d);let p=[...i[0]][0].length,m=t.slice(0,a+i.index+p+o);if(Math.min(a,o)%2){let b=m.slice(1,-1);return{type:"em",raw:m,text:b,tokens:this.lexer.inlineTokens(b)}}let x=m.slice(2,-2);return{type:"strong",raw:m,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let r;if(r=this.rules.inline.url.exec(t)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},Ti=class p1{constructor(t){qt(this,"tokens");qt(this,"options");qt(this,"state");qt(this,"tokenizer");qt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Dl,this.options.tokenizer=this.options.tokenizer||new Sp,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:kn,block:Xf.normal,inline:Fu.normal};this.options.pedantic?(r.block=Xf.pedantic,r.inline=Fu.pedantic):this.options.gfm&&(r.block=Xf.gfm,this.options.breaks?r.inline=Fu.breaks:r.inline=Fu.gfm),this.tokenizer.rules=r}static get rules(){return{block:Xf,inline:Fu}}static lex(t,r){return new p1(r).lex(t)}static lexInline(t,r){return new p1(r).inlineTokens(t)}lex(t){t=t.replace(kn.carriageReturn,`
291
- `),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){var i,a,s;for(this.options.pedantic&&(t=t.replace(kn.tabCharGlobal," ").replace(kn.spaceLine,""));t;){let o;if((a=(i=this.options.extensions)==null?void 0:i.block)!=null&&a.some(d=>(o=d.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let d=r.at(-1);o.raw.length===1&&d!==void 0?d.raw+=`
292
- `:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let d=r.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
293
- `)?"":`
294
- `)+o.raw,d.text+=`
295
- `+o.text,this.inlineQueue.at(-1).src=d.text):r.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let d=r.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
296
- `)?"":`
297
- `)+o.raw,d.text+=`
298
- `+o.raw,this.inlineQueue.at(-1).src=d.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),r.push(o);continue}let u=t;if((s=this.options.extensions)!=null&&s.startBlock){let d=1/0,f=t.slice(1),p;this.options.extensions.startBlock.forEach(m=>{p=m.call({lexer:this},f),typeof p=="number"&&p>=0&&(d=Math.min(d,p))}),d<1/0&&d>=0&&(u=t.substring(0,d+1))}if(this.state.top&&(o=this.tokenizer.paragraph(u))){let d=r.at(-1);n&&(d==null?void 0:d.type)==="paragraph"?(d.raw+=(d.raw.endsWith(`
299
- `)?"":`
300
- `)+o.raw,d.text+=`
301
- `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):r.push(o),n=u.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let d=r.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
302
- `)?"":`
303
- `)+o.raw,d.text+=`
304
- `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):r.push(o);continue}if(t){let d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){var u,d,f,p,m;let n=t,i=null;if(this.tokens.links){let x=Object.keys(this.tokens.links);if(x.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)x.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((d=(u=this.options.hooks)==null?void 0:u.emStrongMask)==null?void 0:d.call({lexer:this},n))??n;let s=!1,o="";for(;t;){s||(o=""),s=!1;let x;if((p=(f=this.options.extensions)==null?void 0:f.inline)!=null&&p.some(v=>(x=v.call({lexer:this},t,r))?(t=t.substring(x.raw.length),r.push(x),!0):!1))continue;if(x=this.tokenizer.escape(t)){t=t.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.tag(t)){t=t.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.link(t)){t=t.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(x.raw.length);let v=r.at(-1);x.type==="text"&&(v==null?void 0:v.type)==="text"?(v.raw+=x.raw,v.text+=x.text):r.push(x);continue}if(x=this.tokenizer.emStrong(t,n,o)){t=t.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.codespan(t)){t=t.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.br(t)){t=t.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.del(t)){t=t.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.autolink(t)){t=t.substring(x.raw.length),r.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(t))){t=t.substring(x.raw.length),r.push(x);continue}let b=t;if((m=this.options.extensions)!=null&&m.startInline){let v=1/0,k=t.slice(1),w;this.options.extensions.startInline.forEach(C=>{w=C.call({lexer:this},k),typeof w=="number"&&w>=0&&(v=Math.min(v,w))}),v<1/0&&v>=0&&(b=t.substring(0,v+1))}if(x=this.tokenizer.inlineText(b)){t=t.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(o=x.raw.slice(-1)),s=!0;let v=r.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=x.raw,v.text+=x.text):r.push(x);continue}if(t){let v="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(v);break}else throw new Error(v)}}return r}},Cp=class{constructor(t){qt(this,"options");qt(this,"parser");this.options=t||Dl}space(t){return""}code({text:t,lang:r,escaped:n}){var s;let i=(s=(r||"").match(kn.notSpaceStart))==null?void 0:s[0],a=t.replace(kn.endingNewline,"")+`
305
- `;return i?'<pre><code class="language-'+Vi(i)+'">'+(n?a:Vi(a,!0))+`</code></pre>
306
- `:"<pre><code>"+(n?a:Vi(a,!0))+`</code></pre>
307
- `}blockquote({tokens:t}){return`<blockquote>
308
- ${this.parser.parse(t)}</blockquote>
309
- `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
310
- `}hr(t){return`<hr>
311
- `}list(t){let r=t.ordered,n=t.start,i="";for(let o=0;o<t.items.length;o++){let u=t.items[o];i+=this.listitem(u)}let a=r?"ol":"ul",s=r&&n!==1?' start="'+n+'"':"";return"<"+a+s+`>
312
- `+i+"</"+a+`>
313
- `}listitem(t){var n;let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?((n=t.tokens[0])==null?void 0:n.type)==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+Vi(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
314
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
315
- `}table(t){let r="",n="";for(let a=0;a<t.header.length;a++)n+=this.tablecell(t.header[a]);r+=this.tablerow({text:n});let i="";for(let a=0;a<t.rows.length;a++){let s=t.rows[a];n="";for(let o=0;o<s.length;o++)n+=this.tablecell(s[o]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
316
- <thead>
317
- `+r+`</thead>
318
- `+i+`</table>
319
- `}tablerow({text:t}){return`<tr>
320
- ${t}</tr>
321
- `}tablecell(t){let r=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+r+`</${n}>
322
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Vi(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:n}){let i=this.parser.parseInline(n),a=f4(t);if(a===null)return i;t=a;let s='<a href="'+t+'"';return r&&(s+=' title="'+Vi(r)+'"'),s+=">"+i+"</a>",s}image({href:t,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=f4(t);if(a===null)return Vi(n);t=a;let s=`<img src="${t}" alt="${n}"`;return r&&(s+=` title="${Vi(r)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Vi(t.text)}},k2=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ei=class g1{constructor(t){qt(this,"options");qt(this,"renderer");qt(this,"textRenderer");this.options=t||Dl,this.options.renderer=this.options.renderer||new Cp,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new k2}static parse(t,r){return new g1(r).parse(t)}static parseInline(t,r){return new g1(r).parseInline(t)}parse(t,r=!0){var i,a;let n="";for(let s=0;s<t.length;s++){let o=t[s];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[o.type]){let d=o,f=this.options.extensions.renderers[d.type].call({parser:this},d);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=f||"";continue}}let u=o;switch(u.type){case"space":{n+=this.renderer.space(u);continue}case"hr":{n+=this.renderer.hr(u);continue}case"heading":{n+=this.renderer.heading(u);continue}case"code":{n+=this.renderer.code(u);continue}case"table":{n+=this.renderer.table(u);continue}case"blockquote":{n+=this.renderer.blockquote(u);continue}case"list":{n+=this.renderer.list(u);continue}case"html":{n+=this.renderer.html(u);continue}case"def":{n+=this.renderer.def(u);continue}case"paragraph":{n+=this.renderer.paragraph(u);continue}case"text":{let d=u,f=this.renderer.text(d);for(;s+1<t.length&&t[s+1].type==="text";)d=t[++s],f+=`
323
- `+this.renderer.text(d);r?n+=this.renderer.paragraph({type:"paragraph",raw:f,text:f,tokens:[{type:"text",raw:f,text:f,escaped:!0}]}):n+=f;continue}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(t,r=this.renderer){var i,a;let n="";for(let s=0;s<t.length;s++){let o=t[s];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[o.type]){let d=this.options.extensions.renderers[o.type].call({parser:this},o);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=d||"";continue}}let u=o;switch(u.type){case"escape":{n+=r.text(u);break}case"html":{n+=r.html(u);break}case"link":{n+=r.link(u);break}case"image":{n+=r.image(u);break}case"strong":{n+=r.strong(u);break}case"em":{n+=r.em(u);break}case"codespan":{n+=r.codespan(u);break}case"br":{n+=r.br(u);break}case"del":{n+=r.del(u);break}case"text":{n+=r.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}},u0,Ju=(u0=class{constructor(t){qt(this,"options");qt(this,"block");this.options=t||Dl}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Ti.lex:Ti.lexInline}provideParser(){return this.block?Ei.parse:Ei.parseInline}},qt(u0,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),qt(u0,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),u0),ite=class{constructor(...t){qt(this,"defaults",p2());qt(this,"options",this.setOptions);qt(this,"parse",this.parseMarkdown(!0));qt(this,"parseInline",this.parseMarkdown(!1));qt(this,"Parser",Ei);qt(this,"Renderer",Cp);qt(this,"TextRenderer",k2);qt(this,"Lexer",Ti);qt(this,"Tokenizer",Sp);qt(this,"Hooks",Ju);this.use(...t)}walkTokens(t,r){var i,a;let n=[];for(let s of t)switch(n=n.concat(r.call(this,s)),s.type){case"table":{let o=s;for(let u of o.header)n=n.concat(this.walkTokens(u.tokens,r));for(let u of o.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,r));break}case"list":{let o=s;n=n.concat(this.walkTokens(o.items,r));break}default:{let o=s;(a=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[o.type]?this.defaults.extensions.childTokens[o.type].forEach(u=>{let d=o[u].flat(1/0);n=n.concat(this.walkTokens(d,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let u=a.renderer.apply(this,o);return u===!1&&(u=s.apply(this,o)),u}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new Cp(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,u=n.renderer[o],d=a[o];a[o]=(...f)=>{let p=u.apply(a,f);return p===!1&&(p=d.apply(a,f)),p||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Sp(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,u=n.tokenizer[o],d=a[o];a[o]=(...f)=>{let p=u.apply(a,f);return p===!1&&(p=d.apply(a,f)),p}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new Ju;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,u=n.hooks[o],d=a[o];Ju.passThroughHooks.has(s)?a[o]=f=>{if(this.defaults.async&&Ju.passThroughHooksRespectAsync.has(s))return(async()=>{let m=await u.call(a,f);return d.call(a,m)})();let p=u.call(a,f);return d.call(a,p)}:a[o]=(...f)=>{if(this.defaults.async)return(async()=>{let m=await u.apply(a,f);return m===!1&&(m=await d.apply(a,f)),m})();let p=u.apply(a,f);return p===!1&&(p=d.apply(a,f)),p}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let u=[];return u.push(s.call(this,o)),a&&(u=u.concat(a.call(this,o))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Ti.lex(t,r??this.defaults)}parser(t,r){return Ei.parse(t,r??this.defaults)}parseMarkdown(t){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,u=await(a.hooks?await a.hooks.provideLexer():t?Ti.lex:Ti.lexInline)(o,a),d=a.hooks?await a.hooks.processAllTokens(u):u;a.walkTokens&&await Promise.all(this.walkTokens(d,a.walkTokens));let f=await(a.hooks?await a.hooks.provideParser():t?Ei.parse:Ei.parseInline)(d,a);return a.hooks?await a.hooks.postprocess(f):f})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer():t?Ti.lex:Ti.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let u=(a.hooks?a.hooks.provideParser():t?Ei.parse:Ei.parseInline)(o,a);return a.hooks&&(u=a.hooks.postprocess(u)),u}catch(o){return s(o)}}}onError(t,r){return n=>{if(n.message+=`
324
- Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Vi(n.message+"",!0)+"</pre>";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},kl=new ite;function Rt(e,t){return kl.parse(e,t)}Rt.options=Rt.setOptions=function(e){return kl.setOptions(e),Rt.defaults=kl.defaults,BM(Rt.defaults),Rt};Rt.getDefaults=p2;Rt.defaults=Dl;Rt.use=function(...e){return kl.use(...e),Rt.defaults=kl.defaults,BM(Rt.defaults),Rt};Rt.walkTokens=function(e,t){return kl.walkTokens(e,t)};Rt.parseInline=kl.parseInline;Rt.Parser=Ei;Rt.parser=Ei.parse;Rt.Renderer=Cp;Rt.TextRenderer=k2;Rt.Lexer=Ti;Rt.lexer=Ti.lex;Rt.Tokenizer=Sp;Rt.Hooks=Ju;Rt.parse=Rt;Rt.options;Rt.setOptions;Rt.use;Rt.walkTokens;Rt.parseInline;Ei.parse;Ti.lex;function YM(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=Array.from(typeof e=="string"?[e]:e);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,"");var i=n.reduce(function(o,u){var d=u.match(/\n([\t ]+|(?!\s).)/g);return d?o.concat(d.map(function(f){var p,m;return(m=(p=f.match(/[\t ]/g))===null||p===void 0?void 0:p.length)!==null&&m!==void 0?m:0})):o},[]);if(i.length){var a=new RegExp(`
325
- [ ]{`+Math.min.apply(Math,i)+"}","g");n=n.map(function(o){return o.replace(a,`
326
- `)})}n[0]=n[0].replace(/^\r?\n/,"");var s=n[0];return t.forEach(function(o,u){var d=s.match(/(?:^|\n)( *)$/),f=d?d[1]:"",p=o;typeof o=="string"&&o.includes(`
327
- `)&&(p=String(o).split(`
328
- `).map(function(m,x){return x===0?m:""+f+m}).join(`
329
- `)),s+=p+n[u+1]}),s}var ate={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},m1=new Map,GM=new Map,ste=O(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(we.debug("Registering icon pack:",t.name),"loader"in t)GM.set(t.name,t.loader);else if("icons"in t)m1.set(t.name,t.icons);else throw we.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),XM=O(async(e,t)=>{const r=lee(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const n=r.prefix||t;if(!n)throw new Error(`Icon name must contain a prefix: ${e}`);let i=m1.get(n);if(!i){const s=GM.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},m1.set(n,i)}catch(o){throw we.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=uee(i,r.name);if(!a)throw new Error(`Icon not found: ${e}`);return a},"getRegisteredIconData"),lte=O(async e=>{try{return await XM(e),!0}catch{return!1}},"isIconAvailable"),ph=O(async(e,t,r)=>{let n;try{n=await XM(e,t==null?void 0:t.fallbackPrefix)}catch(s){we.error(s),n=ate}const i=xee(n,t),a=wee(vee(i.body),{...i.attributes,...r});return xi(a,cn())},"getIconSVG");function QM(e,{markdownAutoWrap:t}){const n=e.replace(/<br\/>/g,`
330
- `).replace(/\n{2,}/g,`
331
- `),i=YM(n);return t===!1?i.replace(/ /g,"&nbsp;"):i}O(QM,"preprocessMarkdown");function ZM(e,t={}){const r=QM(e,t),n=Rt.lexer(r),i=[[]];let a=0;function s(o,u="normal"){o.type==="text"?o.text.split(`
332
- `).forEach((f,p)=>{p!==0&&(a++,i.push([])),f.split(" ").forEach(m=>{m=m.replace(/&#39;/g,"'"),m&&i[a].push({content:m,type:u})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(d=>{s(d,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return O(s,"processNode"),n.forEach(o=>{var u;o.type==="paragraph"?(u=o.tokens)==null||u.forEach(d=>{s(d)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}O(ZM,"markdownToLines");function KM(e,{markdownAutoWrap:t}={}){const r=Rt.lexer(e);function n(i){var a,s,o;return i.type==="text"?t===!1?i.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):i.text.replace(/\n */g,"<br/>"):i.type==="strong"?`<strong>${(a=i.tokens)==null?void 0:a.map(n).join("")}</strong>`:i.type==="em"?`<em>${(s=i.tokens)==null?void 0:s.map(n).join("")}</em>`:i.type==="paragraph"?`<p>${(o=i.tokens)==null?void 0:o.map(n).join("")}</p>`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(we.warn(`Unsupported markdown: ${i.type}`),i.raw)}return O(n,"output"),r.map(n).join("")}O(KM,"markdownToHTML");function JM(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}O(JM,"splitTextToChars");function eL(e,t){const r=JM(t.content);return S2(e,[],r,t.type)}O(eL,"splitWordToFitWidth");function S2(e,t,r,n){if(r.length===0)return[{content:t.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...t,i];return e([{content:s.join(""),type:n}])?S2(e,s,a,n):(t.length===0&&i&&(t.push(i),r.shift()),[{content:t.join(""),type:n},{content:r.join(""),type:n}])}O(S2,"splitWordToFitWidthRecursion");function tL(e,t){if(e.some(({content:r})=>r.includes(`
333
- `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return _p(e,t)}O(tL,"splitLineToFitWidth");function _p(e,t,r=[],n=[]){if(e.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";e[0].content===" "&&(i=" ",e.shift());const a=e.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),t(s))return _p(e,t,r,s);if(n.length>0)r.push(n),e.unshift(a);else if(a.content){const[o,u]=eL(t,a);r.push([o]),u.content&&e.unshift(u)}return _p(e,t,r)}O(_p,"splitLineToFitWidthRecursion");function x1(e,t){t&&e.attr("style",t)}O(x1,"applyStyle");async function rL(e,t,r,n,i=!1,a=cn()){const s=e.append("foreignObject");s.attr("width",`${10*r}px`),s.attr("height",`${10*r}px`);const o=s.append("xhtml:div"),u=ec(t.label)?await Dv(t.label.replace(Tc.lineBreakRegex,`
334
- `),a):xi(t.label,a),d=t.isNode?"nodeLabel":"edgeLabel",f=o.append("span");f.html(u),x1(f,t.labelStyle),f.attr("class",`${d} ${n}`),x1(o,t.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),o.style("max-width",r+"px"),o.style("text-align","center"),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let p=o.node().getBoundingClientRect();return p.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),p=o.node().getBoundingClientRect()),s.node()}O(rL,"addHtmlSpan");function vg(e,t,r){return e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em")}O(vg,"createTspan");function nL(e,t,r){const n=e.append("text"),i=vg(n,1,t);wg(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}O(nL,"computeWidthOfText");function ote(e,t,r){var s;const n=e.append("text"),i=vg(n,1,t);wg(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}O(ote,"computeDimensionOfText");function iL(e,t,r,n=!1){const a=t.append("g"),s=a.insert("rect").attr("class","background").attr("style","stroke: none"),o=a.append("text").attr("y","-10.1");let u=0;for(const d of r){const f=O(m=>nL(a,1.1,m)<=e,"checkWidth"),p=f(d)?[d]:tL(d,f);for(const m of p){const x=vg(o,u,1.1);wg(x,m),u++}}if(n){const d=o.node().getBBox(),f=2;return s.attr("x",d.x-f).attr("y",d.y-f).attr("width",d.width+2*f).attr("height",d.height+2*f),a.node()}else return o.node()}O(iL,"createFormattedText");function wg(e,t){e.text(""),t.forEach((r,n)=>{const i=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(r.content):i.text(" "+r.content)})}O(wg,"updateTextContentAndStyles");async function aL(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await lte(o)?await ph(o,void 0,{class:"label-icon"}):`<i class='${xi(i,t).replace(":"," ")}'></i>`})()),i));const n=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}O(aL,"replaceIconSubstring");var Es=O(async(e,t="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,isNode:s=!0,width:o=200,addSvgBackground:u=!1}={},d)=>{if(we.debug("XYZ createText",t,r,n,i,a,s,"addSvgBackground: ",u),a){const f=KM(t,d),p=await aL(Ll(f),d),m=t.replace(/\\\\/g,"\\"),x={isNode:s,label:ec(t)?m:p,labelStyle:r.replace("fill:","color:")};return await rL(e,x,o,i,u,d)}else{const f=t.replace(/<br\s*\/?>/g,"<br/>"),p=ZM(f.replace("<br>","<br/>"),d),m=iL(o,e,p,t?u:!1);if(s){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const x=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");et(m).attr("style",x)}else{const x=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");et(m).select("rect").attr("style",x.replace(/background:/g,"fill:"));const b=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");et(m).select("text").attr("style",b)}return m}},"createText");function zy(e,t,r){if(e&&e.length){const[n,i]=t,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const u of e){const[d,f]=u;u[0]=(d-n)*s-(f-i)*o+n,u[1]=(d-n)*o+(f-i)*s+i}}}function cte(e,t){return e[0]===t[0]&&e[1]===t[1]}function ute(e,t,r,n=1){const i=r,a=Math.max(t,.1),s=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,o=[0,0];if(i)for(const d of s)zy(d,o,i);const u=(function(d,f,p){const m=[];for(const C of d){const T=[...C];cte(T[0],T[T.length-1])||T.push([T[0][0],T[0][1]]),T.length>2&&m.push(T)}const x=[];f=Math.max(f,.1);const b=[];for(const C of m)for(let T=0;T<C.length-1;T++){const j=C[T],L=C[T+1];if(j[1]!==L[1]){const E=Math.min(j[1],L[1]);b.push({ymin:E,ymax:Math.max(j[1],L[1]),x:E===j[1]?j[0]:L[0],islope:(L[0]-j[0])/(L[1]-j[1])})}}if(b.sort(((C,T)=>C.ymin<T.ymin?-1:C.ymin>T.ymin?1:C.x<T.x?-1:C.x>T.x?1:C.ymax===T.ymax?0:(C.ymax-T.ymax)/Math.abs(C.ymax-T.ymax))),!b.length)return x;let v=[],k=b[0].ymin,w=0;for(;v.length||b.length;){if(b.length){let C=-1;for(let T=0;T<b.length&&!(b[T].ymin>k);T++)C=T;b.splice(0,C+1).forEach((T=>{v.push({s:k,edge:T})}))}if(v=v.filter((C=>!(C.edge.ymax<=k))),v.sort(((C,T)=>C.edge.x===T.edge.x?0:(C.edge.x-T.edge.x)/Math.abs(C.edge.x-T.edge.x))),(p!==1||w%f==0)&&v.length>1)for(let C=0;C<v.length;C+=2){const T=C+1;if(T>=v.length)break;const j=v[C].edge,L=v[T].edge;x.push([[Math.round(j.x),k],[Math.round(L.x),k]])}k+=p,v.forEach((C=>{C.edge.x=C.edge.x+p*C.edge.islope})),w++}return x})(s,a,n);if(i){for(const d of s)zy(d,o,-i);(function(d,f,p){const m=[];d.forEach((x=>m.push(...x))),zy(m,f,p)})(u,o,-i)}return u}function gh(e,t){var r;const n=t.hachureAngle+90;let i=t.hachureGap;i<0&&(i=4*t.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),ute(e,i,n,a||1)}class C2{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const n=gh(t,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(t,r){const n=[];for(const i of t)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function kg(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class dte extends C2{fillPolygons(t,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=gh(t,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),u=.5*n*Math.sin(a);for(const[d,f]of i)kg([d,f])&&s.push([[d[0]-o,d[1]+u],[...f]],[[d[0]+o,d[1]-u],[...f]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class hte extends C2{fillPolygons(t,r){const n=this._fillPolygons(t,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(t,i);return n.ops=n.ops.concat(a.ops),n}}class fte{constructor(t){this.helper=t}fillPolygons(t,r){const n=gh(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(t,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of t){const u=kg(o),d=u/i,f=Math.ceil(d)-1,p=u-f*i,m=(o[0][0]+o[1][0])/2-i/4,x=Math.min(o[0][1],o[1][1]);for(let b=0;b<f;b++){const v=x+p+b*i,k=m-s+2*Math.random()*s,w=v-s+2*Math.random()*s,C=this.helper.ellipse(k,w,a,a,r);n.push(...C.ops)}}return{type:"fillSketch",ops:n}}}class pte{constructor(t){this.helper=t}fillPolygons(t,r){const n=gh(t,r);return{type:"fillSketch",ops:this.dashedLine(n,r)}}dashedLine(t,r){const n=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,i=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,a=[];return t.forEach((s=>{const o=kg(s),u=Math.floor(o/(n+i)),d=(o+i-u*(n+i))/2;let f=s[0],p=s[1];f[0]>p[0]&&(f=s[1],p=s[0]);const m=Math.atan((p[1]-f[1])/(p[0]-f[0]));for(let x=0;x<u;x++){const b=x*(n+i),v=b+n,k=[f[0]+b*Math.cos(m)+d*Math.cos(m),f[1]+b*Math.sin(m)+d*Math.sin(m)],w=[f[0]+v*Math.cos(m)+d*Math.cos(m),f[1]+v*Math.sin(m)+d*Math.sin(m)];a.push(...this.helper.doubleLineOps(k[0],k[1],w[0],w[1],r))}})),a}}class gte{constructor(t){this.helper=t}fillPolygons(t,r){const n=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,i=r.zigzagOffset<0?n:r.zigzagOffset,a=gh(t,r=Object.assign({},r,{hachureGap:n+i}));return{type:"fillSketch",ops:this.zigzagLines(a,i,r)}}zigzagLines(t,r,n){const i=[];return t.forEach((a=>{const s=kg(a),o=Math.round(s/(2*r));let u=a[0],d=a[1];u[0]>d[0]&&(u=a[1],d=a[0]);const f=Math.atan((d[1]-u[1])/(d[0]-u[0]));for(let p=0;p<o;p++){const m=2*p*r,x=2*(p+1)*r,b=Math.sqrt(2*Math.pow(r,2)),v=[u[0]+m*Math.cos(f),u[1]+m*Math.sin(f)],k=[u[0]+x*Math.cos(f),u[1]+x*Math.sin(f)],w=[v[0]+b*Math.cos(f+Math.PI/4),v[1]+b*Math.sin(f+Math.PI/4)];i.push(...this.helper.doubleLineOps(v[0],v[1],w[0],w[1],n),...this.helper.doubleLineOps(w[0],w[1],k[0],k[1],n))}})),i}}const Rn={};class mte{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const xte=0,Iy=1,m4=2,Qf={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Fy(e,t){return e.type===t}function _2(e){const t=[],r=(function(s){const o=new Array;for(;s!=="";)if(s.match(/^([ \t\r\n,]+)/))s=s.substr(RegExp.$1.length);else if(s.match(/^([aAcChHlLmMqQsStTvVzZ])/))o[o.length]={type:xte,text:RegExp.$1},s=s.substr(RegExp.$1.length);else{if(!s.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];o[o.length]={type:Iy,text:`${parseFloat(RegExp.$1)}`},s=s.substr(RegExp.$1.length)}return o[o.length]={type:m4,text:""},o})(e);let n="BOD",i=0,a=r[i];for(;!Fy(a,m4);){let s=0;const o=[];if(n==="BOD"){if(a.text!=="M"&&a.text!=="m")return _2("M0,0"+e);i++,s=Qf[a.text],n=a.text}else Fy(a,Iy)?s=Qf[n]:(i++,s=Qf[a.text],n=a.text);if(!(i+s<r.length))throw new Error("Path data ended short");for(let u=i;u<i+s;u++){const d=r[u];if(!Fy(d,Iy))throw new Error("Param not a number: "+n+","+d.text);o[o.length]=+d.text}if(typeof Qf[n]!="number")throw new Error("Bad segment: "+n);{const u={key:n,data:o};t.push(u),i+=s,a=r[i],n==="M"&&(n="L"),n==="m"&&(n="l")}}return t}function sL(e){let t=0,r=0,n=0,i=0;const a=[];for(const{key:s,data:o}of e)switch(s){case"M":a.push({key:"M",data:[...o]}),[t,r]=o,[n,i]=o;break;case"m":t+=o[0],r+=o[1],a.push({key:"M",data:[t,r]}),n=t,i=r;break;case"L":a.push({key:"L",data:[...o]}),[t,r]=o;break;case"l":t+=o[0],r+=o[1],a.push({key:"L",data:[t,r]});break;case"C":a.push({key:"C",data:[...o]}),t=o[4],r=o[5];break;case"c":{const u=o.map(((d,f)=>f%2?d+r:d+t));a.push({key:"C",data:u}),t=u[4],r=u[5];break}case"Q":a.push({key:"Q",data:[...o]}),t=o[2],r=o[3];break;case"q":{const u=o.map(((d,f)=>f%2?d+r:d+t));a.push({key:"Q",data:u}),t=u[2],r=u[3];break}case"A":a.push({key:"A",data:[...o]}),t=o[5],r=o[6];break;case"a":t+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],t,r]});break;case"H":a.push({key:"H",data:[...o]}),t=o[0];break;case"h":t+=o[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),t=o[2],r=o[3];break;case"s":{const u=o.map(((d,f)=>f%2?d+r:d+t));a.push({key:"S",data:u}),t=u[2],r=u[3];break}case"T":a.push({key:"T",data:[...o]}),t=o[0],r=o[1];break;case"t":t+=o[0],r+=o[1],a.push({key:"T",data:[t,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=n,r=i}return a}function lL(e){const t=[];let r="",n=0,i=0,a=0,s=0,o=0,u=0;for(const{key:d,data:f}of e){switch(d){case"M":t.push({key:"M",data:[...f]}),[n,i]=f,[a,s]=f;break;case"C":t.push({key:"C",data:[...f]}),n=f[4],i=f[5],o=f[2],u=f[3];break;case"L":t.push({key:"L",data:[...f]}),[n,i]=f;break;case"H":n=f[0],t.push({key:"L",data:[n,i]});break;case"V":i=f[0],t.push({key:"L",data:[n,i]});break;case"S":{let p=0,m=0;r==="C"||r==="S"?(p=n+(n-o),m=i+(i-u)):(p=n,m=i),t.push({key:"C",data:[p,m,...f]}),o=f[0],u=f[1],n=f[2],i=f[3];break}case"T":{const[p,m]=f;let x=0,b=0;r==="Q"||r==="T"?(x=n+(n-o),b=i+(i-u)):(x=n,b=i);const v=n+2*(x-n)/3,k=i+2*(b-i)/3,w=p+2*(x-p)/3,C=m+2*(b-m)/3;t.push({key:"C",data:[v,k,w,C,p,m]}),o=x,u=b,n=p,i=m;break}case"Q":{const[p,m,x,b]=f,v=n+2*(p-n)/3,k=i+2*(m-i)/3,w=x+2*(p-x)/3,C=b+2*(m-b)/3;t.push({key:"C",data:[v,k,w,C,x,b]}),o=p,u=m,n=x,i=b;break}case"A":{const p=Math.abs(f[0]),m=Math.abs(f[1]),x=f[2],b=f[3],v=f[4],k=f[5],w=f[6];p===0||m===0?(t.push({key:"C",data:[n,i,k,w,k,w]}),n=k,i=w):(n!==k||i!==w)&&(oL(n,i,k,w,p,m,x,b,v).forEach((function(C){t.push({key:"C",data:C})})),n=k,i=w);break}case"Z":t.push({key:"Z",data:[]}),n=a,i=s}r=d}return t}function Hu(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function oL(e,t,r,n,i,a,s,o,u,d){const f=(p=s,Math.PI*p/180);var p;let m=[],x=0,b=0,v=0,k=0;if(d)[x,b,v,k]=d;else{[e,t]=Hu(e,t,-f),[r,n]=Hu(r,n,-f);const Y=(e-r)/2,B=(t-n)/2;let U=Y*Y/(i*i)+B*B/(a*a);U>1&&(U=Math.sqrt(U),i*=U,a*=U);const R=i*i,H=a*a,V=R*H-R*B*B-H*Y*Y,Q=R*B*B+H*Y*Y,A=(o===u?-1:1)*Math.sqrt(Math.abs(V/Q));v=A*i*B/a+(e+r)/2,k=A*-a*Y/i+(t+n)/2,x=Math.asin(parseFloat(((t-k)/a).toFixed(9))),b=Math.asin(parseFloat(((n-k)/a).toFixed(9))),e<v&&(x=Math.PI-x),r<v&&(b=Math.PI-b),x<0&&(x=2*Math.PI+x),b<0&&(b=2*Math.PI+b),u&&x>b&&(x-=2*Math.PI),!u&&b>x&&(b-=2*Math.PI)}let w=b-x;if(Math.abs(w)>120*Math.PI/180){const Y=b,B=r,U=n;b=u&&b>x?x+120*Math.PI/180*1:x+120*Math.PI/180*-1,m=oL(r=v+i*Math.cos(b),n=k+a*Math.sin(b),B,U,i,a,s,0,u,[b,Y,v,k])}w=b-x;const C=Math.cos(x),T=Math.sin(x),j=Math.cos(b),L=Math.sin(b),E=Math.tan(w/4),M=4/3*i*E,I=4/3*a*E,P=[e,t],z=[e+M*T,t-I*C],$=[r+M*L,n-I*j],W=[r,n];if(z[0]=2*P[0]-z[0],z[1]=2*P[1]-z[1],d)return[z,$,W].concat(m);{m=[z,$,W].concat(m);const Y=[];for(let B=0;B<m.length;B+=3){const U=Hu(m[B][0],m[B][1],f),R=Hu(m[B+1][0],m[B+1][1],f),H=Hu(m[B+2][0],m[B+2][1],f);Y.push([U[0],U[1],R[0],R[1],H[0],H[1]])}return Y}}const yte={randOffset:function(e,t){return Ze(e,t)},randOffsetWithRange:function(e,t,r){return Tp(e,t,r)},ellipse:function(e,t,r,n,i){const a=uL(r,n,i);return y1(e,t,i,a).opset},doubleLineOps:function(e,t,r,n,i){return Ss(e,t,r,n,i,!0)}};function cL(e,t,r,n,i){return{type:"path",ops:Ss(e,t,r,n,i)}}function C0(e,t,r){const n=(e||[]).length;if(n>2){const i=[];for(let a=0;a<n-1;a++)i.push(...Ss(e[a][0],e[a][1],e[a+1][0],e[a+1][1],r));return t&&i.push(...Ss(e[n-1][0],e[n-1][1],e[0][0],e[0][1],r)),{type:"path",ops:i}}return n===2?cL(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function bte(e,t,r,n,i){return(function(a,s){return C0(a,!0,s)})([[e,t],[e+r,t],[e+r,t+n],[e,t+n]],i)}function x4(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,n=Zf(r[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:Zf(r[0],1.5*(1+.22*t.roughness),v4(t));for(let a=1;a<r.length;a++){const s=r[a];if(s.length){const o=Zf(s,1*(1+.2*t.roughness),t),u=t.disableMultiStroke?[]:Zf(s,1.5*(1+.22*t.roughness),v4(t));for(const d of o)d.op!=="move"&&n.push(d);for(const d of u)d.op!=="move"&&i.push(d)}}return{type:"path",ops:n.concat(i)}}return{type:"path",ops:[]}}function uL(e,t,r){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*n)),a=2*Math.PI/i;let s=Math.abs(e/2),o=Math.abs(t/2);const u=1-r.curveFitting;return s+=Ze(s*u,r),o+=Ze(o*u,r),{increment:a,rx:s,ry:o}}function y1(e,t,r,n){const[i,a]=w4(n.increment,e,t,n.rx,n.ry,1,n.increment*Tp(.1,Tp(.4,1,r),r),r);let s=Ep(i,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[o]=w4(n.increment,e,t,n.rx,n.ry,1.5,0,r),u=Ep(o,null,r);s=s.concat(u)}return{estimatedPoints:a,opset:{type:"path",ops:s}}}function y4(e,t,r,n,i,a,s,o,u){const d=e,f=t;let p=Math.abs(r/2),m=Math.abs(n/2);p+=Ze(.01*p,u),m+=Ze(.01*m,u);let x=i,b=a;for(;x<0;)x+=2*Math.PI,b+=2*Math.PI;b-x>2*Math.PI&&(x=0,b=2*Math.PI);const v=2*Math.PI/u.curveStepCount,k=Math.min(v/2,(b-x)/2),w=k4(k,d,f,p,m,x,b,1,u);if(!u.disableMultiStroke){const C=k4(k,d,f,p,m,x,b,1.5,u);w.push(...C)}return s&&(o?w.push(...Ss(d,f,d+p*Math.cos(x),f+m*Math.sin(x),u),...Ss(d,f,d+p*Math.cos(b),f+m*Math.sin(b),u)):w.push({op:"lineTo",data:[d,f]},{op:"lineTo",data:[d+p*Math.cos(x),f+m*Math.sin(x)]})),{type:"path",ops:w}}function b4(e,t){const r=lL(sL(_2(e))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...Ss(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case"C":{const[u,d,f,p,m,x]=o;n.push(...vte(u,d,f,p,m,x,a,t)),a=[m,x];break}case"Z":n.push(...Ss(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:"path",ops:n}}function Py(e,t){const r=[];for(const n of e)if(n.length){const i=t.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+Ze(i,t),n[0][1]+Ze(i,t)]});for(let s=1;s<a;s++)r.push({op:"lineTo",data:[n[s][0]+Ze(i,t),n[s][1]+Ze(i,t)]})}}return{type:"fillPath",ops:r}}function ko(e,t){return(function(r,n){let i=r.fillStyle||"hachure";if(!Rn[i])switch(i){case"zigzag":Rn[i]||(Rn[i]=new dte(n));break;case"cross-hatch":Rn[i]||(Rn[i]=new hte(n));break;case"dots":Rn[i]||(Rn[i]=new fte(n));break;case"dashed":Rn[i]||(Rn[i]=new pte(n));break;case"zigzag-line":Rn[i]||(Rn[i]=new gte(n));break;default:i="hachure",Rn[i]||(Rn[i]=new C2(n))}return Rn[i]})(t,yte).fillPolygons(e,t)}function v4(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function dL(e){return e.randomizer||(e.randomizer=new mte(e.seed||0)),e.randomizer.next()}function Tp(e,t,r,n=1){return r.roughness*n*(dL(r)*(t-e)+e)}function Ze(e,t,r=1){return Tp(-e,e,t,r)}function Ss(e,t,r,n,i,a=!1){const s=a?i.disableMultiStrokeFill:i.disableMultiStroke,o=b1(e,t,r,n,i,!0,!1);if(s)return o;const u=b1(e,t,r,n,i,!0,!0);return o.concat(u)}function b1(e,t,r,n,i,a,s){const o=Math.pow(e-r,2)+Math.pow(t-n,2),u=Math.sqrt(o);let d=1;d=u<200?1:u>500?.4:-.0016668*u+1.233334;let f=i.maxRandomnessOffset||0;f*f*100>o&&(f=u/10);const p=f/2,m=.2+.2*dL(i);let x=i.bowing*i.maxRandomnessOffset*(n-t)/200,b=i.bowing*i.maxRandomnessOffset*(e-r)/200;x=Ze(x,i,d),b=Ze(b,i,d);const v=[],k=()=>Ze(p,i,d),w=()=>Ze(f,i,d),C=i.preserveVertices;return s?v.push({op:"move",data:[e+(C?0:k()),t+(C?0:k())]}):v.push({op:"move",data:[e+(C?0:Ze(f,i,d)),t+(C?0:Ze(f,i,d))]}),s?v.push({op:"bcurveTo",data:[x+e+(r-e)*m+k(),b+t+(n-t)*m+k(),x+e+2*(r-e)*m+k(),b+t+2*(n-t)*m+k(),r+(C?0:k()),n+(C?0:k())]}):v.push({op:"bcurveTo",data:[x+e+(r-e)*m+w(),b+t+(n-t)*m+w(),x+e+2*(r-e)*m+w(),b+t+2*(n-t)*m+w(),r+(C?0:w()),n+(C?0:w())]}),v}function Zf(e,t,r){if(!e.length)return[];const n=[];n.push([e[0][0]+Ze(t,r),e[0][1]+Ze(t,r)]),n.push([e[0][0]+Ze(t,r),e[0][1]+Ze(t,r)]);for(let i=1;i<e.length;i++)n.push([e[i][0]+Ze(t,r),e[i][1]+Ze(t,r)]),i===e.length-1&&n.push([e[i][0]+Ze(t,r),e[i][1]+Ze(t,r)]);return Ep(n,null,r)}function Ep(e,t,r){const n=e.length,i=[];if(n>3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let o=1;o+2<n;o++){const u=e[o];a[0]=[u[0],u[1]],a[1]=[u[0]+(s*e[o+1][0]-s*e[o-1][0])/6,u[1]+(s*e[o+1][1]-s*e[o-1][1])/6],a[2]=[e[o+1][0]+(s*e[o][0]-s*e[o+2][0])/6,e[o+1][1]+(s*e[o][1]-s*e[o+2][1])/6],a[3]=[e[o+1][0],e[o+1][1]],i.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}}else n===3?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):n===2&&i.push(...b1(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return i}function w4(e,t,r,n,i,a,s,o){const u=[],d=[];if(o.roughness===0){e/=4,d.push([t+n*Math.cos(-e),r+i*Math.sin(-e)]);for(let f=0;f<=2*Math.PI;f+=e){const p=[t+n*Math.cos(f),r+i*Math.sin(f)];u.push(p),d.push(p)}d.push([t+n*Math.cos(0),r+i*Math.sin(0)]),d.push([t+n*Math.cos(e),r+i*Math.sin(e)])}else{const f=Ze(.5,o)-Math.PI/2;d.push([Ze(a,o)+t+.9*n*Math.cos(f-e),Ze(a,o)+r+.9*i*Math.sin(f-e)]);const p=2*Math.PI+f-.01;for(let m=f;m<p;m+=e){const x=[Ze(a,o)+t+n*Math.cos(m),Ze(a,o)+r+i*Math.sin(m)];u.push(x),d.push(x)}d.push([Ze(a,o)+t+n*Math.cos(f+2*Math.PI+.5*s),Ze(a,o)+r+i*Math.sin(f+2*Math.PI+.5*s)]),d.push([Ze(a,o)+t+.98*n*Math.cos(f+s),Ze(a,o)+r+.98*i*Math.sin(f+s)]),d.push([Ze(a,o)+t+.9*n*Math.cos(f+.5*s),Ze(a,o)+r+.9*i*Math.sin(f+.5*s)])}return[d,u]}function k4(e,t,r,n,i,a,s,o,u){const d=a+Ze(.1,u),f=[];f.push([Ze(o,u)+t+.9*n*Math.cos(d-e),Ze(o,u)+r+.9*i*Math.sin(d-e)]);for(let p=d;p<=s;p+=e)f.push([Ze(o,u)+t+n*Math.cos(p),Ze(o,u)+r+i*Math.sin(p)]);return f.push([t+n*Math.cos(s),r+i*Math.sin(s)]),f.push([t+n*Math.cos(s),r+i*Math.sin(s)]),Ep(f,null,u)}function vte(e,t,r,n,i,a,s,o){const u=[],d=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3];let f=[0,0];const p=o.disableMultiStroke?1:2,m=o.preserveVertices;for(let x=0;x<p;x++)x===0?u.push({op:"move",data:[s[0],s[1]]}):u.push({op:"move",data:[s[0]+(m?0:Ze(d[0],o)),s[1]+(m?0:Ze(d[0],o))]}),f=m?[i,a]:[i+Ze(d[x],o),a+Ze(d[x],o)],u.push({op:"bcurveTo",data:[e+Ze(d[x],o),t+Ze(d[x],o),r+Ze(d[x],o),n+Ze(d[x],o),f[0],f[1]]});return u}function qu(e){return[...e]}function S4(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const n=[];if(r===3)n.push(qu(e[0]),qu(e[1]),qu(e[2]),qu(e[2]));else{const i=[];i.push(e[0],e[0]);for(let o=1;o<e.length;o++)i.push(e[o]),o===e.length-1&&i.push(e[o]);const a=[],s=1-t;n.push(qu(i[0]));for(let o=1;o+2<i.length;o++){const u=i[o];a[0]=[u[0],u[1]],a[1]=[u[0]+(s*i[o+1][0]-s*i[o-1][0])/6,u[1]+(s*i[o+1][1]-s*i[o-1][1])/6],a[2]=[i[o+1][0]+(s*i[o][0]-s*i[o+2][0])/6,i[o+1][1]+(s*i[o][1]-s*i[o+2][1])/6],a[3]=[i[o+1][0],i[o+1][1]],n.push(a[1],a[2],a[3])}}return n}function _0(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function wte(e,t,r){const n=_0(t,r);if(n===0)return _0(e,t);let i=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/n;return i=Math.max(0,Math.min(1,i)),_0(e,tl(t,r,i))}function tl(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function v1(e,t,r,n){const i=n||[];if((function(o,u){const d=o[u+0],f=o[u+1],p=o[u+2],m=o[u+3];let x=3*f[0]-2*d[0]-m[0];x*=x;let b=3*f[1]-2*d[1]-m[1];b*=b;let v=3*p[0]-2*m[0]-d[0];v*=v;let k=3*p[1]-2*m[1]-d[1];return k*=k,x<v&&(x=v),b<k&&(b=k),x+b})(e,t)<r){const o=e[t+0];i.length?(a=i[i.length-1],s=o,Math.sqrt(_0(a,s))>1&&i.push(o)):i.push(o),i.push(e[t+3])}else{const u=e[t+0],d=e[t+1],f=e[t+2],p=e[t+3],m=tl(u,d,.5),x=tl(d,f,.5),b=tl(f,p,.5),v=tl(m,x,.5),k=tl(x,b,.5),w=tl(v,k,.5);v1([u,m,v,w],0,r,i),v1([w,k,b,p],0,r,i)}var a,s;return i}function kte(e,t){return Np(e,0,e.length,t)}function Np(e,t,r,n,i){const a=i||[],s=e[t],o=e[r-1];let u=0,d=1;for(let f=t+1;f<r-1;++f){const p=wte(e[f],s,o);p>u&&(u=p,d=f)}return Math.sqrt(u)>n?(Np(e,t,d+1,n,a),Np(e,d,r,n,a)):(a.length||a.push(s),a.push(o)),a}function Hy(e,t=.15,r){const n=[],i=(e.length-1)/3;for(let a=0;a<i;a++)v1(e,3*a,t,n);return r&&r>0?Np(n,0,n.length,r):n}const Kn="none";class jp{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,n){return{shape:t,sets:r||[],options:n||this.defaultOptions}}line(t,r,n,i,a){const s=this._o(a);return this._d("line",[cL(t,r,n,i,s)],s)}rectangle(t,r,n,i,a){const s=this._o(a),o=[],u=bte(t,r,n,i,s);if(s.fill){const d=[[t,r],[t+n,r],[t+n,r+i],[t,r+i]];s.fillStyle==="solid"?o.push(Py([d],s)):o.push(ko([d],s))}return s.stroke!==Kn&&o.push(u),this._d("rectangle",o,s)}ellipse(t,r,n,i,a){const s=this._o(a),o=[],u=uL(n,i,s),d=y1(t,r,s,u);if(s.fill)if(s.fillStyle==="solid"){const f=y1(t,r,s,u).opset;f.type="fillPath",o.push(f)}else o.push(ko([d.estimatedPoints],s));return s.stroke!==Kn&&o.push(d.opset),this._d("ellipse",o,s)}circle(t,r,n,i){const a=this.ellipse(t,r,n,n,i);return a.shape="circle",a}linearPath(t,r){const n=this._o(r);return this._d("linearPath",[C0(t,!1,n)],n)}arc(t,r,n,i,a,s,o=!1,u){const d=this._o(u),f=[],p=y4(t,r,n,i,a,s,o,!0,d);if(o&&d.fill)if(d.fillStyle==="solid"){const m=Object.assign({},d);m.disableMultiStroke=!0;const x=y4(t,r,n,i,a,s,!0,!1,m);x.type="fillPath",f.push(x)}else f.push((function(m,x,b,v,k,w,C){const T=m,j=x;let L=Math.abs(b/2),E=Math.abs(v/2);L+=Ze(.01*L,C),E+=Ze(.01*E,C);let M=k,I=w;for(;M<0;)M+=2*Math.PI,I+=2*Math.PI;I-M>2*Math.PI&&(M=0,I=2*Math.PI);const P=(I-M)/C.curveStepCount,z=[];for(let $=M;$<=I;$+=P)z.push([T+L*Math.cos($),j+E*Math.sin($)]);return z.push([T+L*Math.cos(I),j+E*Math.sin(I)]),z.push([T,j]),ko([z],C)})(t,r,n,i,a,s,d));return d.stroke!==Kn&&f.push(p),this._d("arc",f,d)}curve(t,r){const n=this._o(r),i=[],a=x4(t,n);if(n.fill&&n.fill!==Kn)if(n.fillStyle==="solid"){const s=x4(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=t;if(o.length){const u=typeof o[0][0]=="number"?[o]:o;for(const d of u)d.length<3?s.push(...d):d.length===3?s.push(...Hy(S4([d[0],d[0],d[1],d[2]]),10,(1+n.roughness)/2)):s.push(...Hy(S4(d),10,(1+n.roughness)/2))}s.length&&i.push(ko([s],n))}return n.stroke!==Kn&&i.push(a),this._d("curve",i,n)}polygon(t,r){const n=this._o(r),i=[],a=C0(t,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(Py([t],n)):i.push(ko([t],n))),n.stroke!==Kn&&i.push(a),this._d("polygon",i,n)}path(t,r){const n=this._o(r),i=[];if(!t)return this._d("path",i,n);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==Kn,s=n.stroke!==Kn,o=!!(n.simplification&&n.simplification<1),u=(function(f,p,m){const x=lL(sL(_2(f))),b=[];let v=[],k=[0,0],w=[];const C=()=>{w.length>=4&&v.push(...Hy(w,p)),w=[]},T=()=>{C(),v.length&&(b.push(v),v=[])};for(const{key:L,data:E}of x)switch(L){case"M":T(),k=[E[0],E[1]],v.push(k);break;case"L":C(),v.push([E[0],E[1]]);break;case"C":if(!w.length){const M=v.length?v[v.length-1]:k;w.push([M[0],M[1]])}w.push([E[0],E[1]]),w.push([E[2],E[3]]),w.push([E[4],E[5]]);break;case"Z":C(),v.push([k[0],k[1]])}if(T(),!m)return b;const j=[];for(const L of b){const E=kte(L,m);E.length&&j.push(E)}return j})(t,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),d=b4(t,n);if(a)if(n.fillStyle==="solid")if(u.length===1){const f=b4(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(f.ops)})}else i.push(Py(u,n));else i.push(ko(u,n));return s&&(o?u.forEach((f=>{i.push(C0(f,!1,n))})):i.push(d)),this._d("path",i,n)}opsToPath(t,r){let n="";for(const i of t.ops){const a=typeof r=="number"&&r>=0?i.data.map((s=>+s.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(t){const r=t.sets||[],n=t.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Kn};break;case"fillPath":s={d:this.opsToPath(a),stroke:Kn,strokeWidth:0,fill:n.fill||Kn};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(t,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||Kn,strokeWidth:n,fill:Kn}}_mergedShape(t){return t.filter(((r,n)=>n===0||r.op!=="move"))}}class Ste{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new jp(r)}draw(t){const r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(t,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),t.save(),n.fillLineDash&&t.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(t.lineDashOffset=n.fillLineDashOffset),t.strokeStyle=n.fill||"",t.lineWidth=i,this._drawToContext(t,r,n.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,n,i="nonzero"){t.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map((o=>+o.toFixed(n))):a.data;switch(a.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1])}}r.type==="fillPath"?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,n,i,a){const s=this.gen.line(t,r,n,i,a);return this.draw(s),s}rectangle(t,r,n,i,a){const s=this.gen.rectangle(t,r,n,i,a);return this.draw(s),s}ellipse(t,r,n,i,a){const s=this.gen.ellipse(t,r,n,i,a);return this.draw(s),s}circle(t,r,n,i){const a=this.gen.circle(t,r,n,i);return this.draw(a),a}linearPath(t,r){const n=this.gen.linearPath(t,r);return this.draw(n),n}polygon(t,r){const n=this.gen.polygon(t,r);return this.draw(n),n}arc(t,r,n,i,a,s,o=!1,u){const d=this.gen.arc(t,r,n,i,a,s,o,u);return this.draw(d),d}curve(t,r){const n=this.gen.curve(t,r);return this.draw(n),n}path(t,r){const n=this.gen.path(t,r);return this.draw(n),n}}const Kf="http://www.w3.org/2000/svg";class Cte{constructor(t,r){this.svg=t,this.gen=new jp(r)}draw(t){const r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(Kf,"g"),s=t.options.fixedDecimalPlaceDigits;for(const o of r){let u=null;switch(o.type){case"path":u=i.createElementNS(Kf,"path"),u.setAttribute("d",this.opsToPath(o,s)),u.setAttribute("stroke",n.stroke),u.setAttribute("stroke-width",n.strokeWidth+""),u.setAttribute("fill","none"),n.strokeLineDash&&u.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&u.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":u=i.createElementNS(Kf,"path"),u.setAttribute("d",this.opsToPath(o,s)),u.setAttribute("stroke","none"),u.setAttribute("stroke-width","0"),u.setAttribute("fill",n.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||u.setAttribute("fill-rule","evenodd");break;case"fillSketch":u=this.fillSketch(i,o,n)}u&&a.appendChild(u)}return a}fillSketch(t,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=t.createElementNS(Kf,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,n,i,a){const s=this.gen.line(t,r,n,i,a);return this.draw(s)}rectangle(t,r,n,i,a){const s=this.gen.rectangle(t,r,n,i,a);return this.draw(s)}ellipse(t,r,n,i,a){const s=this.gen.ellipse(t,r,n,i,a);return this.draw(s)}circle(t,r,n,i){const a=this.gen.circle(t,r,n,i);return this.draw(a)}linearPath(t,r){const n=this.gen.linearPath(t,r);return this.draw(n)}polygon(t,r){const n=this.gen.polygon(t,r);return this.draw(n)}arc(t,r,n,i,a,s,o=!1,u){const d=this.gen.arc(t,r,n,i,a,s,o,u);return this.draw(d)}curve(t,r){const n=this.gen.curve(t,r);return this.draw(n)}path(t,r){const n=this.gen.path(t,r);return this.draw(n)}}var Oe={canvas:(e,t)=>new Ste(e,t),svg:(e,t)=>new Cte(e,t),generator:e=>new jp(e),newSeed:()=>jp.newSeed()},Qe=O(async(e,t,r)=>{var p,m;let n;const i=t.useHtmlLabels||Br((p=Dt())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=e.insert("g").attr("class",n).attr("id",t.domId||t.id),s=a.insert("g").attr("class","label").attr("style",dn(t.labelStyle));let o;t.label===void 0?o="":o=typeof t.label=="string"?t.label:t.label[0];const u=await Es(s,xi(Ll(o),Dt()),{useHtmlLabels:i,width:t.width||((m=Dt().flowchart)==null?void 0:m.wrappingWidth),cssClasses:"markdown-node-label",style:t.labelStyle,addSvgBackground:!!t.icon||!!t.img});let d=u.getBBox();const f=((t==null?void 0:t.padding)??0)/2;if(i){const x=u.children[0],b=et(u),v=x.getElementsByTagName("img");if(v){const k=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...v].map(w=>new Promise(C=>{function T(){if(w.style.display="flex",w.style.flexDirection="column",k){const j=Dt().fontSize?Dt().fontSize:window.getComputedStyle(document.body).fontSize,L=5,[E=v3.fontSize]=xg(j),M=E*L+"px";w.style.minWidth=M,w.style.maxWidth=M}else w.style.width="100%";C(w)}O(T,"setupImage"),setTimeout(()=>{w.complete&&T()}),w.addEventListener("error",T),w.addEventListener("load",T)})))}d=x.getBoundingClientRect(),b.attr("width",d.width),b.attr("height",d.height)}return i?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:s}},"labelHelper"),qy=O(async(e,t,r)=>{var u,d,f,p,m,x;const n=r.useHtmlLabels||Br((d=(u=Dt())==null?void 0:u.flowchart)==null?void 0:d.htmlLabels),i=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Es(i,xi(Ll(t),Dt()),{useHtmlLabels:n,width:r.width||((p=(f=Dt())==null?void 0:f.flowchart)==null?void 0:p.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(Br((x=(m=Dt())==null?void 0:m.flowchart)==null?void 0:x.htmlLabels)){const b=a.children[0],v=et(a);s=b.getBoundingClientRect(),v.attr("width",s.width),v.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:e,bbox:s,halfPadding:o,label:i}},"insertLabel"),Ie=O((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),Ye=O((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function mt(e){const t=e.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}O(mt,"createPathFromPoints");function Cs(e,t,r,n,i,a){const s=[],u=r-e,d=n-t,f=u/a,p=2*Math.PI/f,m=t+d/2;for(let x=0;x<=50;x++){const b=x/50,v=e+b*u,k=m+i*Math.sin(p*(v-e));s.push({x:v,y:k})}return s}O(Cs,"generateFullSineWavePoints");function Fd(e,t,r,n,i,a){const s=[],o=i*Math.PI/180,f=(a*Math.PI/180-o)/(n-1);for(let p=0;p<n;p++){const m=o+p*f,x=e+r*Math.cos(m),b=t+r*Math.sin(m);s.push({x:-x,y:-b})}return s}O(Fd,"generateCirclePoints");var _te=O((e,t)=>{var r=e.x,n=e.y,i=t.x-r,a=t.y-n,s=e.width/2,o=e.height/2,u,d;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),u=a===0?0:o*i/a,d=o):(i<0&&(s=-s),u=s,d=i===0?0:s*a/i),{x:r+u,y:n+d}},"intersectRect"),Ac=_te;function hL(e,t){t&&e.attr("style",t)}O(hL,"applyStyle");async function fL(e){const t=et(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=t.append("xhtml:div"),n=Dt();let i=e.label;e.label&&ec(e.label)&&(i=await Dv(e.label.replace(Tc.lineBreakRegex,`
335
- `),n));const s='<span class="'+(e.isNode?"nodeLabel":"edgeLabel")+'" '+(e.labelStyle?'style="'+e.labelStyle+'"':"")+">"+i+"</span>";return r.html(xi(s,n)),hL(r,e.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}O(fL,"addHtmlLabel");var Tte=O(async(e,t,r,n)=>{let i=e||"";if(typeof i=="object"&&(i=i[0]),Br(Dt().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),we.info("vertexText"+i);const a={isNode:n,label:Ll(i).replace(/fa[blrs]?:fa-[\w-]+/g,o=>`<i class='${o.replace(":"," ")}'></i>`),labelStyle:t&&t.replace("fill:","color:")};return await fL(a)}else{const a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("style",t.replace("color:","fill:"));let s=[];typeof i=="string"?s=i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?s=i:s=[];for(const o of s){const u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),r?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=o.trim(),a.appendChild(u)}return a}},"createLabel"),cl=Tte,Ns=O((e,t,r,n,i)=>["M",e+i,t,"H",e+r-i,"A",i,i,0,0,1,e+r,t+i,"V",t+n-i,"A",i,i,0,0,1,e+r-i,t+n,"H",e+i,"A",i,i,0,0,1,e,t+n-i,"V",t+i,"A",i,i,0,0,1,e+i,t,"Z"].join(" "),"createRoundedRectPathD"),pL=O(async(e,t)=>{we.info("Creating subgraph rect for ",t.id,t);const r=Dt(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:u,borderStyles:d,backgroundStyles:f}=ze(t),p=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),m=Br(r.flowchart.htmlLabels),x=p.insert("g").attr("class","cluster-label "),b=await Es(x,t.label,{style:t.labelStyle,useHtmlLabels:m,isNode:!0});let v=b.getBBox();if(Br(r.flowchart.htmlLabels)){const M=b.children[0],I=et(b);v=M.getBoundingClientRect(),I.attr("width",v.width),I.attr("height",v.height)}const k=t.width<=v.width+t.padding?v.width+t.padding:t.width;t.width<=v.width+t.padding?t.diff=(k-t.width)/2-t.padding:t.diff=-t.padding;const w=t.height,C=t.x-k/2,T=t.y-w/2;we.trace("Data ",t,JSON.stringify(t));let j;if(t.look==="handDrawn"){const M=Oe.svg(p),I=$e(t,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),P=M.path(Ns(C,T,k,w,0),I);j=p.insert(()=>(we.debug("Rough node insert CXC",P),P),":first-child"),j.select("path:nth-child(2)").attr("style",d.join(";")),j.select("path").attr("style",f.join(";").replace("fill","stroke"))}else j=p.insert("rect",":first-child"),j.attr("style",u).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",T).attr("width",k).attr("height",w);const{subGraphTitleTopMargin:L}=n2(r);if(x.attr("transform",`translate(${t.x-v.width/2}, ${t.y-t.height/2+L})`),o){const M=x.select("span");M&&M.attr("style",o)}const E=j.node().getBBox();return t.offsetX=0,t.width=E.width,t.height=E.height,t.offsetY=v.height-t.padding/2,t.intersect=function(M){return Ac(t,M)},{cluster:p,labelBBox:v}},"rect"),Ete=O((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.id),n=r.insert("rect",":first-child"),i=0*t.padding,a=i/2;n.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const s=n.node().getBBox();return t.width=s.width,t.height=s.height,t.intersect=function(o){return Ac(t,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),Nte=O(async(e,t)=>{const r=Dt(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:u}=n,d=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-id",t.id).attr("data-look",t.look),f=d.insert("g",":first-child"),p=d.insert("g").attr("class","cluster-label");let m=d.append("rect");const x=p.node().appendChild(await cl(t.label,t.labelStyle,void 0,!0));let b=x.getBBox();if(Br(r.flowchart.htmlLabels)){const P=x.children[0],z=et(x);b=P.getBoundingClientRect(),z.attr("width",b.width),z.attr("height",b.height)}const v=0*t.padding,k=v/2,w=(t.width<=b.width+t.padding?b.width+t.padding:t.width)+v;t.width<=b.width+t.padding?t.diff=(w-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height+v,T=t.height+v-b.height-6,j=t.x-w/2,L=t.y-C/2;t.width=w;const E=t.y-t.height/2-k+b.height+2;let M;if(t.look==="handDrawn"){const P=t.cssClasses.includes("statediagram-cluster-alt"),z=Oe.svg(d),$=t.rx||t.ry?z.path(Ns(j,L,w,C,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:u,seed:i}):z.rectangle(j,L,w,C,{seed:i});M=d.insert(()=>$,":first-child");const W=z.rectangle(j,E,w,T,{fill:P?a:s,fillStyle:P?"hachure":"solid",stroke:u,seed:i});M=d.insert(()=>$,":first-child"),m=d.insert(()=>W)}else M=f.insert("rect",":first-child"),M.attr("class","outer").attr("x",j).attr("y",L).attr("width",w).attr("height",C).attr("data-look",t.look),m.attr("class","inner").attr("x",j).attr("y",E).attr("width",w).attr("height",T);p.attr("transform",`translate(${t.x-b.width/2}, ${L+1-(Br(r.flowchart.htmlLabels)?0:3)})`);const I=M.node().getBBox();return t.height=I.height,t.offsetX=0,t.offsetY=b.height-t.padding/2,t.labelBBox=b,t.intersect=function(P){return Ac(t,P)},{cluster:d,labelBBox:b}},"roundedWithTitle"),jte=O(async(e,t)=>{we.info("Creating subgraph rect for ",t.id,t);const r=Dt(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:u,borderStyles:d,backgroundStyles:f}=ze(t),p=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),m=Br(r.flowchart.htmlLabels),x=p.insert("g").attr("class","cluster-label "),b=await Es(x,t.label,{style:t.labelStyle,useHtmlLabels:m,isNode:!0,width:t.width});let v=b.getBBox();if(Br(r.flowchart.htmlLabels)){const M=b.children[0],I=et(b);v=M.getBoundingClientRect(),I.attr("width",v.width),I.attr("height",v.height)}const k=t.width<=v.width+t.padding?v.width+t.padding:t.width;t.width<=v.width+t.padding?t.diff=(k-t.width)/2-t.padding:t.diff=-t.padding;const w=t.height,C=t.x-k/2,T=t.y-w/2;we.trace("Data ",t,JSON.stringify(t));let j;if(t.look==="handDrawn"){const M=Oe.svg(p),I=$e(t,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),P=M.path(Ns(C,T,k,w,t.rx),I);j=p.insert(()=>(we.debug("Rough node insert CXC",P),P),":first-child"),j.select("path:nth-child(2)").attr("style",d.join(";")),j.select("path").attr("style",f.join(";").replace("fill","stroke"))}else j=p.insert("rect",":first-child"),j.attr("style",u).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",T).attr("width",k).attr("height",w);const{subGraphTitleTopMargin:L}=n2(r);if(x.attr("transform",`translate(${t.x-v.width/2}, ${t.y-t.height/2+L})`),o){const M=x.select("span");M&&M.attr("style",o)}const E=j.node().getBBox();return t.offsetX=0,t.width=E.width,t.height=E.height,t.offsetY=v.height-t.padding/2,t.intersect=function(M){return Ac(t,M)},{cluster:p,labelBBox:v}},"kanbanSection"),Ate=O((e,t)=>{const r=Dt(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-look",t.look),o=s.insert("g",":first-child"),u=0*t.padding,d=t.width+u;t.diff=-t.padding;const f=t.height+u,p=t.x-d/2,m=t.y-f/2;t.width=d;let x;if(t.look==="handDrawn"){const k=Oe.svg(s).rectangle(p,m,d,f,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});x=s.insert(()=>k,":first-child")}else x=o.insert("rect",":first-child"),x.attr("class","divider").attr("x",p).attr("y",m).attr("width",d).attr("height",f).attr("data-look",t.look);const b=x.node().getBBox();return t.height=b.height,t.offsetX=0,t.offsetY=0,t.intersect=function(v){return Ac(t,v)},{cluster:s,labelBBox:{}}},"divider"),Mte=pL,Lte={rect:pL,squareRect:Mte,roundedWithTitle:Nte,noteGroup:Ete,divider:Ate,kanbanSection:jte},gL=new Map,Dte=O(async(e,t)=>{const r=t.shape||"rect",n=await Lte[r](e,t);return gL.set(t.id,n),n},"insertCluster"),Zfe=O(()=>{gL=new Map},"clear");function mL(e,t){return e.intersect(t)}O(mL,"intersectNode");var Rte=mL;function xL(e,t,r,n){var i=e.x,a=e.y,s=i-n.x,o=a-n.y,u=Math.sqrt(t*t*o*o+r*r*s*s),d=Math.abs(t*r*s/u);n.x<i&&(d=-d);var f=Math.abs(t*r*o/u);return n.y<a&&(f=-f),{x:i+d,y:a+f}}O(xL,"intersectEllipse");var yL=xL;function bL(e,t,r){return yL(e,t,t,r)}O(bL,"intersectCircle");var Ote=bL;function vL(e,t,r,n){{const i=t.y-e.y,a=e.x-t.x,s=t.x*e.y-e.x*t.y,o=i*r.x+a*r.y+s,u=i*n.x+a*n.y+s,d=1e-6;if(o!==0&&u!==0&&w1(o,u))return;const f=n.y-r.y,p=r.x-n.x,m=n.x*r.y-r.x*n.y,x=f*e.x+p*e.y+m,b=f*t.x+p*t.y+m;if(Math.abs(x)<d&&Math.abs(b)<d&&w1(x,b))return;const v=i*p-f*a;if(v===0)return;const k=Math.abs(v/2);let w=a*m-p*s;const C=w<0?(w-k)/v:(w+k)/v;w=f*s-i*m;const T=w<0?(w-k)/v:(w+k)/v;return{x:C,y:T}}}O(vL,"intersectLine");function w1(e,t){return e*t>0}O(w1,"sameSign");var Bte=vL;function wL(e,t,r){let n=e.x,i=e.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(f){s=Math.min(s,f.x),o=Math.min(o,f.y)}):(s=Math.min(s,t.x),o=Math.min(o,t.y));let u=n-e.width/2-s,d=i-e.height/2-o;for(let f=0;f<t.length;f++){let p=t[f],m=t[f<t.length-1?f+1:0],x=Bte(e,r,{x:u+p.x,y:d+p.y},{x:u+m.x,y:d+m.y});x&&a.push(x)}return a.length?(a.length>1&&a.sort(function(f,p){let m=f.x-r.x,x=f.y-r.y,b=Math.sqrt(m*m+x*x),v=p.x-r.x,k=p.y-r.y,w=Math.sqrt(v*v+k*k);return b<w?-1:b===w?0:1}),a[0]):e}O(wL,"intersectPolygon");var $te=wL,Ae={node:Rte,circle:Ote,ellipse:yL,polygon:$te,rect:Ac};function kL(e,t){const{labelStyles:r}=ze(t);t.labelStyle=r;const n=Ye(t);let i=n;n||(i="anchor");const a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),s=1,{cssStyles:o}=t,u=Oe.svg(a),d=$e(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(d.roughness=0);const f=u.circle(0,0,s*2,d),p=a.insert(()=>f,":first-child");return p.attr("class","anchor").attr("style",dn(o)),Ie(t,p),t.intersect=function(m){return we.info("Circle intersect",t,s,m),Ae.circle(t,s,m)},a}O(kL,"anchor");function k1(e,t,r,n,i,a,s){const u=(e+r)/2,d=(t+n)/2,f=Math.atan2(n-t,r-e),p=(r-e)/2,m=(n-t)/2,x=p/i,b=m/a,v=Math.sqrt(x**2+b**2);if(v>1)throw new Error("The given radii are too small to create an arc between the points.");const k=Math.sqrt(1-v**2),w=u+k*a*Math.sin(f)*(s?-1:1),C=d-k*i*Math.cos(f)*(s?-1:1),T=Math.atan2((t-C)/a,(e-w)/i);let L=Math.atan2((n-C)/a,(r-w)/i)-T;s&&L<0&&(L+=2*Math.PI),!s&&L>0&&(L-=2*Math.PI);const E=[];for(let M=0;M<20;M++){const I=M/19,P=T+I*L,z=w+i*Math.cos(P),$=C+a*Math.sin(P);E.push({x:z,y:$})}return E}O(k1,"generateArcPoints");async function SL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=a.width+t.padding+20,o=a.height+t.padding,u=o/2,d=u/(2.5+o/50),{cssStyles:f}=t,p=[{x:s/2,y:-o/2},{x:-s/2,y:-o/2},...k1(-s/2,-o/2,-s/2,o/2,d,u,!1),{x:s/2,y:o/2},...k1(s/2,o/2,s/2,-o/2,d,u,!0)],m=Oe.svg(i),x=$e(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=mt(p),v=m.path(b,x),k=i.insert(()=>v,":first-child");return k.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(${d/2}, 0)`),Ie(t,k),t.intersect=function(w){return Ae.polygon(t,p,w)},i}O(SL,"bowTieRect");function js(e,t,r,n){return e.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}O(js,"insertPolygonShape");async function CL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=a.height+t.padding,o=12,u=a.width+t.padding+o,d=0,f=u,p=-s,m=0,x=[{x:d+o,y:p},{x:f,y:p},{x:f,y:m},{x:d,y:m},{x:d,y:p+o},{x:d+o,y:p}];let b;const{cssStyles:v}=t;if(t.look==="handDrawn"){const k=Oe.svg(i),w=$e(t,{}),C=mt(x),T=k.path(C,w);b=i.insert(()=>T,":first-child").attr("transform",`translate(${-u/2}, ${s/2})`),v&&b.attr("style",v)}else b=js(i,u,s,x);return n&&b.attr("style",n),Ie(t,b),t.intersect=function(k){return Ae.polygon(t,x,k)},i}O(CL,"card");function _L(e,t){const{nodeStyles:r}=ze(t);t.label="";const n=e.insert("g").attr("class",Ye(t)).attr("id",t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=Oe.svg(n),u=$e(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const d=mt(s),f=o.path(d,u),p=n.insert(()=>f,":first-child");return i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),r&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(m){return Ae.polygon(t,s,m)},n}O(_L,"choice");async function T2(e,t,r){const{labelStyles:n,nodeStyles:i}=ze(t);t.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await Qe(e,t,Ye(t)),u=(r==null?void 0:r.padding)??o,d=s.width/2+u;let f;const{cssStyles:p}=t;if(t.look==="handDrawn"){const m=Oe.svg(a),x=$e(t,{}),b=m.circle(0,0,d*2,x);f=a.insert(()=>b,":first-child"),f.attr("class","basic label-container").attr("style",dn(p))}else f=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",d).attr("cx",0).attr("cy",0);return Ie(t,f),t.calcIntersect=function(m,x){const b=m.width/2;return Ae.circle(m,b,x)},t.intersect=function(m){return we.info("Circle intersect",t,d,m),Ae.circle(t,d,m)},a}O(T2,"circle");function TL(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=e*2,i={x:n/2*t,y:n/2*r},a={x:-(n/2)*t,y:n/2*r},s={x:-(n/2)*t,y:-(n/2)*r},o={x:n/2*t,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y}
336
- M ${i.x},${i.y} L ${s.x},${s.y}`}O(TL,"createLine");function EL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r,t.label="";const i=e.insert("g").attr("class",Ye(t)).attr("id",t.domId??t.id),a=Math.max(30,(t==null?void 0:t.width)??0),{cssStyles:s}=t,o=Oe.svg(i),u=$e(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const d=o.circle(0,0,a*2,u),f=TL(a),p=o.path(f,u),m=i.insert(()=>d,":first-child");return m.insert(()=>p),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),Ie(t,m),t.intersect=function(x){return we.info("crossedCircle intersect",t,{radius:a,point:x}),Ae.circle(t,a,x)},i}O(EL,"crossedCircle");function Ta(e,t,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,f=(a*Math.PI/180-o)/(n-1);for(let p=0;p<n;p++){const m=o+p*f,x=e+r*Math.cos(m),b=t+r*Math.sin(m);s.push({x:-x,y:-b})}return s}O(Ta,"generateCirclePoints");async function NL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=a.width+(t.padding??0),u=a.height+(t.padding??0),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Ta(o/2,-u/2,d,30,-90,0),{x:-o/2-d,y:d},...Ta(o/2+d*2,-d,d,20,-180,-270),...Ta(o/2+d*2,d,d,20,-90,-180),{x:-o/2-d,y:-u/2},...Ta(o/2,u/2,d,20,0,90)],m=[{x:o/2,y:-u/2-d},{x:-o/2,y:-u/2-d},...Ta(o/2,-u/2,d,20,-90,0),{x:-o/2-d,y:-d},...Ta(o/2+o*.1,-d,d,20,-180,-270),...Ta(o/2+o*.1,d,d,20,-90,-180),{x:-o/2-d,y:u/2},...Ta(o/2,u/2,d,20,0,90),{x:-o/2,y:u/2+d},{x:o/2,y:u/2+d}],x=Oe.svg(i),b=$e(t,{fill:"none"});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=mt(p).replace("Z",""),w=x.path(k,b),C=mt(m),T=x.path(C,{...b}),j=i.insert("g",":first-child");return j.insert(()=>T,":first-child").attr("stroke-opacity",0),j.insert(()=>w,":first-child"),j.attr("class","text"),f&&t.look!=="handDrawn"&&j.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&j.selectAll("path").attr("style",n),j.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-o/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),Ie(t,j),t.intersect=function(L){return Ae.polygon(t,m,L)},i}O(NL,"curlyBraceLeft");function Ea(e,t,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,f=(a*Math.PI/180-o)/(n-1);for(let p=0;p<n;p++){const m=o+p*f,x=e+r*Math.cos(m),b=t+r*Math.sin(m);s.push({x,y:b})}return s}O(Ea,"generateCirclePoints");async function jL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=a.width+(t.padding??0),u=a.height+(t.padding??0),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Ea(o/2,-u/2,d,20,-90,0),{x:o/2+d,y:-d},...Ea(o/2+d*2,-d,d,20,-180,-270),...Ea(o/2+d*2,d,d,20,-90,-180),{x:o/2+d,y:u/2},...Ea(o/2,u/2,d,20,0,90)],m=[{x:-o/2,y:-u/2-d},{x:o/2,y:-u/2-d},...Ea(o/2,-u/2,d,20,-90,0),{x:o/2+d,y:-d},...Ea(o/2+d*2,-d,d,20,-180,-270),...Ea(o/2+d*2,d,d,20,-90,-180),{x:o/2+d,y:u/2},...Ea(o/2,u/2,d,20,0,90),{x:o/2,y:u/2+d},{x:-o/2,y:u/2+d}],x=Oe.svg(i),b=$e(t,{fill:"none"});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=mt(p).replace("Z",""),w=x.path(k,b),C=mt(m),T=x.path(C,{...b}),j=i.insert("g",":first-child");return j.insert(()=>T,":first-child").attr("stroke-opacity",0),j.insert(()=>w,":first-child"),j.attr("class","text"),f&&t.look!=="handDrawn"&&j.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&j.selectAll("path").attr("style",n),j.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-o/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),Ie(t,j),t.intersect=function(L){return Ae.polygon(t,m,L)},i}O(jL,"curlyBraceRight");function Xr(e,t,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,f=(a*Math.PI/180-o)/(n-1);for(let p=0;p<n;p++){const m=o+p*f,x=e+r*Math.cos(m),b=t+r*Math.sin(m);s.push({x:-x,y:-b})}return s}O(Xr,"generateCirclePoints");async function AL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=a.width+(t.padding??0),u=a.height+(t.padding??0),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Xr(o/2,-u/2,d,30,-90,0),{x:-o/2-d,y:d},...Xr(o/2+d*2,-d,d,20,-180,-270),...Xr(o/2+d*2,d,d,20,-90,-180),{x:-o/2-d,y:-u/2},...Xr(o/2,u/2,d,20,0,90)],m=[...Xr(-o/2+d+d/2,-u/2,d,20,-90,-180),{x:o/2-d/2,y:d},...Xr(-o/2-d/2,-d,d,20,0,90),...Xr(-o/2-d/2,d,d,20,-90,0),{x:o/2-d/2,y:-d},...Xr(-o/2+d+d/2,u/2,d,30,-180,-270)],x=[{x:o/2,y:-u/2-d},{x:-o/2,y:-u/2-d},...Xr(o/2,-u/2,d,20,-90,0),{x:-o/2-d,y:-d},...Xr(o/2+d*2,-d,d,20,-180,-270),...Xr(o/2+d*2,d,d,20,-90,-180),{x:-o/2-d,y:u/2},...Xr(o/2,u/2,d,20,0,90),{x:-o/2,y:u/2+d},{x:o/2-d-d/2,y:u/2+d},...Xr(-o/2+d+d/2,-u/2,d,20,-90,-180),{x:o/2-d/2,y:d},...Xr(-o/2-d/2,-d,d,20,0,90),...Xr(-o/2-d/2,d,d,20,-90,0),{x:o/2-d/2,y:-d},...Xr(-o/2+d+d/2,u/2,d,30,-180,-270)],b=Oe.svg(i),v=$e(t,{fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=mt(p).replace("Z",""),C=b.path(w,v),j=mt(m).replace("Z",""),L=b.path(j,v),E=mt(x),M=b.path(E,{...v}),I=i.insert("g",":first-child");return I.insert(()=>M,":first-child").attr("stroke-opacity",0),I.insert(()=>C,":first-child"),I.insert(()=>L,":first-child"),I.attr("class","text"),f&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",n),I.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-o/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),Ie(t,I),t.intersect=function(P){return Ae.polygon(t,x,P)},i}O(AL,"curlyBraces");async function ML(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=80,o=20,u=Math.max(s,(a.width+(t.padding??0)*2)*1.25,(t==null?void 0:t.width)??0),d=Math.max(o,a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),f=d/2,{cssStyles:p}=t,m=Oe.svg(i),x=$e(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=u,v=d,k=b-f,w=v/4,C=[{x:k,y:0},{x:w,y:0},{x:0,y:v/2},{x:w,y:v},{x:k,y:v},...Fd(-k,-v/2,f,50,270,90)],T=mt(C),j=m.path(T,x),L=i.insert(()=>j,":first-child");return L.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&L.selectChildren("path").attr("style",p),n&&t.look!=="handDrawn"&&L.selectChildren("path").attr("style",n),L.attr("transform",`translate(${-u/2}, ${-d/2})`),Ie(t,L),t.intersect=function(E){return Ae.polygon(t,C,E)},i}O(ML,"curvedTrapezoid");var zte=O((e,t,r,n,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),Ite=O((e,t,r,n,i,a)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),Fte=O((e,t,r,n,i,a)=>[`M${e-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function LL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=Math.max(a.width+t.padding,t.width??0),u=o/2,d=u/(2.5+o/50),f=Math.max(a.height+d+t.padding,t.height??0);let p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const x=Oe.svg(i),b=Ite(0,0,o,f,u,d),v=Fte(0,d,o,f,u,d),k=x.path(b,$e(t,{})),w=x.path(v,$e(t,{fill:"none"}));p=i.insert(()=>w,":first-child"),p=i.insert(()=>k,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else{const x=zte(0,0,o,f,u,d);p=i.insert("path",":first-child").attr("d",x).attr("class","basic label-container").attr("style",dn(m)).attr("style",n)}return p.attr("label-offset-y",d),p.attr("transform",`translate(${-o/2}, ${-(f/2+d)})`),Ie(t,p),s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+(t.padding??0)/1.5-(a.y-(a.top??0))})`),t.intersect=function(x){const b=Ae.rect(t,x),v=b.x-(t.x??0);if(u!=0&&(Math.abs(v)<(t.width??0)/2||Math.abs(v)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-d)){let k=d*d*(1-v*v/(u*u));k>0&&(k=Math.sqrt(k)),k=d-k,x.y-(t.y??0)>0&&(k=-k),b.y+=k}return b},i}O(LL,"cylinder");async function DL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=a.width+t.padding,u=a.height+t.padding,d=u*.2,f=-o/2,p=-u/2-d/2,{cssStyles:m}=t,x=Oe.svg(i),b=$e(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],k=x.polygon(v.map(C=>[C.x,C.y]),b),w=i.insert(()=>k,":first-child");return w.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",n),s.attr("transform",`translate(${f+(t.padding??0)/2-(a.x-(a.left??0))}, ${p+d+(t.padding??0)/2-(a.y-(a.top??0))})`),Ie(t,w),t.intersect=function(C){return Ae.rect(t,C)},i}O(DL,"dividedRectangle");async function RL(e,t){var m,x;const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s}=await Qe(e,t,Ye(t)),u=a.width/2+s+5,d=a.width/2+s;let f;const{cssStyles:p}=t;if(t.look==="handDrawn"){const b=Oe.svg(i),v=$e(t,{roughness:.2,strokeWidth:2.5}),k=$e(t,{roughness:.2,strokeWidth:1.5}),w=b.circle(0,0,u*2,v),C=b.circle(0,0,d*2,k);f=i.insert("g",":first-child"),f.attr("class",dn(t.cssClasses)).attr("style",dn(p)),(m=f.node())==null||m.appendChild(w),(x=f.node())==null||x.appendChild(C)}else{f=i.insert("g",":first-child");const b=f.insert("circle",":first-child"),v=f.insert("circle");f.attr("class","basic label-container").attr("style",n),b.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),v.attr("class","inner-circle").attr("style",n).attr("r",d).attr("cx",0).attr("cy",0)}return Ie(t,f),t.intersect=function(b){return we.info("DoubleCircle intersect",t,u,b),Ae.circle(t,u,b)},i}O(RL,"doublecircle");function OL(e,t,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=ze(t);t.label="",t.labelStyle=n;const a=e.insert("g").attr("class",Ye(t)).attr("id",t.domId??t.id),s=7,{cssStyles:o}=t,u=Oe.svg(a),{nodeBorder:d}=r,f=$e(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(f.roughness=0);const p=u.circle(0,0,s*2,f),m=a.insert(()=>p,":first-child");return m.selectAll("path").attr("style",`fill: ${d} !important;`),o&&o.length>0&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",o),i&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",i),Ie(t,m),t.intersect=function(x){return we.info("filledCircle intersect",t,{radius:s,point:x}),Ae.circle(t,s,x)},a}O(OL,"filledCircle");async function BL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=a.width+(t.padding??0),u=o+a.height,d=o+a.height,f=[{x:0,y:-u},{x:d,y:-u},{x:d/2,y:0}],{cssStyles:p}=t,m=Oe.svg(i),x=$e(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=mt(f),v=m.path(b,x),k=i.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${u/2})`);return p&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",p),n&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",n),t.width=o,t.height=u,Ie(t,k),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-u/2+(t.padding??0)/2+(a.y-(a.top??0))})`),t.intersect=function(w){return we.info("Triangle intersect",t,f,w),Ae.polygon(t,f,w)},i}O(BL,"flippedTriangle");function $L(e,t,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=ze(t);t.label="";const s=e.insert("g").attr("class",Ye(t)).attr("id",t.domId??t.id),{cssStyles:o}=t;let u=Math.max(70,(t==null?void 0:t.width)??0),d=Math.max(10,(t==null?void 0:t.height)??0);r==="LR"&&(u=Math.max(10,(t==null?void 0:t.width)??0),d=Math.max(70,(t==null?void 0:t.height)??0));const f=-1*u/2,p=-1*d/2,m=Oe.svg(s),x=$e(t,{stroke:i.lineColor,fill:i.lineColor});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=m.rectangle(f,p,u,d,x),v=s.insert(()=>b,":first-child");o&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",o),a&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",a),Ie(t,v);const k=(n==null?void 0:n.padding)??0;return t.width&&t.height&&(t.width+=k/2||0,t.height+=k/2||0),t.intersect=function(w){return Ae.rect(t,w)},s}O($L,"forkJoin");async function zL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const i=80,a=50,{shapeSvg:s,bbox:o}=await Qe(e,t,Ye(t)),u=Math.max(i,o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),d=Math.max(a,o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),f=d/2,{cssStyles:p}=t,m=Oe.svg(s),x=$e(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:-u/2,y:-d/2},{x:u/2-f,y:-d/2},...Fd(-u/2+f,0,f,50,90,270),{x:u/2-f,y:d/2},{x:-u/2,y:d/2}],v=mt(b),k=m.path(v,x),w=s.insert(()=>k,":first-child");return w.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",p),n&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",n),Ie(t,w),t.intersect=function(C){return we.info("Pill intersect",t,{radius:f,point:C}),Ae.polygon(t,b,C)},s}O(zL,"halfRoundedRectangle");async function IL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=a.height+(t.padding??0),o=a.width+(t.padding??0)*2.5,{cssStyles:u}=t,d=Oe.svg(i),f=$e(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let p=o/2;const m=p/6;p=p+m;const x=s/2,b=x/2,v=p-b,k=[{x:-v,y:-x},{x:0,y:-x},{x:v,y:-x},{x:p,y:0},{x:v,y:x},{x:0,y:x},{x:-v,y:x},{x:-p,y:0}],w=mt(k),C=d.path(w,f),T=i.insert(()=>C,":first-child");return T.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",u),n&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),t.width=o,t.height=s,Ie(t,T),t.intersect=function(j){return Ae.polygon(t,k,j)},i}O(IL,"hexagon");async function FL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.label="",t.labelStyle=r;const{shapeSvg:i}=await Qe(e,t,Ye(t)),a=Math.max(30,(t==null?void 0:t.width)??0),s=Math.max(30,(t==null?void 0:t.height)??0),{cssStyles:o}=t,u=Oe.svg(i),d=$e(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],p=mt(f),m=u.path(p,d),x=i.insert(()=>m,":first-child");return x.attr("class","basic label-container"),o&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",o),n&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),x.attr("transform",`translate(${-a/2}, ${-s/2})`),Ie(t,x),t.intersect=function(b){return we.info("Pill intersect",t,{points:f}),Ae.polygon(t,f,b)},i}O(FL,"hourglass");async function PL(e,t,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ze(t);t.labelStyle=i;const a=t.assetHeight??48,s=t.assetWidth??48,o=Math.max(a,s),u=n==null?void 0:n.wrappingWidth;t.width=Math.max(o,u??0);const{shapeSvg:d,bbox:f,label:p}=await Qe(e,t,"icon-shape default"),m=t.pos==="t",x=o,b=o,{nodeBorder:v}=r,{stylesMap:k}=Ec(t),w=-b/2,C=-x/2,T=t.label?8:0,j=Oe.svg(d),L=$e(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const E=j.rectangle(w,C,b,x,L),M=Math.max(b,f.width),I=x+f.height+T,P=j.rectangle(-M/2,-I/2,M,I,{...L,fill:"transparent",stroke:"none"}),z=d.insert(()=>E,":first-child"),$=d.insert(()=>P);if(t.icon){const W=d.append("g");W.html(`<g>${await ph(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const Y=W.node().getBBox(),B=Y.width,U=Y.height,R=Y.x,H=Y.y;W.attr("transform",`translate(${-B/2-R},${m?f.height/2+T/2-U/2-H:-f.height/2-T/2-U/2-H})`),W.attr("style",`color: ${k.get("stroke")??v};`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-I/2:I/2-f.height})`),z.attr("transform",`translate(0,${m?f.height/2+T/2:-f.height/2-T/2})`),Ie(t,$),t.intersect=function(W){if(we.info("iconSquare intersect",t,W),!t.label)return Ae.rect(t,W);const Y=t.x??0,B=t.y??0,U=t.height??0;let R=[];return m?R=[{x:Y-f.width/2,y:B-U/2},{x:Y+f.width/2,y:B-U/2},{x:Y+f.width/2,y:B-U/2+f.height+T},{x:Y+b/2,y:B-U/2+f.height+T},{x:Y+b/2,y:B+U/2},{x:Y-b/2,y:B+U/2},{x:Y-b/2,y:B-U/2+f.height+T},{x:Y-f.width/2,y:B-U/2+f.height+T}]:R=[{x:Y-b/2,y:B-U/2},{x:Y+b/2,y:B-U/2},{x:Y+b/2,y:B-U/2+x},{x:Y+f.width/2,y:B-U/2+x},{x:Y+f.width/2/2,y:B+U/2},{x:Y-f.width/2,y:B+U/2},{x:Y-f.width/2,y:B-U/2+x},{x:Y-b/2,y:B-U/2+x}],Ae.polygon(t,R,W)},d}O(PL,"icon");async function HL(e,t,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ze(t);t.labelStyle=i;const a=t.assetHeight??48,s=t.assetWidth??48,o=Math.max(a,s),u=n==null?void 0:n.wrappingWidth;t.width=Math.max(o,u??0);const{shapeSvg:d,bbox:f,label:p}=await Qe(e,t,"icon-shape default"),m=20,x=t.label?8:0,b=t.pos==="t",{nodeBorder:v,mainBkg:k}=r,{stylesMap:w}=Ec(t),C=Oe.svg(d),T=$e(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const j=w.get("fill");T.stroke=j??k;const L=d.append("g");t.icon&&L.html(`<g>${await ph(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const E=L.node().getBBox(),M=E.width,I=E.height,P=E.x,z=E.y,$=Math.max(M,I)*Math.SQRT2+m*2,W=C.circle(0,0,$,T),Y=Math.max($,f.width),B=$+f.height+x,U=C.rectangle(-Y/2,-B/2,Y,B,{...T,fill:"transparent",stroke:"none"}),R=d.insert(()=>W,":first-child"),H=d.insert(()=>U);return L.attr("transform",`translate(${-M/2-P},${b?f.height/2+x/2-I/2-z:-f.height/2-x/2-I/2-z})`),L.attr("style",`color: ${w.get("stroke")??v};`),p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${b?-B/2:B/2-f.height})`),R.attr("transform",`translate(0,${b?f.height/2+x/2:-f.height/2-x/2})`),Ie(t,H),t.intersect=function(V){return we.info("iconSquare intersect",t,V),Ae.rect(t,V)},d}O(HL,"iconCircle");async function qL(e,t,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ze(t);t.labelStyle=i;const a=t.assetHeight??48,s=t.assetWidth??48,o=Math.max(a,s),u=n==null?void 0:n.wrappingWidth;t.width=Math.max(o,u??0);const{shapeSvg:d,bbox:f,halfPadding:p,label:m}=await Qe(e,t,"icon-shape default"),x=t.pos==="t",b=o+p*2,v=o+p*2,{nodeBorder:k,mainBkg:w}=r,{stylesMap:C}=Ec(t),T=-v/2,j=-b/2,L=t.label?8:0,E=Oe.svg(d),M=$e(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");const I=C.get("fill");M.stroke=I??w;const P=E.path(Ns(T,j,v,b,5),M),z=Math.max(v,f.width),$=b+f.height+L,W=E.rectangle(-z/2,-$/2,z,$,{...M,fill:"transparent",stroke:"none"}),Y=d.insert(()=>P,":first-child").attr("class","icon-shape2"),B=d.insert(()=>W);if(t.icon){const U=d.append("g");U.html(`<g>${await ph(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const R=U.node().getBBox(),H=R.width,V=R.height,Q=R.x,A=R.y;U.attr("transform",`translate(${-H/2-Q},${x?f.height/2+L/2-V/2-A:-f.height/2-L/2-V/2-A})`),U.attr("style",`color: ${C.get("stroke")??k};`)}return m.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${x?-$/2:$/2-f.height})`),Y.attr("transform",`translate(0,${x?f.height/2+L/2:-f.height/2-L/2})`),Ie(t,B),t.intersect=function(U){if(we.info("iconSquare intersect",t,U),!t.label)return Ae.rect(t,U);const R=t.x??0,H=t.y??0,V=t.height??0;let Q=[];return x?Q=[{x:R-f.width/2,y:H-V/2},{x:R+f.width/2,y:H-V/2},{x:R+f.width/2,y:H-V/2+f.height+L},{x:R+v/2,y:H-V/2+f.height+L},{x:R+v/2,y:H+V/2},{x:R-v/2,y:H+V/2},{x:R-v/2,y:H-V/2+f.height+L},{x:R-f.width/2,y:H-V/2+f.height+L}]:Q=[{x:R-v/2,y:H-V/2},{x:R+v/2,y:H-V/2},{x:R+v/2,y:H-V/2+b},{x:R+f.width/2,y:H-V/2+b},{x:R+f.width/2/2,y:H+V/2},{x:R-f.width/2,y:H+V/2},{x:R-f.width/2,y:H-V/2+b},{x:R-v/2,y:H-V/2+b}],Ae.polygon(t,Q,U)},d}O(qL,"iconRounded");async function UL(e,t,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ze(t);t.labelStyle=i;const a=t.assetHeight??48,s=t.assetWidth??48,o=Math.max(a,s),u=n==null?void 0:n.wrappingWidth;t.width=Math.max(o,u??0);const{shapeSvg:d,bbox:f,halfPadding:p,label:m}=await Qe(e,t,"icon-shape default"),x=t.pos==="t",b=o+p*2,v=o+p*2,{nodeBorder:k,mainBkg:w}=r,{stylesMap:C}=Ec(t),T=-v/2,j=-b/2,L=t.label?8:0,E=Oe.svg(d),M=$e(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");const I=C.get("fill");M.stroke=I??w;const P=E.path(Ns(T,j,v,b,.1),M),z=Math.max(v,f.width),$=b+f.height+L,W=E.rectangle(-z/2,-$/2,z,$,{...M,fill:"transparent",stroke:"none"}),Y=d.insert(()=>P,":first-child"),B=d.insert(()=>W);if(t.icon){const U=d.append("g");U.html(`<g>${await ph(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const R=U.node().getBBox(),H=R.width,V=R.height,Q=R.x,A=R.y;U.attr("transform",`translate(${-H/2-Q},${x?f.height/2+L/2-V/2-A:-f.height/2-L/2-V/2-A})`),U.attr("style",`color: ${C.get("stroke")??k};`)}return m.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${x?-$/2:$/2-f.height})`),Y.attr("transform",`translate(0,${x?f.height/2+L/2:-f.height/2-L/2})`),Ie(t,B),t.intersect=function(U){if(we.info("iconSquare intersect",t,U),!t.label)return Ae.rect(t,U);const R=t.x??0,H=t.y??0,V=t.height??0;let Q=[];return x?Q=[{x:R-f.width/2,y:H-V/2},{x:R+f.width/2,y:H-V/2},{x:R+f.width/2,y:H-V/2+f.height+L},{x:R+v/2,y:H-V/2+f.height+L},{x:R+v/2,y:H+V/2},{x:R-v/2,y:H+V/2},{x:R-v/2,y:H-V/2+f.height+L},{x:R-f.width/2,y:H-V/2+f.height+L}]:Q=[{x:R-v/2,y:H-V/2},{x:R+v/2,y:H-V/2},{x:R+v/2,y:H-V/2+b},{x:R+f.width/2,y:H-V/2+b},{x:R+f.width/2/2,y:H+V/2},{x:R-f.width/2,y:H+V/2},{x:R-f.width/2,y:H-V/2+b},{x:R-v/2,y:H-V/2+b}],Ae.polygon(t,Q,U)},d}O(UL,"iconSquare");async function VL(e,t,{config:{flowchart:r}}){const n=new Image;n.src=(t==null?void 0:t.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));t.imageAspectRatio=i/a;const{labelStyles:s}=ze(t);t.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;t.defaultWidth=r==null?void 0:r.wrappingWidth;const u=Math.max(t.label?o??0:0,(t==null?void 0:t.assetWidth)??i),d=t.constraint==="on"&&t!=null&&t.assetHeight?t.assetHeight*t.imageAspectRatio:u,f=t.constraint==="on"?d/t.imageAspectRatio:(t==null?void 0:t.assetHeight)??a;t.width=Math.max(d,o??0);const{shapeSvg:p,bbox:m,label:x}=await Qe(e,t,"image-shape default"),b=t.pos==="t",v=-d/2,k=-f/2,w=t.label?8:0,C=Oe.svg(p),T=$e(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const j=C.rectangle(v,k,d,f,T),L=Math.max(d,m.width),E=f+m.height+w,M=C.rectangle(-L/2,-E/2,L,E,{...T,fill:"none",stroke:"none"}),I=p.insert(()=>j,":first-child"),P=p.insert(()=>M);if(t.img){const z=p.append("image");z.attr("href",t.img),z.attr("width",d),z.attr("height",f),z.attr("preserveAspectRatio","none"),z.attr("transform",`translate(${-d/2},${b?E/2-f:-E/2})`)}return x.attr("transform",`translate(${-m.width/2-(m.x-(m.left??0))},${b?-f/2-m.height/2-w/2:f/2-m.height/2+w/2})`),I.attr("transform",`translate(0,${b?m.height/2+w/2:-m.height/2-w/2})`),Ie(t,P),t.intersect=function(z){if(we.info("iconSquare intersect",t,z),!t.label)return Ae.rect(t,z);const $=t.x??0,W=t.y??0,Y=t.height??0;let B=[];return b?B=[{x:$-m.width/2,y:W-Y/2},{x:$+m.width/2,y:W-Y/2},{x:$+m.width/2,y:W-Y/2+m.height+w},{x:$+d/2,y:W-Y/2+m.height+w},{x:$+d/2,y:W+Y/2},{x:$-d/2,y:W+Y/2},{x:$-d/2,y:W-Y/2+m.height+w},{x:$-m.width/2,y:W-Y/2+m.height+w}]:B=[{x:$-d/2,y:W-Y/2},{x:$+d/2,y:W-Y/2},{x:$+d/2,y:W-Y/2+f},{x:$+m.width/2,y:W-Y/2+f},{x:$+m.width/2/2,y:W+Y/2},{x:$-m.width/2,y:W+Y/2},{x:$-m.width/2,y:W-Y/2+f},{x:$-d/2,y:W-Y/2+f}],Ae.polygon(t,B,z)},p}O(VL,"imageSquare");async function WL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),o=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),u=[{x:0,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:-3*o/6,y:-o}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Oe.svg(i),m=$e(t,{}),x=mt(u),b=p.path(x,m);d=i.insert(()=>b,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),f&&d.attr("style",f)}else d=js(i,s,o,u);return n&&d.attr("style",n),t.width=s,t.height=o,Ie(t,d),t.intersect=function(p){return Ae.polygon(t,u,p)},i}O(WL,"inv_trapezoid");async function Sg(e,t,r){const{labelStyles:n,nodeStyles:i}=ze(t);t.labelStyle=n;const{shapeSvg:a,bbox:s}=await Qe(e,t,Ye(t)),o=Math.max(s.width+r.labelPaddingX*2,(t==null?void 0:t.width)||0),u=Math.max(s.height+r.labelPaddingY*2,(t==null?void 0:t.height)||0),d=-o/2,f=-u/2;let p,{rx:m,ry:x}=t;const{cssStyles:b}=t;if(r!=null&&r.rx&&r.ry&&(m=r.rx,x=r.ry),t.look==="handDrawn"){const v=Oe.svg(a),k=$e(t,{}),w=m||x?v.path(Ns(d,f,o,u,m||0),k):v.rectangle(d,f,o,u,k);p=a.insert(()=>w,":first-child"),p.attr("class","basic label-container").attr("style",dn(b))}else p=a.insert("rect",":first-child"),p.attr("class","basic label-container").attr("style",i).attr("rx",dn(m)).attr("ry",dn(x)).attr("x",d).attr("y",f).attr("width",o).attr("height",u);return Ie(t,p),t.calcIntersect=function(v,k){return Ae.rect(v,k)},t.intersect=function(v){return Ae.rect(t,v)},a}O(Sg,"drawRect");async function YL(e,t){const{shapeSvg:r,bbox:n,label:i}=await Qe(e,t,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Ie(t,a),t.intersect=function(u){return Ae.rect(t,u)},r}O(YL,"labelRect");async function GL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=Math.max(a.width+(t.padding??0),(t==null?void 0:t.width)??0),o=Math.max(a.height+(t.padding??0),(t==null?void 0:t.height)??0),u=[{x:0,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:-(3*o)/6,y:-o}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Oe.svg(i),m=$e(t,{}),x=mt(u),b=p.path(x,m);d=i.insert(()=>b,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),f&&d.attr("style",f)}else d=js(i,s,o,u);return n&&d.attr("style",n),t.width=s,t.height=o,Ie(t,d),t.intersect=function(p){return Ae.polygon(t,u,p)},i}O(GL,"lean_left");async function XL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=Math.max(a.width+(t.padding??0),(t==null?void 0:t.width)??0),o=Math.max(a.height+(t.padding??0),(t==null?void 0:t.height)??0),u=[{x:-3*o/6,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:0,y:-o}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Oe.svg(i),m=$e(t,{}),x=mt(u),b=p.path(x,m);d=i.insert(()=>b,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),f&&d.attr("style",f)}else d=js(i,s,o,u);return n&&d.attr("style",n),t.width=s,t.height=o,Ie(t,d),t.intersect=function(p){return Ae.polygon(t,u,p)},i}O(XL,"lean_right");function QL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.label="",t.labelStyle=r;const i=e.insert("g").attr("class",Ye(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,s=Math.max(35,(t==null?void 0:t.width)??0),o=Math.max(35,(t==null?void 0:t.height)??0),u=7,d=[{x:s,y:0},{x:0,y:o+u/2},{x:s-2*u,y:o+u/2},{x:0,y:2*o},{x:s,y:o-u/2},{x:2*u,y:o-u/2}],f=Oe.svg(i),p=$e(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=mt(d),x=f.path(m,p),b=i.insert(()=>x,":first-child");return a&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",a),n&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(-${s/2},${-o})`),Ie(t,b),t.intersect=function(v){return we.info("lightningBolt intersect",t,v),Ae.polygon(t,d,v)},i}O(QL,"lightningBolt");var Pte=O((e,t,r,n,i,a,s)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${e},${t+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Hte=O((e,t,r,n,i,a,s)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${e},${t+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),qte=O((e,t,r,n,i,a)=>[`M${e-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function ZL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=Math.max(a.width+(t.padding??0),t.width??0),u=o/2,d=u/(2.5+o/50),f=Math.max(a.height+d+(t.padding??0),t.height??0),p=f*.1;let m;const{cssStyles:x}=t;if(t.look==="handDrawn"){const b=Oe.svg(i),v=Hte(0,0,o,f,u,d,p),k=qte(0,d,o,f,u,d),w=$e(t,{}),C=b.path(v,w),T=b.path(k,w);i.insert(()=>T,":first-child").attr("class","line"),m=i.insert(()=>C,":first-child"),m.attr("class","basic label-container"),x&&m.attr("style",x)}else{const b=Pte(0,0,o,f,u,d,p);m=i.insert("path",":first-child").attr("d",b).attr("class","basic label-container").attr("style",dn(x)).attr("style",n)}return m.attr("label-offset-y",d),m.attr("transform",`translate(${-o/2}, ${-(f/2+d)})`),Ie(t,m),s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+d-(a.y-(a.top??0))})`),t.intersect=function(b){const v=Ae.rect(t,b),k=v.x-(t.x??0);if(u!=0&&(Math.abs(k)<(t.width??0)/2||Math.abs(k)==(t.width??0)/2&&Math.abs(v.y-(t.y??0))>(t.height??0)/2-d)){let w=d*d*(1-k*k/(u*u));w>0&&(w=Math.sqrt(w)),w=d-w,b.y-(t.y??0)>0&&(w=-w),v.y+=w}return v},i}O(ZL,"linedCylinder");async function KL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=u/4,f=u+d,{cssStyles:p}=t,m=Oe.svg(i),x=$e(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:-o/2-o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:f/2},...Cs(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,d,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2},{x:-o/2,y:-f/2},{x:-o/2,y:f/2*1.1},{x:-o/2,y:-f/2}],v=m.polygon(b.map(w=>[w.x,w.y]),x),k=i.insert(()=>v,":first-child");return k.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(0,${-d/2})`),s.attr("transform",`translate(${-o/2+(t.padding??0)+o/2*.1/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)-d/2-(a.y-(a.top??0))})`),Ie(t,k),t.intersect=function(w){return Ae.polygon(t,b,w)},i}O(KL,"linedWaveEdgedRect");async function JL(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=5,f=-o/2,p=-u/2,{cssStyles:m}=t,x=Oe.svg(i),b=$e(t,{}),v=[{x:f-d,y:p+d},{x:f-d,y:p+u+d},{x:f+o-d,y:p+u+d},{x:f+o-d,y:p+u},{x:f+o,y:p+u},{x:f+o,y:p+u-d},{x:f+o+d,y:p+u-d},{x:f+o+d,y:p-d},{x:f+d,y:p-d},{x:f+d,y:p},{x:f,y:p},{x:f,y:p+d}],k=[{x:f,y:p+d},{x:f+o-d,y:p+d},{x:f+o-d,y:p+u},{x:f+o,y:p+u},{x:f+o,y:p},{x:f,y:p}];t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=mt(v),C=x.path(w,b),T=mt(k),j=x.path(T,{...b,fill:"none"}),L=i.insert(()=>j,":first-child");return L.insert(()=>C,":first-child"),L.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",n),s.attr("transform",`translate(${-(a.width/2)-d-(a.x-(a.left??0))}, ${-(a.height/2)+d-(a.y-(a.top??0))})`),Ie(t,L),t.intersect=function(E){return Ae.polygon(t,v,E)},i}O(JL,"multiRect");async function eD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=u/4,f=u+d,p=-o/2,m=-f/2,x=5,{cssStyles:b}=t,v=Cs(p-x,m+f+x,p+o-x,m+f+x,d,.8),k=v==null?void 0:v[v.length-1],w=[{x:p-x,y:m+x},{x:p-x,y:m+f+x},...v,{x:p+o-x,y:k.y-x},{x:p+o,y:k.y-x},{x:p+o,y:k.y-2*x},{x:p+o+x,y:k.y-2*x},{x:p+o+x,y:m-x},{x:p+x,y:m-x},{x:p+x,y:m},{x:p,y:m},{x:p,y:m+x}],C=[{x:p,y:m+x},{x:p+o-x,y:m+x},{x:p+o-x,y:k.y-x},{x:p+o,y:k.y-x},{x:p+o,y:m},{x:p,y:m}],T=Oe.svg(i),j=$e(t,{});t.look!=="handDrawn"&&(j.roughness=0,j.fillStyle="solid");const L=mt(w),E=T.path(L,j),M=mt(C),I=T.path(M,j),P=i.insert(()=>E,":first-child");return P.insert(()=>I),P.attr("class","basic label-container"),b&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",b),n&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",n),P.attr("transform",`translate(0,${-d/2})`),s.attr("transform",`translate(${-(a.width/2)-x-(a.x-(a.left??0))}, ${-(a.height/2)+x-d/2-(a.y-(a.top??0))})`),Ie(t,P),t.intersect=function(z){return Ae.polygon(t,w,z)},i}O(eD,"multiWaveEdgedRectangle");async function tD(e,t,{config:{themeVariables:r}}){var C;const{labelStyles:n,nodeStyles:i}=ze(t);t.labelStyle=n,t.useHtmlLabels||((C=cn().flowchart)==null?void 0:C.htmlLabels)!==!1||(t.centerLabel=!0);const{shapeSvg:s,bbox:o,label:u}=await Qe(e,t,Ye(t)),d=Math.max(o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),f=Math.max(o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),p=-d/2,m=-f/2,{cssStyles:x}=t,b=Oe.svg(s),v=$e(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const k=b.rectangle(p,m,d,f,v),w=s.insert(()=>k,":first-child");return w.attr("class","basic label-container"),x&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),u.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Ie(t,w),t.intersect=function(T){return Ae.rect(t,T)},s}O(tD,"note");var Ute=O((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function rD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=a.width+t.padding,o=a.height+t.padding,u=s+o,d=.5,f=[{x:u/2,y:0},{x:u,y:-u/2},{x:u/2,y:-u},{x:0,y:-u/2}];let p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const x=Oe.svg(i),b=$e(t,{}),v=Ute(0,0,u),k=x.path(v,b);p=i.insert(()=>k,":first-child").attr("transform",`translate(${-u/2+d}, ${u/2})`),m&&p.attr("style",m)}else p=js(i,u,u,f),p.attr("transform",`translate(${-u/2+d}, ${u/2})`);return n&&p.attr("style",n),Ie(t,p),t.calcIntersect=function(x,b){const v=x.width,k=[{x:v/2,y:0},{x:v,y:-v/2},{x:v/2,y:-v},{x:0,y:-v/2}],w=Ae.polygon(x,k,b);return{x:w.x-.5,y:w.y-.5}},t.intersect=function(x){return this.calcIntersect(t,x)},i}O(rD,"question");async function nD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=Math.max(a.width+(t.padding??0),(t==null?void 0:t.width)??0),u=Math.max(a.height+(t.padding??0),(t==null?void 0:t.height)??0),d=-o/2,f=-u/2,p=f/2,m=[{x:d+p,y:f},{x:d,y:0},{x:d+p,y:-f},{x:-d,y:-f},{x:-d,y:f}],{cssStyles:x}=t,b=Oe.svg(i),v=$e(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const k=mt(m),w=b.path(k,v),C=i.insert(()=>w,":first-child");return C.attr("class","basic label-container"),x&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",x),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-p/2},0)`),s.attr("transform",`translate(${-p/2-a.width/2-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),Ie(t,C),t.intersect=function(T){return Ae.polygon(t,m,T)},i}O(nD,"rect_left_inv_arrow");async function iD(e,t){var I,P;const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;let i;t.cssClasses?i="node "+t.cssClasses:i="node default";const a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),u=t.description,d=t.label,f=o.node().appendChild(await cl(d,t.labelStyle,!0,!0));let p={width:0,height:0};if(Br((P=(I=Dt())==null?void 0:I.flowchart)==null?void 0:P.htmlLabels)){const z=f.children[0],$=et(f);p=z.getBoundingClientRect(),$.attr("width",p.width),$.attr("height",p.height)}we.info("Text 2",u);const m=u||[],x=f.getBBox(),b=o.node().appendChild(await cl(m.join?m.join("<br/>"):m,t.labelStyle,!0,!0)),v=b.children[0],k=et(b);p=v.getBoundingClientRect(),k.attr("width",p.width),k.attr("height",p.height);const w=(t.padding||0)/2;et(b).attr("transform","translate( "+(p.width>x.width?0:(x.width-p.width)/2)+", "+(x.height+w+5)+")"),et(f).attr("transform","translate( "+(p.width<x.width?0:-(x.width-p.width)/2)+", 0)"),p=o.node().getBBox(),o.attr("transform","translate("+-p.width/2+", "+(-p.height/2-w+3)+")");const C=p.width+(t.padding||0),T=p.height+(t.padding||0),j=-p.width/2-w,L=-p.height/2-w;let E,M;if(t.look==="handDrawn"){const z=Oe.svg(a),$=$e(t,{}),W=z.path(Ns(j,L,C,T,t.rx||0),$),Y=z.line(-p.width/2-w,-p.height/2-w+x.height+w,p.width/2+w,-p.height/2-w+x.height+w,$);M=a.insert(()=>(we.debug("Rough node insert CXC",W),Y),":first-child"),E=a.insert(()=>(we.debug("Rough node insert CXC",W),W),":first-child")}else E=s.insert("rect",":first-child"),M=s.insert("line"),E.attr("class","outer title-state").attr("style",n).attr("x",-p.width/2-w).attr("y",-p.height/2-w).attr("width",p.width+(t.padding||0)).attr("height",p.height+(t.padding||0)),M.attr("class","divider").attr("x1",-p.width/2-w).attr("x2",p.width/2+w).attr("y1",-p.height/2-w+x.height+w).attr("y2",-p.height/2-w+x.height+w);return Ie(t,E),t.intersect=function(z){return Ae.rect(t,z)},a}O(iD,"rectWithTitle");function ed(e,t,r,n,i,a,s){const u=(e+r)/2,d=(t+n)/2,f=Math.atan2(n-t,r-e),p=(r-e)/2,m=(n-t)/2,x=p/i,b=m/a,v=Math.sqrt(x**2+b**2);if(v>1)throw new Error("The given radii are too small to create an arc between the points.");const k=Math.sqrt(1-v**2),w=u+k*a*Math.sin(f)*(s?-1:1),C=d-k*i*Math.cos(f)*(s?-1:1),T=Math.atan2((t-C)/a,(e-w)/i);let L=Math.atan2((n-C)/a,(r-w)/i)-T;s&&L<0&&(L+=2*Math.PI),!s&&L>0&&(L-=2*Math.PI);const E=[];for(let M=0;M<20;M++){const I=M/19,P=T+I*L,z=w+i*Math.cos(P),$=C+a*Math.sin(P);E.push({x:z,y:$})}return E}O(ed,"generateArcPoints");async function aD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=(t==null?void 0:t.padding)??0,o=(t==null?void 0:t.padding)??0,u=(t!=null&&t.width?t==null?void 0:t.width:a.width)+s*2,d=(t!=null&&t.height?t==null?void 0:t.height:a.height)+o*2,f=t.radius||5,p=t.taper||5,{cssStyles:m}=t,x=Oe.svg(i),b=$e(t,{});t.stroke&&(b.stroke=t.stroke),t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const v=[{x:-u/2+p,y:-d/2},{x:u/2-p,y:-d/2},...ed(u/2-p,-d/2,u/2,-d/2+p,f,f,!0),{x:u/2,y:-d/2+p},{x:u/2,y:d/2-p},...ed(u/2,d/2-p,u/2-p,d/2,f,f,!0),{x:u/2-p,y:d/2},{x:-u/2+p,y:d/2},...ed(-u/2+p,d/2,-u/2,d/2-p,f,f,!0),{x:-u/2,y:d/2-p},{x:-u/2,y:-d/2+p},...ed(-u/2,-d/2+p,-u/2+p,-d/2,f,f,!0)],k=mt(v),w=x.path(k,b),C=i.insert(()=>w,":first-child");return C.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",n),Ie(t,C),t.intersect=function(T){return Ae.polygon(t,v,T)},i}O(aD,"roundedRect");async function sD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=(t==null?void 0:t.padding)??0,u=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),d=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),f=-a.width/2-o,p=-a.height/2-o,{cssStyles:m}=t,x=Oe.svg(i),b=$e(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const v=[{x:f,y:p},{x:f+u+8,y:p},{x:f+u+8,y:p+d},{x:f-8,y:p+d},{x:f-8,y:p},{x:f,y:p},{x:f,y:p+d}],k=x.polygon(v.map(C=>[C.x,C.y]),b),w=i.insert(()=>k,":first-child");return w.attr("class","basic label-container").attr("style",dn(m)),n&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",n),s.attr("transform",`translate(${-u/2+4+(t.padding??0)-(a.x-(a.left??0))},${-d/2+(t.padding??0)-(a.y-(a.top??0))})`),Ie(t,w),t.intersect=function(C){return Ae.rect(t,C)},i}O(sD,"shadedProcess");async function lD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=-o/2,f=-u/2,{cssStyles:p}=t,m=Oe.svg(i),x=$e(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:d,y:f},{x:d,y:f+u},{x:d+o,y:f+u},{x:d+o,y:f-u/2}],v=mt(b),k=m.path(v,x),w=i.insert(()=>k,":first-child");return w.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",p),n&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",n),w.attr("transform",`translate(0, ${u/4})`),s.attr("transform",`translate(${-o/2+(t.padding??0)-(a.x-(a.left??0))}, ${-u/4+(t.padding??0)-(a.y-(a.top??0))})`),Ie(t,w),t.intersect=function(C){return Ae.polygon(t,b,C)},i}O(lD,"slopedRect");async function oD(e,t){const r={rx:0,ry:0,labelPaddingX:t.labelPaddingX??((t==null?void 0:t.padding)||0)*2,labelPaddingY:((t==null?void 0:t.padding)||0)*1};return Sg(e,t,r)}O(oD,"squareRect");async function cD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=a.height+t.padding,o=a.width+s/4+t.padding,u=s/2,{cssStyles:d}=t,f=Oe.svg(i),p=$e(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=[{x:-o/2+u,y:-s/2},{x:o/2-u,y:-s/2},...Fd(-o/2+u,0,u,50,90,270),{x:o/2-u,y:s/2},...Fd(o/2-u,0,u,50,270,450)],x=mt(m),b=f.path(x,p),v=i.insert(()=>b,":first-child");return v.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",d),n&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",n),Ie(t,v),t.intersect=function(k){return Ae.polygon(t,m,k)},i}O(cD,"stadium");async function uD(e,t){return Sg(e,t,{rx:5,ry:5})}O(uD,"state");function dD(e,t,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=ze(t);t.labelStyle=n;const{cssStyles:a}=t,{lineColor:s,stateBorder:o,nodeBorder:u}=r,d=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),f=Oe.svg(d),p=$e(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=f.circle(0,0,14,{...p,stroke:s,strokeWidth:2}),x=o??u,b=f.circle(0,0,5,{...p,fill:x,stroke:x,strokeWidth:2,fillStyle:"solid"}),v=d.insert(()=>m,":first-child");return v.insert(()=>b),a&&v.selectAll("path").attr("style",a),i&&v.selectAll("path").attr("style",i),Ie(t,v),t.intersect=function(k){return Ae.circle(t,7,k)},d}O(dD,"stateEnd");function hD(e,t,{config:{themeVariables:r}}){const{lineColor:n}=r,i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const o=Oe.svg(i).circle(0,0,14,aZ(n));a=i.insert(()=>o),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else a=i.insert("circle",":first-child"),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return Ie(t,a),t.intersect=function(s){return Ae.circle(t,7,s)},i}O(hD,"stateStart");async function fD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=((t==null?void 0:t.padding)||0)/2,o=a.width+t.padding,u=a.height+t.padding,d=-a.width/2-s,f=-a.height/2-s,p=[{x:0,y:0},{x:o,y:0},{x:o,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:o+8,y:0},{x:o+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(t.look==="handDrawn"){const m=Oe.svg(i),x=$e(t,{}),b=m.rectangle(d-8,f,o+16,u,x),v=m.line(d,f,d,f+u,x),k=m.line(d+o,f,d+o,f+u,x);i.insert(()=>v,":first-child"),i.insert(()=>k,":first-child");const w=i.insert(()=>b,":first-child"),{cssStyles:C}=t;w.attr("class","basic label-container").attr("style",dn(C)),Ie(t,w)}else{const m=js(i,o,u,p);n&&m.attr("style",n),Ie(t,m)}return t.intersect=function(m){return Ae.polygon(t,p,m)},i}O(fD,"subroutine");async function pD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),o=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),u=-s/2,d=-o/2,f=.2*o,p=.2*o,{cssStyles:m}=t,x=Oe.svg(i),b=$e(t,{}),v=[{x:u-f/2,y:d},{x:u+s+f/2,y:d},{x:u+s+f/2,y:d+o},{x:u-f/2,y:d+o}],k=[{x:u+s-f/2,y:d+o},{x:u+s+f/2,y:d+o},{x:u+s+f/2,y:d+o-p}];t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=mt(v),C=x.path(w,b),T=mt(k),j=x.path(T,{...b,fillStyle:"solid"}),L=i.insert(()=>j,":first-child");return L.insert(()=>C,":first-child"),L.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",n),Ie(t,L),t.intersect=function(E){return Ae.polygon(t,v,E)},i}O(pD,"taggedRect");async function gD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=u/4,f=.2*o,p=.2*u,m=u+d,{cssStyles:x}=t,b=Oe.svg(i),v=$e(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const k=[{x:-o/2-o/2*.1,y:m/2},...Cs(-o/2-o/2*.1,m/2,o/2+o/2*.1,m/2,d,.8),{x:o/2+o/2*.1,y:-m/2},{x:-o/2-o/2*.1,y:-m/2}],w=-o/2+o/2*.1,C=-m/2-p*.4,T=[{x:w+o-f,y:(C+u)*1.4},{x:w+o,y:C+u-p},{x:w+o,y:(C+u)*.9},...Cs(w+o,(C+u)*1.3,w+o-f,(C+u)*1.5,-u*.03,.5)],j=mt(k),L=b.path(j,v),E=mt(T),M=b.path(E,{...v,fillStyle:"solid"}),I=i.insert(()=>M,":first-child");return I.insert(()=>L,":first-child"),I.attr("class","basic label-container"),x&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",x),n&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",n),I.attr("transform",`translate(0,${-d/2})`),s.attr("transform",`translate(${-o/2+(t.padding??0)-(a.x-(a.left??0))},${-u/2+(t.padding??0)-d/2-(a.y-(a.top??0))})`),Ie(t,I),t.intersect=function(P){return Ae.polygon(t,k,P)},i}O(gD,"taggedWaveEdgedRectangle");async function mD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=Math.max(a.width+t.padding,(t==null?void 0:t.width)||0),o=Math.max(a.height+t.padding,(t==null?void 0:t.height)||0),u=-s/2,d=-o/2,f=i.insert("rect",":first-child");return f.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",u).attr("y",d).attr("width",s).attr("height",o),Ie(t,f),t.intersect=function(p){return Ae.rect(t,p)},i}O(mD,"text");var Vte=O((e,t,r,n,i,a)=>`M${e},${t}
337
- a${i},${a} 0,0,1 0,${-n}
338
- l${r},0
339
- a${i},${a} 0,0,1 0,${n}
340
- M${r},${-n}
341
- a${i},${a} 0,0,0 0,${n}
342
- l${-r},0`,"createCylinderPathD"),Wte=O((e,t,r,n,i,a)=>[`M${e},${t}`,`M${e+r},${t}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),Yte=O((e,t,r,n,i,a)=>[`M${e+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD");async function xD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s,halfPadding:o}=await Qe(e,t,Ye(t)),u=t.look==="neo"?o*2:o,d=a.height+u,f=d/2,p=f/(2.5+d/50),m=a.width+p+u,{cssStyles:x}=t;let b;if(t.look==="handDrawn"){const v=Oe.svg(i),k=Wte(0,0,m,d,p,f),w=Yte(0,0,m,d,p,f),C=v.path(k,$e(t,{})),T=v.path(w,$e(t,{fill:"none"}));b=i.insert(()=>T,":first-child"),b=i.insert(()=>C,":first-child"),b.attr("class","basic label-container"),x&&b.attr("style",x)}else{const v=Vte(0,0,m,d,p,f);b=i.insert("path",":first-child").attr("d",v).attr("class","basic label-container").attr("style",dn(x)).attr("style",n),b.attr("class","basic label-container"),x&&b.selectAll("path").attr("style",x),n&&b.selectAll("path").attr("style",n)}return b.attr("label-offset-x",p),b.attr("transform",`translate(${-m/2}, ${d/2} )`),s.attr("transform",`translate(${-(a.width/2)-p-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),Ie(t,b),t.intersect=function(v){const k=Ae.rect(t,v),w=k.y-(t.y??0);if(f!=0&&(Math.abs(w)<(t.height??0)/2||Math.abs(w)==(t.height??0)/2&&Math.abs(k.x-(t.x??0))>(t.width??0)/2-p)){let C=p*p*(1-w*w/(f*f));C!=0&&(C=Math.sqrt(Math.abs(C))),C=p-C,v.x-(t.x??0)>0&&(C=-C),k.x+=C}return k},i}O(xD,"tiltedCylinder");async function yD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=a.width+t.padding,o=a.height+t.padding,u=[{x:-3*o/6,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:0,y:-o}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Oe.svg(i),m=$e(t,{}),x=mt(u),b=p.path(x,m);d=i.insert(()=>b,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),f&&d.attr("style",f)}else d=js(i,s,o,u);return n&&d.attr("style",n),t.width=s,t.height=o,Ie(t,d),t.intersect=function(p){return Ae.polygon(t,u,p)},i}O(yD,"trapezoid");async function bD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=60,o=20,u=Math.max(s,a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),d=Math.max(o,a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),{cssStyles:f}=t,p=Oe.svg(i),m=$e(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const x=[{x:-u/2*.8,y:-d/2},{x:u/2*.8,y:-d/2},{x:u/2,y:-d/2*.6},{x:u/2,y:d/2},{x:-u/2,y:d/2},{x:-u/2,y:-d/2*.6}],b=mt(x),v=p.path(b,m),k=i.insert(()=>v,":first-child");return k.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",f),n&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",n),Ie(t,k),t.intersect=function(w){return Ae.polygon(t,x,w)},i}O(bD,"trapezoidalPentagon");async function vD(e,t){var C;const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=Br((C=Dt().flowchart)==null?void 0:C.htmlLabels),u=a.width+(t.padding??0),d=u+a.height,f=u+a.height,p=[{x:0,y:0},{x:f,y:0},{x:f/2,y:-d}],{cssStyles:m}=t,x=Oe.svg(i),b=$e(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const v=mt(p),k=x.path(v,b),w=i.insert(()=>k,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`);return m&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",n),t.width=u,t.height=d,Ie(t,w),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${d/2-(a.height+(t.padding??0)/(o?2:1)-(a.y-(a.top??0)))})`),t.intersect=function(T){return we.info("Triangle intersect",t,p,T),Ae.polygon(t,p,T)},i}O(vD,"triangle");async function wD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=u/8,f=u+d,{cssStyles:p}=t,x=70-o,b=x>0?x/2:0,v=Oe.svg(i),k=$e(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const w=[{x:-o/2-b,y:f/2},...Cs(-o/2-b,f/2,o/2+b,f/2,d,.8),{x:o/2+b,y:-f/2},{x:-o/2-b,y:-f/2}],C=mt(w),T=v.path(C,k),j=i.insert(()=>T,":first-child");return j.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&j.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&j.selectAll("path").attr("style",n),j.attr("transform",`translate(0,${-d/2})`),s.attr("transform",`translate(${-o/2+(t.padding??0)-(a.x-(a.left??0))},${-u/2+(t.padding??0)-d-(a.y-(a.top??0))})`),Ie(t,j),t.intersect=function(L){return Ae.polygon(t,w,L)},i}O(wD,"waveEdgedRectangle");async function kD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a}=await Qe(e,t,Ye(t)),s=100,o=50,u=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),d=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),f=u/d;let p=u,m=d;p>m*f?m=p/f:p=m*f,p=Math.max(p,s),m=Math.max(m,o);const x=Math.min(m*.2,m/4),b=m+x*2,{cssStyles:v}=t,k=Oe.svg(i),w=$e(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const C=[{x:-p/2,y:b/2},...Cs(-p/2,b/2,p/2,b/2,x,1),{x:p/2,y:-b/2},...Cs(p/2,-b/2,-p/2,-b/2,x,-1)],T=mt(C),j=k.path(T,w),L=i.insert(()=>j,":first-child");return L.attr("class","basic label-container"),v&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",v),n&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",n),Ie(t,L),t.intersect=function(E){return Ae.polygon(t,C,E)},i}O(kD,"waveRectangle");async function SD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Qe(e,t,Ye(t)),o=Math.max(a.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(a.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=5,f=-o/2,p=-u/2,{cssStyles:m}=t,x=Oe.svg(i),b=$e(t,{}),v=[{x:f-d,y:p-d},{x:f-d,y:p+u},{x:f+o,y:p+u},{x:f+o,y:p-d}],k=`M${f-d},${p-d} L${f+o},${p-d} L${f+o},${p+u} L${f-d},${p+u} L${f-d},${p-d}
343
- M${f-d},${p} L${f+o},${p}
344
- M${f},${p-d} L${f},${p+u}`;t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=x.path(k,b),C=i.insert(()=>w,":first-child");return C.attr("transform",`translate(${d/2}, ${d/2})`),C.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),s.attr("transform",`translate(${-(a.width/2)+d/2-(a.x-(a.left??0))}, ${-(a.height/2)+d/2-(a.y-(a.top??0))})`),Ie(t,C),t.intersect=function(T){return Ae.polygon(t,v,T)},i}O(SD,"windowPane");async function E2(e,t){var G,q,Z,re;const r=t;if(r.alias&&(t.label=r.alias),t.look==="handDrawn"){const{themeVariables:J}=cn(),{background:ie}=J,ne={...t,id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ie}`]};await E2(e,ne)}const n=cn();t.useHtmlLabels=n.htmlLabels;let i=((G=n.er)==null?void 0:G.diagramPadding)??10,a=((q=n.er)==null?void 0:q.entityPadding)??6;const{cssStyles:s}=t,{labelStyles:o,nodeStyles:u}=ze(t);if(r.attributes.length===0&&t.label){const J={rx:0,ry:0,labelPaddingX:i,labelPaddingY:i*1.5};Da(t.label,n)+J.labelPaddingX*2<n.er.minEntityWidth&&(t.width=n.er.minEntityWidth);const ie=await Sg(e,t,J);if(!Br(n.htmlLabels)){const ne=ie.select("text"),oe=(Z=ne.node())==null?void 0:Z.getBBox();ne.attr("transform",`translate(${-oe.width/2}, 0)`)}return ie}n.htmlLabels||(i*=1.25,a*=1.25);let d=Ye(t);d||(d="node default");const f=e.insert("g").attr("class",d).attr("id",t.domId||t.id),p=await No(f,t.label??"",n,0,0,["name"],o);p.height+=a;let m=0;const x=[],b=[];let v=0,k=0,w=0,C=0,T=!0,j=!0;for(const J of r.attributes){const ie=await No(f,J.type,n,0,m,["attribute-type"],o);v=Math.max(v,ie.width+i);const ne=await No(f,J.name,n,0,m,["attribute-name"],o);k=Math.max(k,ne.width+i);const oe=await No(f,J.keys.join(),n,0,m,["attribute-keys"],o);w=Math.max(w,oe.width+i);const fe=await No(f,J.comment,n,0,m,["attribute-comment"],o);C=Math.max(C,fe.width+i);const xe=Math.max(ie.height,ne.height,oe.height,fe.height)+a;b.push({yOffset:m,rowHeight:xe}),m+=xe}let L=4;w<=i&&(T=!1,w=0,L--),C<=i&&(j=!1,C=0,L--);const E=f.node().getBBox();if(p.width+i*2-(v+k+w+C)>0){const J=p.width+i*2-(v+k+w+C);v+=J/L,k+=J/L,w>0&&(w+=J/L),C>0&&(C+=J/L)}const M=v+k+w+C,I=Oe.svg(f),P=$e(t,{});t.look!=="handDrawn"&&(P.roughness=0,P.fillStyle="solid");let z=0;b.length>0&&(z=b.reduce((J,ie)=>J+((ie==null?void 0:ie.rowHeight)??0),0));const $=Math.max(E.width+i*2,(t==null?void 0:t.width)||0,M),W=Math.max((z??0)+p.height,(t==null?void 0:t.height)||0),Y=-$/2,B=-W/2;f.selectAll("g:not(:first-child)").each((J,ie,ne)=>{const oe=et(ne[ie]),fe=oe.attr("transform");let xe=0,de=0;if(fe){const ke=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(fe);ke&&(xe=parseFloat(ke[1]),de=parseFloat(ke[2]),oe.attr("class").includes("attribute-name")?xe+=v:oe.attr("class").includes("attribute-keys")?xe+=v+k:oe.attr("class").includes("attribute-comment")&&(xe+=v+k+w))}oe.attr("transform",`translate(${Y+i/2+xe}, ${de+B+p.height+a/2})`)}),f.select(".name").attr("transform","translate("+-p.width/2+", "+(B+a/2)+")");const U=I.rectangle(Y,B,$,W,P),R=f.insert(()=>U,":first-child").attr("style",s.join("")),{themeVariables:H}=cn(),{rowEven:V,rowOdd:Q,nodeBorder:A}=H;x.push(0);for(const[J,ie]of b.entries()){const oe=(J+1)%2===0&&ie.yOffset!==0,fe=I.rectangle(Y,p.height+B+(ie==null?void 0:ie.yOffset),$,ie==null?void 0:ie.rowHeight,{...P,fill:oe?V:Q,stroke:A});f.insert(()=>fe,"g.label").attr("style",s.join("")).attr("class",`row-rect-${oe?"even":"odd"}`)}let D=I.line(Y,p.height+B,$+Y,p.height+B,P);f.insert(()=>D).attr("class","divider"),D=I.line(v+Y,p.height+B,v+Y,W+B,P),f.insert(()=>D).attr("class","divider"),T&&(D=I.line(v+k+Y,p.height+B,v+k+Y,W+B,P),f.insert(()=>D).attr("class","divider")),j&&(D=I.line(v+k+w+Y,p.height+B,v+k+w+Y,W+B,P),f.insert(()=>D).attr("class","divider"));for(const J of x)D=I.line(Y,p.height+B+J,$+Y,p.height+B+J,P),f.insert(()=>D).attr("class","divider");if(Ie(t,R),u&&t.look!=="handDrawn"){const J=u.split(";"),ie=(re=J==null?void 0:J.filter(ne=>ne.includes("stroke")))==null?void 0:re.map(ne=>`${ne}`).join("; ");f.selectAll("path").attr("style",ie??""),f.selectAll(".row-rect-even path").attr("style",u)}return t.intersect=function(J){return Ae.rect(t,J)},f}O(E2,"erBox");async function No(e,t,r,n=0,i=0,a=[],s=""){const o=e.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);t!==p5(t)&&(t=p5(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));const u=o.node().appendChild(await Es(o,t,{width:Da(t,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(t.includes("&lt;")||t.includes("&gt;")){let f=u.children[0];for(f.textContent=f.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");f.childNodes[0];)f=f.childNodes[0],f.textContent=f.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let d=u.getBBox();if(Br(r.htmlLabels)){const f=u.children[0];f.style.textAlign="start";const p=et(u);d=f.getBoundingClientRect(),p.attr("width",d.width),p.attr("height",d.height)}return d}O(No,"addText");async function CD(e,t,r,n,i=r.class.padding??12){const a=n?0:3,s=e.insert("g").attr("class",Ye(t)).attr("id",t.domId||t.id);let o=null,u=null,d=null,f=null,p=0,m=0,x=0;if(o=s.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const C=t.annotations[0];await td(o,{text:`«${C}»`},0),p=o.node().getBBox().height}u=s.insert("g").attr("class","label-group text"),await td(u,t,0,["font-weight: bolder"]);const b=u.node().getBBox();m=b.height,d=s.insert("g").attr("class","members-group text");let v=0;for(const C of t.members){const T=await td(d,C,v,[C.parseClassifier()]);v+=T+a}x=d.node().getBBox().height,x<=0&&(x=i/2),f=s.insert("g").attr("class","methods-group text");let k=0;for(const C of t.methods){const T=await td(f,C,k,[C.parseClassifier()]);k+=T+a}let w=s.node().getBBox();if(o!==null){const C=o.node().getBBox();o.attr("transform",`translate(${-C.width/2})`)}return u.attr("transform",`translate(${-b.width/2}, ${p})`),w=s.node().getBBox(),d.attr("transform",`translate(0, ${p+m+i*2})`),w=s.node().getBBox(),f.attr("transform",`translate(0, ${p+m+(x?x+i*4:i*2)})`),w=s.node().getBBox(),{shapeSvg:s,bbox:w}}O(CD,"textHelper");async function td(e,t,r,n=[]){const i=e.insert("g").attr("class","label").attr("style",n.join("; ")),a=cn();let s="useHtmlLabels"in t?t.useHtmlLabels:Br(a.htmlLabels)??!0,o="";"text"in t?o=t.text:o=t.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),ec(o)&&(s=!0);const u=await Es(i,zv(Ll(o)),{width:Da(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let d,f=1;if(s){const p=u.children[0],m=et(u);f=p.innerHTML.split("<br>").length,p.innerHTML.includes("</math>")&&(f+=p.innerHTML.split("<mrow>").length-1);const x=p.getElementsByTagName("img");if(x){const b=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...x].map(v=>new Promise(k=>{function w(){var C;if(v.style.display="flex",v.style.flexDirection="column",b){const T=((C=a.fontSize)==null?void 0:C.toString())??window.getComputedStyle(document.body).fontSize,L=parseInt(T,10)*5+"px";v.style.minWidth=L,v.style.maxWidth=L}else v.style.width="100%";k(v)}O(w,"setupImage"),setTimeout(()=>{v.complete&&w()}),v.addEventListener("error",w),v.addEventListener("load",w)})))}d=p.getBoundingClientRect(),m.attr("width",d.width),m.attr("height",d.height)}else{n.includes("font-weight: bolder")&&et(u).selectAll("tspan").attr("font-weight",""),f=u.children.length;const p=u.children[0];(u.textContent===""||u.textContent.includes("&gt"))&&(p.textContent=o[0]+o.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),o[1]===" "&&(p.textContent=p.textContent[0]+" "+p.textContent.substring(1))),p.textContent==="undefined"&&(p.textContent=""),d=u.getBBox()}return i.attr("transform","translate(0,"+(-d.height/(2*f)+r)+")"),d.height}O(td,"addText");async function _D(e,t){var P,z;const r=Dt(),n=r.class.padding??12,i=n,a=t.useHtmlLabels??Br(r.htmlLabels)??!0,s=t;s.annotations=s.annotations??[],s.members=s.members??[],s.methods=s.methods??[];const{shapeSvg:o,bbox:u}=await CD(e,t,r,a,i),{labelStyles:d,nodeStyles:f}=ze(t);t.labelStyle=d,t.cssStyles=s.styles||"";const p=((P=s.styles)==null?void 0:P.join(";"))||f||"";t.cssStyles||(t.cssStyles=p.replaceAll("!important","").split(";"));const m=s.members.length===0&&s.methods.length===0&&!((z=r.class)!=null&&z.hideEmptyMembersBox),x=Oe.svg(o),b=$e(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const v=u.width;let k=u.height;s.members.length===0&&s.methods.length===0?k+=i:s.members.length>0&&s.methods.length===0&&(k+=i*2);const w=-v/2,C=-k/2,T=x.rectangle(w-n,C-n-(m?n:s.members.length===0&&s.methods.length===0?-n/2:0),v+2*n,k+2*n+(m?n*2:s.members.length===0&&s.methods.length===0?-n:0),b),j=o.insert(()=>T,":first-child");j.attr("class","basic label-container");const L=j.node().getBBox();o.selectAll(".text").each(($,W,Y)=>{var Q;const B=et(Y[W]),U=B.attr("transform");let R=0;if(U){const D=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(U);D&&(R=parseFloat(D[2]))}let H=R+C+n-(m?n:s.members.length===0&&s.methods.length===0?-n/2:0);a||(H-=4);let V=w;(B.attr("class").includes("label-group")||B.attr("class").includes("annotation-group"))&&(V=-((Q=B.node())==null?void 0:Q.getBBox().width)/2||0,o.selectAll("text").each(function(A,D,G){window.getComputedStyle(G[D]).textAnchor==="middle"&&(V=0)})),B.attr("transform",`translate(${V}, ${H})`)});const E=o.select(".annotation-group").node().getBBox().height-(m?n/2:0)||0,M=o.select(".label-group").node().getBBox().height-(m?n/2:0)||0,I=o.select(".members-group").node().getBBox().height-(m?n/2:0)||0;if(s.members.length>0||s.methods.length>0||m){const $=x.line(L.x,E+M+C+n,L.x+L.width,E+M+C+n,b);o.insert(()=>$).attr("class","divider").attr("style",p)}if(m||s.members.length>0||s.methods.length>0){const $=x.line(L.x,E+M+I+C+i*2+n,L.x+L.width,E+M+I+C+n+i*2,b);o.insert(()=>$).attr("class","divider").attr("style",p)}if(s.look!=="handDrawn"&&o.selectAll("path").attr("style",p),j.select(":nth-child(2)").attr("style",p),o.selectAll(".divider").select("path").attr("style",p),t.labelStyle?o.selectAll("span").attr("style",t.labelStyle):o.selectAll("span").attr("style",p),!a){const $=RegExp(/color\s*:\s*([^;]*)/),W=$.exec(p);if(W){const Y=W[0].replace("color","fill");o.selectAll("tspan").attr("style",Y)}else if(d){const Y=$.exec(d);if(Y){const B=Y[0].replace("color","fill");o.selectAll("tspan").attr("style",B)}}}return Ie(t,j),t.intersect=function($){return Ae.rect(t,$)},o}O(_D,"classBox");async function TD(e,t){var E,M;const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const i=t,a=t,s=20,o=20,u="verifyMethod"in t,d=Ye(t),f=e.insert("g").attr("class",d).attr("id",t.domId??t.id);let p;u?p=await Wi(f,`&lt;&lt;${i.type}&gt;&gt;`,0,t.labelStyle):p=await Wi(f,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let m=p;const x=await Wi(f,i.name,m,t.labelStyle+"; font-weight: bold;");if(m+=x+o,u){const I=await Wi(f,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,t.labelStyle);m+=I;const P=await Wi(f,`${i.text?`Text: ${i.text}`:""}`,m,t.labelStyle);m+=P;const z=await Wi(f,`${i.risk?`Risk: ${i.risk}`:""}`,m,t.labelStyle);m+=z,await Wi(f,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,t.labelStyle)}else{const I=await Wi(f,`${a.type?`Type: ${a.type}`:""}`,m,t.labelStyle);m+=I,await Wi(f,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,t.labelStyle)}const b=(((E=f.node())==null?void 0:E.getBBox().width)??200)+s,v=(((M=f.node())==null?void 0:M.getBBox().height)??200)+s,k=-b/2,w=-v/2,C=Oe.svg(f),T=$e(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const j=C.rectangle(k,w,b,v,T),L=f.insert(()=>j,":first-child");if(L.attr("class","basic label-container").attr("style",n),f.selectAll(".label").each((I,P,z)=>{const $=et(z[P]),W=$.attr("transform");let Y=0,B=0;if(W){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(W);V&&(Y=parseFloat(V[1]),B=parseFloat(V[2]))}const U=B-v/2;let R=k+s/2;(P===0||P===1)&&(R=Y),$.attr("transform",`translate(${R}, ${U+s})`)}),m>p+x+o){const I=C.line(k,w+p+x+o,k+b,w+p+x+o,T);f.insert(()=>I).attr("style",n)}return Ie(t,L),t.intersect=function(I){return Ae.rect(t,I)},f}O(TD,"requirementBox");async function Wi(e,t,r,n=""){if(t==="")return 0;const i=e.insert("g").attr("class","label").attr("style",n),a=Dt(),s=a.htmlLabels??!0,o=await Es(i,zv(Ll(t)),{width:Da(t,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let u;if(s){const d=o.children[0],f=et(o);u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{const d=o.children[0];for(const f of d.children)f.textContent=f.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),n&&f.setAttribute("style",n);u=o.getBBox(),u.height+=6}return i.attr("transform",`translate(${-u.width/2},${-u.height/2+r})`),u.height}O(Wi,"addText");var Gte=O(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function ED(e,t,{config:r}){var W,Y;const{labelStyles:n,nodeStyles:i}=ze(t);t.labelStyle=n||"";const a=10,s=t.width;t.width=(t.width??200)-10;const{shapeSvg:o,bbox:u,label:d}=await Qe(e,t,Ye(t)),f=t.padding||10;let p="",m;"ticket"in t&&t.ticket&&((W=r==null?void 0:r.kanban)!=null&&W.ticketBaseUrl)&&(p=(Y=r==null?void 0:r.kanban)==null?void 0:Y.ticketBaseUrl.replace("#TICKET#",t.ticket),m=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",p).attr("target","_blank"));const x={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let b,v;m?{label:b,bbox:v}=await qy(m,"ticket"in t&&t.ticket||"",x):{label:b,bbox:v}=await qy(o,"ticket"in t&&t.ticket||"",x);const{label:k,bbox:w}=await qy(o,"assigned"in t&&t.assigned||"",x);t.width=s;const C=10,T=(t==null?void 0:t.width)||0,j=Math.max(v.height,w.height)/2,L=Math.max(u.height+C*2,(t==null?void 0:t.height)||0)+j,E=-T/2,M=-L/2;d.attr("transform","translate("+(f-T/2)+", "+(-j-u.height/2)+")"),b.attr("transform","translate("+(f-T/2)+", "+(-j+u.height/2)+")"),k.attr("transform","translate("+(f+T/2-w.width-2*a)+", "+(-j+u.height/2)+")");let I;const{rx:P,ry:z}=t,{cssStyles:$}=t;if(t.look==="handDrawn"){const B=Oe.svg(o),U=$e(t,{}),R=P||z?B.path(Ns(E,M,T,L,P||0),U):B.rectangle(E,M,T,L,U);I=o.insert(()=>R,":first-child"),I.attr("class","basic label-container").attr("style",$||null)}else{I=o.insert("rect",":first-child"),I.attr("class","basic label-container __APA__").attr("style",i).attr("rx",P??5).attr("ry",z??5).attr("x",E).attr("y",M).attr("width",T).attr("height",L);const B="priority"in t&&t.priority;if(B){const U=o.append("line"),R=E+2,H=M+Math.floor((P??0)/2),V=M+L-Math.floor((P??0)/2);U.attr("x1",R).attr("y1",H).attr("x2",R).attr("y2",V).attr("stroke-width","4").attr("stroke",Gte(B))}}return Ie(t,I),t.height=L,t.intersect=function(B){return Ae.rect(t,B)},o}O(ED,"kanbanItem");async function ND(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Qe(e,t,Ye(t)),u=a.width+10*s,d=a.height+8*s,f=.15*u,{cssStyles:p}=t,m=a.width+20,x=a.height+20,b=Math.max(u,m),v=Math.max(d,x);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let k;const w=`M0 0
345
- a${f},${f} 1 0,0 ${b*.25},${-1*v*.1}
346
- a${f},${f} 1 0,0 ${b*.25},0
347
- a${f},${f} 1 0,0 ${b*.25},0
348
- a${f},${f} 1 0,0 ${b*.25},${v*.1}
349
-
350
- a${f},${f} 1 0,0 ${b*.15},${v*.33}
351
- a${f*.8},${f*.8} 1 0,0 0,${v*.34}
352
- a${f},${f} 1 0,0 ${-1*b*.15},${v*.33}
353
-
354
- a${f},${f} 1 0,0 ${-1*b*.25},${v*.15}
355
- a${f},${f} 1 0,0 ${-1*b*.25},0
356
- a${f},${f} 1 0,0 ${-1*b*.25},0
357
- a${f},${f} 1 0,0 ${-1*b*.25},${-1*v*.15}
358
-
359
- a${f},${f} 1 0,0 ${-1*b*.1},${-1*v*.33}
360
- a${f*.8},${f*.8} 1 0,0 0,${-1*v*.34}
361
- a${f},${f} 1 0,0 ${b*.1},${-1*v*.33}
362
- H0 V0 Z`;if(t.look==="handDrawn"){const C=Oe.svg(i),T=$e(t,{}),j=C.path(w,T);k=i.insert(()=>j,":first-child"),k.attr("class","basic label-container").attr("style",dn(p))}else k=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",w);return k.attr("transform",`translate(${-b/2}, ${-v/2})`),Ie(t,k),t.calcIntersect=function(C,T){return Ae.rect(C,T)},t.intersect=function(C){return we.info("Bang intersect",t,C),Ae.rect(t,C)},i}O(ND,"bang");async function jD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Qe(e,t,Ye(t)),u=a.width+2*s,d=a.height+2*s,f=.15*u,p=.25*u,m=.35*u,x=.2*u,{cssStyles:b}=t;let v;const k=`M0 0
363
- a${f},${f} 0 0,1 ${u*.25},${-1*u*.1}
364
- a${m},${m} 1 0,1 ${u*.4},${-1*u*.1}
365
- a${p},${p} 1 0,1 ${u*.35},${u*.2}
366
-
367
- a${f},${f} 1 0,1 ${u*.15},${d*.35}
368
- a${x},${x} 1 0,1 ${-1*u*.15},${d*.65}
369
-
370
- a${p},${f} 1 0,1 ${-1*u*.25},${u*.15}
371
- a${m},${m} 1 0,1 ${-1*u*.5},0
372
- a${f},${f} 1 0,1 ${-1*u*.25},${-1*u*.15}
373
-
374
- a${f},${f} 1 0,1 ${-1*u*.1},${-1*d*.35}
375
- a${x},${x} 1 0,1 ${u*.1},${-1*d*.65}
376
- H0 V0 Z`;if(t.look==="handDrawn"){const w=Oe.svg(i),C=$e(t,{}),T=w.path(k,C);v=i.insert(()=>T,":first-child"),v.attr("class","basic label-container").attr("style",dn(b))}else v=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",k);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),v.attr("transform",`translate(${-u/2}, ${-d/2})`),Ie(t,v),t.calcIntersect=function(w,C){return Ae.rect(w,C)},t.intersect=function(w){return we.info("Cloud intersect",t,w),Ae.rect(t,w)},i}O(jD,"cloud");async function AD(e,t){const{labelStyles:r,nodeStyles:n}=ze(t);t.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Qe(e,t,Ye(t)),u=a.width+8*s,d=a.height+2*s,f=5,p=`
377
- M${-u/2} ${d/2-f}
378
- v${-d+2*f}
379
- q0,-${f} ${f},-${f}
380
- h${u-2*f}
381
- q${f},0 ${f},${f}
382
- v${d-2*f}
383
- q0,${f} -${f},${f}
384
- h${-u+2*f}
385
- q-${f},0 -${f},-${f}
386
- Z
387
- `,m=i.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("style",n).attr("d",p);return i.append("line").attr("class","node-line-").attr("x1",-u/2).attr("y1",d/2).attr("x2",u/2).attr("y2",d/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),Ie(t,m),t.calcIntersect=function(x,b){return Ae.rect(x,b)},t.intersect=function(x){return Ae.rect(t,x)},i}O(AD,"defaultMindmapNode");async function MD(e,t){const r={padding:t.padding??0};return T2(e,t,r)}O(MD,"mindmapCircle");var Xte=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:oD},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:aD},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:cD},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:fD},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:LL},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:T2},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:ND},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:jD},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:rD},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:IL},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:XL},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:GL},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:yD},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:WL},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:RL},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:mD},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:CL},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:sD},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:hD},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:dD},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:$L},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:FL},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:NL},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:jL},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:AL},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:QL},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:wD},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:zL},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:xD},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:ZL},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:ML},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:DL},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:vD},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:SD},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:OL},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:bD},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:BL},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:lD},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:eD},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:JL},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:SL},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:EL},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:gD},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:pD},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:kD},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:nD},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:KL}],Qte=O(()=>{const t=[...Object.entries({state:uD,choice:_L,note:tD,rectWithTitle:iD,labelRect:YL,iconSquare:UL,iconCircle:HL,icon:PL,iconRounded:qL,imageSquare:VL,anchor:kL,kanbanItem:ED,mindmapCircle:MD,defaultMindmapNode:AD,classBox:_D,erBox:E2,requirementBox:TD}),...Xte.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),LD=Qte();function Zte(e){return e in LD}O(Zte,"isValidShape");var Cg=new Map;async function DD(e,t,r){let n,i;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const a=t.shape?LD[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let s;r.config.securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),n=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s??null),i=await a(n,t,r)}else i=await a(e,t,r),n=i;return t.tooltip&&i.attr("title",t.tooltip),Cg.set(t.id,n),t.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}O(DD,"insertNode");var Kfe=O((e,t)=>{Cg.set(t.id,e)},"setNodeElem"),Jfe=O(()=>{Cg.clear()},"clear"),e0e=O(e=>{const t=Cg.get(e.id);we.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode"),Kte=O((e,t,r,n,i,a)=>{t.arrowTypeStart&&C4(e,"start",t.arrowTypeStart,r,n,i,a),t.arrowTypeEnd&&C4(e,"end",t.arrowTypeEnd,r,n,i,a)},"addEdgeMarkers"),Jte={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},C4=O((e,t,r,n,i,a,s)=>{var p;const o=Jte[r];if(!o){we.warn(`Unknown arrow type: ${r}`);return}const u=o.type,f=`${i}_${a}-${u}${t==="start"?"Start":"End"}`;if(s&&s.trim()!==""){const m=s.replace(/[^\dA-Za-z]/g,"_"),x=`${f}_${m}`;if(!document.getElementById(x)){const b=document.getElementById(f);if(b){const v=b.cloneNode(!0);v.id=x,v.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",s),o.fill&&w.setAttribute("fill",s)}),(p=b.parentNode)==null||p.appendChild(v)}}e.attr(`marker-${t}`,`url(${n}#${x})`)}else e.attr(`marker-${t}`,`url(${n}#${f})`)},"addEdgeMarker"),Ap=new Map,Qr=new Map,t0e=O(()=>{Ap.clear(),Qr.clear()},"clear"),Jf=O(e=>e?e.reduce((r,n)=>r+";"+n,""):"","getLabelStyles"),ere=O(async(e,t)=>{let r=Br(Dt().flowchart.htmlLabels);const{labelStyles:n}=ze(t);t.labelStyle=n;const i=await Es(e,t.label,{style:t.labelStyle,useHtmlLabels:r,addSvgBackground:!0,isNode:!1});we.info("abc82",t,t.labelType);const a=e.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",t.id);s.node().appendChild(i);let o=i.getBBox();if(r){const d=i.children[0],f=et(i);o=d.getBoundingClientRect(),f.attr("width",o.width),f.attr("height",o.height)}s.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),Ap.set(t.id,a),t.width=o.width,t.height=o.height;let u;if(t.startLabelLeft){const d=await cl(t.startLabelLeft,Jf(t.labelStyle)),f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner");u=p.node().appendChild(d);const m=d.getBBox();p.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),Qr.get(t.id)||Qr.set(t.id,{}),Qr.get(t.id).startLeft=f,rd(u,t.startLabelLeft)}if(t.startLabelRight){const d=await cl(t.startLabelRight,Jf(t.labelStyle)),f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner");u=f.node().appendChild(d),p.node().appendChild(d);const m=d.getBBox();p.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),Qr.get(t.id)||Qr.set(t.id,{}),Qr.get(t.id).startRight=f,rd(u,t.startLabelRight)}if(t.endLabelLeft){const d=await cl(t.endLabelLeft,Jf(t.labelStyle)),f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner");u=p.node().appendChild(d);const m=d.getBBox();p.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),f.node().appendChild(d),Qr.get(t.id)||Qr.set(t.id,{}),Qr.get(t.id).endLeft=f,rd(u,t.endLabelLeft)}if(t.endLabelRight){const d=await cl(t.endLabelRight,Jf(t.labelStyle)),f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner");u=p.node().appendChild(d);const m=d.getBBox();p.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),f.node().appendChild(d),Qr.get(t.id)||Qr.set(t.id,{}),Qr.get(t.id).endRight=f,rd(u,t.endLabelRight)}return i},"insertEdgeLabel");function rd(e,t){Dt().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}O(rd,"setTerminalWidth");var tre=O((e,t)=>{we.debug("Moving label abc88 ",e.id,e.label,Ap.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const n=Dt(),{subGraphTitleTotalMargin:i}=n2(n);if(e.label){const a=Ap.get(e.id);let s=e.x,o=e.y;if(r){const u=ji.calcLabelPosition(r);we.debug("Moving label "+e.label+" from (",s,",",o,") to (",u.x,",",u.y,") abc88"),t.updatedPath&&(s=u.x,o=u.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(e.startLabelLeft){const a=Qr.get(e.id).startLeft;let s=e.x,o=e.y;if(r){const u=ji.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);s=u.x,o=u.y}a.attr("transform",`translate(${s}, ${o})`)}if(e.startLabelRight){const a=Qr.get(e.id).startRight;let s=e.x,o=e.y;if(r){const u=ji.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);s=u.x,o=u.y}a.attr("transform",`translate(${s}, ${o})`)}if(e.endLabelLeft){const a=Qr.get(e.id).endLeft;let s=e.x,o=e.y;if(r){const u=ji.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);s=u.x,o=u.y}a.attr("transform",`translate(${s}, ${o})`)}if(e.endLabelRight){const a=Qr.get(e.id).endRight;let s=e.x,o=e.y;if(r){const u=ji.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);s=u.x,o=u.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),rre=O((e,t)=>{const r=e.x,n=e.y,i=Math.abs(t.x-r),a=Math.abs(t.y-n),s=e.width/2,o=e.height/2;return i>=s||a>=o},"outsideNode"),nre=O((e,t,r)=>{we.debug(`intersection calc abc89:
388
- outsidePoint: ${JSON.stringify(t)}
389
- insidePoint : ${JSON.stringify(r)}
390
- node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const n=e.x,i=e.y,a=Math.abs(n-r.x),s=e.width/2;let o=r.x<t.x?s-a:s+a;const u=e.height/2,d=Math.abs(t.y-r.y),f=Math.abs(t.x-r.x);if(Math.abs(i-t.y)*s>Math.abs(n-t.x)*u){let p=r.y<t.y?t.y-u-i:i-u-t.y;o=f*p/d;const m={x:r.x<t.x?r.x+o:r.x-f+o,y:r.y<t.y?r.y+d-p:r.y-d+p};return o===0&&(m.x=t.x,m.y=t.y),f===0&&(m.x=t.x),d===0&&(m.y=t.y),we.debug(`abc89 top/bottom calc, Q ${d}, q ${p}, R ${f}, r ${o}`,m),m}else{r.x<t.x?o=t.x-s-n:o=n-s-t.x;let p=d*o/f,m=r.x<t.x?r.x+f-o:r.x-f+o,x=r.y<t.y?r.y+p:r.y-p;return we.debug(`sides calc abc89, Q ${d}, q ${p}, R ${f}, r ${o}`,{_x:m,_y:x}),o===0&&(m=t.x,x=t.y),f===0&&(m=t.x),d===0&&(x=t.y),{x:m,y:x}}},"intersection"),_4=O((e,t)=>{we.warn("abc88 cutPathAtIntersect",e,t);let r=[],n=e[0],i=!1;return e.forEach(a=>{if(we.info("abc88 checking point",a,t),!rre(t,a)&&!i){const s=nre(t,n,a);we.debug("abc88 inside",a,n,s),we.debug("abc88 intersection",s,t);let o=!1;r.forEach(u=>{o=o||u.x===s.x&&u.y===s.y}),r.some(u=>u.x===s.x&&u.y===s.y)?we.warn("abc88 no intersect",s,r):r.push(s),i=!0}else we.warn("abc88 outside",a,n),n=a,i||r.push(a)}),we.debug("returning points",r),r},"cutPathAtIntersect");function RD(e){const t=[],r=[];for(let n=1;n<e.length-1;n++){const i=e[n-1],a=e[n],s=e[n+1];(i.x===a.x&&a.y===s.y&&Math.abs(a.x-s.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(t.push(a),r.push(n))}return{cornerPoints:t,cornerPointPositions:r}}O(RD,"extractCornerPoints");var T4=O(function(e,t,r){const n=t.x-e.x,i=t.y-e.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:t.x-s*n,y:t.y-s*i}},"findAdjacentPoint"),ire=O(function(e){const{cornerPointPositions:t}=RD(e),r=[];for(let n=0;n<e.length;n++)if(t.includes(n)){const i=e[n-1],a=e[n+1],s=e[n],o=T4(i,s,5),u=T4(a,s,5),d=u.x-o.x,f=u.y-o.y;r.push(o);const p=Math.sqrt(2)*2;let m={x:s.x,y:s.y};if(Math.abs(a.x-i.x)>10&&Math.abs(a.y-i.y)>=10){we.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const x=5;s.x===o.x?m={x:d<0?o.x-x+p:o.x+x-p,y:f<0?o.y-p:o.y+p}:m={x:d<0?o.x-p:o.x+p,y:f<0?o.y-x+p:o.y+x-p}}else we.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(m,u)}else r.push(e[n]);return r},"fixCorners"),are=O((e,t,r)=>{const n=e-t-r,i=2,a=2,s=i+a,o=Math.floor(n/s),u=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${t} ${u} ${r}`},"generateDashArray"),sre=O(function(e,t,r,n,i,a,s,o=!1){var B;const{handDrawnSeed:u}=Dt();let d=t.points,f=!1;const p=i;var m=a;const x=[];for(const U in t.cssCompiledStyles)dM(U)||x.push(t.cssCompiledStyles[U]);we.debug("UIO intersect check",t.points,m.x,p.x),m.intersect&&p.intersect&&!o&&(d=d.slice(1,t.points.length-1),d.unshift(p.intersect(d[0])),we.debug("Last point UIO",t.start,"-->",t.end,d[d.length-1],m,m.intersect(d[d.length-1])),d.push(m.intersect(d[d.length-1])));const b=btoa(JSON.stringify(d));t.toCluster&&(we.info("to cluster abc88",r.get(t.toCluster)),d=_4(t.points,r.get(t.toCluster).node),f=!0),t.fromCluster&&(we.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(d,null,2)),d=_4(d.reverse(),r.get(t.fromCluster).node).reverse(),f=!0);let v=d.filter(U=>!Number.isNaN(U.y));v=ire(v);let k=w0;switch(k=lp,t.curve){case"linear":k=lp;break;case"basis":k=w0;break;case"cardinal":k=fj;break;case"bumpX":k=oj;break;case"bumpY":k=cj;break;case"catmullRom":k=gj;break;case"monotoneX":k=wj;break;case"monotoneY":k=kj;break;case"natural":k=Cj;break;case"step":k=_j;break;case"stepAfter":k=Ej;break;case"stepBefore":k=Tj;break;default:k=w0}const{x:w,y:C}=iZ(t),T=OX().x(w).y(C).curve(k);let j;switch(t.thickness){case"normal":j="edge-thickness-normal";break;case"thick":j="edge-thickness-thick";break;case"invisible":j="edge-thickness-invisible";break;default:j="edge-thickness-normal"}switch(t.pattern){case"solid":j+=" edge-pattern-solid";break;case"dotted":j+=" edge-pattern-dotted";break;case"dashed":j+=" edge-pattern-dashed";break;default:j+=" edge-pattern-solid"}let L,E=t.curve==="rounded"?OD(BD(v,t),5):T(v);const M=Array.isArray(t.style)?t.style:[t.style];let I=M.find(U=>U==null?void 0:U.startsWith("stroke:")),P=!1;if(t.look==="handDrawn"){const U=Oe.svg(e);Object.assign([],v);const R=U.path(E,{roughness:.3,seed:u});j+=" transition",L=et(R).select("path").attr("id",t.id).attr("class"," "+j+(t.classes?" "+t.classes:"")).attr("style",M?M.reduce((V,Q)=>V+";"+Q,""):"");let H=L.attr("d");L.attr("d",H),e.node().appendChild(L.node())}else{const U=x.join(";"),R=M?M.reduce((q,Z)=>q+Z+";",""):"";let H="";t.animate&&(H=" edge-animation-fast"),t.animation&&(H=" edge-animation-"+t.animation);const V=(U?U+";"+R+";":R)+";"+(M?M.reduce((q,Z)=>q+";"+Z,""):"");L=e.append("path").attr("d",E).attr("id",t.id).attr("class"," "+j+(t.classes?" "+t.classes:"")+(H??"")).attr("style",V),I=(B=V.match(/stroke:([^;]+)/))==null?void 0:B[1],P=t.animate===!0||!!t.animation||U.includes("animation");const Q=L.node(),A=typeof Q.getTotalLength=="function"?Q.getTotalLength():0,D=H5[t.arrowTypeStart]||0,G=H5[t.arrowTypeEnd]||0;if(t.look==="neo"&&!P){const Z=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?are(A,D,G):`0 ${D} ${A-D-G} ${G}`}; stroke-dashoffset: 0;`;L.attr("style",Z+L.attr("style"))}}L.attr("data-edge",!0),L.attr("data-et","edge"),L.attr("data-id",t.id),L.attr("data-points",b),t.showPoints&&v.forEach(U=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",U.x).attr("cy",U.y)});let z="";(Dt().flowchart.arrowMarkerAbsolute||Dt().state.arrowMarkerAbsolute)&&(z=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,z=z.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),we.info("arrowTypeStart",t.arrowTypeStart),we.info("arrowTypeEnd",t.arrowTypeEnd),Kte(L,t,z,s,n,I);const $=Math.floor(d.length/2),W=d[$];ji.isLabelCoordinateInPath(W,L.attr("d"))||(f=!0);let Y={};return f&&(Y.updatedPath=d),Y.originalPath=t.points,Y},"insertEdge");function OD(e,t){if(e.length<2)return"";let r="";const n=e.length,i=1e-5;for(let a=0;a<n;a++){const s=e[a],o=e[a-1],u=e[a+1];if(a===0)r+=`M${s.x},${s.y}`;else if(a===n-1)r+=`L${s.x},${s.y}`;else{const d=s.x-o.x,f=s.y-o.y,p=u.x-s.x,m=u.y-s.y,x=Math.hypot(d,f),b=Math.hypot(p,m);if(x<i||b<i){r+=`L${s.x},${s.y}`;continue}const v=d/x,k=f/x,w=p/b,C=m/b,T=v*w+k*C,j=Math.max(-1,Math.min(1,T)),L=Math.acos(j);if(L<i||Math.abs(Math.PI-L)<i){r+=`L${s.x},${s.y}`;continue}const E=Math.min(t/Math.sin(L/2),x/2,b/2),M=s.x-v*E,I=s.y-k*E,P=s.x+w*E,z=s.y+C*E;r+=`L${M},${I}`,r+=`Q${s.x},${s.y} ${P},${z}`}}return r}O(OD,"generateRoundedPath");function S1(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,n=t.y-e.y;return{angle:Math.atan2(n,r),deltaX:r,deltaY:n}}O(S1,"calculateDeltaAndAngle");function BD(e,t){const r=e.map(i=>({...i}));if(e.length>=2&&sn[t.arrowTypeStart]){const i=sn[t.arrowTypeStart],a=e[0],s=e[1],{angle:o}=S1(a,s),u=i*Math.cos(o),d=i*Math.sin(o);r[0].x=a.x+u,r[0].y=a.y+d}const n=e.length;if(n>=2&&sn[t.arrowTypeEnd]){const i=sn[t.arrowTypeEnd],a=e[n-1],s=e[n-2],{angle:o}=S1(s,a),u=i*Math.cos(o),d=i*Math.sin(o);r[n-1].x=a.x-u,r[n-1].y=a.y-d}return r}O(BD,"applyMarkerOffsetsToPoints");var lre=O((e,t,r,n)=>{t.forEach(i=>{Sre[i](e,r,n)})},"insertMarkers"),ore=O((e,t,r)=>{we.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),cre=O((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),ure=O((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),dre=O((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),hre=O((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),fre=O((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),pre=O((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),gre=O((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),mre=O((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),xre=O((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),yre=O((e,t,r)=>{const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),bre=O((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),vre=O((e,t,r)=>{const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),wre=O((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
391
- L20,10
392
- M20,10
393
- L0,20`)},"requirement_arrow"),kre=O((e,t,r)=>{const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Sre={extension:ore,composition:cre,aggregation:ure,dependency:dre,lollipop:hre,point:fre,circle:pre,cross:gre,barb:mre,only_one:xre,zero_or_one:yre,one_or_more:bre,zero_or_more:vre,requirement_arrow:wre,requirement_contains:kre},Cre=lre,_re={common:Tc,getConfig:cn,insertCluster:Dte,insertEdge:sre,insertEdgeLabel:ere,insertMarkers:Cre,insertNode:DD,interpolateToCurve:o2,labelHelper:Qe,log:we,positionEdgeLabel:tre},Pd={},$D=O(e=>{for(const t of e)Pd[t.name]=t},"registerLayoutLoaders"),Tre=O(()=>{$D([{name:"dagre",loader:O(async()=>await Ot(()=>import("./dagre-6UL2VRFP.js"),__vite__mapDeps([0,1,2,3,4,5])),"loader")},{name:"cose-bilkent",loader:O(async()=>await Ot(()=>import("./cose-bilkent-S5V4N54A.js"),__vite__mapDeps([6,7])),"loader")}])},"registerDefaultLayoutLoaders");Tre();var r0e=O(async(e,t)=>{if(!(e.layoutAlgorithm in Pd))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const r=Pd[e.layoutAlgorithm];return(await r.loader()).render(e,t,_re,{algorithm:r.algorithm})},"render"),n0e=O((e="",{fallback:t="dagre"}={})=>{if(e in Pd)return e;if(t in Pd)return we.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),zD="comm",ID="rule",FD="decl",Ere="@import",Nre="@namespace",jre="@keyframes",Are="@layer",PD=Math.abs,N2=String.fromCharCode;function HD(e){return e.trim()}function T0(e,t,r){return e.replace(t,r)}function Mre(e,t,r){return e.indexOf(t,r)}function Io(e,t){return e.charCodeAt(t)|0}function ac(e,t,r){return e.slice(t,r)}function Gi(e){return e.length}function Lre(e){return e.length}function e0(e,t){return t.push(e),e}var _g=1,sc=1,qD=0,yi=0,Cr=0,Mc="";function j2(e,t,r,n,i,a,s,o){return{value:e,root:t,parent:r,type:n,props:i,children:a,line:_g,column:sc,length:s,return:"",siblings:o}}function Dre(){return Cr}function Rre(){return Cr=yi>0?Io(Mc,--yi):0,sc--,Cr===10&&(sc=1,_g--),Cr}function Ri(){return Cr=yi<qD?Io(Mc,yi++):0,sc++,Cr===10&&(sc=1,_g++),Cr}function ps(){return Io(Mc,yi)}function E0(){return yi}function Tg(e,t){return ac(Mc,e,t)}function Hd(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ore(e){return _g=sc=1,qD=Gi(Mc=e),yi=0,[]}function Bre(e){return Mc="",e}function Uy(e){return HD(Tg(yi-1,C1(e===91?e+2:e===40?e+1:e)))}function $re(e){for(;(Cr=ps())&&Cr<33;)Ri();return Hd(e)>2||Hd(Cr)>3?"":" "}function zre(e,t){for(;--t&&Ri()&&!(Cr<48||Cr>102||Cr>57&&Cr<65||Cr>70&&Cr<97););return Tg(e,E0()+(t<6&&ps()==32&&Ri()==32))}function C1(e){for(;Ri();)switch(Cr){case e:return yi;case 34:case 39:e!==34&&e!==39&&C1(Cr);break;case 40:e===41&&C1(e);break;case 92:Ri();break}return yi}function Ire(e,t){for(;Ri()&&e+Cr!==57;)if(e+Cr===84&&ps()===47)break;return"/*"+Tg(t,yi-1)+"*"+N2(e===47?e:Ri())}function Fre(e){for(;!Hd(ps());)Ri();return Tg(e,yi)}function Pre(e){return Bre(N0("",null,null,null,[""],e=Ore(e),0,[0],e))}function N0(e,t,r,n,i,a,s,o,u){for(var d=0,f=0,p=s,m=0,x=0,b=0,v=1,k=1,w=1,C=0,T="",j=i,L=a,E=n,M=T;k;)switch(b=C,C=Ri()){case 40:if(b!=108&&Io(M,p-1)==58){Mre(M+=T0(Uy(C),"&","&\f"),"&\f",PD(d?o[d-1]:0))!=-1&&(w=-1);break}case 34:case 39:case 91:M+=Uy(C);break;case 9:case 10:case 13:case 32:M+=$re(b);break;case 92:M+=zre(E0()-1,7);continue;case 47:switch(ps()){case 42:case 47:e0(Hre(Ire(Ri(),E0()),t,r,u),u),(Hd(b||1)==5||Hd(ps()||1)==5)&&Gi(M)&&ac(M,-1,void 0)!==" "&&(M+=" ");break;default:M+="/"}break;case 123*v:o[d++]=Gi(M)*w;case 125*v:case 59:case 0:switch(C){case 0:case 125:k=0;case 59+f:w==-1&&(M=T0(M,/\f/g,"")),x>0&&(Gi(M)-p||v===0&&b===47)&&e0(x>32?N4(M+";",n,r,p-1,u):N4(T0(M," ","")+";",n,r,p-2,u),u);break;case 59:M+=";";default:if(e0(E=E4(M,t,r,d,f,i,o,T,j=[],L=[],p,a),a),C===123)if(f===0)N0(M,t,E,E,j,a,p,o,L);else{switch(m){case 99:if(Io(M,3)===110)break;case 108:if(Io(M,2)===97)break;default:f=0;case 100:case 109:case 115:}f?N0(e,E,E,n&&e0(E4(e,E,E,0,0,i,o,T,i,j=[],p,L),L),i,L,p,o,n?j:L):N0(M,E,E,E,[""],L,0,o,L)}}d=f=x=0,v=w=1,T=M="",p=s;break;case 58:p=1+Gi(M),x=b;default:if(v<1){if(C==123)--v;else if(C==125&&v++==0&&Rre()==125)continue}switch(M+=N2(C),C*v){case 38:w=f>0?1:(M+="\f",-1);break;case 44:o[d++]=(Gi(M)-1)*w,w=1;break;case 64:ps()===45&&(M+=Uy(Ri())),m=ps(),f=p=Gi(T=M+=Fre(E0())),C++;break;case 45:b===45&&Gi(M)==2&&(v=0)}}return a}function E4(e,t,r,n,i,a,s,o,u,d,f,p){for(var m=i-1,x=i===0?a:[""],b=Lre(x),v=0,k=0,w=0;v<n;++v)for(var C=0,T=ac(e,m+1,m=PD(k=s[v])),j=e;C<b;++C)(j=HD(k>0?x[C]+" "+T:T0(T,/&\f/g,x[C])))&&(u[w++]=j);return j2(e,t,r,i===0?ID:o,u,d,f,p)}function Hre(e,t,r,n){return j2(e,t,r,zD,N2(Dre()),ac(e,2,-2),0,n)}function N4(e,t,r,n,i){return j2(e,t,r,FD,ac(e,0,n),ac(e,n+1,-1),n,i)}function _1(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function qre(e,t,r,n){switch(e.type){case Are:if(e.children.length)break;case Ere:case Nre:case FD:return e.return=e.return||e.value;case zD:return"";case jre:return e.return=e.value+"{"+_1(e.children,n)+"}";case ID:if(!Gi(e.value=e.props.join(",")))return""}return Gi(r=_1(e.children,n))?e.return=e.value+"{"+r+"}":""}var Ure=gM(Object.keys,Object),Vre=Object.prototype,Wre=Vre.hasOwnProperty;function Yre(e){if(!gg(e))return Ure(e);var t=[];for(var r in Object(e))Wre.call(e,r)&&r!="constructor"&&t.push(r);return t}var T1=Ml(ia,"DataView"),E1=Ml(ia,"Promise"),N1=Ml(ia,"Set"),j1=Ml(ia,"WeakMap"),j4="[object Map]",Gre="[object Object]",A4="[object Promise]",M4="[object Set]",L4="[object WeakMap]",D4="[object DataView]",Xre=Al(T1),Qre=Al(Id),Zre=Al(E1),Kre=Al(N1),Jre=Al(j1),rl=Nc;(T1&&rl(new T1(new ArrayBuffer(1)))!=D4||Id&&rl(new Id)!=j4||E1&&rl(E1.resolve())!=A4||N1&&rl(new N1)!=M4||j1&&rl(new j1)!=L4)&&(rl=function(e){var t=Nc(e),r=t==Gre?e.constructor:void 0,n=r?Al(r):"";if(n)switch(n){case Xre:return D4;case Qre:return j4;case Zre:return A4;case Kre:return M4;case Jre:return L4}return t});var ene="[object Map]",tne="[object Set]",rne=Object.prototype,nne=rne.hasOwnProperty;function R4(e){if(e==null)return!0;if(mg(e)&&(vp(e)||typeof e=="string"||typeof e.splice=="function"||s2(e)||l2(e)||bp(e)))return!e.length;var t=rl(e);if(t==ene||t==tne)return!e.size;if(gg(e))return!Yre(e).length;for(var r in e)if(nne.call(e,r))return!1;return!0}var UD="c4",ine=O(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),ane=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO.js");return{diagram:t}},__vite__mapDeps([8,9]));return{id:UD,diagram:e}},"loader"),sne={id:UD,detector:ine,loader:ane},lne=sne,VD="flowchart",one=O((e,t)=>{var r,n;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),cne=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS.js");return{diagram:t}},__vite__mapDeps([10,11,12,13,14]));return{id:VD,diagram:e}},"loader"),une={id:VD,detector:one,loader:cne},dne=une,WD="flowchart-v2",hne=O((e,t)=>{var r,n,i;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),fne=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS.js");return{diagram:t}},__vite__mapDeps([10,11,12,13,14]));return{id:WD,diagram:e}},"loader"),pne={id:WD,detector:hne,loader:fne},gne=pne,YD="er",mne=O(e=>/^\s*erDiagram/.test(e),"detector"),xne=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA.js");return{diagram:t}},__vite__mapDeps([15,12,13,14]));return{id:YD,diagram:e}},"loader"),yne={id:YD,detector:mne,loader:xne},bne=yne,GD="gitGraph",vne=O(e=>/^\s*gitGraph/.test(e),"detector"),wne=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./gitGraphDiagram-NY62KEGX.js");return{diagram:t}},__vite__mapDeps([16,17,18,19,4,2]));return{id:GD,diagram:e}},"loader"),kne={id:GD,detector:vne,loader:wne},Sne=kne,XD="gantt",Cne=O(e=>/^\s*gantt/.test(e),"detector"),_ne=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./ganttDiagram-JELNMOA3.js");return{diagram:t}},__vite__mapDeps([20,21,22,23]));return{id:XD,diagram:e}},"loader"),Tne={id:XD,detector:Cne,loader:_ne},Ene=Tne,QD="info",Nne=O(e=>/^\s*info/.test(e),"detector"),jne=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./infoDiagram-WHAUD3N6.js");return{diagram:t}},__vite__mapDeps([24,19,4,2]));return{id:QD,diagram:e}},"loader"),Ane={id:QD,detector:Nne,loader:jne},ZD="pie",Mne=O(e=>/^\s*pie/.test(e),"detector"),Lne=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX.js");return{diagram:t}},__vite__mapDeps([25,17,19,4,2,26,27,22]));return{id:ZD,diagram:e}},"loader"),Dne={id:ZD,detector:Mne,loader:Lne},KD="quadrantChart",Rne=O(e=>/^\s*quadrantChart/.test(e),"detector"),One=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B.js");return{diagram:t}},__vite__mapDeps([28,21,22,23]));return{id:KD,diagram:e}},"loader"),Bne={id:KD,detector:Rne,loader:One},$ne=Bne,JD="xychart",zne=O(e=>/^\s*xychart(-beta)?/.test(e),"detector"),Ine=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R.js");return{diagram:t}},__vite__mapDeps([29,22,27,21,23]));return{id:JD,diagram:e}},"loader"),Fne={id:JD,detector:zne,loader:Ine},Pne=Fne,e6="requirement",Hne=O(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),qne=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ.js");return{diagram:t}},__vite__mapDeps([30,12,13]));return{id:e6,diagram:e}},"loader"),Une={id:e6,detector:Hne,loader:qne},Vne=Une,t6="sequence",Wne=O(e=>/^\s*sequenceDiagram/.test(e),"detector"),Yne=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW.js");return{diagram:t}},__vite__mapDeps([31,9,18]));return{id:t6,diagram:e}},"loader"),Gne={id:t6,detector:Wne,loader:Yne},Xne=Gne,r6="class",Qne=O((e,t)=>{var r;return((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),Zne=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG.js");return{diagram:t}},__vite__mapDeps([32,33,11,12,13]));return{id:r6,diagram:e}},"loader"),Kne={id:r6,detector:Qne,loader:Zne},Jne=Kne,n6="classDiagram",eie=O((e,t)=>{var r;return/^\s*classDiagram/.test(e)&&((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),tie=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB.js");return{diagram:t}},__vite__mapDeps([34,33,11,12,13]));return{id:n6,diagram:e}},"loader"),rie={id:n6,detector:eie,loader:tie},nie=rie,i6="state",iie=O((e,t)=>{var r;return((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),aie=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC.js");return{diagram:t}},__vite__mapDeps([35,36,12,13,1,2,3,4]));return{id:i6,diagram:e}},"loader"),sie={id:i6,detector:iie,loader:aie},lie=sie,a6="stateDiagram",oie=O((e,t)=>{var r;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),cie=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3.js");return{diagram:t}},__vite__mapDeps([37,36,12,13]));return{id:a6,diagram:e}},"loader"),uie={id:a6,detector:oie,loader:cie},die=uie,s6="journey",hie=O(e=>/^\s*journey/.test(e),"detector"),fie=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q.js");return{diagram:t}},__vite__mapDeps([38,9,11,26]));return{id:s6,diagram:e}},"loader"),pie={id:s6,detector:hie,loader:fie},gie=pie,mie=O((e,t,r)=>{we.debug(`rendering svg for syntax error
394
- `);const n=QX(t),i=n.append("g");n.attr("viewBox","0 0 2412 512"),N3(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),l6={draw:mie},xie=l6,yie={db:{},renderer:l6,parser:{parse:O(()=>{},"parse")}},bie=yie,o6="flowchart-elk",vie=O((e,t={})=>{var r;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),wie=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS.js");return{diagram:t}},__vite__mapDeps([10,11,12,13,14]));return{id:o6,diagram:e}},"loader"),kie={id:o6,detector:vie,loader:wie},Sie=kie,c6="timeline",Cie=O(e=>/^\s*timeline/.test(e),"detector"),_ie=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./timeline-definition-IT6M3QCI.js");return{diagram:t}},__vite__mapDeps([39,26]));return{id:c6,diagram:e}},"loader"),Tie={id:c6,detector:Cie,loader:_ie},Eie=Tie,u6="mindmap",Nie=O(e=>/^\s*mindmap/.test(e),"detector"),jie=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./mindmap-definition-VGOIOE7T.js");return{diagram:t}},__vite__mapDeps([40,12,13]));return{id:u6,diagram:e}},"loader"),Aie={id:u6,detector:Nie,loader:jie},Mie=Aie,d6="kanban",Lie=O(e=>/^\s*kanban/.test(e),"detector"),Die=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./kanban-definition-3W4ZIXB7.js");return{diagram:t}},__vite__mapDeps([41,11]));return{id:d6,diagram:e}},"loader"),Rie={id:d6,detector:Lie,loader:Die},Oie=Rie,h6="sankey",Bie=O(e=>/^\s*sankey(-beta)?/.test(e),"detector"),$ie=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./sankeyDiagram-TZEHDZUN.js");return{diagram:t}},__vite__mapDeps([42,27,22]));return{id:h6,diagram:e}},"loader"),zie={id:h6,detector:Bie,loader:$ie},Iie=zie,f6="packet",Fie=O(e=>/^\s*packet(-beta)?/.test(e),"detector"),Pie=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./diagram-S2PKOQOG.js");return{diagram:t}},__vite__mapDeps([43,17,19,4,2]));return{id:f6,diagram:e}},"loader"),Hie={id:f6,detector:Fie,loader:Pie},p6="radar",qie=O(e=>/^\s*radar-beta/.test(e),"detector"),Uie=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./diagram-QEK2KX5R.js");return{diagram:t}},__vite__mapDeps([44,17,19,4,2]));return{id:p6,diagram:e}},"loader"),Vie={id:p6,detector:qie,loader:Uie},g6="block",Wie=O(e=>/^\s*block(-beta)?/.test(e),"detector"),Yie=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./blockDiagram-VD42YOAC.js");return{diagram:t}},__vite__mapDeps([45,11,5,1,2,14]));return{id:g6,diagram:e}},"loader"),Gie={id:g6,detector:Wie,loader:Yie},Xie=Gie,m6="architecture",Qie=O(e=>/^\s*architecture/.test(e),"detector"),Zie=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./architectureDiagram-VXUJARFQ.js");return{diagram:t}},__vite__mapDeps([46,17,19,4,2,7]));return{id:m6,diagram:e}},"loader"),Kie={id:m6,detector:Qie,loader:Zie},Jie=Kie,x6="treemap",eae=O(e=>/^\s*treemap/.test(e),"detector"),tae=O(async()=>{const{diagram:e}=await Ot(async()=>{const{diagram:t}=await import("./diagram-PSM6KHXK.js");return{diagram:t}},__vite__mapDeps([47,13,17,19,4,2,23,27,22]));return{id:x6,diagram:e}},"loader"),rae={id:x6,detector:eae,loader:tae},O4=!1,Eg=O(()=>{O4||(O4=!0,J0("error",bie,e=>e.toLowerCase().trim()==="error"),J0("---",{db:{clear:O(()=>{},"clear")},styles:{},renderer:{draw:O(()=>{},"draw")},parser:{parse:O(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:O(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Ob(Sie,Mie,Jie),Ob(lne,Oie,nie,Jne,bne,Ene,Ane,Dne,Vne,Xne,gne,dne,Eie,Sne,die,lie,gie,$ne,Iie,Hie,Pne,Xie,Vie,rae))},"addDiagrams"),nae=O(async()=>{we.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(ml).map(async([r,{detector:n,loader:i}])=>{if(i)try{Ib(r)}catch{try{const{diagram:a,id:s}=await i();J0(s,a,n)}catch(a){throw we.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete ml[r],a}}}))).filter(r=>r.status==="rejected");if(t.length>0){we.error(`Failed to load ${t.length} external diagrams`);for(const r of t)we.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),iae="graphics-document document";function y6(e,t){e.attr("role",iae),t!==""&&e.attr("aria-roledescription",t)}O(y6,"setA11yDiagramInfo");function b6(e,t,r,n){if(e.insert!==void 0){if(r){const i=`chart-desc-${n}`;e.attr("aria-describedby",i),e.insert("desc",":first-child").attr("id",i).text(r)}if(t){const i=`chart-title-${n}`;e.attr("aria-labelledby",i),e.insert("title",":first-child").attr("id",i).text(t)}}}O(b6,"addSVGa11yTitleDescription");var pl,A1=(pl=class{constructor(t,r,n,i,a){this.type=t,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(t,r={}){var d,f;const n=cn(),i=Lv(t,n);t=ree(t)+`
395
- `;try{Ib(i)}catch{const p=oV(i);if(!p)throw new m3(`Diagram ${i} not found.`);const{id:m,diagram:x}=await p();J0(m,x)}const{db:a,parser:s,renderer:o,init:u}=Ib(i);return s.parser&&(s.parser.yy=a),(d=a.clear)==null||d.call(a),u==null||u(n),r.title&&((f=a.setDiagramTitle)==null||f.call(a,r.title)),await s.parse(t),new pl(i,t,a,s,o)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},O(pl,"Diagram"),pl),B4=[],aae=O(()=>{B4.forEach(e=>{e()}),B4=[]},"attachFunctions"),sae=O(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function v6(e){const t=e.match(g3);if(!t)return{text:e,metadata:{}};let r=nZ(t[1],{schema:rZ})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:e.slice(t[0].length),metadata:n}}O(v6,"extractFrontMatter");var lae=O(e=>e.replace(/\r\n?/g,`
396
- `).replace(/<(\w+)([^>]*)>/g,(t,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),oae=O(e=>{const{text:t,metadata:r}=v6(e),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:t}},"processFrontmatter"),cae=O(e=>{const t=ji.detectInit(e)??{},r=ji.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(t.wrap=!0),{text:qJ(e),directive:t}},"processDirectives");function A2(e){const t=lae(e),r=oae(t),n=cae(r.text),i=f2(r.config,n.directive);return e=sae(n.text),{code:e,title:r.title,config:i}}O(A2,"preprocessDiagram");function w6(e){const t=new TextEncoder().encode(e),r=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(r)}O(w6,"toBase64");var uae=5e4,dae="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",hae="sandbox",fae="loose",pae="http://www.w3.org/2000/svg",gae="http://www.w3.org/1999/xlink",mae="http://www.w3.org/1999/xhtml",xae="100%",yae="100%",bae="border:0;margin:0;",vae="margin:0",wae="allow-top-navigation-by-user-activation allow-popups",kae='The "iframe" tag is not supported by your browser.',Sae=["foreignobject"],Cae=["dominant-baseline"];function M2(e){const t=A2(e);return Z0(),CV(t.config??{}),t}O(M2,"processAndSetConfigs");async function k6(e,t){Eg();try{const{code:r,config:n}=M2(e);return{diagramType:(await C6(r)).type,config:n}}catch(r){if(t!=null&&t.suppressErrors)return!1;throw r}}O(k6,"parse");var $4=O((e,t,r=[])=>`
397
- .${e} ${t} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),_ae=O((e,t=new Map)=>{var n;let r="";if(e.themeCSS!==void 0&&(r+=`
398
- ${e.themeCSS}`),e.fontFamily!==void 0&&(r+=`
399
- :root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(r+=`
400
- :root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){const o=e.htmlLabels??((n=e.flowchart)==null?void 0:n.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(u=>{R4(u.styles)||o.forEach(d=>{r+=$4(u.id,d,u.styles)}),R4(u.textStyles)||(r+=$4(u.id,"tspan",((u==null?void 0:u.textStyles)||[]).map(d=>d.replace("color","fill"))))})}return r},"createCssStyles"),Tae=O((e,t,r,n)=>{const i=_ae(e,r),a=UV(t,i,e.themeVariables);return _1(Pre(`${n}{${a}}`),qre)},"createUserStyles"),Eae=O((e="",t,r)=>{let n=e;return!r&&!t&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=Ll(n),n=n.replace(/<br>/g,"<br/>"),n},"cleanUpSvgCode"),Nae=O((e="",t)=>{var i,a;const r=(a=(i=t==null?void 0:t.viewBox)==null?void 0:i.baseVal)!=null&&a.height?t.viewBox.baseVal.height+"px":yae,n=w6(`<body style="${vae}">${e}</body>`);return`<iframe style="width:${xae};height:${r};${bae}" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="${wae}">
401
- ${kae}
402
- </iframe>`},"putIntoIFrame"),z4=O((e,t,r,n,i)=>{const a=e.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns",pae);return i&&s.attr("xmlns:xlink",i),s.append("g"),e},"appendDivSvgG");function M1(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}O(M1,"sandboxedIframe");var jae=O((e,t,r,n)=>{var i,a,s;(i=e.getElementById(t))==null||i.remove(),(a=e.getElementById(r))==null||a.remove(),(s=e.getElementById(n))==null||s.remove()},"removeExistingElements"),Aae=O(async function(e,t,r){var W,Y,B,U,R,H;Eg();const n=M2(t);t=n.code;const i=cn();we.debug(i),t.length>((i==null?void 0:i.maxTextSize)??uae)&&(t=dae);const a="#"+e,s="i"+e,o="#"+s,u="d"+e,d="#"+u,f=O(()=>{const Q=et(m?o:d).node();Q&&"remove"in Q&&Q.remove()},"removeTempElements");let p=et("body");const m=i.securityLevel===hae,x=i.securityLevel===fae,b=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),m){const V=M1(et(r),s);p=et(V.nodes()[0].contentDocument.body),p.node().style.margin=0}else p=et(r);z4(p,e,u,`font-family: ${b}`,gae)}else{if(jae(document,e,u,s),m){const V=M1(et("body"),s);p=et(V.nodes()[0].contentDocument.body),p.node().style.margin=0}else p=et("body");z4(p,e,u)}let v,k;try{v=await A1.fromText(t,{title:n.title})}catch(V){if(i.suppressErrorRendering)throw f(),V;v=await A1.fromText("error"),k=V}const w=p.select(d).node(),C=v.type,T=w.firstChild,j=T.firstChild,L=(Y=(W=v.renderer).getClasses)==null?void 0:Y.call(W,t,v),E=Tae(i,C,L,a),M=document.createElement("style");M.innerHTML=E,T.insertBefore(M,j);try{await v.renderer.draw(t,e,r5.version,v)}catch(V){throw i.suppressErrorRendering?f():xie.draw(t,e,r5.version),V}const I=p.select(`${d} svg`),P=(U=(B=v.db).getAccTitle)==null?void 0:U.call(B),z=(H=(R=v.db).getAccDescription)==null?void 0:H.call(R);_6(C,I,P,z),p.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",mae);let $=p.select(d).node().innerHTML;if(we.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),$=Eae($,m,Br(i.arrowMarkerAbsolute)),m){const V=p.select(d+" svg").node();$=Nae($,V)}else x||($=Ko.sanitize($,{ADD_TAGS:Sae,ADD_ATTR:Cae,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(aae(),k)throw k;return f(),{diagramType:C,svg:$,bindFunctions:v.db.bindFunctions}},"render");function S6(e={}){var n;const t=Rr({},e);t!=null&&t.fontFamily&&!((n=t.themeVariables)!=null&&n.fontFamily)&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),kV(t),t!=null&&t.theme&&t.theme in ja?t.themeVariables=ja[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=ja.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?wV(t):w3();Mv(r.logLevel),Eg()}O(S6,"initialize");var C6=O((e,t={})=>{const{code:r}=A2(e);return A1.fromText(r,t)},"getDiagramFromText");function _6(e,t,r,n){y6(t,e),b6(t,r,n,t.attr("id"))}O(_6,"addA11yInfo");var Sl=Object.freeze({render:Aae,parse:k6,getDiagramFromText:C6,initialize:S6,getConfig:cn,setConfig:k3,getSiteConfig:w3,updateSiteConfig:SV,reset:O(()=>{Z0()},"reset"),globalReset:O(()=>{Z0(Jo)},"globalReset"),defaultConfig:Jo});Mv(cn().logLevel);Z0(cn());var Mae=O((e,t,r)=>{we.warn(e),h2(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),T6=O(async function(e={querySelector:".mermaid"}){try{await Lae(e)}catch(t){if(h2(t)&&we.error(t.str),ti.parseError&&ti.parseError(t),!e.suppressErrors)throw we.error("Use the suppressErrors option to suppress these errors"),t}},"run"),Lae=O(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const n=Sl.getConfig();we.debug(`${e?"":"No "}Callback function found`);let i;if(r)i=r;else if(t)i=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");we.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(we.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),Sl.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new ji.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const u of Array.from(i)){if(we.info("Rendering diagram: "+u.id),u.getAttribute("data-processed"))continue;u.setAttribute("data-processed","true");const d=`mermaid-${a.next()}`;s=u.innerHTML,s=YM(ji.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");const f=ji.detectInit(s);f&&we.debug("Detected early reinit: ",f);try{const{svg:p,bindFunctions:m}=await A6(d,s,u);u.innerHTML=p,e&&await e(d),m&&m(u)}catch(p){Mae(p,o,ti.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),E6=O(function(e){Sl.initialize(e)},"initialize"),Dae=O(async function(e,t,r){we.warn("mermaid.init is deprecated. Please use run instead."),e&&E6(e);const n={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?n.querySelector=t:t&&(t instanceof HTMLElement?n.nodes=[t]:n.nodes=t),await T6(n)},"init"),Rae=O(async(e,{lazyLoad:t=!0}={})=>{Eg(),Ob(...e),t===!1&&await nae()},"registerExternalDiagrams"),N6=O(function(){if(ti.startOnLoad){const{startOnLoad:e}=Sl.getConfig();e&&ti.run().catch(t=>we.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",N6,!1);var Oae=O(function(e){ti.parseError=e},"setParseErrorHandler"),Mp=[],Vy=!1,j6=O(async()=>{if(!Vy){for(Vy=!0;Mp.length>0;){const e=Mp.shift();if(e)try{await e()}catch(t){we.error("Error executing queue",t)}}Vy=!1}},"executeQueue"),Bae=O(async(e,t)=>new Promise((r,n)=>{const i=O(()=>new Promise((a,s)=>{Sl.parse(e,t).then(o=>{a(o),r(o)},o=>{var u;we.error("Error parsing",o),(u=ti.parseError)==null||u.call(ti,o),s(o),n(o)})}),"performCall");Mp.push(i),j6().catch(n)}),"parse"),A6=O((e,t,r)=>new Promise((n,i)=>{const a=O(()=>new Promise((s,o)=>{Sl.render(e,t,r).then(u=>{s(u),n(u)},u=>{var d;we.error("Error parsing",u),(d=ti.parseError)==null||d.call(ti,u),o(u),i(u)})}),"performCall");Mp.push(a),j6().catch(i)}),"render"),$ae=O(()=>Object.keys(ml).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),ti={startOnLoad:!0,mermaidAPI:Sl,parse:Bae,render:A6,init:Dae,run:T6,registerExternalDiagrams:Rae,registerLayoutLoaders:$D,initialize:E6,parseError:void 0,contentLoaded:N6,setParseErrorHandler:Oae,detectType:Lv,registerIconPacks:ste,getRegisteredDiagramsMetadata:$ae},L1=ti;/*! Check if previously processed *//*!
403
- * Wait for document loaded before starting the execution
404
- */L1.initialize({startOnLoad:!1,theme:"default",securityLevel:"loose",flowchart:{useMaxWidth:!0,htmlLabels:!0,curve:"basis"}});function zae({chart:e,className:t=""}){const r=N.useRef(null),[n,i]=N.useState(""),[a,s]=N.useState(null);return N.useEffect(()=>{(async()=>{if(!e.trim()){i("");return}try{const u=`mermaid-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,d=document.documentElement.classList.contains("dark");L1.initialize({startOnLoad:!1,theme:d?"dark":"default",securityLevel:"loose",flowchart:{useMaxWidth:!0,htmlLabels:!0,curve:"basis"}});const{svg:f}=await L1.render(u,e);i(f),s(null)}catch(u){console.error("Mermaid render error:",u),s(u instanceof Error?u.message:"Failed to render diagram"),i("")}})()},[e]),a?h.jsxs("div",{className:`p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg ${t}`,children:[h.jsxs("div",{className:"flex items-center gap-2 text-red-600 dark:text-red-400 mb-2",children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),h.jsx("span",{className:"font-medium",children:"Diagram Error"})]}),h.jsx("pre",{className:"text-sm text-red-700 dark:text-red-300 whitespace-pre-wrap",children:a}),h.jsxs("details",{className:"mt-2",children:[h.jsx("summary",{className:"text-xs text-red-500 dark:text-red-400 cursor-pointer",children:"Show source"}),h.jsx("pre",{className:"mt-2 p-2 bg-red-100 dark:bg-red-900/40 rounded text-xs overflow-x-auto",children:e})]})]}):h.jsx("div",{ref:r,className:`mermaid-diagram flex justify-center p-4 bg-white dark:bg-slate-800/50 rounded-lg border border-gray-200 dark:border-slate-700 ${t}`,dangerouslySetInnerHTML:{__html:n}})}function M6({step:e,mode:t="view",onChange:r,onDelete:n}){const{state:i,gotoStepById:a}=rr(),s=t==="edit",o=D0(e),u=hr(o,i.variables),[d,f]=N.useState(o),p=x=>{a(x)},m=x=>{f(x),r&&("slide"in e?r({...e,slide:x}):r({...e,content:x}))};return h.jsx(Bi,{isActive:!0,color:"primary",intensity:"subtle",children:h.jsxs("div",{className:"bg-white/90 dark:bg-slate-800/80 backdrop-blur-sm rounded-xl shadow-md dark:shadow-xl border border-gray-200 dark:border-[rgba(var(--color-primary-rgb),0.2)] transition-colors duration-300",children:[s&&h.jsxs("div",{className:"flex items-center justify-between px-8 py-3 border-b border-gray-200 dark:border-slate-700",children:[h.jsx("span",{className:"text-sm font-medium text-gray-500 dark:text-slate-400",children:"Slide"}),n&&h.jsx("button",{onClick:n,className:"p-1.5 text-gray-400 hover:text-red-500 dark:text-slate-500 dark:hover:text-red-400 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsxs("div",{className:"p-8",children:[s?h.jsx("textarea",{value:d,onChange:x=>m(x.target.value),className:"w-full min-h-[200px] p-4 font-mono text-sm bg-gray-50 dark:bg-slate-900 border border-gray-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-theme-primary resize-y",placeholder:"Enter markdown content..."}):h.jsxs("div",{children:[e.title&&h.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-slate-100 mb-4",children:e.title}),h.jsx("div",{className:"prose prose-lg max-w-none prose-headings:text-gray-900 dark:prose-invert dark:prose-headings:bg-gradient-to-r dark:prose-headings:from-theme-primary dark:prose-headings:to-theme-accent dark:prose-headings:bg-clip-text dark:prose-headings:text-transparent prose-strong:text-theme-primary dark:prose-strong:text-theme-primary prose-p:text-gray-700 dark:prose-p:text-slate-300 prose-li:text-gray-700 dark:prose-li:text-slate-300",children:h.jsx(dH,{remarkPlugins:[CU],components:{code({className:x,children:b,...v}){const k=/language-(\w+)/.exec(x||"");if((k?k[1]:"")==="mermaid"){const C=String(b).replace(/\n$/,"");return h.jsx(zae,{chart:C,className:"my-4"})}return h.jsx("code",{className:x,...v,children:b})}},children:u})})]}),e.choices&&e.choices.length>0&&h.jsx(_U,{choices:e.choices,onSelect:p})]})]})})}function gd(e,t){const r=e.match(/^(\w+)\s*(==|!=)\s*['"]?(\w+)['"]?$/);if(!r)return!1;const[,n,i,a]=r,s=qr(t,n);return i==="=="?String(s)===a:i==="!="?String(s)!==a:!1}const Iae=[{patterns:["timeout","timed out"],type:"Request Timeout"},{patterns:["network","failed to fetch","connection"],type:"Network Error"},{patterns:["401","unauthorized"],type:"Authentication Error"},{patterns:["403","forbidden"],type:"Access Denied"},{patterns:["415","unsupported media type","mime"],type:"Invalid Content-Type"},{patterns:["404"],regex:/\bnot found\b/,type:"Not Found"},{patterns:["500","internal server"],type:"Server Error"},{patterns:["polling"],type:"Polling Failed"},{patterns:["recording"],type:"Recording Missing"}];function Fae(e){const t=e.toLowerCase();for(const{patterns:r,regex:n,type:i}of Iae){const a=r.some(o=>t.includes(o)),s=n?n.test(t):!1;if(a||s)return i}return"Request Error"}const Pae={GET:"bg-green-100 dark:bg-green-500/20 text-green-700 dark:text-green-400 border border-green-300 dark:border-green-500/30",POST:"bg-cyan-100 dark:bg-cyan-500/20 text-cyan-700 dark:text-cyan-400 border border-cyan-300 dark:border-cyan-500/30",PUT:"bg-yellow-100 dark:bg-yellow-500/20 text-yellow-700 dark:text-yellow-400 border border-yellow-300 dark:border-yellow-500/30",PATCH:"bg-orange-100 dark:bg-orange-500/20 text-orange-700 dark:text-orange-400 border border-orange-300 dark:border-orange-500/30",DELETE:"bg-red-100 dark:bg-red-500/20 text-red-700 dark:text-red-400 border border-red-300 dark:border-red-500/30"},Hae="bg-gray-100 dark:bg-slate-500/20 text-gray-700 dark:text-slate-400 border border-gray-300 dark:border-slate-500/30";function qae(e){return Pae[e]||Hae}function Uae(e,t){if(typeof e=="object"&&e!==null){const r=e;return String(r.error||r.detail||r.message||`HTTP ${t}`)}return`HTTP ${t}`}function Lp(e,t){if(!e)return;const r=e.filter(n=>!n.hidden).filter(n=>!n.paramIn||n.paramIn==="body").filter(n=>{const i=t[n.name];return n.required||i!==""&&i!==void 0&&i!==null}).map(n=>[n.name,t[n.name]]);return r.length>0?Object.fromEntries(r):void 0}function D1(e,t){if(!e)return"";const r=e.filter(i=>!i.hidden&&i.paramIn==="query").filter(i=>{const a=t[i.name];return a!==""&&a!==void 0&&a!==null}).map(i=>[i.name,String(t[i.name])]);return r.length===0?"":`?${new URLSearchParams(r).toString()}`}async function Rl(e){const t=await fetch("/api/execute",{method:"POST",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"true"},body:JSON.stringify(e)}),r=await t.json();return{data:r.data,status:r.status??t.status}}async function Vae(e){const t=await fetch("/api/execute-graphql",{method:"POST",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"true"},body:JSON.stringify(e)}),r=await t.json();return t.ok?{data:r,status:t.status}:{data:r,status:t.status,error:r.error||`Request failed with status ${t.status}`}}function Wy(e,t){const r={};return e==null||e.forEach(n=>{const i=n.default??(n.type==="toggle"?!1:"");r[n.name]=typeof i=="string"?hr(i,t):i}),r}function I4(e){return e?e.map(t=>`${t.name}:${t.default??""}`).join("|"):""}function L6({form:e,variables:t}){const[r,n]=N.useState(()=>Wy(e,t)),i=N.useRef(I4(e)),a=N.useMemo(()=>Wy(e,t),[e,t]);N.useEffect(()=>{const u=I4(e);u!==i.current&&(i.current=u,n(Wy(e,t)))},[e,t]);const s=N.useMemo(()=>e?e.some(u=>{const d=String(r[u.name]??""),f=String(a[u.name]??"");return d!==f}):!1,[r,a,e]),o=N.useCallback(u=>{const d=String(r[u]??""),f=String(a[u]??"");return d!==f},[r,a]);return{formValues:r,setFormValues:n,defaultValues:a,hasModifications:s,isFieldModified:o}}function Wae({step:e,formValues:t,variables:r,method:n,fullUrl:i}){const[a,s]=N.useState(!1),[o,u]=N.useState(null),[d,f]=N.useState(null),[p,m]=N.useState(!1),x=N.useCallback(async()=>{s(!0),m(!0),f(null),u(null);try{const v=e.form?Lp(e.form,t):ln(e.body,r),k=await Rl({method:n,url:i,headers:ln(e.headers,r),body:n!=="GET"?v:void 0});if(k.error)throw new Error(k.error);u(k.data)}catch(v){f(v instanceof Error?v.message:"Unknown error")}finally{m(!1)}},[e,t,r,n,i]),b=N.useCallback(()=>{s(!1),u(null),f(null)},[]);return{isTryItMode:a,tryItResponse:o,tryItError:d,isTryItExecuting:p,handleTryIt:x,handleReturnToRecorded:b}}function Yae({pollConfig:e,defaultInterval:t,defaultMaxAttempts:r}){const[n,i]=N.useState(null),a=N.useRef(null),s=N.useCallback(async(u,d)=>{var x;if(!e)throw new Error("No poll configuration");const f=e.interval||t,p=e.max_attempts||r,m=hr(e.endpoint.replace("$jobId",u),{...d,jobId:u});i({isPolling:!0,attempt:0,maxAttempts:p,status:"polling"});for(let b=1;b<=p;b++){if((x=a.current)!=null&&x.signal.aborted)throw new Error("Polling cancelled");i({isPolling:!0,attempt:b,maxAttempts:p,status:"polling"}),await new Promise(w=>setTimeout(w,f));const v=await Rl({method:"GET",url:m});if(v.status>=400)continue;const k=v.data;if(e.success_when&&gd(e.success_when,k))return i(null),k;if(e.failure_when&&gd(e.failure_when,k))throw i(null),new Error(`Job failed: ${JSON.stringify(k)}`)}throw i(null),new Error(`Polling timeout after ${p} attempts`)},[e,t,r]),o=N.useCallback(()=>{var u;(u=a.current)==null||u.abort(),i(null)},[]);return{pollingState:n,pollForResult:s,abortPolling:o,abortControllerRef:a}}const F4=new Map,Gae=300*1e3;async function Xae(e){const t=F4.get(e);if(t&&Date.now()-t.timestamp<Gae)return t.spec;try{const r=await fetch(e);if(!r.ok)return console.warn(`Failed to fetch OpenAPI spec from ${e}: ${r.status}`),null;const n=await r.json();return!n.openapi&&!n.swagger||!n.paths?(console.warn(`Invalid OpenAPI spec from ${e}: missing openapi/swagger or paths`),null):(F4.set(e,{spec:n,timestamp:Date.now()}),n)}catch(r){return console.warn(`Error fetching OpenAPI spec from ${e}: ${r instanceof Error?r.message:"Unknown error"}`),null}}function Qae(e,t){var i;const r=t.match(/^#\/components\/schemas\/(.+)$/);if(r&&((i=e.components)!=null&&i.schemas))return e.components.schemas[r[1]]||null;const n=t.match(/^#\/definitions\/(.+)$/);return n&&e.definitions&&e.definitions[n[1]]||null}function Fo(e,t){if(t.$ref){const r=Qae(e,t.$ref);if(r)return Fo(e,r)}if(t.allOf){const r={type:"object",properties:{},required:[]};for(const n of t.allOf){const i=Fo(e,n);i.properties&&(r.properties={...r.properties,...i.properties}),i.required&&(r.required=[...r.required||[],...i.required])}return r}return t}function R1(e){if(e.enum)return"select";switch(e.type){case"integer":case"number":return"number";case"boolean":return"select";case"array":case"object":return"textarea";case"string":default:return"text"}}function P4(e){var t;if(e.type==="array"){const r=(t=e.items)==null?void 0:t.type;return r==="string"||r==="number"||r==="integer"?2:3}if(e.type==="object"&&e.properties){const r=Object.keys(e.properties).length;return r<=2?2:r<=4?3:4}return 2}function O1(e){if(e.enum)return e.enum.map(t=>({value:String(t),label:String(t)}));if(e.type==="boolean")return[{value:"true",label:"true"},{value:"false",label:"false"}]}function Dp(e,t,r){const n=e.paths[r];if(!n){const i=r.replace(/\$\w+/g,s=>`{${s.slice(1)}}`),a=Object.keys(e.paths).find(s=>{const o=s.replace(/\{[^}]+\}/g,"[^/]+");return new RegExp(`^${o}$`).test(i)});return a?H4(e,e.paths[a],t):[]}return H4(e,n,t)}function H4(e,t,r){var s;const n=t[r.toLowerCase()];if(!n)return[];const i=[];if(n.parameters){for(const o of n.parameters)if(o.in==="query"||o.in==="path"){let u;o.schema?u=Fo(e,o.schema):o.type==="array"&&((s=o.items)!=null&&s.enum)?u={type:"string",enum:o.items.enum,default:o.items.default??o.default}:u={type:o.type||"string",enum:o.enum,default:o.default,format:o.format};const d=R1(u),f={name:o.name,label:o.description||o.name,type:d,required:o.required??!1,paramIn:o.in};u.default!==void 0&&(f.default=u.default);const p=O1(u);p&&(f.options=p),o.description&&(f.placeholder=o.description),d==="textarea"&&(f.rows=P4(u)),i.push(f)}}let a=null;if(n.requestBody){const o=n.requestBody.content["application/json"];o!=null&&o.schema&&(a=o.schema)}if(!a&&n.parameters){const o=n.parameters.find(u=>u.in==="body");o!=null&&o.schema&&(a=o.schema)}if(a){const o=Fo(e,a);if(o.properties){const u=o.required||[];for(const[d,f]of Object.entries(o.properties)){const p=Fo(e,f),m=R1(p),x={name:d,label:p.description||d,type:m,required:u.includes(d),paramIn:"body"};p.default!==void 0&&(x.default=p.default);const b=O1(p);b&&(x.options=b),p.description&&x.label===d&&(x.placeholder=p.description),m==="textarea"&&(x.rows=P4(p)),i.push(x)}}}return i}function Zae(e,t,r){const n=new Map;for(const i of e)n.set(i.name,{...i});if(t)for(const[i,a]of Object.entries(t)){const s=n.get(i);s?s.default=a:n.set(i,{name:i,default:a,type:typeof a=="number"?"number":"text"})}return Array.from(n.values())}function Kae(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,t=>t.toUpperCase())}function q4(e,t,r){const n=e.paths[r];if(!n){const i=r.replace(/\$\w+/g,s=>`{${s.slice(1)}}`),a=Object.keys(e.paths).find(s=>{const o=s.replace(/\{[^}]+\}/g,"[^/]+");return new RegExp(`^${o}$`).test(i)});return a?U4(e,e.paths[a],t):[]}return U4(e,n,t)}function U4(e,t,r){const n=t[r.toLowerCase()];if(!n)return[];const i=n.responses[200]||n.responses[201];if(!(i!=null&&i.content))return[];const a=i.content["application/json"];return a!=null&&a.schema?[{key:"",label:"Response",type:"json",expandedDepth:2}]:[]}const B1=["get","post","put","delete","patch"];function $1(e){const t=[];for(const[r,n]of Object.entries(e.paths))for(const i of B1){const a=n[i];a&&t.push({method:i.toUpperCase(),path:r,summary:a.summary,description:a.description,operationId:a.operationId,tags:a.tags||["Untagged"],deprecated:!1})}return t}function z1(e){const t=$1(e),r=new Map;for(const a of t){const s=a.tags[0]||"Untagged";r.has(s)||r.set(s,[]),r.get(s).push(a)}for(const[,a]of r)a.sort((s,o)=>{const u=s.path.localeCompare(o.path);return u!==0?u:B1.indexOf(s.method.toLowerCase())-B1.indexOf(o.method.toLowerCase())});const n=new Map,i=Array.from(r.keys()).sort((a,s)=>a==="Untagged"?1:s==="Untagged"?-1:a.localeCompare(s));for(const a of i)n.set(a,r.get(a));return n}function D6(e,t){if(!t.trim())return $1(e);const r=t.toLowerCase().trim();return $1(e).filter(i=>{var a,s,o;return i.path.toLowerCase().includes(r)||i.method.toLowerCase().includes(r)||((a=i.summary)==null?void 0:a.toLowerCase().includes(r))||((s=i.description)==null?void 0:s.toLowerCase().includes(r))||((o=i.operationId)==null?void 0:o.toLowerCase().includes(r))||i.tags.some(u=>u.toLowerCase().includes(r))})}function Jae(e,t,r){const n=e.paths[r];return n&&n[t.toLowerCase()]||null}function ese(e,t,r){const n=Jae(e,t,r);if(!(n!=null&&n.parameters))return[];const i=[];for(const a of n.parameters){if(a.in==="body")continue;const s=a.schema||{type:"string"},o=Fo(e,s),u={name:a.name,label:a.description||Kae(a.name),type:R1(o),required:a.required||!1,placeholder:`${a.in} parameter`,paramIn:a.in};o.default!==void 0&&(u.default=o.default);const d=O1(o);d&&(u.options=d),i.push(u)}return i}function tse(e){const t=e.indexOf("?");return t>=0?e.slice(0,t):e}function R6({openapiUrl:e,method:t,path:r,defaults:n,manualForm:i}){const[a,s]=N.useState(i),[o,u]=N.useState(!1),[d,f]=N.useState(null);return N.useEffect(()=>{if(i&&i.length>0){s(i),u(!1),f(null);return}if(!e){s(void 0),u(!1);return}let p=!1;u(!0),f(null);async function m(){try{const x=await Xae(e);if(p)return;if(!x){f("Failed to load OpenAPI spec"),s(void 0),u(!1);return}const b=tse(r),v=Dp(x,t,b);if(v.length===0&&n){const k=Object.entries(n).map(([w,C])=>({name:w,type:typeof C=="number"?"number":typeof C=="boolean"?"toggle":"text",default:typeof C=="string"||typeof C=="number"||typeof C=="boolean"?C:String(C)}));s(k)}else if(v.length>0){const k=n?Zae(v,n):v;s(k)}else s(void 0);u(!1)}catch(x){if(p)return;f(x instanceof Error?x.message:"Error loading OpenAPI spec"),s(void 0),u(!1)}}return m(),()=>{p=!0}},[e,t,r,n,i]),{formFields:a,isLoading:o,error:d}}function rse(e){const t=new Date,r=new Date(e),n=t.getTime()-r.getTime(),i=Math.floor(n/6e4);if(i<0)return r.toLocaleDateString();if(i<1)return"Just now";if(i<60)return`${i} min ago`;const a=Math.floor(i/60);if(a<24)return a===1?"1 hour ago":`${a} hours ago`;const s=Math.floor(a/24);return s===1?"Yesterday":s<7?`${s} days ago`:r.toLocaleDateString(void 0,{month:"short",day:"numeric",year:r.getFullYear()!==t.getFullYear()?"numeric":void 0})}function nse(e,t=16){return e.length<=t?e:`${e.slice(0,10)}...${e.slice(-8)}`}function ise(e,t,r,n){const i=r[t];if(!i)return null;let a;if(n&&i[n])a=i[n];else if(i.default)a=i.default;else{const s=Object.keys(i);s.length>0&&(a=i[s[0]])}return a?a.replace("{value}",e):null}const ase=({expanded:e})=>h.jsx("svg",{className:`w-3 h-3 mr-1 transition-transform ${e?"rotate-90":""}`,fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})});function V4({expanded:e,onToggle:t,label:r}){return h.jsxs("button",{onClick:t,className:"inline-flex items-center text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300 focus:outline-none",children:[h.jsx(ase,{expanded:e}),h.jsx("span",{className:"text-gray-500 dark:text-slate-400",children:r})]})}function I1({data:e,depth:t=0,expandedDepth:r=2}){const[n,i]=N.useState(t<r);if(e===null)return h.jsx("span",{className:"text-gray-400 dark:text-slate-500 italic",children:"null"});if(e===void 0)return h.jsx("span",{className:"text-gray-400 dark:text-slate-500 italic",children:"undefined"});if(typeof e=="boolean")return h.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:String(e)});if(typeof e=="number")return h.jsx("span",{className:"text-cyan-600 dark:text-cyan-400",children:e});if(typeof e=="string")return h.jsxs("span",{className:"text-green-600 dark:text-green-400",children:['"',e,'"']});if(Array.isArray(e))return e.length===0?h.jsx("span",{className:"text-gray-500 dark:text-slate-400",children:"[]"}):h.jsxs("span",{children:[h.jsx(V4,{expanded:n,onToggle:()=>i(!n),label:`[${e.length}]`}),n&&h.jsx("div",{className:"ml-4 pl-2 border-l-2 border-gray-200 dark:border-slate-600",children:e.map((a,s)=>h.jsxs("div",{className:"py-0.5",children:[h.jsxs("span",{className:"text-gray-400 dark:text-slate-500 mr-2",children:[s,":"]}),h.jsx(I1,{data:a,depth:t+1,expandedDepth:r})]},s))})]});if(typeof e=="object"){const a=Object.entries(e);return a.length===0?h.jsx("span",{className:"text-gray-500 dark:text-slate-400",children:"{}"}):h.jsxs("span",{children:[h.jsx(V4,{expanded:n,onToggle:()=>i(!n),label:`{${a.length}}`}),n&&h.jsx("div",{className:"ml-4 pl-2 border-l-2 border-gray-200 dark:border-slate-600",children:a.map(([s,o])=>h.jsxs("div",{className:"py-0.5",children:[h.jsxs("span",{className:"text-blue-600 dark:text-blue-400 mr-1",children:['"',s,'"']}),h.jsx("span",{className:"text-gray-400 dark:text-slate-500 mr-1",children:":"}),h.jsx(I1,{data:o,depth:t+1,expandedDepth:r})]},s))})]})}return h.jsx("span",{className:"text-gray-700 dark:text-slate-300",children:String(e)})}function W4({text:e}){const[t,r]=N.useState(!1),n=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)}catch{}};return h.jsx("button",{onClick:n,className:"ml-2 p-1 rounded hover:bg-gray-200 dark:hover:bg-slate-600 transition-colors",title:"Copy to clipboard",children:t?h.jsx("svg",{className:"w-3.5 h-3.5 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):h.jsx("svg",{className:"w-3.5 h-3.5 text-gray-400 dark:text-slate-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})})}function xs({value:e,type:t,link:r,linkKey:n,expandedDepth:i,columns:a}){var d,f,p,m,x;const{state:s}=rr(),o=String(e??""),u=((p=(f=(d=s.config)==null?void 0:d.settings)==null?void 0:f.effects)==null?void 0:p.counters)??!0;if(typeof e=="number"&&!t)return h.jsx("span",{className:"font-mono text-sm text-gray-700 dark:text-slate-300",children:u?h.jsx(av,{end:e,decimals:Number.isInteger(e)?0:2,duration:1}):e});if(t==="ref"){const b=nse(o);let v;if(r){const k=((x=(m=s.config)==null?void 0:m.settings)==null?void 0:x.links)||{},w=ise(o,r,k,n);w?v=w:r.startsWith("http")&&(v=`${r}${o}`)}return v?h.jsxs("span",{className:"inline-flex items-center",children:[h.jsx("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-sm text-cyan-600 dark:text-cyan-400 hover:text-cyan-500 dark:hover:text-cyan-300 hover:underline transition-colors",children:b}),h.jsx(W4,{text:o})]}):h.jsxs("span",{className:"inline-flex items-center",children:[h.jsx("code",{className:"font-mono text-sm bg-gray-200 dark:bg-slate-700/50 text-purple-600 dark:text-purple-300 px-1.5 py-0.5 rounded border border-gray-300 dark:border-slate-600/50",children:b}),h.jsx(W4,{text:o})]})}if(t==="currency")return h.jsx("span",{className:"font-semibold text-green-600 dark:text-green-400",children:u?h.jsx(pE,{amount:Number(e),duration:1.5}):`$${Number(e).toLocaleString("en-US",{minimumFractionDigits:2})}`});if(t==="link")return h.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300 hover:underline transition-colors inline-flex items-center gap-1",children:[o.length>50?`${o.slice(0,50)}...`:o,h.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]});if(t==="code")return h.jsx("pre",{className:"font-mono text-sm bg-gray-100 dark:bg-slate-800 text-gray-800 dark:text-slate-200 p-3 rounded-lg border border-gray-200 dark:border-slate-700 overflow-x-auto",children:h.jsx("code",{children:o})});if(t==="table"&&Array.isArray(e)&&a)return h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"min-w-full text-sm border border-gray-200 dark:border-slate-700 rounded-lg overflow-hidden",children:[h.jsx("thead",{className:"bg-gray-100 dark:bg-slate-800",children:h.jsx("tr",{children:a.map(b=>h.jsx("th",{className:"px-3 py-2 text-left font-medium text-gray-700 dark:text-slate-300 border-b border-gray-200 dark:border-slate-700",children:b.label},b.key))})}),h.jsx("tbody",{children:e.map((b,v)=>h.jsx("tr",{className:v%2===0?"bg-white dark:bg-slate-900":"bg-gray-50 dark:bg-slate-800/50",children:a.map(k=>h.jsx("td",{className:"px-3 py-2 text-gray-700 dark:text-slate-300 border-b border-gray-200 dark:border-slate-700",children:typeof b=="object"&&b!==null?String(b[k.key]??""):""},k.key))},v))})]})});if(t==="json")return h.jsx("div",{className:"font-mono text-sm bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg p-3 max-h-80 overflow-auto",children:h.jsx(I1,{data:e,expandedDepth:i??2})});if(t==="mono")return h.jsx("code",{className:"font-mono text-sm text-gray-600 dark:text-slate-400",children:o});if(t==="relative_time")try{return h.jsx("span",{className:"text-sm text-gray-500 dark:text-slate-400",children:rse(o)})}catch{return h.jsx("span",{className:"text-sm text-gray-500 dark:text-slate-400",children:o})}return h.jsx("span",{className:"font-mono text-sm text-gray-700 dark:text-slate-300",children:o})}function sse(e,t,r,n){const i=[`curl -X ${e.toUpperCase()}`];if(i.push(`'${t0(t)}'`),r)for(const[a,s]of Object.entries(r))i.push(`-H '${t0(a)}: ${t0(s)}'`);if(n&&!(r!=null&&r["Content-Type"])&&!(r!=null&&r["content-type"])&&i.push("-H 'Content-Type: application/json'"),n){const a=typeof n=="string"?n:JSON.stringify(n);i.push(`-d '${t0(a)}'`)}return i.length<=3?i.join(" "):i.join(` \\
405
- `)}function t0(e){return e.replace(/'/g,"'\\''")}function Rp({title:e,summary:t,children:r,defaultExpanded:n=!0}){const[i,a]=N.useState(n);return h.jsxs("div",{className:"overflow-hidden",children:[h.jsxs("button",{onClick:()=>a(!i),className:"w-full flex items-center justify-between py-2 text-left group hover:bg-gray-100/50 dark:hover:bg-slate-800/30 rounded-lg px-2 -mx-2 transition-colors",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("svg",{className:`w-4 h-4 text-gray-500 dark:text-slate-400 transition-transform duration-200 ${i?"rotate-90":""}`,fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),h.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-slate-300",children:e})]}),t&&!i&&h.jsx("span",{className:"text-xs text-gray-500 dark:text-slate-400 truncate max-w-xs bg-gray-100 dark:bg-slate-700/50 px-2 py-0.5 rounded",children:t})]}),h.jsx("div",{className:`transition-all duration-300 ease-in-out overflow-hidden ${i?"max-h-[800px] opacity-100 mt-2":"max-h-0 opacity-0"}`,children:r})]})}function lse({method:e,url:t,headers:r,body:n,defaultExpanded:i=!1}){const[a,s]=N.useState(!1),o=sse(e,t,r,n),u=async()=>{try{await navigator.clipboard.writeText(o),s(!0),setTimeout(()=>s(!1),2e3)}catch(d){console.error("Failed to copy:",d)}};return h.jsx(Rp,{title:"cURL Command",defaultExpanded:i,children:h.jsxs("div",{className:"relative",children:[h.jsx("pre",{className:"bg-slate-900 text-slate-100 p-4 rounded-lg text-xs font-mono overflow-x-auto",children:h.jsx("code",{className:"whitespace-pre-wrap break-all",children:ose(o)})}),h.jsx("button",{onClick:u,className:`absolute top-2 right-2 px-2 py-1 rounded text-xs font-medium transition-all duration-200 ${a?"bg-green-600 text-white":"bg-slate-700 text-slate-300 hover:bg-slate-600"}`,children:a?"Copied!":"Copy"})]})})}function ose(e){const t=e.split(/(\s+|'[^']*')/g).filter(Boolean);return h.jsx(h.Fragment,{children:t.map((r,n)=>r==="curl"?h.jsx("span",{className:"text-cyan-400",children:r},n):r.match(/^-[A-Za-z]$/)?h.jsx("span",{className:"text-yellow-400",children:r},n):r.match(/^(GET|POST|PUT|PATCH|DELETE)$/)?h.jsx("span",{className:"text-green-400",children:r},n):r.startsWith("'")&&r.endsWith("'")?h.jsx("span",{className:"text-orange-300",children:r},n):r==="\\"?h.jsx("span",{className:"text-slate-500",children:r},n):h.jsx("span",{children:r},n))})}function cse({method:e,url:t,body:r,headers:n,showCurl:i=!1}){let a;try{a=r?JSON.parse(r):void 0}catch{a=r}return h.jsxs("div",{className:"border-b border-gray-200 dark:border-slate-700/50 p-4 bg-gray-50/50 dark:bg-slate-900/30",children:[h.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-slate-300 mb-2",children:"Request"}),h.jsx("pre",{className:"bg-gray-100 dark:bg-slate-950 text-gray-800 dark:text-slate-100 p-3 rounded-lg text-sm overflow-x-auto border border-gray-200 dark:border-slate-700/50",children:h.jsxs("code",{children:[e," ",t,e!=="GET"&&r&&h.jsxs(h.Fragment,{children:[`
406
-
407
- `,r]})]})}),i&&h.jsx("div",{className:"mt-3",children:h.jsx(lse,{method:e,url:t,headers:n,body:a})})]})}function use({pollingState:e}){return h.jsxs("div",{className:"border-b border-gray-200 dark:border-slate-700/50 p-4 bg-gradient-to-br from-gray-100 via-[rgba(var(--color-primary-rgb),0.1)] to-gray-100 dark:from-slate-900 dark:via-[rgba(var(--color-primary-rgb),0.1)] dark:to-slate-900",children:[h.jsx(p$,{status:"confirming"}),h.jsx("div",{className:"mt-4",children:h.jsx(f$,{stage:"confirming"})}),h.jsxs("div",{className:"mt-4 flex items-center justify-center gap-3",children:[h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"w-12 h-12 rounded-full bg-[rgba(var(--color-accent-rgb),0.2)] flex items-center justify-center border border-[rgba(var(--color-accent-rgb),0.3)]",children:h.jsx(kd,{color:"blue",size:"lg"})}),h.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-[rgba(var(--color-accent-rgb),0.3)] animate-ping opacity-20"})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-theme-accent font-medium",children:h.jsx(I0,{variant:"primary",children:"Waiting for confirmation..."})}),h.jsxs("p",{className:"text-gray-500 dark:text-slate-400 text-sm",children:["Attempt ",e.attempt," of ",e.maxAttempts]})]})]}),h.jsx("div",{className:"mt-4 bg-gray-300 dark:bg-slate-700 rounded-full h-2 overflow-hidden",children:h.jsx("div",{className:"bg-gradient-to-r from-theme-primary via-theme-accent to-theme-primary h-full transition-all duration-300",style:{width:`${e.attempt/e.maxAttempts*100}%`}})})]})}function dse({method:e,endpoint:t,title:r,description:n,status:i,pollingState:a,mode:s="view",onDelete:o}){const u=i==="executing",d=s==="edit";return h.jsxs("div",{className:"border-b border-[rgba(var(--color-primary-rgb),0.1)] dark:border-slate-700/50 p-4 bg-[rgba(var(--color-primary-rgb),0.03)] dark:bg-slate-900/50",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("span",{className:`px-2 py-1 rounded text-sm font-bold ${qae(e)}`,children:e}),h.jsxs("div",{className:"min-w-0",children:[r&&h.jsx("div",{className:"font-medium text-gray-900 dark:text-slate-100 truncate",children:r}),h.jsx("code",{className:`text-gray-700 dark:text-slate-300 font-mono ${r?"text-xs":"text-sm"}`,children:i==="complete"?h.jsx(I0,{variant:"success",children:t}):u?h.jsx(I0,{variant:"primary",children:t}):t})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[i==="complete"&&h.jsxs("span",{className:"inline-flex items-center gap-2 text-green-600 dark:text-green-400 text-sm font-medium",children:[h.jsx($i,{size:20,animated:!0}),"Complete"]}),u&&h.jsxs("span",{className:"inline-flex items-center gap-2 text-cyan-600 dark:text-cyan-400 text-sm font-medium",children:[h.jsx(kd,{color:"blue",size:"sm"}),a?"Confirming":"Processing"]}),d&&o&&h.jsx("button",{onClick:o,className:"p-1.5 text-gray-400 hover:text-red-500 dark:text-slate-500 dark:hover:text-red-400 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),n&&h.jsx("p",{className:"text-gray-500 dark:text-slate-400 text-sm mt-2",children:n})]})}function O6({field:e,value:t,onChange:r,isModified:n,disabled:i}){var a;return h.jsxs("div",{children:[h.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-gray-600 dark:text-slate-400 mb-1",children:[h.jsx("span",{className:"truncate",children:e.label||e.name}),e.required&&h.jsx("span",{className:"text-red-500 dark:text-red-400 flex-shrink-0",children:"*"}),n&&h.jsx("span",{className:"flex-shrink-0 inline-flex items-center px-1 py-0.5 rounded text-[10px] font-medium bg-amber-100 dark:bg-amber-500/20 text-amber-700 dark:text-amber-400 border border-amber-300 dark:border-amber-500/30",children:"modified"})]}),e.type==="textarea"?h.jsx("textarea",{value:String(t??""),onChange:s=>r(s.target.value),disabled:e.readonly||i,placeholder:e.placeholder,rows:e.rows??2,className:"w-full px-3 py-1.5 bg-white dark:bg-slate-700/50 border border-gray-300 dark:border-slate-600 rounded-lg text-sm font-mono text-gray-900 dark:text-slate-200 placeholder-gray-400 dark:placeholder-slate-500 disabled:bg-gray-100 dark:disabled:bg-slate-800 disabled:text-gray-500 dark:disabled:text-slate-500 focus:outline-none focus:ring-2 focus:ring-theme-primary/50 focus:border-theme-primary resize-y"}):e.type==="select"?h.jsx("select",{value:String(t??""),onChange:s=>r(s.target.value),disabled:e.readonly||i,className:"w-full px-3 py-1.5 bg-white dark:bg-slate-700/50 border border-gray-300 dark:border-slate-600 rounded-lg text-sm text-gray-900 dark:text-slate-200 disabled:bg-gray-100 dark:disabled:bg-slate-800 disabled:text-gray-500 dark:disabled:text-slate-500 focus:outline-none focus:ring-2 focus:ring-theme-primary/50 focus:border-theme-primary",children:(a=e.options)==null?void 0:a.map(s=>h.jsx("option",{value:s.value,children:s.label},s.value))}):e.type==="toggle"?h.jsx("button",{type:"button",onClick:()=>r(!t),disabled:e.readonly||i,className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-theme-primary/50 focus:ring-offset-2 dark:focus:ring-offset-slate-900 disabled:opacity-50 disabled:cursor-not-allowed ${t?"bg-theme-primary":"bg-gray-200 dark:bg-slate-600"}`,children:h.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${t?"translate-x-5":"translate-x-0"}`})}):e.type==="slider"?h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"range",min:e.min??0,max:e.max??100,step:e.step??1,value:Number(t)||e.min||0,onChange:s=>r(Number(s.target.value)),disabled:e.readonly||i,className:"flex-1 h-2 bg-gray-200 dark:bg-slate-600 rounded-lg appearance-none cursor-pointer accent-theme-primary disabled:opacity-50 disabled:cursor-not-allowed"}),h.jsx("span",{className:"min-w-[3rem] text-right text-sm font-mono text-gray-700 dark:text-slate-300 bg-gray-100 dark:bg-slate-700 px-2 py-1 rounded",children:t??e.min??0})]}):h.jsx("input",{type:e.type==="number"?"number":"text",value:String(t??""),onChange:s=>r(e.type==="number"?Number(s.target.value):s.target.value),disabled:e.readonly||i,placeholder:e.placeholder,className:"w-full px-3 py-1.5 bg-white dark:bg-slate-700/50 border border-gray-300 dark:border-slate-600 rounded-lg text-sm font-mono text-gray-900 dark:text-slate-200 placeholder-gray-400 dark:placeholder-slate-500 disabled:bg-gray-100 dark:disabled:bg-slate-800 disabled:text-gray-500 dark:disabled:text-slate-500 focus:outline-none focus:ring-2 focus:ring-theme-primary/50 focus:border-theme-primary"})]})}function Yy({title:e,fields:t,values:r,onChange:n,isFieldModified:i,disabled:a}){return t.length===0?null:h.jsxs("div",{className:"space-y-2",children:[h.jsx("h4",{className:"text-[10px] font-medium text-gray-500 dark:text-slate-500 uppercase tracking-wider",children:e}),h.jsx("div",{className:"grid gap-x-3 gap-y-2 md:grid-cols-2",children:t.map(s=>h.jsx(O6,{field:s,value:r[s.name],onChange:o=>n(s.name,o),isModified:i(s.name),disabled:a},s.name))})]})}function B6({fields:e,values:t,onChange:r,isFieldModified:n,disabled:i}){const a=e.filter(f=>!f.hidden),{pathFields:s,queryFields:o,bodyFields:u}=N.useMemo(()=>{const f=[],p=[],m=[];for(const x of a)x.paramIn==="path"?f.push(x):x.paramIn==="query"?p.push(x):m.push(x);return{pathFields:f,queryFields:p,bodyFields:m}},[a]);if(a.length===0)return null;const d=[s,o,u].filter(f=>f.length>0).length>1;return h.jsxs("div",{className:"border-b border-gray-200 dark:border-slate-700/50 p-3 bg-gray-50/50 dark:bg-slate-900/30",children:[h.jsx("h3",{className:"text-xs font-semibold text-gray-700 dark:text-slate-300 mb-2 uppercase tracking-wide",children:"Request Parameters"}),d?h.jsxs("div",{className:"space-y-3",children:[h.jsx(Yy,{title:"Path Parameters",fields:s,values:t,onChange:r,isFieldModified:n,disabled:i}),h.jsx(Yy,{title:"Query Parameters",fields:o,values:t,onChange:r,isFieldModified:n,disabled:i}),h.jsx(Yy,{title:"Request Body",fields:u,values:t,onChange:r,isFieldModified:n,disabled:i})]}):h.jsx("div",{className:"grid gap-x-3 gap-y-2 md:grid-cols-2",children:a.map(f=>h.jsx(O6,{field:f,value:t[f.name],onChange:p=>r(f.name,p),isModified:n(f.name),disabled:i},f.name))})]})}function $6({error:e,onRetry:t,onSkip:r}){return h.jsx("div",{className:"border-t border-red-300 dark:border-red-500/30 bg-red-50 dark:bg-red-500/10 p-4",children:h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[h.jsx("svg",{className:"w-5 h-5 text-red-500 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),h.jsx("span",{className:"font-medium text-red-700 dark:text-red-400",children:Fae(e)})]}),h.jsx("div",{className:"text-red-600 dark:text-red-400 text-sm max-h-32 overflow-y-auto whitespace-pre-wrap break-words",children:e})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("button",{onClick:t,className:"px-3 py-1.5 bg-red-100 dark:bg-red-500/20 text-red-700 dark:text-red-400 rounded-lg text-sm font-medium hover:bg-red-200 dark:hover:bg-red-500/30 flex items-center gap-1.5 border border-red-300 dark:border-red-500/30",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Retry"]}),r&&h.jsxs("button",{onClick:r,className:"px-3 py-1.5 bg-gray-100 dark:bg-slate-700 text-gray-600 dark:text-slate-400 rounded-lg text-sm font-medium hover:bg-gray-200 dark:hover:bg-slate-600 flex items-center gap-1.5 border border-gray-300 dark:border-slate-600",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})}),"Skip"]})]})]})})}function hse({response:e,error:t,onReturn:r}){return h.jsxs("div",{className:"border-t border-amber-300 dark:border-amber-500/30 bg-amber-50 dark:bg-amber-900/20 p-4",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 text-amber-700 dark:text-amber-300",children:[h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"})}),h.jsx("span",{className:"text-sm font-medium",children:"Live Response (not from recording)"})]}),h.jsxs("button",{onClick:r,className:"text-sm text-amber-600 dark:text-amber-400 hover:text-amber-700 dark:hover:text-amber-300 hover:underline transition-colors flex items-center gap-1",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),"Return to recorded"]})]}),t&&h.jsx("div",{className:"mb-3 p-3 bg-red-100 dark:bg-red-500/20 rounded-lg border border-red-300 dark:border-red-500/30",children:h.jsx("p",{className:"text-red-700 dark:text-red-400 text-sm",children:t})}),e!=null&&h.jsxs(h.Fragment,{children:[h.jsx("h3",{className:"text-sm font-semibold text-amber-700 dark:text-amber-300 mb-2",children:"Response"}),h.jsx("pre",{className:"bg-white dark:bg-slate-950 text-gray-800 dark:text-slate-100 p-3 rounded-lg text-sm overflow-x-auto max-h-64 border border-amber-300 dark:border-amber-500/30",children:h.jsx("code",{children:JSON.stringify(e,null,2)})})]})]})}function Op(e,t){if(!t)return!1;const r=t.toLowerCase();return e==null?"null".includes(r)||"undefined".includes(r):typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e).toLowerCase().includes(r):Array.isArray(e)?e.some(n=>Op(n,t)):typeof e=="object"?Object.entries(e).some(([n,i])=>n.toLowerCase().includes(r)||Op(i,t)):!1}function fse(e,t){return t?e.toLowerCase().includes(t.toLowerCase()):!1}function r0(e,t){return!t||e==null||typeof e=="object"?!1:String(e).toLowerCase().includes(t.toLowerCase())}function F1({data:e,path:t,depth:r,expandedPaths:n,toggleExpand:i,searchTerm:a,onCopyPath:s,onCopyValue:o}){const[u,d]=N.useState(null),f=n.has(t),p=x=>{x.stopPropagation(),s(t)},m=x=>{x.stopPropagation(),o(e)};if(e===null){const x=r0(null,a);return h.jsx("span",{className:`italic cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-600 rounded px-0.5 ${x?"bg-yellow-200 dark:bg-yellow-800":"text-gray-400 dark:text-slate-500"}`,onClick:m,title:"Click to copy value",children:"null"})}if(e===void 0)return h.jsx("span",{className:"text-gray-400 dark:text-slate-500 italic",children:"undefined"});if(typeof e=="boolean"){const x=r0(e,a);return h.jsx("span",{className:`cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-600 rounded px-0.5 ${x?"bg-yellow-200 dark:bg-yellow-800":"text-purple-600 dark:text-purple-400"}`,onClick:m,title:"Click to copy value",children:String(e)})}if(typeof e=="number"){const x=r0(e,a);return h.jsx("span",{className:`cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-600 rounded px-0.5 ${x?"bg-yellow-200 dark:bg-yellow-800":"text-cyan-600 dark:text-cyan-400"}`,onClick:m,title:"Click to copy value",children:e})}if(typeof e=="string"){const x=r0(e,a),b=e.length>100?`${e.slice(0,100)}...`:e;return h.jsxs("span",{className:`cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-600 rounded px-0.5 ${x?"bg-yellow-200 dark:bg-yellow-800":"text-green-600 dark:text-green-400"}`,onClick:m,title:e.length>100?`${e}
408
-
409
- Click to copy value`:"Click to copy value",children:['"',b,'"']})}if(Array.isArray(e)){if(e.length===0)return h.jsx("span",{className:"text-gray-500 dark:text-slate-400",children:"[]"});const x=a&&Op(e,a);return h.jsxs("span",{onMouseEnter:()=>d(t),onMouseLeave:()=>d(null),children:[h.jsxs("button",{onClick:()=>i(t),className:"inline-flex items-center text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300 focus:outline-none",children:[h.jsx("svg",{className:`w-3 h-3 mr-1 transition-transform ${f?"rotate-90":""}`,fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),h.jsxs("span",{className:x&&!f?"text-yellow-600 dark:text-yellow-400":"",children:["[",e.length,"]"]})]}),u===t&&h.jsx("button",{onClick:p,className:"ml-1 text-xs text-gray-400 hover:text-blue-500 dark:hover:text-blue-400",title:"Copy path",children:t||"root"}),f&&h.jsx("div",{className:"ml-4 pl-2 border-l-2 border-gray-200 dark:border-slate-600",children:e.map((b,v)=>{const k=t?`${t}[${v}]`:`[${v}]`;return h.jsxs("div",{className:"py-0.5",children:[h.jsxs("span",{className:"text-gray-400 dark:text-slate-500 mr-2",children:[v,":"]}),h.jsx(F1,{data:b,path:k,depth:r+1,expandedPaths:n,toggleExpand:i,searchTerm:a,onCopyPath:s,onCopyValue:o})]},v)})})]})}if(typeof e=="object"){const x=Object.entries(e);if(x.length===0)return h.jsx("span",{className:"text-gray-500 dark:text-slate-400",children:"{}"});const b=a&&Op(e,a);return h.jsxs("span",{onMouseEnter:()=>d(t),onMouseLeave:()=>d(null),children:[h.jsxs("button",{onClick:()=>i(t),className:"inline-flex items-center text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300 focus:outline-none",children:[h.jsx("svg",{className:`w-3 h-3 mr-1 transition-transform ${f?"rotate-90":""}`,fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),h.jsx("span",{className:b&&!f?"text-yellow-600 dark:text-yellow-400":"",children:`{${x.length}}`})]}),u===t&&h.jsx("button",{onClick:p,className:"ml-1 text-xs text-gray-400 hover:text-blue-500 dark:hover:text-blue-400",title:"Copy path",children:t||"root"}),f&&h.jsx("div",{className:"ml-4 pl-2 border-l-2 border-gray-200 dark:border-slate-600",children:x.map(([v,k])=>{const w=t?`${t}.${v}`:v,C=fse(v,a);return h.jsxs("div",{className:"py-0.5",children:[h.jsxs("span",{className:`mr-1 cursor-pointer hover:underline ${C?"bg-yellow-200 dark:bg-yellow-800 text-blue-700 dark:text-blue-300":"text-blue-600 dark:text-blue-400"}`,onClick:T=>{T.stopPropagation(),s(w)},title:`Copy path: ${w}`,children:['"',v,'"']}),h.jsx("span",{className:"text-gray-400 dark:text-slate-500 mr-1",children:":"}),h.jsx(F1,{data:k,path:w,depth:r+1,expandedPaths:n,toggleExpand:i,searchTerm:a,onCopyPath:s,onCopyValue:o})]},v)})})]})}return h.jsx("span",{className:"text-gray-700 dark:text-slate-300",children:String(e)})}function P1(e,t,r="",n=0){const i=[];return n>=t||(Array.isArray(e)?(i.push(r),e.forEach((a,s)=>{const o=r?`${r}[${s}]`:`[${s}]`;i.push(...P1(a,t,o,n+1))})):e!==null&&typeof e=="object"&&(i.push(r),Object.entries(e).forEach(([a,s])=>{const o=r?`${r}.${a}`:a;i.push(...P1(s,t,o,n+1))}))),i}function H1(e,t=""){const r=[];return Array.isArray(e)&&e.length>0?(r.push(t),e.forEach((n,i)=>{const a=t?`${t}[${i}]`:`[${i}]`;r.push(...H1(n,a))})):e!==null&&typeof e=="object"&&Object.keys(e).length>0&&(r.push(t),Object.entries(e).forEach(([n,i])=>{const a=t?`${t}.${n}`:n;r.push(...H1(i,a))})),r}function pse({data:e,defaultExpandedDepth:t=2,maxHeight:r="400px",className:n}){const[i,a]=N.useState(""),[s,o]=N.useState(null),u=N.useMemo(()=>new Set(P1(e,t)),[e,t]),[d,f]=N.useState(u),p=N.useCallback(w=>{f(C=>{const T=new Set(C);return T.has(w)?T.delete(w):T.add(w),T})},[]),m=N.useCallback(()=>{const w=H1(e);f(new Set(w))},[e]),x=N.useCallback(()=>{f(new Set)},[]),b=N.useCallback(async()=>{try{await navigator.clipboard.writeText(JSON.stringify(e,null,2)),o("all"),setTimeout(()=>o(null),2e3)}catch{}},[e]),v=N.useCallback(async w=>{try{await navigator.clipboard.writeText(w||"root"),o(w||"root"),setTimeout(()=>o(null),2e3)}catch{}},[]),k=N.useCallback(async w=>{try{const C=typeof w=="string"?w:JSON.stringify(w,null,2);await navigator.clipboard.writeText(C),o("value"),setTimeout(()=>o(null),2e3)}catch{}},[]);return h.jsxs("div",{className:`border border-gray-200 dark:border-slate-700 rounded-lg overflow-hidden ${n||""}`,children:[h.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-gray-100 dark:bg-slate-800 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"relative flex-1 max-w-xs",children:[h.jsx("input",{type:"text",value:i,onChange:w=>a(w.target.value),placeholder:"Search keys or values...",className:"w-full pl-7 pr-2 py-1 text-xs bg-white dark:bg-slate-900 border border-gray-300 dark:border-slate-600 rounded focus:outline-none focus:ring-1 focus:ring-blue-500 dark:focus:ring-blue-400"}),h.jsx("svg",{className:"absolute left-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),i&&h.jsx("button",{onClick:()=>a(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:h.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{onClick:m,className:"px-2 py-1 text-xs text-gray-600 dark:text-slate-400 hover:bg-gray-200 dark:hover:bg-slate-700 rounded transition-colors",title:"Expand all",children:h.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})})}),h.jsx("button",{onClick:x,className:"px-2 py-1 text-xs text-gray-600 dark:text-slate-400 hover:bg-gray-200 dark:hover:bg-slate-700 rounded transition-colors",title:"Collapse all",children:h.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"})})}),h.jsx("button",{onClick:b,className:"px-2 py-1 text-xs text-gray-600 dark:text-slate-400 hover:bg-gray-200 dark:hover:bg-slate-700 rounded transition-colors flex items-center gap-1",title:"Copy all",children:s==="all"?h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-3.5 h-3.5 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),h.jsx("span",{className:"text-green-500",children:"Copied!"})]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})}),h.jsx("span",{children:"Copy"})]})})]})]}),h.jsx("div",{className:`p-3 bg-gray-50 dark:bg-slate-900/50 font-mono text-sm overflow-auto ${n||""}`,style:{maxHeight:r},children:h.jsx(F1,{data:e,path:"",depth:0,expandedPaths:d,toggleExpand:p,searchTerm:i,onCopyPath:v,onCopyValue:k})}),s&&s!=="all"&&h.jsxs("div",{className:"px-3 py-1 bg-green-50 dark:bg-green-900/20 border-t border-gray-200 dark:border-slate-700 text-xs text-green-600 dark:text-green-400",children:["Copied: ",s==="value"?"value":s]})]})}function gse(e){if(e==null)return"";const r=JSON.stringify(e).length,n=r>1e3?`${(r/1024).toFixed(1)}KB`:`${r}B`;return typeof e=="object"&&e!==null?Array.isArray(e)?`${e.length} items, ${n}`:`${Object.keys(e).length} keys, ${n}`:n}function Ng({response:e,results:t,hideResults:r,hideResultsOnDesktop:n}){const i=gse(e);return h.jsxs("div",{className:"border-t border-gray-200 dark:border-slate-700/50 p-4 bg-gray-50/50 dark:bg-slate-900/30 space-y-3",children:[h.jsx(Rp,{title:"Response",summary:i,defaultExpanded:!0,children:h.jsx(pse,{data:e,defaultExpandedDepth:2,maxHeight:"320px",className:"xl:!max-h-[600px]"})}),!r&&t&&t.length>0&&h.jsx("div",{className:n?"xl:hidden":"",children:h.jsx(Rp,{title:"Results",summary:`${t.length} field${t.length>1?"s":""}`,defaultExpanded:!0,children:h.jsx("div",{className:"bg-gray-100 dark:bg-slate-800/50 rounded-lg p-4 space-y-3 border border-gray-200 dark:border-slate-700/50",children:t.map(a=>{const s=qr(e,a.key);return a.type==="table"||a.type==="json"||a.type==="code"?h.jsxs("div",{className:"space-y-1",children:[h.jsx("span",{className:"text-gray-500 dark:text-slate-400 text-sm font-medium",children:a.label}),h.jsx(xs,{value:s,type:a.type,link:a.link,expandedDepth:a.expandedDepth,columns:a.columns})]},a.key||a.label):h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"text-gray-500 dark:text-slate-400 text-sm",children:[a.label,":"]}),h.jsx(xs,{value:s,type:a.type,link:a.link,expandedDepth:a.expandedDepth,columns:a.columns})]},a.key||a.label)})})})})]})}function Y4({response:e,results:t}){return!t||t.length===0?null:h.jsx("div",{className:"border-t border-gray-200 dark:border-slate-700/50 p-4 bg-gray-50/50 dark:bg-slate-900/30",children:h.jsx(Rp,{title:"Results",summary:`${t.length} field${t.length>1?"s":""}`,defaultExpanded:!0,children:h.jsx("div",{className:"bg-gray-100 dark:bg-slate-800/50 rounded-lg p-4 space-y-3 border border-gray-200 dark:border-slate-700/50",children:t.map(r=>{const n=qr(e,r.key);return r.type==="table"||r.type==="json"||r.type==="code"?h.jsxs("div",{className:"space-y-1",children:[h.jsx("span",{className:"text-gray-500 dark:text-slate-400 text-sm font-medium",children:r.label}),h.jsx(xs,{value:n,type:r.type,link:r.link,linkKey:r.link_key,expandedDepth:r.expandedDepth,columns:r.columns})]},r.key||r.label):h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"text-gray-500 dark:text-slate-400 text-sm",children:[r.label,":"]}),h.jsx(xs,{value:n,type:r.type,link:r.link,linkKey:r.link_key,expandedDepth:r.expandedDepth,columns:r.columns})]},r.key||r.label)})})})})}function mse({onExecute:e,onTryIt:t,onReset:r,status:n,isExecuting:i,isTryItExecuting:a,pollingState:s,showTryIt:o}){return h.jsxs("div",{className:"p-4 flex items-center gap-4 bg-[rgba(var(--color-primary-rgb),0.03)] dark:bg-slate-900/30 flex-wrap border-t border-[rgba(var(--color-primary-rgb),0.08)] dark:border-transparent",children:[h.jsx("button",{onClick:e,disabled:i||a,className:"px-6 py-2.5 bg-gradient-to-r from-theme-primary to-theme-accent text-white rounded-lg font-medium hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2 shadow-lg shadow-[rgba(var(--color-primary-rgb),0.25)] transition-all duration-300 hover:shadow-xl hover:shadow-[rgba(var(--color-primary-rgb),0.4)] border border-[rgba(var(--color-primary-rgb),0.3)]",children:i?h.jsxs(h.Fragment,{children:[h.jsx(kd,{color:"purple",size:"sm"}),s?"Confirming...":"Executing..."]}):h.jsxs(h.Fragment,{children:[h.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),"Execute"]})}),o&&h.jsx("button",{onClick:t,disabled:a,className:"px-4 py-2.5 bg-gradient-to-r from-amber-500 to-orange-500 text-white rounded-lg font-medium hover:from-amber-400 hover:to-orange-400 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2 shadow-lg shadow-amber-500/25 transition-all duration-300 hover:shadow-xl hover:shadow-amber-500/40 border border-amber-500/30",children:a?h.jsxs(h.Fragment,{children:[h.jsx(kd,{color:"purple",size:"sm"}),"Trying..."]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Try with your values"]})}),n==="complete"&&r&&h.jsxs("button",{onClick:r,className:"px-4 py-2.5 bg-gray-500 text-white rounded-lg font-medium hover:bg-gray-600 flex items-center gap-2 shadow-lg transition-all duration-300",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset"]}),n==="complete"&&h.jsxs("span",{className:"font-medium flex items-center gap-2",children:[h.jsx($i,{size:24,animated:!0}),h.jsx(I0,{variant:"success",children:"Success!"})]}),n==="error"&&h.jsxs("span",{className:"text-red-500 dark:text-red-400 font-medium flex items-center gap-1",children:[h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),"Failed"]})]})}function xse({missingVariables:e}){const{dispatch:t}=rr();if(e.length===0)return null;const r=a=>{t({type:"SET_STEP",payload:a})},n=e.filter(a=>a.provider),i=e.filter(a=>!a.provider);return h.jsx("div",{className:"bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-700 rounded-lg p-3 mb-4",children:h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx("svg",{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),h.jsxs("div",{className:"flex-1 text-sm",children:[h.jsx("p",{className:"font-medium text-amber-800 dark:text-amber-200",children:"Missing variables"}),h.jsxs("div",{className:"mt-1 text-amber-700 dark:text-amber-300",children:[n.length>0&&h.jsx("div",{className:"space-y-1",children:n.map(({name:a,provider:s})=>h.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[h.jsxs("code",{className:"bg-amber-100 dark:bg-amber-800/50 px-1 rounded text-xs",children:["$",a]}),h.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"is set by"}),h.jsx("button",{onClick:()=>r(s.stepIndex),className:"text-amber-800 dark:text-amber-200 underline hover:no-underline font-medium",children:s.stepTitle})]},a))}),i.length>0&&h.jsxs("div",{className:"mt-1",children:[h.jsx("span",{children:"Unknown variables: "}),i.map(({name:a},s)=>h.jsxs("span",{children:[s>0&&", ",h.jsxs("code",{className:"bg-amber-100 dark:bg-amber-800/50 px-1 rounded text-xs",children:["$",a]})]},a))]})]})]})]})})}const yse={executing:"blue",complete:"green",error:"orange"};function z6({step:e,mode:t="view",onChange:r,onDelete:n}){var xe,de,ge,ke,Te,Ne,Ke,ut,tt,rt;const{state:i,dispatch:a,getStepStatus:s,getVariableProvider:o}=rr(),{method:u,endpoint:d}=L0(e),f=hr(d,i.variables),m=`${e.base_url||((de=(xe=i.config)==null?void 0:xe.settings)==null?void 0:de.base_url)||""}${f}`,x=e.openapi||((ke=(ge=i.config)==null?void 0:ge.settings)==null?void 0:ke.openapi),{formFields:b,isLoading:v}=R6({openapiUrl:x,method:u,path:d,defaults:e.defaults,manualForm:e.form}),k=b||e.form,{formValues:w,setFormValues:C,hasModifications:T,isFieldModified:j}=L6({form:k,variables:i.variables}),{isTryItMode:L,tryItResponse:E,tryItError:M,isTryItExecuting:I,handleTryIt:P,handleReturnToRecorded:z}=Wae({step:e,formValues:w,variables:i.variables,method:u,fullUrl:m}),$=((Ke=(Ne=(Te=i.config)==null?void 0:Te.settings)==null?void 0:Ne.polling)==null?void 0:Ke.interval)||2e3,W=((rt=(tt=(ut=i.config)==null?void 0:ut.settings)==null?void 0:tt.polling)==null?void 0:rt.max_attempts)||30,{pollingState:Y,pollForResult:B,abortControllerRef:U}=Yae({pollConfig:e.poll,defaultInterval:$,defaultMaxAttempts:W}),R=s(i.currentStep),H=i.stepResponses[i.currentStep],V=i.stepErrors[i.currentStep],Q=N.useMemo(()=>{const nt=[...jo(d),...jo(e.body),...jo(e.headers),...jo(k==null?void 0:k.map(xt=>xt.default))];return a$(nt,i.variables).map(xt=>({name:xt,provider:o(xt)}))},[d,e.body,e.headers,k,i.variables,o]);function A(){if(k&&k.length>0){const nt=Lp(k,w);return nt?JSON.stringify(nt,null,2):""}if(e.body){const nt=ln(e.body,i.variables);return nt?JSON.stringify(nt,null,2):""}return""}function D(nt,wt){if(!e.save)return;const xt={};for(const[_e,je]of Object.entries(e.save))je==="_status"&&wt!==void 0?xt[_e]=wt:nt&&(xt[_e]=qr(nt,je));Object.keys(xt).length>0&&a({type:"SET_VARIABLES",payload:xt})}function G(nt,wt){a({type:"SET_STEP_RESPONSE",payload:{step:i.currentStep,response:nt}}),D(nt,wt),wt>=400?(a({type:"SET_STEP_ERROR",payload:{step:i.currentStep,error:Uae(nt,wt)}}),a({type:"SET_STEP_STATUS",payload:{step:i.currentStep,status:"error"}})):a({type:"SET_STEP_STATUS",payload:{step:i.currentStep,status:"complete"}})}async function q(){var nt,wt;a({type:"SET_STEP_ERROR",payload:{step:i.currentStep,error:null}}),a({type:"SET_STEP_STATUS",payload:{step:i.currentStep,status:"executing"}}),U.current=new AbortController;try{const xt=k&&k.length>0?Lp(k,w):e.body?ln(e.body,i.variables):void 0,_e=k?D1(k,w):"",je=m+_e;if(i.mode==="live"){const le=await Rl({method:u,url:je,headers:ln(e.headers,i.variables),body:u!=="GET"?xt:void 0});if(le.error)throw new Error(le.error);let be=le.data;if(e.wait_for&&e.poll&&le.data){const Le=qr(le.data,e.wait_for);if(Le){const We=await B(String(Le),{...i.variables,...le.data});be={...le.data,...We}}}G(be,le.status)}else{const le=(nt=i.recordings)==null?void 0:nt.recordings.find(be=>be.stepId===`step-${i.currentStep}`);if(!((wt=le==null?void 0:le.response)!=null&&wt.body))throw new Error("No recording available for this step");await new Promise(be=>setTimeout(be,500)),G(le.response.body,le.response.status||200)}}catch(xt){a({type:"SET_STEP_ERROR",payload:{step:i.currentStep,error:xt instanceof Error?xt.message:"Unknown error"}}),a({type:"SET_STEP_STATUS",payload:{step:i.currentStep,status:"error"}})}}function Z(nt,wt){C(xt=>({...xt,[nt]:wt}))}function re(){a({type:"SET_STEP_RESPONSE",payload:{step:i.currentStep,response:void 0}}),a({type:"SET_STEP_ERROR",payload:{step:i.currentStep,error:null}}),a({type:"SET_STEP_STATUS",payload:{step:i.currentStep,status:"pending"}})}const J=R==="executing",ie=i.mode==="recorded"&&T&&!L&&i.isLiveAvailable,ne=yse[R]||"blue",oe=H!=null&&!L||L,fe=k&&k.length>0;return h.jsx(Bi,{isActive:J||R==="complete",color:ne,intensity:"medium",children:h.jsxs("div",{className:"bg-white/90 dark:bg-slate-800/80 backdrop-blur-sm rounded-xl border border-[rgba(var(--color-primary-rgb),0.12)] dark:border-slate-700/50 overflow-hidden transition-colors duration-300",children:[h.jsx(dse,{method:u,endpoint:f,title:e.title,description:e.description,status:R,pollingState:Y,mode:t,onDelete:n}),v&&h.jsx("div",{className:"px-4 py-2 text-sm text-gray-500 dark:text-slate-400",children:"Loading form fields..."}),h.jsxs("div",{className:oe?"xl:grid xl:grid-cols-2":"",children:[h.jsxs("div",{className:oe?"xl:pr-4":"",children:[k&&k.length>0&&h.jsx(B6,{fields:k,values:w,onChange:Z,isFieldModified:j,disabled:J}),h.jsx(cse,{method:u,url:m+(k?D1(k,w):""),body:u!=="GET"&&(k||e.body)?A():void 0,headers:e.headers?ln(e.headers,i.variables):void 0,showCurl:e.show_curl}),Y&&h.jsx(use,{pollingState:Y}),Q.length>0&&R==="pending"&&h.jsx("div",{className:"px-4 pb-2",children:h.jsx(xse,{missingVariables:Q})}),t==="view"&&h.jsx(mse,{onExecute:q,onTryIt:P,onReset:re,status:R,isExecuting:J,isTryItExecuting:I,pollingState:Y,showTryIt:ie}),t==="view"&&V&&h.jsx($6,{error:V,onRetry:q,onSkip:()=>{a({type:"SET_STEP_STATUS",payload:{step:i.currentStep,status:"complete"}}),a({type:"NEXT_STEP"})}}),!fe&&H!==null&&H!==void 0&&!L&&e.results&&e.results.length>0&&h.jsx("div",{className:"hidden xl:block",children:h.jsx(Y4,{response:H,results:e.results})})]}),oe&&h.jsxs("div",{className:"xl:border-l xl:border-gray-200 xl:dark:border-slate-700/50",children:[L&&h.jsx(hse,{response:E,error:M,onReturn:z}),H!=null&&!L&&h.jsxs(h.Fragment,{children:[fe&&e.results&&e.results.length>0&&h.jsx("div",{className:"hidden xl:block",children:h.jsx(Y4,{response:H,results:e.results})}),h.jsx(Ng,{response:H,results:e.results,hideResultsOnDesktop:e.results&&e.results.length>0})]})]})]})]})})}function I6({step:e,mode:t="view",onChange:r,onDelete:n}){var L;const{state:i,dispatch:a,getStepStatus:s}=rr(),[o,u]=N.useState(""),[d,f]=N.useState(!1),p=t==="edit",m=s(i.currentStep),x=i.stepResponses[i.currentStep],b=i.stepErrors[i.currentStep],v=e.typing_speed||30,k="shell"in e?e.shell:e.command,w=hr(k,i.variables),C=E=>{if(!e.save)return;const M={};for(const[I,P]of Object.entries(e.save))if(P==="stdout"||P==="output")M[I]=E.stdout;else if(P==="stderr")M[I]=E.stderr;else if(P==="status")M[I]=E.status;else{const z=new RegExp(P),$=E.stdout.match(z);$&&(M[I]=$[1]||$[0])}Object.keys(M).length>0&&a({type:"SET_VARIABLES",payload:M})};N.useEffect(()=>{if(m==="executing"&&!d){f(!0),u("");let E=0;const M=setInterval(()=>{E<w.length?(u(w.slice(0,E+1)),E++):(clearInterval(M),f(!1))},v);return()=>clearInterval(M)}},[m,w,d,v]);const T=N.useCallback(()=>{u(""),f(!1),a({type:"SET_STEP_RESPONSE",payload:{step:i.currentStep,response:void 0}}),a({type:"SET_STEP_ERROR",payload:{step:i.currentStep,error:null}}),a({type:"SET_STEP_STATUS",payload:{step:i.currentStep,status:"pending"}})},[a,i.currentStep]),j=async()=>{var E;a({type:"SET_STEP_STATUS",payload:{step:i.currentStep,status:"executing"}});try{if(i.mode==="live"){const M=await fetch("/api/execute-shell",{method:"POST",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"true"},body:JSON.stringify({command:w,shell_type:e.shell_type,workdir:e.workdir,env:e.env})}),I=await M.json();if(!M.ok)throw new Error(I.stderr||"Command failed");a({type:"SET_STEP_RESPONSE",payload:{step:i.currentStep,response:I}}),C(I),a({type:"SET_STEP_STATUS",payload:{step:i.currentStep,status:"complete"}})}else{const M=(E=i.recordings)==null?void 0:E.recordings.find(I=>I.stepId===`step-${i.currentStep}`);if(await new Promise(I=>setTimeout(I,w.length*30+500)),M!=null&&M.output||M!=null&&M.stdout){const I={stdout:M.stdout??M.output??"",stderr:M.stderr??"",status:M.status??0,output:M.stdout??M.output??""};a({type:"SET_STEP_RESPONSE",payload:{step:i.currentStep,response:I}}),C(I),a({type:"SET_STEP_STATUS",payload:{step:i.currentStep,status:"complete"}})}else throw new Error("No recording available for this step")}}catch(M){a({type:"SET_STEP_ERROR",payload:{step:i.currentStep,error:M instanceof Error?M.message:"Unknown error"}}),a({type:"SET_STEP_STATUS",payload:{step:i.currentStep,status:"error"}})}};return h.jsx(Bi,{isActive:m==="complete",color:"orange",intensity:"medium",children:h.jsxs("div",{className:"bg-white/90 dark:bg-slate-800/80 backdrop-blur-sm rounded-xl shadow-md dark:shadow-xl border border-gray-200 dark:border-orange-500/20 overflow-hidden transition-colors duration-300",children:[h.jsxs("div",{className:"border-b border-gray-200 dark:border-slate-700 p-4 bg-gray-50 dark:bg-slate-900/30",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-lg bg-orange-100 dark:bg-orange-500/20 flex items-center justify-center",children:h.jsx("svg",{className:"w-5 h-5 text-orange-600 dark:text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:e.title||((L=e.shell_type)==null?void 0:L.toUpperCase())||"SHELL"}),e.workdir&&h.jsxs("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:["in ",h.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:e.workdir})]})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[m==="complete"&&h.jsx($i,{size:24,animated:!1}),p&&n&&h.jsx("button",{onClick:n,className:"p-1.5 text-gray-400 hover:text-red-500 dark:text-slate-500 dark:hover:text-red-400 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),e.description&&h.jsx("p",{className:"text-gray-600 dark:text-gray-300 text-sm mt-2",children:e.description})]}),!1,h.jsxs("div",{className:"bg-gray-900 p-4 font-mono text-sm",children:[h.jsxs("div",{className:"flex items-center gap-2 text-gray-400 mb-2",children:[h.jsx("span",{className:"text-green-400",children:"$"}),h.jsxs("span",{className:"text-gray-100",children:[m==="executing"?o:w,m==="executing"&&d&&h.jsx("span",{className:"animate-pulse bg-gray-100 w-2 h-4 inline-block ml-0.5"})]})]}),(x==null?void 0:x.stdout)&&h.jsx("pre",{className:"text-gray-300 whitespace-pre-wrap mt-2 border-t border-gray-700 pt-2",children:x.stdout}),(x==null?void 0:x.stderr)&&h.jsx("pre",{className:"text-yellow-400 whitespace-pre-wrap mt-2 border-t border-gray-700 pt-2 text-sm",children:x.stderr})]}),t==="view"&&h.jsxs("div",{className:"p-4 border-t border-gray-200 dark:border-slate-700/50",children:[e.confirm&&m==="pending"&&h.jsxs("p",{className:"text-amber-600 text-sm flex items-center gap-1 mb-3",children:[h.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),"Requires confirmation"]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("button",{onClick:j,disabled:m==="executing"||!1,className:"px-6 py-2.5 bg-gradient-to-r from-orange-500 to-orange-600 text-white font-medium rounded-lg hover:from-orange-400 hover:to-orange-500 disabled:opacity-50 disabled:cursor-not-allowed shadow-lg shadow-orange-500/25 transition-all duration-300 flex items-center gap-2",children:m==="executing"?h.jsxs(h.Fragment,{children:[h.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Running..."]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Run Command"]})}),m==="complete"&&h.jsxs("button",{onClick:T,className:"px-4 py-2.5 bg-gray-500 text-white font-medium rounded-lg hover:bg-gray-600 shadow-lg transition-all duration-300 flex items-center gap-2",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset"]}),m==="complete"&&h.jsxs("span",{className:"text-green-600 dark:text-green-400 font-medium flex items-center gap-1",children:[h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),"Complete"]})]})]}),t==="view"&&b&&h.jsx($6,{error:b,onRetry:j,onSkip:()=>{a({type:"SET_STEP_STATUS",payload:{step:i.currentStep,status:"complete"}}),a({type:"NEXT_STEP"})}})]})})}function F6({step:e}){const{state:t,dispatch:r,getStepStatus:n}=rr(),[i,a]=N.useState(!1),s=n(t.currentStep),o=t.stepErrors[t.currentStep],u=hr(fb(e),t.variables),d=async()=>{r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"executing"}});try{if(t.mode==="live"){const f=await fetch("/api/open-browser",{method:"POST",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"true"},body:JSON.stringify({url:u})});if(!f.ok){const p=await f.json();throw new Error(p.error||"Failed to open browser")}r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"complete"}})}else await new Promise(f=>setTimeout(f,500)),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"complete"}})}catch(f){r({type:"SET_STEP_ERROR",payload:{step:t.currentStep,error:f instanceof Error?f.message:"Unknown error"}}),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"error"}})}};return h.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-lg shadow-sm border border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"border-b border-gray-200 dark:border-slate-700 p-4",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("span",{className:"px-2 py-1 rounded text-sm font-bold bg-blue-100 dark:bg-blue-900/50 text-blue-800 dark:text-blue-300",children:"BROWSER"}),e.title&&h.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:e.title})]}),e.description&&h.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm mt-2",children:e.description})]}),h.jsx("div",{className:"p-4 bg-gray-50 dark:bg-slate-900/50 border-b border-gray-200 dark:border-slate-700",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("svg",{className:"w-5 h-5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})}),h.jsx("code",{className:"flex-1 text-sm text-gray-700 dark:text-gray-300 bg-white dark:bg-slate-800 px-3 py-2 rounded border border-gray-200 dark:border-slate-600 truncate",children:u}),h.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 dark:text-blue-400",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})})]})}),e.screenshot&&t.mode==="recorded"&&h.jsx("div",{className:"p-4",children:i?h.jsxs("div",{className:"bg-gray-100 dark:bg-slate-700 rounded-lg p-8 text-center text-gray-500 dark:text-gray-400",children:[h.jsx("svg",{className:"w-12 h-12 mx-auto mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Screenshot not available"]}):h.jsx("img",{src:e.screenshot,alt:"Browser screenshot",className:"w-full rounded-lg border border-gray-200 dark:border-slate-700",onError:()=>a(!0)})}),h.jsxs("div",{className:"p-4 flex items-center gap-4",children:[h.jsx("button",{onClick:d,disabled:s==="executing",className:"px-4 py-2 bg-blue-600 text-white rounded-lg font-medium hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:s==="executing"?h.jsxs(h.Fragment,{children:[h.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Opening..."]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),"Open in Browser"]})}),s==="complete"&&h.jsxs("span",{className:"text-green-600 font-medium flex items-center gap-1",children:[h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),"Opened"]}),s==="error"&&h.jsxs("span",{className:"text-red-600 font-medium flex items-center gap-1",children:[h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),"Failed"]})]}),o&&h.jsx("div",{className:"border-t border-red-200 bg-red-50 dark:bg-red-900/20 p-4",children:h.jsx("p",{className:"text-red-700 dark:text-red-400 text-sm",children:o})})]})}function P6({step:e}){const{state:t}=rr(),[r,n]=N.useState(!1),i=hr(pb(e),t.variables),a=i.split(`
410
- `),s=async()=>{await navigator.clipboard.writeText(i),n(!0),setTimeout(()=>n(!1),2e3)},o=u=>({js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",typescript:"TypeScript",python:"Python",py:"Python",bash:"Bash",sh:"Shell",json:"JSON",yaml:"YAML",yml:"YAML",sql:"SQL",go:"Go",rust:"Rust",java:"Java",cpp:"C++",c:"C"})[(u==null?void 0:u.toLowerCase())||""]||u||"Code";return h.jsx(Bi,{isActive:!0,color:"cyan",intensity:"subtle",children:h.jsxs("div",{className:"bg-white/90 dark:bg-slate-800/80 backdrop-blur-sm rounded-xl shadow-md dark:shadow-xl border border-gray-200 dark:border-slate-600/30 overflow-hidden transition-colors duration-300",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-50 dark:bg-slate-900/50 border-b border-gray-200 dark:border-slate-700/50",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"flex gap-1.5",children:[h.jsx("div",{className:"w-3 h-3 rounded-full bg-red-400"}),h.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-400"}),h.jsx("div",{className:"w-3 h-3 rounded-full bg-green-400"})]}),e.filename&&h.jsx("span",{className:"text-sm font-mono text-gray-600 dark:text-slate-400",children:e.filename})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs text-gray-500 dark:text-slate-500 uppercase tracking-wide",children:o(e.language)}),h.jsx("button",{onClick:s,className:"px-2 py-1 text-xs font-medium text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-200 hover:bg-gray-100 dark:hover:bg-slate-700/50 rounded transition-colors","aria-label":"Copy code",children:r?h.jsx("span",{className:"text-green-500 dark:text-green-400",children:"Copied!"}):h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),"Copy"]})})]})]}),h.jsx("div",{className:"overflow-x-auto",children:h.jsx("pre",{className:"p-4 text-sm font-mono bg-slate-950 dark:bg-slate-950 text-slate-100",children:h.jsx("code",{children:a.map((u,d)=>{var m;const f=d+1,p=(m=e.highlight)==null?void 0:m.includes(f);return h.jsxs("div",{className:`flex ${p?"bg-yellow-500/20 -mx-4 px-4":""}`,children:[h.jsx("span",{className:"select-none text-slate-500 w-8 text-right pr-4 flex-shrink-0",children:f}),h.jsx("span",{className:p?"text-yellow-200":"",children:u||" "})]},d)})})})})]})})}function H6({step:e}){const{state:t,dispatch:r,getStepStatus:n}=rr(),i=N.useMemo(()=>gb(e),[e]),[a,s]=N.useState(i),[o,u]=N.useState(!1),d=N.useRef(null),f=n(t.currentStep),p=e.message?hr(e.message,t.variables):"Waiting...",m=(i-a)/i*100;N.useEffect(()=>{s(i),u(!1),d.current&&clearInterval(d.current)},[i,t.currentStep]),N.useEffect(()=>()=>{d.current&&clearInterval(d.current)},[]);const x=()=>{u(!0),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"executing"}});const v=Date.now();d.current=window.setInterval(()=>{const k=Date.now()-v,w=Math.max(0,i-k);s(w),w===0&&(d.current&&clearInterval(d.current),u(!1),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"complete"}}))},50)},b=v=>v>=1e3?`${(v/1e3).toFixed(1)}s`:`${v}ms`;return h.jsx(Bi,{isActive:o,color:"yellow",intensity:"medium",children:h.jsx("div",{className:"bg-white/90 dark:bg-slate-800/80 backdrop-blur-sm rounded-xl shadow-md dark:shadow-xl border border-gray-200 dark:border-yellow-500/20 p-8 transition-colors duration-300",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"mb-6",children:h.jsx("div",{className:`inline-flex items-center justify-center w-20 h-20 rounded-full bg-yellow-100 dark:bg-yellow-500/20 ${o?"animate-pulse":""}`,children:h.jsx("svg",{className:"w-10 h-10 text-yellow-600 dark:text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})})}),h.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:p}),h.jsx("div",{className:"text-4xl font-mono font-bold text-yellow-600 dark:text-yellow-400 mb-6",children:b(a)}),h.jsx("div",{className:"w-full max-w-md mx-auto mb-6",children:h.jsx("div",{className:"h-2 bg-gray-200 dark:bg-slate-700 rounded-full overflow-hidden",children:h.jsx("div",{className:"h-full bg-gradient-to-r from-yellow-400 to-yellow-600 transition-all duration-100",style:{width:`${m}%`}})})}),f!=="complete"&&!o&&h.jsx("button",{onClick:x,className:"px-6 py-3 bg-gradient-to-r from-yellow-500 to-yellow-600 text-white font-medium rounded-lg hover:from-yellow-400 hover:to-yellow-500 shadow-lg shadow-yellow-500/25 transition-all duration-300",children:"Start Timer"}),o&&h.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Please wait..."}),f==="complete"&&!o&&h.jsxs("div",{className:"flex items-center justify-center gap-2 text-green-600 dark:text-green-400",children:[h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),h.jsx("span",{className:"font-medium",children:"Complete"})]})]})})})}function bse(e,t){const r=e.match(/\s*(==|!=|>=|<=|>|<)\s*/);if(!r)return{passed:!1,leftValue:void 0,rightValue:void 0,operator:"?",error:"Invalid condition syntax. Expected operator (==, !=, >, <, >=, <=)"};const n=r[1],i=r.index,a=e.substring(0,i).trim(),s=e.substring(i+r[0].length).trim(),o=G4(a,t),u=G4(s,t);return{passed:vse(o,u,n),leftValue:o,rightValue:u,operator:n}}function G4(e,t){if(e=e.trim(),e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);if(/^-?\d+(\.\d+)?$/.test(e))return parseFloat(e);if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e!=="undefined"){if(e.startsWith("$")){const n=e.slice(1).split("."),i=n[0];if(!(i in t))return;if(n.length===1)return t[i];const a=n.slice(1).join(".");return qr(t[i],a)}return e}}function vse(e,t,r){switch(r){case"==":return e==t;case"!=":return e!=t;case">":return Number(e)>Number(t);case">=":return Number(e)>=Number(t);case"<":return Number(e)<Number(t);case"<=":return Number(e)<=Number(t);default:return!1}}function X4(e){return e===void 0?"undefined":e===null?"null":typeof e=="string"?`"${e}"`:typeof e=="object"?JSON.stringify(e):String(e)}function q6({step:e}){const{state:t,dispatch:r,getStepStatus:n}=rr(),[i,a]=N.useState(null),s=n(t.currentStep),o=e.description?hr(e.description,t.variables):void 0;N.useEffect(()=>{a(null)},[t.currentStep]);const u=()=>{r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"executing"}}),setTimeout(()=>{const f=bse(R0(e),t.variables);a(f),f.passed?r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"complete"}}):(r({type:"SET_STEP_ERROR",payload:{step:t.currentStep,error:e.message||"Assertion failed"}}),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"error"}}))},300)},d=i===null?"cyan":i.passed?"green":"red";return h.jsx(Bi,{isActive:i!==null,color:d,intensity:"medium",children:h.jsx("div",{className:"bg-white/90 dark:bg-slate-800/80 backdrop-blur-sm rounded-xl shadow-md dark:shadow-xl border border-gray-200 dark:border-[rgba(var(--color-primary-rgb),0.2)] p-8 transition-colors duration-300",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"mb-6",children:h.jsx("div",{className:`inline-flex items-center justify-center w-20 h-20 rounded-full transition-colors duration-300 ${i===null?"bg-cyan-100 dark:bg-cyan-500/20":i.passed?"bg-green-100 dark:bg-green-500/20":"bg-red-100 dark:bg-red-500/20"}`,children:i===null?h.jsx("svg",{className:"w-10 h-10 text-cyan-600 dark:text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}):i.passed?h.jsx($i,{size:40,animated:!0}):h.jsx("svg",{className:"w-10 h-10 text-red-600 dark:text-red-400",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})})}),h.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:e.title||"Assertion"}),o&&h.jsx("p",{className:"text-gray-600 dark:text-slate-400 mb-4",children:o}),h.jsx("div",{className:"bg-gray-100 dark:bg-slate-900/50 rounded-lg p-4 mb-6 font-mono text-sm",children:h.jsx("code",{className:"text-gray-800 dark:text-slate-200",children:R0(e)})}),i&&h.jsx("div",{className:`rounded-lg p-4 mb-6 ${i.passed?"bg-green-50 dark:bg-green-500/10 border border-green-200 dark:border-green-500/30":"bg-red-50 dark:bg-red-500/10 border border-red-200 dark:border-red-500/30"}`,children:i.error?h.jsx("p",{className:"text-red-600 dark:text-red-400",children:i.error}):h.jsxs("div",{className:"space-y-2 text-sm",children:[h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Left value:"}),h.jsx("span",{className:`font-mono ${i.passed?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:X4(i.leftValue)})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Operator:"}),h.jsx("span",{className:"font-mono text-gray-800 dark:text-slate-200",children:i.operator})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Right value:"}),h.jsx("span",{className:`font-mono ${i.passed?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:X4(i.rightValue)})]})]})}),i&&!i.passed&&e.message&&h.jsx("p",{className:"text-red-600 dark:text-red-400 font-medium mb-6",children:e.message}),s!=="complete"&&s!=="error"&&h.jsx("button",{onClick:u,disabled:s==="executing",className:"px-6 py-3 bg-gradient-to-r from-theme-primary to-theme-accent text-white font-medium rounded-lg hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed shadow-lg shadow-[rgba(var(--color-primary-rgb),0.25)] transition-all duration-300",children:s==="executing"?"Verifying...":"Verify"}),s==="error"&&h.jsx("button",{onClick:u,className:"px-6 py-3 bg-gradient-to-r from-red-500 to-red-600 text-white font-medium rounded-lg hover:from-red-400 hover:to-red-500 shadow-lg shadow-red-500/25 transition-all duration-300",children:"Retry"}),s==="complete"&&h.jsx("p",{className:"text-green-600 dark:text-green-400 font-medium",children:"Assertion passed!"})]})})})}function U6({step:e}){var C,T;const{state:t,dispatch:r,getStepStatus:n}=rr(),[i,a]=N.useState({}),[s,o]=N.useState(null),[u,d]=N.useState(null),f=n(t.currentStep),p=e.base_url||((T=(C=t.config)==null?void 0:C.settings)==null?void 0:T.base_url)||"",m=e.endpoint||"/graphql",x=m.startsWith("http://")||m.startsWith("https://"),b=hr(x?m:p+m,t.variables);N.useEffect(()=>{if(e.variables){const j={};for(const[L,E]of Object.entries(e.variables)){const M=hr(String(E),t.variables);j[L]=M}a(j)}o(null),d(null)},[e,t.currentStep]),N.useEffect(()=>{var j;if(t.mode==="recorded"&&t.recordings){const L=t.recordings.recordings.find(E=>E.stepId===`step-${t.currentStep}`);(j=L==null?void 0:L.response)!=null&&j.body&&o(L.response.body)}},[t.mode,t.recordings,t.currentStep]);const v=async()=>{var j,L,E,M;r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"executing"}}),d(null);try{if(t.mode==="recorded"){await new Promise(P=>setTimeout(P,500));const I=(j=t.recordings)==null?void 0:j.recordings.find(P=>P.stepId===`step-${t.currentStep}`);if((L=I==null?void 0:I.response)!=null&&L.body)o(I.response.body),k(I.response.body),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"complete"}});else throw new Error("No recording found for this step")}else{const I=e.base_url||((M=(E=t.config)==null?void 0:E.settings)==null?void 0:M.base_url)||"",P=e.endpoint||"/graphql",z=P.startsWith("http://")||P.startsWith("https://"),$=hr(P,t.variables),W=z?$:hr(I,t.variables)+$,Y=ln(e.headers||{},t.variables),B=ln(i,t.variables),U=await Vae({endpoint:W,query:wd(e),variables:B,headers:Y});if(U.error)throw new Error(U.error);o(U.data),k(U.data),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"complete"}})}}catch(I){const P=I instanceof Error?I.message:"Request failed";d(P),r({type:"SET_STEP_ERROR",payload:{step:t.currentStep,error:P}}),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"error"}})}},k=j=>{if(!e.save)return;const L={};for(const[E,M]of Object.entries(e.save)){const I=qr(j,M);I!==void 0&&(L[E]=I)}Object.keys(L).length>0&&r({type:"SET_VARIABLES",payload:L})},w=()=>{o(null),d(null),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"pending"}})};return h.jsx(Bi,{isActive:f==="complete",color:"pink",intensity:"medium",children:h.jsxs("div",{className:"bg-white/90 dark:bg-slate-800/80 backdrop-blur-sm rounded-xl shadow-md dark:shadow-xl border border-gray-200 dark:border-pink-500/20 overflow-hidden transition-colors duration-300",children:[h.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-slate-700/50 bg-gray-50 dark:bg-slate-900/30",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-lg bg-pink-100 dark:bg-pink-500/20 flex items-center justify-center",children:h.jsx("svg",{className:"w-5 h-5 text-pink-600 dark:text-pink-400",viewBox:"0 0 24 24",fill:"currentColor",children:h.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:e.title||"GraphQL Query"}),b&&h.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:b})]})]}),f==="complete"&&h.jsx($i,{size:24,animated:!1})]})}),!1,h.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700/50",children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Query"}),h.jsx("pre",{className:"p-4 bg-slate-950 rounded-lg text-sm font-mono text-pink-300 overflow-x-auto",children:wd(e)})]}),e.variables&&Object.keys(e.variables).length>0&&h.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700/50",children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Variables"}),h.jsx("div",{className:"space-y-3",children:Object.entries(e.variables).map(([j])=>h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("label",{className:"w-32 text-sm text-gray-600 dark:text-slate-400 font-mono",children:j}),h.jsx("input",{type:"text",value:i[j]||"",onChange:L=>a({...i,[j]:L.target.value}),disabled:f==="executing",className:"flex-1 px-3 py-2 bg-white dark:bg-slate-700/50 border border-gray-200 dark:border-slate-600/50 rounded-lg text-sm font-mono text-gray-900 dark:text-white disabled:opacity-50"})]},j))})]}),h.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700/50",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("button",{onClick:v,disabled:f==="executing"||!1,className:"px-6 py-2.5 bg-gradient-to-r from-pink-500 to-pink-600 text-white font-medium rounded-lg hover:from-pink-400 hover:to-pink-500 disabled:opacity-50 disabled:cursor-not-allowed shadow-lg shadow-pink-500/25 transition-all duration-300 flex items-center gap-2",children:f==="executing"?h.jsxs(h.Fragment,{children:[h.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Executing..."]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Execute Query"]})}),f==="complete"&&h.jsxs("button",{onClick:w,className:"px-4 py-2.5 bg-gray-500 text-white font-medium rounded-lg hover:bg-gray-600 shadow-lg transition-all duration-300 flex items-center gap-2",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset"]}),f==="complete"&&h.jsxs("span",{className:"text-green-600 dark:text-green-400 font-medium flex items-center gap-1",children:[h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),"Complete"]})]})}),u&&h.jsx("div",{className:"p-4 bg-red-50 dark:bg-red-500/10 border-b border-red-200 dark:border-red-500/30",children:h.jsx("p",{className:"text-red-600 dark:text-red-400 text-sm",children:u})}),s!=null&&h.jsxs("div",{className:"p-4",children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Response"}),h.jsx("pre",{className:"p-4 bg-slate-950 rounded-lg text-sm font-mono text-green-300 overflow-x-auto max-h-96",children:JSON.stringify(s,null,2)})]})]})})}function V6({step:e}){const{state:t,dispatch:r,getStepStatus:n}=rr(),[i,a]=N.useState(null),[s,o]=N.useState(null),u=n(t.currentStep),d=e.type||"mongodb",f=e.description?hr(e.description,t.variables):void 0;N.useEffect(()=>{a(null),o(null)},[t.currentStep]),N.useEffect(()=>{var k;if(t.mode==="recorded"&&t.recordings){const w=t.recordings.recordings.find(C=>C.stepId===`step-${t.currentStep}`);(k=w==null?void 0:w.response)!=null&&k.body&&a(w.response.body)}},[t.mode,t.recordings,t.currentStep]);const p=async()=>{var k,w;r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"executing"}}),o(null);try{if(t.mode==="recorded"){await new Promise(T=>setTimeout(T,500));const C=(k=t.recordings)==null?void 0:k.recordings.find(T=>T.stepId===`step-${t.currentStep}`);if((w=C==null?void 0:C.response)!=null&&w.body)a(C.response.body),m(C.response.body),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"complete"}});else throw new Error("No recording found for this step")}else{const C=ln(e.query||{},t.variables),T=e.update?ln(e.update,t.variables):void 0,j=e.document?ln(e.document,t.variables):void 0,L=await fetch("/api/execute-db",{method:"POST",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"true"},body:JSON.stringify({operation:id(e),type:d,collection:e.collection,table:e.table,query:C,update:T,document:j,projection:e.projection})}),E=await L.json();if(!L.ok)throw new Error(E.error||`Request failed with status ${L.status}`);a(E),m(E),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"complete"}})}}catch(C){const T=C instanceof Error?C.message:"Database operation failed";o(T),r({type:"SET_STEP_ERROR",payload:{step:t.currentStep,error:T}}),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"error"}})}},m=k=>{if(!e.save)return;const w={};for(const[C,T]of Object.entries(e.save)){const j=qr(k,T);j!==void 0&&(w[C]=j)}Object.keys(w).length>0&&r({type:"SET_VARIABLES",payload:w})},x=k=>({find:"Find Documents",findOne:"Find One Document",insertOne:"Insert Document",updateOne:"Update Document",deleteOne:"Delete Document",query:"Execute Query"})[k]||k,b=()=>d==="mongodb"?h.jsx("svg",{className:"w-5 h-5 text-emerald-600 dark:text-emerald-400",viewBox:"0 0 24 24",fill:"currentColor",children:h.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"})}):h.jsx("svg",{className:"w-5 h-5 text-emerald-600 dark:text-emerald-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})}),v=()=>typeof e.query=="string"?e.query:JSON.stringify(ln(e.query||{},t.variables),null,2);return h.jsx(Bi,{isActive:u==="complete",color:"green",intensity:"medium",children:h.jsxs("div",{className:"bg-white/90 dark:bg-slate-800/80 backdrop-blur-sm rounded-xl shadow-md dark:shadow-xl border border-gray-200 dark:border-emerald-500/20 overflow-hidden transition-colors duration-300",children:[h.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-slate-700/50 bg-gray-50 dark:bg-slate-900/30",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-lg bg-emerald-100 dark:bg-emerald-500/20 flex items-center justify-center",children:b()}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:e.title||x(id(e))}),h.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-slate-400",children:[h.jsx("span",{className:"px-2 py-0.5 bg-emerald-100 dark:bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 rounded text-xs font-medium uppercase",children:d}),e.collection&&h.jsx("span",{className:"font-mono",children:e.collection}),e.table&&h.jsx("span",{className:"font-mono",children:e.table})]})]})]}),u==="complete"&&h.jsx($i,{size:24,animated:!1})]})}),f&&h.jsx("div",{className:"px-6 py-3 border-b border-gray-200 dark:border-slate-700/50 bg-gray-50/50 dark:bg-slate-900/20",children:h.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400",children:f})}),!1,h.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700/50",children:[h.jsx("div",{className:"flex items-center gap-2 mb-2",children:h.jsx("span",{className:"px-2 py-1 bg-slate-100 dark:bg-slate-700/50 text-slate-700 dark:text-slate-300 rounded text-xs font-mono font-medium",children:id(e)})}),e.query&&h.jsxs("div",{className:"mt-3",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-500 uppercase tracking-wide mb-1",children:typeof e.query=="string"?"Query":"Filter"}),h.jsx("pre",{className:"p-3 bg-slate-950 rounded-lg text-sm font-mono text-emerald-300 overflow-x-auto",children:v()})]}),e.update&&h.jsxs("div",{className:"mt-3",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-500 uppercase tracking-wide mb-1",children:"Update"}),h.jsx("pre",{className:"p-3 bg-slate-950 rounded-lg text-sm font-mono text-yellow-300 overflow-x-auto",children:JSON.stringify(ln(e.update,t.variables),null,2)})]}),e.document&&h.jsxs("div",{className:"mt-3",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-500 uppercase tracking-wide mb-1",children:"Document"}),h.jsx("pre",{className:"p-3 bg-slate-950 rounded-lg text-sm font-mono text-blue-300 overflow-x-auto",children:JSON.stringify(ln(e.document,t.variables),null,2)})]})]}),h.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700/50",children:h.jsx("button",{onClick:p,disabled:u==="executing"||!1,className:"w-full px-4 py-3 bg-gradient-to-r from-emerald-500 to-emerald-600 text-white font-medium rounded-lg hover:from-emerald-400 hover:to-emerald-500 disabled:opacity-50 disabled:cursor-not-allowed shadow-lg shadow-emerald-500/25 transition-all duration-300 flex items-center justify-center gap-2",children:u==="executing"?h.jsxs(h.Fragment,{children:[h.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Executing..."]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Execute"]})})}),s&&h.jsx("div",{className:"p-4 bg-red-50 dark:bg-red-500/10 border-b border-red-200 dark:border-red-500/30",children:h.jsx("p",{className:"text-red-600 dark:text-red-400 text-sm",children:s})}),i!=null&&h.jsxs("div",{className:"p-4",children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Result"}),Array.isArray(i)?h.jsxs("div",{className:"space-y-2",children:[h.jsxs("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:[i.length," document",i.length!==1?"s":""," returned"]}),h.jsx("pre",{className:"p-4 bg-slate-950 rounded-lg text-sm font-mono text-green-300 overflow-x-auto max-h-96",children:JSON.stringify(i,null,2)})]}):h.jsx("pre",{className:"p-4 bg-slate-950 rounded-lg text-sm font-mono text-green-300 overflow-x-auto max-h-96",children:JSON.stringify(i,null,2)})]})]})})}function wse({field:e,value:t,onChange:r,disabled:n}){var i;return h.jsxs("div",{children:[h.jsxs("label",{className:"flex items-center gap-1.5 text-sm font-medium text-gray-700 dark:text-slate-300 mb-1.5",children:[h.jsx("span",{children:e.label||e.name}),e.required&&h.jsx("span",{className:"text-red-500 dark:text-red-400",children:"*"})]}),e.type==="textarea"?h.jsx("textarea",{value:String(t??""),onChange:a=>r(a.target.value),disabled:e.readonly||n,placeholder:e.placeholder,rows:e.rows??3,className:"w-full px-3 py-2 bg-white dark:bg-slate-700/50 border border-gray-300 dark:border-slate-600 rounded-lg text-sm text-gray-900 dark:text-slate-200 placeholder-gray-400 dark:placeholder-slate-500 disabled:bg-gray-100 dark:disabled:bg-slate-800 disabled:text-gray-500 dark:disabled:text-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 resize-y"}):e.type==="select"?h.jsxs("select",{value:String(t??""),onChange:a=>r(a.target.value),disabled:e.readonly||n,className:"w-full px-3 py-2 bg-white dark:bg-slate-700/50 border border-gray-300 dark:border-slate-600 rounded-lg text-sm text-gray-900 dark:text-slate-200 disabled:bg-gray-100 dark:disabled:bg-slate-800 disabled:text-gray-500 dark:disabled:text-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500",children:[h.jsx("option",{value:"",children:"Select..."}),(i=e.options)==null?void 0:i.map(a=>h.jsx("option",{value:a.value,children:a.label},a.value))]}):e.type==="toggle"?h.jsx("button",{type:"button",onClick:()=>r(!t),disabled:e.readonly||n,className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:ring-offset-2 dark:focus:ring-offset-slate-900 disabled:opacity-50 disabled:cursor-not-allowed ${t?"bg-indigo-500":"bg-gray-200 dark:bg-slate-600"}`,children:h.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${t?"translate-x-5":"translate-x-0"}`})}):e.type==="slider"?h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"range",min:e.min??0,max:e.max??100,step:e.step??1,value:Number(t)||e.min||0,onChange:a=>r(Number(a.target.value)),disabled:e.readonly||n,className:"flex-1 h-2 bg-gray-200 dark:bg-slate-600 rounded-lg appearance-none cursor-pointer accent-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed"}),h.jsx("span",{className:"min-w-[3rem] text-right text-sm font-mono text-gray-700 dark:text-slate-300 bg-gray-100 dark:bg-slate-700 px-2 py-1 rounded",children:t??e.min??0})]}):h.jsx("input",{type:e.type==="number"?"number":"text",value:String(t??""),onChange:a=>r(e.type==="number"?Number(a.target.value):a.target.value),disabled:e.readonly||n,placeholder:e.placeholder,className:"w-full px-3 py-2 bg-white dark:bg-slate-700/50 border border-gray-300 dark:border-slate-600 rounded-lg text-sm text-gray-900 dark:text-slate-200 placeholder-gray-400 dark:placeholder-slate-500 disabled:bg-gray-100 dark:disabled:bg-slate-800 disabled:text-gray-500 dark:disabled:text-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"})]})}function W6({step:e}){const{state:t,dispatch:r,getStepStatus:n}=rr(),[i,a]=N.useState({}),[s,o]=N.useState(null),u=n(t.currentStep),d=O0(e),f=e.fields||[],p=e.submit_label||"Continue";N.useEffect(()=>{const v={};for(const k of f){const w=k.default??(k.type==="toggle"?!1:"");v[k.name]=typeof w=="string"?hr(w,t.variables):w}a(v),o(null)},[e,t.currentStep]);const m=N.useMemo(()=>f.every(v=>{if(!v.required)return!0;const k=i[v.name];return!(k==null||k==="")}),[f,i]),x=()=>{if(!m){o("Please fill in all required fields");return}if(r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"executing"}}),o(null),e.save){const v={};for(const[k,w]of Object.entries(e.save))if(w==="$formData")v[k]={...i};else if(w.startsWith("$")){const C=w.slice(1);i[C]!==void 0&&(v[k]=i[C])}Object.keys(v).length>0&&r({type:"SET_VARIABLES",payload:v})}r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"complete"}})},b=(v,k)=>{a(w=>({...w,[v]:k}))};return h.jsx(Bi,{isActive:u==="complete",color:"indigo",intensity:"medium",children:h.jsxs("div",{className:"bg-white/90 dark:bg-slate-800/80 backdrop-blur-sm rounded-xl shadow-md dark:shadow-xl border border-gray-200 dark:border-indigo-500/20 overflow-hidden transition-colors duration-300",children:[h.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-slate-700/50 bg-gray-50 dark:bg-slate-900/30",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 dark:bg-indigo-500/20 flex items-center justify-center",children:h.jsx("svg",{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"})})}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:d}),e.description&&h.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:e.description})]})]}),u==="complete"&&h.jsx($i,{size:24,animated:!1})]})}),f.length>0&&h.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700/50",children:h.jsx("div",{className:"space-y-4",children:f.filter(v=>!v.hidden).map(v=>h.jsx(wse,{field:v,value:i[v.name],onChange:k=>b(v.name,k),disabled:u==="executing"||u==="complete"},v.name))})}),h.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700/50",children:h.jsx("button",{onClick:x,disabled:u==="executing"||u==="complete",className:"w-full px-4 py-3 bg-gradient-to-r from-indigo-500 to-indigo-600 text-white font-medium rounded-lg hover:from-indigo-400 hover:to-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed shadow-lg shadow-indigo-500/25 transition-all duration-300 flex items-center justify-center gap-2",children:u==="executing"?h.jsxs(h.Fragment,{children:[h.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Processing..."]}):u==="complete"?h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Submitted"]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 7l5 5m0 0l-5 5m5-5H6"})}),p]})})}),s&&h.jsx("div",{className:"p-4 bg-red-50 dark:bg-red-500/10 border-t border-red-200 dark:border-red-500/30",children:h.jsx("p",{className:"text-red-600 dark:text-red-400 text-sm",children:s})}),u==="complete"&&e.save&&h.jsx("div",{className:"p-4 bg-green-50 dark:bg-green-500/10",children:h.jsxs("div",{className:"flex items-center gap-2 text-green-700 dark:text-green-300 text-sm",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Form data saved to variables"]})})]})})}function kse(e,t="$"){const r=e.split(`
411
- `),n=[];for(const i of r){const a=i.trimStart();if(a.startsWith(t)){const s=a.slice(t.length).trimStart();n.push({type:"command",text:s})}else n.push({type:"output",text:i})}return n}function Sse(e){const t=[];let r=[];for(const n of e)n.type==="command"?(r.length>0&&(t.push({type:"output",lines:r}),r=[]),t.push({type:"command",lines:[n.text]})):r.push(n.text);return r.length>0&&t.push({type:"output",lines:r}),t}function Y6({step:e}){var z;const{state:t,dispatch:r,getStepStatus:n}=rr(),[i,a]=N.useState(0),[s,o]=N.useState(""),[u,d]=N.useState(!1),[f,p]=N.useState(!1),m=N.useRef(null),x=n(t.currentStep),b=B0(e),v=e.prompt||"$",k=e.typing_speed||30,w=e.output_delay||200,C=e.theme||"dark",T=kse(b,v),j=Sse(T),L={dark:{bg:"bg-slate-950",text:"text-slate-200",prompt:"text-green-400",command:"text-white",output:"text-slate-400"},light:{bg:"bg-gray-100",text:"text-gray-800",prompt:"text-green-600",command:"text-gray-900",output:"text-gray-600"},matrix:{bg:"bg-black",text:"text-green-400",prompt:"text-green-300",command:"text-green-400",output:"text-green-500/80"}}[C];N.useEffect(()=>{m.current&&(m.current.scrollTop=m.current.scrollHeight)},[i,s]),N.useEffect(()=>{o(""),d(!1),p(!1),a(x==="complete"?j.length:0)},[e,t.currentStep,x,j.length]);const E=N.useCallback($=>new Promise(W=>{d(!0);let Y=0;const B=setInterval(()=>{Y<$.length?(o(U=>U+$[Y]),Y++):(clearInterval(B),d(!1),W())},k)}),[k]),M=N.useCallback(()=>{a(0),o(""),d(!1),p(!1),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"pending"}})},[r,t.currentStep]),I=N.useCallback(async()=>{if(!f){a(0),o(""),p(!0),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"executing"}});for(let $=0;$<j.length;$++){const W=j[$];W.type==="command"?(o(""),await E(W.lines[0]),await new Promise(Y=>setTimeout(Y,w)),a($+1),o("")):(a($+1),await new Promise(Y=>setTimeout(Y,w)))}p(!1),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"complete"}})}},[j,f,E,w,r,t.currentStep]),P=u&&((z=j[i])==null?void 0:z.type)==="command"?j[i]:null;return h.jsx(Bi,{isActive:x==="complete",color:"emerald",intensity:"medium",children:h.jsxs("div",{className:"bg-white/90 dark:bg-slate-800/80 backdrop-blur-sm rounded-xl shadow-md dark:shadow-xl border border-gray-200 dark:border-emerald-500/20 overflow-hidden transition-colors duration-300",children:[h.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-slate-700/50 bg-gray-50 dark:bg-slate-900/30",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-lg bg-emerald-100 dark:bg-emerald-500/20 flex items-center justify-center",children:h.jsx("svg",{className:"w-5 h-5 text-emerald-600 dark:text-emerald-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:e.title||"Terminal"}),h.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400",children:"Animated terminal playback"})]})]}),x==="complete"&&h.jsx($i,{size:24,animated:!1})]})}),h.jsx("div",{className:"p-4",children:h.jsxs("div",{ref:m,className:`${L.bg} rounded-lg p-4 font-mono text-sm overflow-y-auto max-h-80`,children:[h.jsxs("div",{className:"flex items-center gap-2 mb-3 pb-2 border-b border-gray-700/50",children:[h.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),h.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),h.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"}),h.jsx("span",{className:"ml-2 text-xs text-gray-500",children:"terminal"})]}),h.jsxs("div",{className:"space-y-1",children:[j.slice(0,i).map(($,W)=>h.jsx("div",{children:$.type==="command"?h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx("span",{className:L.prompt,children:v}),h.jsx("span",{className:L.command,children:$.lines[0]})]}):h.jsx("div",{className:L.output,children:$.lines.map((Y,B)=>h.jsx("div",{children:Y||" "},B))})},W)),P&&h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx("span",{className:L.prompt,children:v}),h.jsxs("span",{className:L.command,children:[s,h.jsx("span",{className:"animate-pulse",children:"▌"})]})]}),!f&&x!=="complete"&&i===0&&h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx("span",{className:L.prompt,children:v}),h.jsx("span",{className:"animate-pulse",children:"▌"})]})]})]})}),h.jsx("div",{className:"p-4 border-t border-gray-200 dark:border-slate-700/50",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("button",{onClick:I,disabled:f,className:"px-6 py-2.5 bg-gradient-to-r from-emerald-500 to-emerald-600 text-white font-medium rounded-lg hover:from-emerald-400 hover:to-emerald-500 disabled:opacity-50 disabled:cursor-not-allowed shadow-lg shadow-emerald-500/25 transition-all duration-300 flex items-center gap-2",children:f?h.jsxs(h.Fragment,{children:[h.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Playing..."]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{d:"M8 5v14l11-7z"})}),"Play"]})}),x==="complete"&&h.jsxs("button",{onClick:M,disabled:f,className:"px-4 py-2.5 bg-gray-500 text-white font-medium rounded-lg hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed shadow-lg transition-all duration-300 flex items-center gap-2",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset"]}),x==="complete"&&h.jsxs("span",{className:"text-green-600 dark:text-green-400 font-medium flex items-center gap-1",children:[h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),"Complete"]})]})})]})})}function G6({step:e}){const{state:t,dispatch:r,getStepStatus:n}=rr(),[i,a]=N.useState({status:"idle",attempt:0,maxAttempts:e.max_attempts||30,currentStage:null,lastResponse:null,error:null}),s=N.useRef(null),o=n(t.currentStep),u=$0(e),d=e.interval||2e3,f=e.max_attempts||30,p=e.stages||[];N.useEffect(()=>{var w;a({status:"idle",attempt:0,maxAttempts:f,currentStage:null,lastResponse:null,error:null}),(w=s.current)==null||w.abort()},[e,t.currentStep,f]);const m=N.useCallback(w=>{if(!p.length)return null;for(const C of p)if(gd(C.when,w))return C.label;return null},[p]),x=N.useCallback(w=>{if(!e.save)return;const C={};for(const[T,j]of Object.entries(e.save)){const L=qr(w,j);L!==void 0&&(C[T]=L)}Object.keys(C).length>0&&r({type:"SET_VARIABLES",payload:C})},[e.save,r]),b=N.useCallback(async()=>{var I,P;if(i.status==="polling")return;const w=new AbortController;s.current=w,r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"executing"}}),a(z=>({...z,status:"polling",attempt:0,error:null}));const C=e.base_url||((P=(I=t.config)==null?void 0:I.settings)==null?void 0:P.base_url)||"",T=u,j=T.startsWith("http://")||T.startsWith("https://"),L=hr(j?T:C+T,t.variables),E={};if(e.headers)for(const[z,$]of Object.entries(e.headers))E[z]=hr(String($),t.variables);for(let z=1;z<=f;z++){if(w.signal.aborted){a($=>({...$,status:"idle",error:"Polling cancelled"}));return}a($=>({...$,attempt:z}));try{const W=(await Rl({method:"GET",url:L,headers:E})).data,Y=m(W);if(a(B=>({...B,lastResponse:W,currentStage:Y})),e.success_when&&gd(e.success_when,W)){a(U=>({...U,status:"success",lastResponse:W})),x(W),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"complete"}});return}if(e.failure_when&&gd(e.failure_when,W)){const U=`Condition failed: ${e.failure_when}`;a(R=>({...R,status:"failure",error:U})),r({type:"SET_STEP_ERROR",payload:{step:t.currentStep,error:U}}),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"error"}});return}}catch{}await new Promise($=>setTimeout($,d))}const M=`Polling timeout after ${f} attempts`;a(z=>({...z,status:"failure",error:M})),r({type:"SET_STEP_ERROR",payload:{step:t.currentStep,error:M}}),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"error"}})},[i.status,u,f,d,e,t,r,m,x]),v=N.useCallback(()=>{var w;(w=s.current)==null||w.abort(),a(C=>({...C,status:"idle",error:"Polling cancelled"})),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"pending"}})},[r,t.currentStep]),k=f>0?i.attempt/f*100:0;return h.jsx(Bi,{isActive:o==="complete",color:"amber",intensity:"medium",children:h.jsxs("div",{className:"bg-white/90 dark:bg-slate-800/80 backdrop-blur-sm rounded-xl shadow-md dark:shadow-xl border border-gray-200 dark:border-amber-500/20 overflow-hidden transition-colors duration-300",children:[h.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-slate-700/50 bg-gray-50 dark:bg-slate-900/30",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-100 dark:bg-amber-500/20 flex items-center justify-center",children:h.jsx("svg",{className:"w-5 h-5 text-amber-600 dark:text-amber-400 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",style:{animationDuration:i.status==="polling"?"1s":"0s",animationPlayState:i.status==="polling"?"running":"paused"},children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white",children:e.title||"Polling"}),h.jsx("p",{className:"text-sm text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:hr(u,t.variables)})]})]}),o==="complete"&&h.jsx($i,{size:24,animated:!1})]})}),p.length>0&&h.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-slate-700/50",children:h.jsx("div",{className:"flex items-center justify-between",children:p.map((w,C)=>{const T=p.findIndex(E=>E.label===i.currentStage),j=w.label===i.currentStage,L=T>C||i.status==="success";return h.jsxs("div",{className:"flex items-center flex-1",children:[h.jsxs("div",{className:"flex flex-col items-center flex-1",children:[h.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-xs font-medium transition-all duration-300 ${L?"bg-green-500 text-white shadow-[0_0_10px_rgba(34,197,94,0.5)]":j?"bg-amber-500 text-white animate-pulse shadow-[0_0_10px_rgba(245,158,11,0.5)]":"bg-gray-200 dark:bg-slate-700 text-gray-500 dark:text-slate-400"}`,children:L?h.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):C+1}),h.jsx("span",{className:`mt-1 text-xs ${j||L?"text-gray-700 dark:text-slate-200 font-medium":"text-gray-400 dark:text-slate-500"}`,children:w.label})]}),C<p.length-1&&h.jsx("div",{className:`h-0.5 flex-1 mx-2 rounded transition-all duration-300 ${L?"bg-green-500":"bg-gray-200 dark:bg-slate-700"}`})]},w.label)})})}),h.jsxs("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-slate-700/50",children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"text-sm text-gray-600 dark:text-slate-400",children:i.status==="polling"?`Attempt ${i.attempt} of ${f}`:i.status==="success"?"Complete!":i.status==="failure"?"Failed":"Ready"}),i.currentStage&&i.status==="polling"&&h.jsx("span",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:i.currentStage})]}),h.jsx("div",{className:"h-2 bg-gray-200 dark:bg-slate-700 rounded-full overflow-hidden",children:h.jsx("div",{className:`h-full transition-all duration-500 ${i.status==="success"?"bg-green-500":i.status==="failure"?"bg-red-500":"bg-amber-500"}`,style:{width:i.status==="success"?"100%":`${k}%`}})})]}),h.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700/50",children:i.status==="polling"?h.jsxs("button",{onClick:v,className:"w-full px-4 py-3 bg-gray-500 text-white font-medium rounded-lg hover:bg-gray-600 shadow-lg transition-all duration-300 flex items-center justify-center gap-2",children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Cancel"]}):h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("button",{onClick:b,disabled:o==="executing",className:"px-6 py-2.5 bg-gradient-to-r from-amber-500 to-amber-600 text-white font-medium rounded-lg hover:from-amber-400 hover:to-amber-500 disabled:opacity-50 disabled:cursor-not-allowed shadow-lg shadow-amber-500/25 transition-all duration-300 flex items-center gap-2",children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Start Polling"]}),o==="complete"&&h.jsxs("button",{onClick:()=>{a({status:"idle",attempt:0,maxAttempts:f,currentStage:null,lastResponse:null,error:null}),r({type:"SET_STEP_STATUS",payload:{step:t.currentStep,status:"pending"}})},className:"px-4 py-2.5 bg-gray-500 text-white font-medium rounded-lg hover:bg-gray-600 shadow-lg transition-all duration-300 flex items-center gap-2",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset"]}),o==="complete"&&h.jsxs("span",{className:"text-green-600 dark:text-green-400 font-medium flex items-center gap-1",children:[h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),"Complete"]})]})}),i.error&&h.jsx("div",{className:"p-4 bg-red-50 dark:bg-red-500/10 border-t border-red-200 dark:border-red-500/30",children:h.jsx("p",{className:"text-red-600 dark:text-red-400 text-sm",children:i.error})}),i.lastResponse!==null&&i.status==="success"&&h.jsxs("div",{className:"p-4",children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-2",children:"Final Response"}),h.jsx("pre",{className:"p-4 bg-slate-950 rounded-lg text-sm font-mono text-green-300 overflow-x-auto max-h-48",children:JSON.stringify(i.lastResponse,null,2)})]})]})})}function X6(){var f,p;const{state:e,getStepStatus:t}=rr(),r=g$(),{playSuccess:n,playError:i,enabled:a}=fE(),s=N.useRef({}),o=(p=(f=e.config)==null?void 0:f.settings)==null?void 0:p.effects,u=(o==null?void 0:o.confetti)??!0,d=(o==null?void 0:o.sounds)??!0;N.useEffect(()=>{const m=e.currentStep,x=t(m),b=s.current[m];x!==b&&(x==="complete"&&b!=="complete"?(u&&r.fire(),d&&a&&n()):x==="error"&&b!=="error"&&d&&a&&i(),s.current={...s.current,[m]:x})},[e.currentStep,e.stepStatuses,t,r,n,i,u,d,a])}function Cse(){var a,s,o;const{currentStepConfig:e,state:t}=rr();X6();const r=((o=(s=(a=t.config)==null?void 0:a.settings)==null?void 0:s.effects)==null?void 0:o.transitions)??!0;if(!e)return h.jsx("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-8 text-center text-gray-500",children:"No step selected"});const i=xc(e)?h.jsx(M6,{step:e}):Tl(e)?h.jsx(z6,{step:e}):yc(e)?h.jsx(I6,{step:e}):Zd(e)?h.jsx(F6,{step:e}):Kd(e)?h.jsx(P6,{step:e}):Jd(e)?h.jsx(H6,{step:e}):eh(e)?h.jsx(q6,{step:e}):bc(e)?h.jsx(U6,{step:e}):th(e)?h.jsx(V6,{step:e}):vc(e)?h.jsx(W6,{step:e}):wc(e)?h.jsx(Y6,{step:e}):kc(e)?h.jsx(G6,{step:e}):h.jsx("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-8 text-center text-gray-500",children:"Unknown step type"});return r?h.jsx(x$,{direction:"right",duration:300,children:i},t.currentStep):i}function _se(){const{state:e,dispatch:t,isFirstStep:r,isLastStep:n,totalSteps:i}=rr();return h.jsxs("nav",{className:"bg-white/80 dark:bg-slate-800/50 backdrop-blur-sm rounded-xl border border-gray-200 dark:border-[rgba(var(--color-primary-rgb),0.2)] p-3 sm:p-4 shadow-md dark:shadow-xl transition-colors duration-300","aria-label":"Demo navigation",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[h.jsxs("button",{onClick:()=>t({type:"PREV_STEP"}),disabled:r,"aria-label":"Previous step",className:"px-2 sm:px-4 py-2 bg-gray-100 dark:bg-slate-700/50 text-gray-700 dark:text-slate-300 rounded-lg font-medium hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1 sm:gap-2 transition-all duration-300 border border-gray-200 dark:border-slate-600/50",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),h.jsx("span",{className:"hidden sm:inline",children:"Previous"})]}),h.jsxs("button",{onClick:()=>t({type:"NEXT_STEP"}),disabled:n,"aria-label":"Next step",className:"px-2 sm:px-4 py-2 bg-gradient-to-r from-theme-primary to-theme-accent text-white rounded-lg font-medium hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1 sm:gap-2 shadow-lg shadow-[rgba(var(--color-primary-rgb),0.25)] transition-all duration-300",children:[h.jsx("span",{className:"hidden sm:inline",children:"Next"}),h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]}),h.jsxs("div",{className:"flex items-center gap-2 sm:gap-4",children:[h.jsxs("span",{className:"text-xs sm:text-sm text-gray-500 dark:text-slate-400",children:[h.jsxs("span",{className:"sm:hidden",children:[e.currentStep+1,"/",i]}),h.jsxs("span",{className:"hidden sm:inline",children:["Step ",e.currentStep+1," of ",i]})]}),h.jsx("button",{onClick:()=>t({type:"RESET"}),"aria-label":"Reset demo",className:"px-2 sm:px-3 py-1.5 text-sm text-gray-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-slate-700/50 rounded transition-colors",children:"Reset"})]})]}),h.jsxs("div",{className:"mt-3 text-xs text-gray-500 dark:text-slate-500 hidden sm:flex gap-4",children:[h.jsxs("span",{children:[h.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-slate-700 rounded text-gray-700 dark:text-slate-300 border border-gray-200 dark:border-slate-600",children:"←"})," ",h.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-slate-700 rounded text-gray-700 dark:text-slate-300 border border-gray-200 dark:border-slate-600",children:"→"})," Navigate"]}),h.jsxs("span",{children:[h.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-slate-700 rounded text-gray-700 dark:text-slate-300 border border-gray-200 dark:border-slate-600",children:"Space"})," Next"]}),h.jsxs("span",{children:[h.jsx("kbd",{className:"px-1.5 py-0.5 bg-gray-100 dark:bg-slate-700 rounded text-gray-700 dark:text-slate-300 border border-gray-200 dark:border-slate-600",children:"R"})," Reset"]})]})]})}function Tr(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,n;r<e.length;r++)(n=Tr(e[r]))!==""&&(t+=(t&&" ")+n);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}const ea={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:r,targetHandle:n})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:n}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},qd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Q6=["Enter"," ","Escape"],Z6={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:r})=>`Moved selected node ${e}. New position, x: ${t}, y: ${r}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var lc;(function(e){e.Strict="strict",e.Loose="loose"})(lc||(lc={}));var fl;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(fl||(fl={}));var Ud;(function(e){e.Partial="partial",e.Full="full"})(Ud||(Ud={}));const K6={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var fs;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(fs||(fs={}));var oc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(oc||(oc={}));var qe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(qe||(qe={}));const Q4={[qe.Left]:qe.Right,[qe.Right]:qe.Left,[qe.Top]:qe.Bottom,[qe.Bottom]:qe.Top};function J6(e){return e===null?null:e?"valid":"invalid"}const eR=e=>"id"in e&&"source"in e&&"target"in e,Tse=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),L2=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),mh=(e,t=[0,0])=>{const{width:r,height:n}=Ba(e),i=e.origin??t,a=r*i[0],s=n*i[1];return{x:e.position.x-a,y:e.position.y-s}},Ese=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((n,i)=>{const a=typeof i=="string";let s=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(s=a?t.nodeLookup.get(i):L2(i)?i:t.nodeLookup.get(i.id));const o=s?Bp(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return jg(n,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ag(r)},xh=(e,t={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},n=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(r=jg(r,Bp(i)),n=!0)}),n?Ag(r):{x:0,y:0,width:0,height:0}},D2=(e,t,[r,n,i]=[0,0,1],a=!1,s=!1)=>{const o={...bh(t,[r,n,i]),width:t.width/i,height:t.height/i},u=[];for(const d of e.values()){const{measured:f,selectable:p=!0,hidden:m=!1}=d;if(s&&!p||m)continue;const x=f.width??d.width??d.initialWidth??null,b=f.height??d.height??d.initialHeight??null,v=Vd(o,uc(d)),k=(x??0)*(b??0),w=a&&v>0;(!d.internals.handleBounds||w||v>=k||d.dragging)&&u.push(d)}return u},Nse=(e,t)=>{const r=new Set;return e.forEach(n=>{r.add(n.id)}),t.filter(n=>r.has(n.source)||r.has(n.target))};function jse(e,t){const r=new Map,n=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!n||n.has(i.id))&&r.set(i.id,i)}),r}async function Ase({nodes:e,width:t,height:r,panZoom:n,minZoom:i,maxZoom:a},s){if(e.size===0)return Promise.resolve(!0);const o=jse(e,s),u=xh(o),d=R2(u,t,r,(s==null?void 0:s.minZoom)??i,(s==null?void 0:s.maxZoom)??a,(s==null?void 0:s.padding)??.1);return await n.setViewport(d,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function tR({nodeId:e,nextPosition:t,nodeLookup:r,nodeOrigin:n=[0,0],nodeExtent:i,onError:a}){const s=r.get(e),o=s.parentId?r.get(s.parentId):void 0,{x:u,y:d}=o?o.internals.positionAbsolute:{x:0,y:0},f=s.origin??n;let p=s.extent||i;if(s.extent==="parent"&&!s.expandParent)if(!o)a==null||a("005",ea.error005());else{const x=o.measured.width,b=o.measured.height;x&&b&&(p=[[u,d],[u+x,d+b]])}else o&&dc(s.extent)&&(p=[[s.extent[0][0]+u,s.extent[0][1]+d],[s.extent[1][0]+u,s.extent[1][1]+d]]);const m=dc(p)?Cl(t,p,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(a==null||a("015",ea.error015())),{position:{x:m.x-u+(s.measured.width??0)*f[0],y:m.y-d+(s.measured.height??0)*f[1]},positionAbsolute:m}}async function Mse({nodesToRemove:e=[],edgesToRemove:t=[],nodes:r,edges:n,onBeforeDelete:i}){const a=new Set(e.map(m=>m.id)),s=[];for(const m of r){if(m.deletable===!1)continue;const x=a.has(m.id),b=!x&&m.parentId&&s.find(v=>v.id===m.parentId);(x||b)&&s.push(m)}const o=new Set(t.map(m=>m.id)),u=n.filter(m=>m.deletable!==!1),f=Nse(s,u);for(const m of u)o.has(m.id)&&!f.find(b=>b.id===m.id)&&f.push(m);if(!i)return{edges:f,nodes:s};const p=await i({nodes:s,edges:f});return typeof p=="boolean"?p?{edges:f,nodes:s}:{edges:[],nodes:[]}:p}const cc=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),Cl=(e={x:0,y:0},t,r)=>({x:cc(e.x,t[0][0],t[1][0]-((r==null?void 0:r.width)??0)),y:cc(e.y,t[0][1],t[1][1]-((r==null?void 0:r.height)??0))});function rR(e,t,r){const{width:n,height:i}=Ba(r),{x:a,y:s}=r.internals.positionAbsolute;return Cl(e,[[a,s],[a+n,s+i]],t)}const Z4=(e,t,r)=>e<t?cc(Math.abs(e-t),1,t)/t:e>r?-cc(Math.abs(e-r),1,t)/t:0,nR=(e,t,r=15,n=40)=>{const i=Z4(e.x,n,t.width-n)*r,a=Z4(e.y,n,t.height-n)*r;return[i,a]},jg=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),q1=({x:e,y:t,width:r,height:n})=>({x:e,y:t,x2:e+r,y2:t+n}),Ag=({x:e,y:t,x2:r,y2:n})=>({x:e,y:t,width:r-e,height:n-t}),uc=(e,t=[0,0])=>{var i,a;const{x:r,y:n}=L2(e)?e.internals.positionAbsolute:mh(e,t);return{x:r,y:n,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},Bp=(e,t=[0,0])=>{var i,a;const{x:r,y:n}=L2(e)?e.internals.positionAbsolute:mh(e,t);return{x:r,y:n,x2:r+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:n+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},iR=(e,t)=>Ag(jg(q1(e),q1(t))),Vd=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),n=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*n)},K4=e=>Ai(e.width)&&Ai(e.height)&&Ai(e.x)&&Ai(e.y),Ai=e=>!isNaN(e)&&isFinite(e),Lse=(e,t)=>{},yh=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),bh=({x:e,y:t},[r,n,i],a=!1,s=[1,1])=>{const o={x:(e-r)/i,y:(t-n)/i};return a?yh(o,s):o},$p=({x:e,y:t},[r,n,i])=>({x:e*i+r,y:t*i+n});function So(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(t*r*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Dse(e,t,r){if(typeof e=="string"||typeof e=="number"){const n=So(e,r),i=So(e,t);return{top:n,right:i,bottom:n,left:i,x:i*2,y:n*2}}if(typeof e=="object"){const n=So(e.top??e.y??0,r),i=So(e.bottom??e.y??0,r),a=So(e.left??e.x??0,t),s=So(e.right??e.x??0,t);return{top:n,right:s,bottom:i,left:a,x:a+s,y:n+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Rse(e,t,r,n,i,a){const{x:s,y:o}=$p(e,[t,r,n]),{x:u,y:d}=$p({x:e.x+e.width,y:e.y+e.height},[t,r,n]),f=i-u,p=a-d;return{left:Math.floor(s),top:Math.floor(o),right:Math.floor(f),bottom:Math.floor(p)}}const R2=(e,t,r,n,i,a)=>{const s=Dse(a,t,r),o=(t-s.x)/e.width,u=(r-s.y)/e.height,d=Math.min(o,u),f=cc(d,n,i),p=e.x+e.width/2,m=e.y+e.height/2,x=t/2-p*f,b=r/2-m*f,v=Rse(e,x,b,f,t,r),k={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:x-k.left+k.right,y:b-k.top+k.bottom,zoom:f}},Wd=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function dc(e){return e!=null&&e!=="parent"}function Ba(e){var t,r;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}}function aR(e){var t,r;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight)!==void 0}function sR(e,t={width:0,height:0},r,n,i){const a={...e},s=n.get(r);if(s){const o=s.origin||i;a.x+=s.internals.positionAbsolute.x-(t.width??0)*o[0],a.y+=s.internals.positionAbsolute.y-(t.height??0)*o[1]}return a}function J4(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function Ose(){let e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}}function Bse(e){return{...Z6,...e||{}}}function md(e,{snapGrid:t=[0,0],snapToGrid:r=!1,transform:n,containerBounds:i}){const{x:a,y:s}=Mi(e),o=bh({x:a-((i==null?void 0:i.left)??0),y:s-((i==null?void 0:i.top)??0)},n),{x:u,y:d}=r?yh(o,t):o;return{xSnapped:u,ySnapped:d,...o}}const O2=e=>({width:e.offsetWidth,height:e.offsetHeight}),lR=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},$se=["INPUT","SELECT","TEXTAREA"];function oR(e){var n,i;const t=((i=(n=e.composedPath)==null?void 0:n.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:$se.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const cR=e=>"clientX"in e,Mi=(e,t)=>{var a,s;const r=cR(e),n=r?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=r?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:n-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},eT=(e,t,r,n,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(s=>{const o=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(o.left-r.left)/n,y:(o.top-r.top)/n,...O2(s)}})};function uR({sourceX:e,sourceY:t,targetX:r,targetY:n,sourceControlX:i,sourceControlY:a,targetControlX:s,targetControlY:o}){const u=e*.125+i*.375+s*.375+r*.125,d=t*.125+a*.375+o*.375+n*.125,f=Math.abs(u-e),p=Math.abs(d-t);return[u,d,f,p]}function n0(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function tT({pos:e,x1:t,y1:r,x2:n,y2:i,c:a}){switch(e){case qe.Left:return[t-n0(t-n,a),r];case qe.Right:return[t+n0(n-t,a),r];case qe.Top:return[t,r-n0(r-i,a)];case qe.Bottom:return[t,r+n0(i-r,a)]}}function dR({sourceX:e,sourceY:t,sourcePosition:r=qe.Bottom,targetX:n,targetY:i,targetPosition:a=qe.Top,curvature:s=.25}){const[o,u]=tT({pos:r,x1:e,y1:t,x2:n,y2:i,c:s}),[d,f]=tT({pos:a,x1:n,y1:i,x2:e,y2:t,c:s}),[p,m,x,b]=uR({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:o,sourceControlY:u,targetControlX:d,targetControlY:f});return[`M${e},${t} C${o},${u} ${d},${f} ${n},${i}`,p,m,x,b]}function hR({sourceX:e,sourceY:t,targetX:r,targetY:n}){const i=Math.abs(r-e)/2,a=r<e?r+i:r-i,s=Math.abs(n-t)/2,o=n<t?n+s:n-s;return[a,o,i,s]}function zse({sourceNode:e,targetNode:t,selected:r=!1,zIndex:n=0,elevateOnSelect:i=!1,zIndexMode:a="basic"}){if(a==="manual")return n;const s=i&&r?n+1e3:n,o=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return s+o}function Ise({sourceNode:e,targetNode:t,width:r,height:n,transform:i}){const a=jg(Bp(e),Bp(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const s={x:-i[0]/i[2],y:-i[1]/i[2],width:r/i[2],height:n/i[2]};return Vd(s,Ag(a))>0}const Fse=({source:e,sourceHandle:t,target:r,targetHandle:n})=>`xy-edge__${e}${t||""}-${r}${n||""}`,Pse=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),Hse=(e,t,r={})=>{if(!e.source||!e.target)return t;const n=r.getEdgeId||Fse;let i;return eR(e)?i={...e}:i={...e,id:n(e)},Pse(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function fR({sourceX:e,sourceY:t,targetX:r,targetY:n}){const[i,a,s,o]=hR({sourceX:e,sourceY:t,targetX:r,targetY:n});return[`M ${e},${t}L ${r},${n}`,i,a,s,o]}const rT={[qe.Left]:{x:-1,y:0},[qe.Right]:{x:1,y:0},[qe.Top]:{x:0,y:-1},[qe.Bottom]:{x:0,y:1}},qse=({source:e,sourcePosition:t=qe.Bottom,target:r})=>t===qe.Left||t===qe.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},nT=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Use({source:e,sourcePosition:t=qe.Bottom,target:r,targetPosition:n=qe.Top,center:i,offset:a,stepPosition:s}){const o=rT[t],u=rT[n],d={x:e.x+o.x*a,y:e.y+o.y*a},f={x:r.x+u.x*a,y:r.y+u.y*a},p=qse({source:d,sourcePosition:t,target:f}),m=p.x!==0?"x":"y",x=p[m];let b=[],v,k;const w={x:0,y:0},C={x:0,y:0},[,,T,j]=hR({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(o[m]*u[m]===-1){m==="x"?(v=i.x??d.x+(f.x-d.x)*s,k=i.y??(d.y+f.y)/2):(v=i.x??(d.x+f.x)/2,k=i.y??d.y+(f.y-d.y)*s);const E=[{x:v,y:d.y},{x:v,y:f.y}],M=[{x:d.x,y:k},{x:f.x,y:k}];o[m]===x?b=m==="x"?E:M:b=m==="x"?M:E}else{const E=[{x:d.x,y:f.y}],M=[{x:f.x,y:d.y}];if(m==="x"?b=o.x===x?M:E:b=o.y===x?E:M,t===n){const W=Math.abs(e[m]-r[m]);if(W<=a){const Y=Math.min(a-1,a-W);o[m]===x?w[m]=(d[m]>e[m]?-1:1)*Y:C[m]=(f[m]>r[m]?-1:1)*Y}}if(t!==n){const W=m==="x"?"y":"x",Y=o[m]===u[W],B=d[W]>f[W],U=d[W]<f[W];(o[m]===1&&(!Y&&B||Y&&U)||o[m]!==1&&(!Y&&U||Y&&B))&&(b=m==="x"?E:M)}const I={x:d.x+w.x,y:d.y+w.y},P={x:f.x+C.x,y:f.y+C.y},z=Math.max(Math.abs(I.x-b[0].x),Math.abs(P.x-b[0].x)),$=Math.max(Math.abs(I.y-b[0].y),Math.abs(P.y-b[0].y));z>=$?(v=(I.x+P.x)/2,k=b[0].y):(v=b[0].x,k=(I.y+P.y)/2)}return[[e,{x:d.x+w.x,y:d.y+w.y},...b,{x:f.x+C.x,y:f.y+C.y},r],v,k,T,j]}function Vse(e,t,r,n){const i=Math.min(nT(e,t)/2,nT(t,r)/2,n),{x:a,y:s}=t;if(e.x===a&&a===r.x||e.y===s&&s===r.y)return`L${a} ${s}`;if(e.y===s){const d=e.x<r.x?-1:1,f=e.y<r.y?1:-1;return`L ${a+i*d},${s}Q ${a},${s} ${a},${s+i*f}`}const o=e.x<r.x?1:-1,u=e.y<r.y?-1:1;return`L ${a},${s+i*u}Q ${a},${s} ${a+i*o},${s}`}function zp({sourceX:e,sourceY:t,sourcePosition:r=qe.Bottom,targetX:n,targetY:i,targetPosition:a=qe.Top,borderRadius:s=5,centerX:o,centerY:u,offset:d=20,stepPosition:f=.5}){const[p,m,x,b,v]=Use({source:{x:e,y:t},sourcePosition:r,target:{x:n,y:i},targetPosition:a,center:{x:o,y:u},offset:d,stepPosition:f});return[p.reduce((w,C,T)=>{let j="";return T>0&&T<p.length-1?j=Vse(p[T-1],C,p[T+1],s):j=`${T===0?"M":"L"}${C.x} ${C.y}`,w+=j,w},""),m,x,b,v]}function iT(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Wse(e){var p;const{sourceNode:t,targetNode:r}=e;if(!iT(t)||!iT(r))return null;const n=t.internals.handleBounds||aT(t.handles),i=r.internals.handleBounds||aT(r.handles),a=sT((n==null?void 0:n.source)??[],e.sourceHandle),s=sT(e.connectionMode===lc.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!a||!s)return(p=e.onError)==null||p.call(e,"008",ea.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const o=(a==null?void 0:a.position)||qe.Bottom,u=(s==null?void 0:s.position)||qe.Top,d=_l(t,a,o),f=_l(r,s,u);return{sourceX:d.x,sourceY:d.y,targetX:f.x,targetY:f.y,sourcePosition:o,targetPosition:u}}function aT(e){if(!e)return null;const t=[],r=[];for(const n of e)n.width=n.width??1,n.height=n.height??1,n.type==="source"?t.push(n):n.type==="target"&&r.push(n);return{source:t,target:r}}function _l(e,t,r=qe.Left,n=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:o}=t??Ba(e);if(n)return{x:i+s/2,y:a+o/2};switch((t==null?void 0:t.position)??r){case qe.Top:return{x:i+s/2,y:a};case qe.Right:return{x:i+s,y:a+o/2};case qe.Bottom:return{x:i+s/2,y:a+o};case qe.Left:return{x:i,y:a+o/2}}}function sT(e,t){return e&&(t?e.find(r=>r.id===t):e[0])||null}function U1(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(n=>`${n}=${e[n]}`).join("&")}`:""}function Yse(e,{id:t,defaultColor:r,defaultMarkerStart:n,defaultMarkerEnd:i}){const a=new Set;return e.reduce((s,o)=>([o.markerStart||n,o.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const d=U1(u,t);a.has(d)||(s.push({id:d,color:u.color||r,...u}),a.add(d))}}),s),[]).sort((s,o)=>s.id.localeCompare(o.id))}const pR=1e3,Gse=10,B2={nodeOrigin:[0,0],nodeExtent:qd,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Xse={...B2,checkEquality:!0};function $2(e,t){const r={...e};for(const n in t)t[n]!==void 0&&(r[n]=t[n]);return r}function Qse(e,t,r){const n=$2(B2,r);for(const i of e.values())if(i.parentId)I2(i,e,t,n);else{const a=mh(i,n.nodeOrigin),s=dc(i.extent)?i.extent:n.nodeExtent,o=Cl(a,s,Ba(i));i.internals.positionAbsolute=o}}function Zse(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const r=[],n=[];for(const i of e.handles){const a={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?r.push(a):i.type==="target"&&n.push(a)}return{source:r,target:n}}function z2(e){return e==="manual"}function V1(e,t,r,n={}){var d,f;const i=$2(Xse,n),a={i:0},s=new Map(t),o=i!=null&&i.elevateNodesOnSelect&&!z2(i.zIndexMode)?pR:0;let u=e.length>0;t.clear(),r.clear();for(const p of e){let m=s.get(p.id);if(i.checkEquality&&p===(m==null?void 0:m.internals.userNode))t.set(p.id,m);else{const x=mh(p,i.nodeOrigin),b=dc(p.extent)?p.extent:i.nodeExtent,v=Cl(x,b,Ba(p));m={...i.defaults,...p,measured:{width:(d=p.measured)==null?void 0:d.width,height:(f=p.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:Zse(p,m),z:gR(p,o,i.zIndexMode),userNode:p}},t.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(u=!1),p.parentId&&I2(m,t,r,n,a)}return u}function Kse(e,t){if(!e.parentId)return;const r=t.get(e.parentId);r?r.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function I2(e,t,r,n,i){const{elevateNodesOnSelect:a,nodeOrigin:s,nodeExtent:o,zIndexMode:u}=$2(B2,n),d=e.parentId,f=t.get(d);if(!f){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Kse(e,r),i&&!f.parentId&&f.internals.rootParentIndex===void 0&&u==="auto"&&(f.internals.rootParentIndex=++i.i,f.internals.z=f.internals.z+i.i*Gse),i&&f.internals.rootParentIndex!==void 0&&(i.i=f.internals.rootParentIndex);const p=a&&!z2(u)?pR:0,{x:m,y:x,z:b}=Jse(e,f,s,o,p,u),{positionAbsolute:v}=e.internals,k=m!==v.x||x!==v.y;(k||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:k?{x:m,y:x}:v,z:b}})}function gR(e,t,r){const n=Ai(e.zIndex)?e.zIndex:0;return z2(r)?n:n+(e.selected?t:0)}function Jse(e,t,r,n,i,a){const{x:s,y:o}=t.internals.positionAbsolute,u=Ba(e),d=mh(e,r),f=dc(e.extent)?Cl(d,e.extent,u):d;let p=Cl({x:s+f.x,y:o+f.y},n,u);e.extent==="parent"&&(p=rR(p,u,t));const m=gR(e,i,a),x=t.internals.z??0;return{x:p.x,y:p.y,z:x>=m?x+1:m}}function F2(e,t,r,n=[0,0]){var s;const i=[],a=new Map;for(const o of e){const u=t.get(o.parentId);if(!u)continue;const d=((s=a.get(o.parentId))==null?void 0:s.expandedRect)??uc(u),f=iR(d,o.rect);a.set(o.parentId,{expandedRect:f,parent:u})}return a.size>0&&a.forEach(({expandedRect:o,parent:u},d)=>{var T;const f=u.internals.positionAbsolute,p=Ba(u),m=u.origin??n,x=o.x<f.x?Math.round(Math.abs(f.x-o.x)):0,b=o.y<f.y?Math.round(Math.abs(f.y-o.y)):0,v=Math.max(p.width,Math.round(o.width)),k=Math.max(p.height,Math.round(o.height)),w=(v-p.width)*m[0],C=(k-p.height)*m[1];(x>0||b>0||w||C)&&(i.push({id:d,type:"position",position:{x:u.position.x-x+w,y:u.position.y-b+C}}),(T=r.get(d))==null||T.forEach(j=>{e.some(L=>L.id===j.id)||i.push({id:j.id,type:"position",position:{x:j.position.x+x,y:j.position.y+b}})})),(p.width<o.width||p.height<o.height||x||b)&&i.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:v+(x?m[0]*x-w:0),height:k+(b?m[1]*b-C:0)}})}),i}function ele(e,t,r,n,i,a,s){const o=n==null?void 0:n.querySelector(".xyflow__viewport");let u=!1;if(!o)return{changes:[],updatedInternals:u};const d=[],f=window.getComputedStyle(o),{m22:p}=new window.DOMMatrixReadOnly(f.transform),m=[];for(const x of e.values()){const b=t.get(x.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),u=!0;continue}const v=O2(x.nodeElement),k=b.measured.width!==v.width||b.measured.height!==v.height;if(!!(v.width&&v.height&&(k||!b.internals.handleBounds||x.force))){const C=x.nodeElement.getBoundingClientRect(),T=dc(b.extent)?b.extent:a;let{positionAbsolute:j}=b.internals;b.parentId&&b.extent==="parent"?j=rR(j,v,t.get(b.parentId)):T&&(j=Cl(j,T,v));const L={...b,measured:v,internals:{...b.internals,positionAbsolute:j,handleBounds:{source:eT("source",x.nodeElement,C,p,b.id),target:eT("target",x.nodeElement,C,p,b.id)}}};t.set(b.id,L),b.parentId&&I2(L,t,r,{nodeOrigin:i,zIndexMode:s}),u=!0,k&&(d.push({id:b.id,type:"dimensions",dimensions:v}),b.expandParent&&b.parentId&&m.push({id:b.id,parentId:b.parentId,rect:uc(L,i)}))}}if(m.length>0){const x=F2(m,t,r,i);d.push(...x)}return{changes:d,updatedInternals:u}}async function tle({delta:e,panZoom:t,transform:r,translateExtent:n,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[i,a]],n),o=!!s&&(s.x!==r[0]||s.y!==r[1]||s.k!==r[2]);return Promise.resolve(o)}function lT(e,t,r,n,i,a){let s=i;const o=n.get(s)||new Map;n.set(s,o.set(r,t)),s=`${i}-${e}`;const u=n.get(s)||new Map;if(n.set(s,u.set(r,t)),a){s=`${i}-${e}-${a}`;const d=n.get(s)||new Map;n.set(s,d.set(r,t))}}function mR(e,t,r){e.clear(),t.clear();for(const n of r){const{source:i,target:a,sourceHandle:s=null,targetHandle:o=null}=n,u={edgeId:n.id,source:i,target:a,sourceHandle:s,targetHandle:o},d=`${i}-${s}--${a}-${o}`,f=`${a}-${o}--${i}-${s}`;lT("source",u,f,e,i,s),lT("target",u,d,e,a,o),t.set(n.id,n)}}function xR(e,t){if(!e.parentId)return!1;const r=t.get(e.parentId);return r?r.selected?!0:xR(r,t):!1}function oT(e,t,r){var i;let n=e;do{if((i=n==null?void 0:n.matches)!=null&&i.call(n,t))return!0;if(n===r)return!1;n=n==null?void 0:n.parentElement}while(n);return!1}function rle(e,t,r,n){const i=new Map;for(const[a,s]of e)if((s.selected||s.id===n)&&(!s.parentId||!xR(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const o=e.get(a);o&&i.set(a,{id:a,position:o.position||{x:0,y:0},distance:{x:r.x-o.internals.positionAbsolute.x,y:r.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return i}function Gy({nodeId:e,dragItems:t,nodeLookup:r,dragging:n=!0}){var s,o,u;const i=[];for(const[d,f]of t){const p=(s=r.get(d))==null?void 0:s.internals.userNode;p&&i.push({...p,position:f.position,dragging:n})}if(!e)return[i[0],i];const a=(o=r.get(e))==null?void 0:o.internals.userNode;return[a?{...a,position:((u=t.get(e))==null?void 0:u.position)||a.position,dragging:n}:i[0],i]}function nle({dragItems:e,snapGrid:t,x:r,y:n}){const i=e.values().next().value;if(!i)return null;const a={x:r-i.distance.x,y:n-i.distance.y},s=yh(a,t);return{x:s.x-a.x,y:s.y-a.y}}function ile({onNodeMouseDown:e,getStoreItems:t,onDragStart:r,onDrag:n,onDragStop:i}){let a={x:null,y:null},s=0,o=new Map,u=!1,d={x:0,y:0},f=null,p=!1,m=null,x=!1,b=!1,v=null;function k({noDragClassName:C,handleSelector:T,domNode:j,isSelectable:L,nodeId:E,nodeClickDistance:M=0}){m=et(j);function I({x:W,y:Y}){const{nodeLookup:B,nodeExtent:U,snapGrid:R,snapToGrid:H,nodeOrigin:V,onNodeDrag:Q,onSelectionDrag:A,onError:D,updateNodePositions:G}=t();a={x:W,y:Y};let q=!1;const Z=o.size>1,re=Z&&U?q1(xh(o)):null,J=Z&&H?nle({dragItems:o,snapGrid:R,x:W,y:Y}):null;for(const[ie,ne]of o){if(!B.has(ie))continue;let oe={x:W-ne.distance.x,y:Y-ne.distance.y};H&&(oe=J?{x:Math.round(oe.x+J.x),y:Math.round(oe.y+J.y)}:yh(oe,R));let fe=null;if(Z&&U&&!ne.extent&&re){const{positionAbsolute:ge}=ne.internals,ke=ge.x-re.x+U[0][0],Te=ge.x+ne.measured.width-re.x2+U[1][0],Ne=ge.y-re.y+U[0][1],Ke=ge.y+ne.measured.height-re.y2+U[1][1];fe=[[ke,Ne],[Te,Ke]]}const{position:xe,positionAbsolute:de}=tR({nodeId:ie,nextPosition:oe,nodeLookup:B,nodeExtent:fe||U,nodeOrigin:V,onError:D});q=q||ne.position.x!==xe.x||ne.position.y!==xe.y,ne.position=xe,ne.internals.positionAbsolute=de}if(b=b||q,!!q&&(G(o,!0),v&&(n||Q||!E&&A))){const[ie,ne]=Gy({nodeId:E,dragItems:o,nodeLookup:B});n==null||n(v,o,ie,ne),Q==null||Q(v,ie,ne),E||A==null||A(v,ne)}}async function P(){if(!f)return;const{transform:W,panBy:Y,autoPanSpeed:B,autoPanOnNodeDrag:U}=t();if(!U){u=!1,cancelAnimationFrame(s);return}const[R,H]=nR(d,f,B);(R!==0||H!==0)&&(a.x=(a.x??0)-R/W[2],a.y=(a.y??0)-H/W[2],await Y({x:R,y:H})&&I(a)),s=requestAnimationFrame(P)}function z(W){var Z;const{nodeLookup:Y,multiSelectionActive:B,nodesDraggable:U,transform:R,snapGrid:H,snapToGrid:V,selectNodesOnDrag:Q,onNodeDragStart:A,onSelectionDragStart:D,unselectNodesAndEdges:G}=t();p=!0,(!Q||!L)&&!B&&E&&((Z=Y.get(E))!=null&&Z.selected||G()),L&&Q&&E&&(e==null||e(E));const q=md(W.sourceEvent,{transform:R,snapGrid:H,snapToGrid:V,containerBounds:f});if(a=q,o=rle(Y,U,q,E),o.size>0&&(r||A||!E&&D)){const[re,J]=Gy({nodeId:E,dragItems:o,nodeLookup:Y});r==null||r(W.sourceEvent,o,re,J),A==null||A(W.sourceEvent,re,J),E||D==null||D(W.sourceEvent,J)}}const $=U3().clickDistance(M).on("start",W=>{const{domNode:Y,nodeDragThreshold:B,transform:U,snapGrid:R,snapToGrid:H}=t();f=(Y==null?void 0:Y.getBoundingClientRect())||null,x=!1,b=!1,v=W.sourceEvent,B===0&&z(W),a=md(W.sourceEvent,{transform:U,snapGrid:R,snapToGrid:H,containerBounds:f}),d=Mi(W.sourceEvent,f)}).on("drag",W=>{const{autoPanOnNodeDrag:Y,transform:B,snapGrid:U,snapToGrid:R,nodeDragThreshold:H,nodeLookup:V}=t(),Q=md(W.sourceEvent,{transform:B,snapGrid:U,snapToGrid:R,containerBounds:f});if(v=W.sourceEvent,(W.sourceEvent.type==="touchmove"&&W.sourceEvent.touches.length>1||E&&!V.has(E))&&(x=!0),!x){if(!u&&Y&&p&&(u=!0,P()),!p){const A=Mi(W.sourceEvent,f),D=A.x-d.x,G=A.y-d.y;Math.sqrt(D*D+G*G)>H&&z(W)}(a.x!==Q.xSnapped||a.y!==Q.ySnapped)&&o&&p&&(d=Mi(W.sourceEvent,f),I(Q))}}).on("end",W=>{if(!(!p||x)&&(u=!1,p=!1,cancelAnimationFrame(s),o.size>0)){const{nodeLookup:Y,updateNodePositions:B,onNodeDragStop:U,onSelectionDragStop:R}=t();if(b&&(B(o,!1),b=!1),i||U||!E&&R){const[H,V]=Gy({nodeId:E,dragItems:o,nodeLookup:Y,dragging:!1});i==null||i(W.sourceEvent,o,H,V),U==null||U(W.sourceEvent,H,V),E||R==null||R(W.sourceEvent,V)}}}).filter(W=>{const Y=W.target;return!W.button&&(!C||!oT(Y,`.${C}`,j))&&(!T||oT(Y,T,j))});m.call($)}function w(){m==null||m.on(".drag",null)}return{update:k,destroy:w}}function ale(e,t,r){const n=[],i={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const a of t.values())Vd(i,uc(a))>0&&n.push(a);return n}const sle=250;function lle(e,t,r,n){var o,u;let i=[],a=1/0;const s=ale(e,r,t+sle);for(const d of s){const f=[...((o=d.internals.handleBounds)==null?void 0:o.source)??[],...((u=d.internals.handleBounds)==null?void 0:u.target)??[]];for(const p of f){if(n.nodeId===p.nodeId&&n.type===p.type&&n.id===p.id)continue;const{x:m,y:x}=_l(d,p,p.position,!0),b=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(x-e.y,2));b>t||(b<a?(i=[{...p,x:m,y:x}],a=b):b===a&&i.push({...p,x:m,y:x}))}}if(!i.length)return null;if(i.length>1){const d=n.type==="source"?"target":"source";return i.find(f=>f.type===d)??i[0]}return i[0]}function yR(e,t,r,n,i,a=!1){var d,f,p;const s=n.get(e);if(!s)return null;const o=i==="strict"?(d=s.internals.handleBounds)==null?void 0:d[t]:[...((f=s.internals.handleBounds)==null?void 0:f.source)??[],...((p=s.internals.handleBounds)==null?void 0:p.target)??[]],u=(r?o==null?void 0:o.find(m=>m.id===r):o==null?void 0:o[0])??null;return u&&a?{...u,..._l(s,u,u.position,!0)}:u}function bR(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function ole(e,t){let r=null;return t?r=!0:e&&!t&&(r=!1),r}const vR=()=>!0;function cle(e,{connectionMode:t,connectionRadius:r,handleId:n,nodeId:i,edgeUpdaterType:a,isTarget:s,domNode:o,nodeLookup:u,lib:d,autoPanOnConnect:f,flowId:p,panBy:m,cancelConnection:x,onConnectStart:b,onConnect:v,onConnectEnd:k,isValidConnection:w=vR,onReconnectEnd:C,updateConnection:T,getTransform:j,getFromHandle:L,autoPanSpeed:E,dragThreshold:M=1,handleDomNode:I}){const P=lR(e.target);let z=0,$;const{x:W,y:Y}=Mi(e),B=bR(a,I),U=o==null?void 0:o.getBoundingClientRect();let R=!1;if(!U||!B)return;const H=yR(i,B,n,u,t);if(!H)return;let V=Mi(e,U),Q=!1,A=null,D=!1,G=null;function q(){if(!f||!U)return;const[xe,de]=nR(V,U,E);m({x:xe,y:de}),z=requestAnimationFrame(q)}const Z={...H,nodeId:i,type:B,position:H.position},re=u.get(i);let ie={inProgress:!0,isValid:null,from:_l(re,Z,qe.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:re,to:V,toHandle:null,toPosition:Q4[Z.position],toNode:null,pointer:V};function ne(){R=!0,T(ie),b==null||b(e,{nodeId:i,handleId:n,handleType:B})}M===0&&ne();function oe(xe){if(!R){const{x:Ke,y:ut}=Mi(xe),tt=Ke-W,rt=ut-Y;if(!(tt*tt+rt*rt>M*M))return;ne()}if(!L()||!Z){fe(xe);return}const de=j();V=Mi(xe,U),$=lle(bh(V,de,!1,[1,1]),r,u,Z),Q||(q(),Q=!0);const ge=wR(xe,{handle:$,connectionMode:t,fromNodeId:i,fromHandleId:n,fromType:s?"target":"source",isValidConnection:w,doc:P,lib:d,flowId:p,nodeLookup:u});G=ge.handleDomNode,A=ge.connection,D=ole(!!$,ge.isValid);const ke=u.get(i),Te=ke?_l(ke,Z,qe.Left,!0):ie.from,Ne={...ie,from:Te,isValid:D,to:ge.toHandle&&D?$p({x:ge.toHandle.x,y:ge.toHandle.y},de):V,toHandle:ge.toHandle,toPosition:D&&ge.toHandle?ge.toHandle.position:Q4[Z.position],toNode:ge.toHandle?u.get(ge.toHandle.nodeId):null,pointer:V};T(Ne),ie=Ne}function fe(xe){if(!("touches"in xe&&xe.touches.length>0)){if(R){($||G)&&A&&D&&(v==null||v(A));const{inProgress:de,...ge}=ie,ke={...ge,toPosition:ie.toHandle?ie.toPosition:null};k==null||k(xe,ke),a&&(C==null||C(xe,ke))}x(),cancelAnimationFrame(z),Q=!1,D=!1,A=null,G=null,P.removeEventListener("mousemove",oe),P.removeEventListener("mouseup",fe),P.removeEventListener("touchmove",oe),P.removeEventListener("touchend",fe)}}P.addEventListener("mousemove",oe),P.addEventListener("mouseup",fe),P.addEventListener("touchmove",oe),P.addEventListener("touchend",fe)}function wR(e,{handle:t,connectionMode:r,fromNodeId:n,fromHandleId:i,fromType:a,doc:s,lib:o,flowId:u,isValidConnection:d=vR,nodeLookup:f}){const p=a==="target",m=t?s.querySelector(`.${o}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x,y:b}=Mi(e),v=s.elementFromPoint(x,b),k=v!=null&&v.classList.contains(`${o}-flow__handle`)?v:m,w={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const C=bR(void 0,k),T=k.getAttribute("data-nodeid"),j=k.getAttribute("data-handleid"),L=k.classList.contains("connectable"),E=k.classList.contains("connectableend");if(!T||!C)return w;const M={source:p?T:n,sourceHandle:p?j:i,target:p?n:T,targetHandle:p?i:j};w.connection=M;const P=L&&E&&(r===lc.Strict?p&&C==="source"||!p&&C==="target":T!==n||j!==i);w.isValid=P&&d(M),w.toHandle=yR(T,C,j,f,r,!0)}return w}const W1={onPointerDown:cle,isValid:wR};function ule({domNode:e,panZoom:t,getTransform:r,getViewScale:n}){const i=et(e);function a({translateExtent:o,width:u,height:d,zoomStep:f=1,pannable:p=!0,zoomable:m=!0,inversePan:x=!1}){const b=T=>{if(T.sourceEvent.type!=="wheel"||!t)return;const j=r(),L=T.sourceEvent.ctrlKey&&Wd()?10:1,E=-T.sourceEvent.deltaY*(T.sourceEvent.deltaMode===1?.05:T.sourceEvent.deltaMode?1:.002)*f,M=j[2]*Math.pow(2,E*L);t.scaleTo(M)};let v=[0,0];const k=T=>{(T.sourceEvent.type==="mousedown"||T.sourceEvent.type==="touchstart")&&(v=[T.sourceEvent.clientX??T.sourceEvent.touches[0].clientX,T.sourceEvent.clientY??T.sourceEvent.touches[0].clientY])},w=T=>{const j=r();if(T.sourceEvent.type!=="mousemove"&&T.sourceEvent.type!=="touchmove"||!t)return;const L=[T.sourceEvent.clientX??T.sourceEvent.touches[0].clientX,T.sourceEvent.clientY??T.sourceEvent.touches[0].clientY],E=[L[0]-v[0],L[1]-v[1]];v=L;const M=n()*Math.max(j[2],Math.log(j[2]))*(x?-1:1),I={x:j[0]-E[0]*M,y:j[1]-E[1]*M},P=[[0,0],[u,d]];t.setViewportConstrained({x:I.x,y:I.y,zoom:j[2]},P,o)},C=jj().on("start",k).on("zoom",p?w:null).on("zoom.wheel",m?b:null);i.call(C,{})}function s(){i.on("zoom",null)}return{update:a,destroy:s,pointer:_i}}const Mg=e=>({x:e.x,y:e.y,zoom:e.k}),Xy=({x:e,y:t,zoom:r})=>cg.translate(e,t).scale(r),Do=(e,t)=>e.target.closest(`.${t}`),kR=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),dle=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Qy=(e,t=0,r=dle,n=()=>{})=>{const i=typeof t=="number"&&t>0;return i||n(),i?e.transition().duration(t).ease(r).on("end",n):e},SR=e=>{const t=e.ctrlKey&&Wd()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function hle({zoomPanValues:e,noWheelClassName:t,d3Selection:r,d3Zoom:n,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:s,onPanZoomStart:o,onPanZoom:u,onPanZoomEnd:d}){return f=>{if(Do(f,t))return f.ctrlKey&&f.preventDefault(),!1;f.preventDefault(),f.stopImmediatePropagation();const p=r.property("__zoom").k||1;if(f.ctrlKey&&s){const k=_i(f),w=SR(f),C=p*Math.pow(2,w);n.scaleTo(r,C,k,f);return}const m=f.deltaMode===1?20:1;let x=i===fl.Vertical?0:f.deltaX*m,b=i===fl.Horizontal?0:f.deltaY*m;!Wd()&&f.shiftKey&&i!==fl.Vertical&&(x=f.deltaY*m,b=0),n.translateBy(r,-(x/p)*a,-(b/p)*a,{internal:!0});const v=Mg(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(f,v),e.panScrollTimeout=setTimeout(()=>{d==null||d(f,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(f,v))}}function fle({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:r}){return function(n,i){const a=n.type==="wheel",s=!t&&a&&!n.ctrlKey,o=Do(n,e);if(n.ctrlKey&&a&&o&&n.preventDefault(),s||o)return null;n.preventDefault(),r.call(this,n,i)}}function ple({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:r}){return n=>{var a,s,o;if((a=n.sourceEvent)!=null&&a.internal)return;const i=Mg(n.transform);e.mouseButton=((s=n.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((o=n.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),r&&(r==null||r(n.sourceEvent,i))}}function gle({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:r,onTransformChange:n,onPanZoom:i}){return a=>{var s,o;e.usedRightMouseButton=!!(r&&kR(t,e.mouseButton??0)),(s=a.sourceEvent)!=null&&s.sync||n([a.transform.x,a.transform.y,a.transform.k]),i&&!((o=a.sourceEvent)!=null&&o.internal)&&(i==null||i(a.sourceEvent,Mg(a.transform)))}}function mle({zoomPanValues:e,panOnDrag:t,panOnScroll:r,onDraggingChange:n,onPanZoomEnd:i,onPaneContextMenu:a}){return s=>{var o;if(!((o=s.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,a&&kR(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&a(s.sourceEvent),e.usedRightMouseButton=!1,n(!1),i)){const u=Mg(s.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(s.sourceEvent,u)},r?150:0)}}}function xle({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:r,panOnDrag:n,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:s,noWheelClassName:o,noPanClassName:u,lib:d,connectionInProgress:f}){return p=>{var k;const m=e||t,x=r&&p.ctrlKey,b=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(Do(p,`${d}-flow__node`)||Do(p,`${d}-flow__edge`)))return!0;if(!n&&!m&&!i&&!a&&!r||s||f&&!b||Do(p,o)&&b||Do(p,u)&&(!b||i&&b&&!e)||!r&&p.ctrlKey&&b)return!1;if(!r&&p.type==="touchstart"&&((k=p.touches)==null?void 0:k.length)>1)return p.preventDefault(),!1;if(!m&&!i&&!x&&b||!n&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(n)&&!n.includes(p.button)&&p.type==="mousedown")return!1;const v=Array.isArray(n)&&n.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||b)&&v}}function yle({domNode:e,minZoom:t,maxZoom:r,translateExtent:n,viewport:i,onPanZoom:a,onPanZoomStart:s,onPanZoomEnd:o,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),p=jj().scaleExtent([t,r]).translateExtent(n),m=et(e).call(p);C({x:i.x,y:i.y,zoom:cc(i.zoom,t,r)},[[0,0],[f.width,f.height]],n);const x=m.on("wheel.zoom"),b=m.on("dblclick.zoom");p.wheelDelta(SR);function v($,W){return m?new Promise(Y=>{p==null||p.interpolate((W==null?void 0:W.interpolate)==="linear"?hd:x0).transform(Qy(m,W==null?void 0:W.duration,W==null?void 0:W.ease,()=>Y(!0)),$)}):Promise.resolve(!1)}function k({noWheelClassName:$,noPanClassName:W,onPaneContextMenu:Y,userSelectionActive:B,panOnScroll:U,panOnDrag:R,panOnScrollMode:H,panOnScrollSpeed:V,preventScrolling:Q,zoomOnPinch:A,zoomOnScroll:D,zoomOnDoubleClick:G,zoomActivationKeyPressed:q,lib:Z,onTransformChange:re,connectionInProgress:J,paneClickDistance:ie,selectionOnDrag:ne}){B&&!d.isZoomingOrPanning&&w();const oe=U&&!q&&!B;p.clickDistance(ne?1/0:!Ai(ie)||ie<0?0:ie);const fe=oe?hle({zoomPanValues:d,noWheelClassName:$,d3Selection:m,d3Zoom:p,panOnScrollMode:H,panOnScrollSpeed:V,zoomOnPinch:A,onPanZoomStart:s,onPanZoom:a,onPanZoomEnd:o}):fle({noWheelClassName:$,preventScrolling:Q,d3ZoomHandler:x});if(m.on("wheel.zoom",fe,{passive:!1}),!B){const de=ple({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:s});p.on("start",de);const ge=gle({zoomPanValues:d,panOnDrag:R,onPaneContextMenu:!!Y,onPanZoom:a,onTransformChange:re});p.on("zoom",ge);const ke=mle({zoomPanValues:d,panOnDrag:R,panOnScroll:U,onPaneContextMenu:Y,onPanZoomEnd:o,onDraggingChange:u});p.on("end",ke)}const xe=xle({zoomActivationKeyPressed:q,panOnDrag:R,zoomOnScroll:D,panOnScroll:U,zoomOnDoubleClick:G,zoomOnPinch:A,userSelectionActive:B,noPanClassName:W,noWheelClassName:$,lib:Z,connectionInProgress:J});p.filter(xe),G?m.on("dblclick.zoom",b):m.on("dblclick.zoom",null)}function w(){p.on("zoom",null)}async function C($,W,Y){const B=Xy($),U=p==null?void 0:p.constrain()(B,W,Y);return U&&await v(U),new Promise(R=>R(U))}async function T($,W){const Y=Xy($);return await v(Y,W),new Promise(B=>B(Y))}function j($){if(m){const W=Xy($),Y=m.property("__zoom");(Y.k!==$.zoom||Y.x!==$.x||Y.y!==$.y)&&(p==null||p.transform(m,W,null,{sync:!0}))}}function L(){const $=m?Nj(m.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function E($,W){return m?new Promise(Y=>{p==null||p.interpolate((W==null?void 0:W.interpolate)==="linear"?hd:x0).scaleTo(Qy(m,W==null?void 0:W.duration,W==null?void 0:W.ease,()=>Y(!0)),$)}):Promise.resolve(!1)}function M($,W){return m?new Promise(Y=>{p==null||p.interpolate((W==null?void 0:W.interpolate)==="linear"?hd:x0).scaleBy(Qy(m,W==null?void 0:W.duration,W==null?void 0:W.ease,()=>Y(!0)),$)}):Promise.resolve(!1)}function I($){p==null||p.scaleExtent($)}function P($){p==null||p.translateExtent($)}function z($){const W=!Ai($)||$<0?0:$;p==null||p.clickDistance(W)}return{update:k,destroy:w,setViewport:T,setViewportConstrained:C,getViewport:L,scaleTo:E,scaleBy:M,setScaleExtent:I,setTranslateExtent:P,syncViewport:j,setClickDistance:z}}var hc;(function(e){e.Line="line",e.Handle="handle"})(hc||(hc={}));function ble({width:e,prevWidth:t,height:r,prevHeight:n,affectsX:i,affectsY:a}){const s=e-t,o=r-n,u=[s>0?1:s<0?-1:0,o>0?1:o<0?-1:0];return s&&i&&(u[0]=u[0]*-1),o&&a&&(u[1]=u[1]*-1),u}function cT(e){const t=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),n=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:r,affectsX:n,affectsY:i}}function cs(e,t){return Math.max(0,t-e)}function us(e,t){return Math.max(0,e-t)}function i0(e,t,r){return Math.max(0,t-e,e-r)}function uT(e,t){return e?!t:t}function vle(e,t,r,n,i,a,s,o){let{affectsX:u,affectsY:d}=t;const{isHorizontal:f,isVertical:p}=t,m=f&&p,{xSnapped:x,ySnapped:b}=r,{minWidth:v,maxWidth:k,minHeight:w,maxHeight:C}=n,{x:T,y:j,width:L,height:E,aspectRatio:M}=e;let I=Math.floor(f?x-e.pointerX:0),P=Math.floor(p?b-e.pointerY:0);const z=L+(u?-I:I),$=E+(d?-P:P),W=-a[0]*L,Y=-a[1]*E;let B=i0(z,v,k),U=i0($,w,C);if(s){let V=0,Q=0;u&&I<0?V=cs(T+I+W,s[0][0]):!u&&I>0&&(V=us(T+z+W,s[1][0])),d&&P<0?Q=cs(j+P+Y,s[0][1]):!d&&P>0&&(Q=us(j+$+Y,s[1][1])),B=Math.max(B,V),U=Math.max(U,Q)}if(o){let V=0,Q=0;u&&I>0?V=us(T+I,o[0][0]):!u&&I<0&&(V=cs(T+z,o[1][0])),d&&P>0?Q=us(j+P,o[0][1]):!d&&P<0&&(Q=cs(j+$,o[1][1])),B=Math.max(B,V),U=Math.max(U,Q)}if(i){if(f){const V=i0(z/M,w,C)*M;if(B=Math.max(B,V),s){let Q=0;!u&&!d||u&&!d&&m?Q=us(j+Y+z/M,s[1][1])*M:Q=cs(j+Y+(u?I:-I)/M,s[0][1])*M,B=Math.max(B,Q)}if(o){let Q=0;!u&&!d||u&&!d&&m?Q=cs(j+z/M,o[1][1])*M:Q=us(j+(u?I:-I)/M,o[0][1])*M,B=Math.max(B,Q)}}if(p){const V=i0($*M,v,k)/M;if(U=Math.max(U,V),s){let Q=0;!u&&!d||d&&!u&&m?Q=us(T+$*M+W,s[1][0])/M:Q=cs(T+(d?P:-P)*M+W,s[0][0])/M,U=Math.max(U,Q)}if(o){let Q=0;!u&&!d||d&&!u&&m?Q=cs(T+$*M,o[1][0])/M:Q=us(T+(d?P:-P)*M,o[0][0])/M,U=Math.max(U,Q)}}}P=P+(P<0?U:-U),I=I+(I<0?B:-B),i&&(m?z>$*M?P=(uT(u,d)?-I:I)/M:I=(uT(u,d)?-P:P)*M:f?(P=I/M,d=u):(I=P*M,u=d));const R=u?T+I:T,H=d?j+P:j;return{width:L+(u?-I:I),height:E+(d?-P:P),x:a[0]*I*(u?-1:1)+R,y:a[1]*P*(d?-1:1)+H}}const CR={width:0,height:0,x:0,y:0},wle={...CR,pointerX:0,pointerY:0,aspectRatio:1};function kle(e){return[[0,0],[e.measured.width,e.measured.height]]}function Sle(e,t,r){const n=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,s=e.measured.height??0,o=r[0]*a,u=r[1]*s;return[[n-o,i-u],[n+a-o,i+s-u]]}function Cle({domNode:e,nodeId:t,getStoreItems:r,onChange:n,onEnd:i}){const a=et(e);let s={controlDirection:cT("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:d,boundaries:f,keepAspectRatio:p,resizeDirection:m,onResizeStart:x,onResize:b,onResizeEnd:v,shouldResize:k}){let w={...CR},C={...wle};s={boundaries:f,resizeDirection:m,keepAspectRatio:p,controlDirection:cT(d)};let T,j=null,L=[],E,M,I,P=!1;const z=U3().on("start",$=>{const{nodeLookup:W,transform:Y,snapGrid:B,snapToGrid:U,nodeOrigin:R,paneDomNode:H}=r();if(T=W.get(t),!T)return;j=(H==null?void 0:H.getBoundingClientRect())??null;const{xSnapped:V,ySnapped:Q}=md($.sourceEvent,{transform:Y,snapGrid:B,snapToGrid:U,containerBounds:j});w={width:T.measured.width??0,height:T.measured.height??0,x:T.position.x??0,y:T.position.y??0},C={...w,pointerX:V,pointerY:Q,aspectRatio:w.width/w.height},E=void 0,T.parentId&&(T.extent==="parent"||T.expandParent)&&(E=W.get(T.parentId),M=E&&T.extent==="parent"?kle(E):void 0),L=[],I=void 0;for(const[A,D]of W)if(D.parentId===t&&(L.push({id:A,position:{...D.position},extent:D.extent}),D.extent==="parent"||D.expandParent)){const G=Sle(D,T,D.origin??R);I?I=[[Math.min(G[0][0],I[0][0]),Math.min(G[0][1],I[0][1])],[Math.max(G[1][0],I[1][0]),Math.max(G[1][1],I[1][1])]]:I=G}x==null||x($,{...w})}).on("drag",$=>{const{transform:W,snapGrid:Y,snapToGrid:B,nodeOrigin:U}=r(),R=md($.sourceEvent,{transform:W,snapGrid:Y,snapToGrid:B,containerBounds:j}),H=[];if(!T)return;const{x:V,y:Q,width:A,height:D}=w,G={},q=T.origin??U,{width:Z,height:re,x:J,y:ie}=vle(C,s.controlDirection,R,s.boundaries,s.keepAspectRatio,q,M,I),ne=Z!==A,oe=re!==D,fe=J!==V&&ne,xe=ie!==Q&&oe;if(!fe&&!xe&&!ne&&!oe)return;if((fe||xe||q[0]===1||q[1]===1)&&(G.x=fe?J:w.x,G.y=xe?ie:w.y,w.x=G.x,w.y=G.y,L.length>0)){const Te=J-V,Ne=ie-Q;for(const Ke of L)Ke.position={x:Ke.position.x-Te+q[0]*(Z-A),y:Ke.position.y-Ne+q[1]*(re-D)},H.push(Ke)}if((ne||oe)&&(G.width=ne&&(!s.resizeDirection||s.resizeDirection==="horizontal")?Z:w.width,G.height=oe&&(!s.resizeDirection||s.resizeDirection==="vertical")?re:w.height,w.width=G.width,w.height=G.height),E&&T.expandParent){const Te=q[0]*(G.width??0);G.x&&G.x<Te&&(w.x=Te,C.x=C.x-(G.x-Te));const Ne=q[1]*(G.height??0);G.y&&G.y<Ne&&(w.y=Ne,C.y=C.y-(G.y-Ne))}const de=ble({width:w.width,prevWidth:A,height:w.height,prevHeight:D,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),ge={...w,direction:de};(k==null?void 0:k($,ge))!==!1&&(P=!0,b==null||b($,ge),n(G,H))}).on("end",$=>{P&&(v==null||v($,{...w}),i==null||i({...w}),P=!1)});a.call(z)}function u(){a.on(".drag",null)}return{update:o,destroy:u}}var Zy={exports:{}},Ky={},Jy={exports:{}},eb={};/**
412
- * @license React
413
- * use-sync-external-store-shim.production.js
414
- *
415
- * Copyright (c) Meta Platforms, Inc. and affiliates.
416
- *
417
- * This source code is licensed under the MIT license found in the
418
- * LICENSE file in the root directory of this source tree.
419
- */var dT;function _le(){if(dT)return eb;dT=1;var e=mc();function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,a=e.useLayoutEffect,s=e.useDebugValue;function o(p,m){var x=m(),b=n({inst:{value:x,getSnapshot:m}}),v=b[0].inst,k=b[1];return a(function(){v.value=x,v.getSnapshot=m,u(v)&&k({inst:v})},[p,x,m]),i(function(){return u(v)&&k({inst:v}),p(function(){u(v)&&k({inst:v})})},[p]),s(x),x}function u(p){var m=p.getSnapshot;p=p.value;try{var x=m();return!r(p,x)}catch{return!0}}function d(p,m){return m()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:o;return eb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,eb}var hT;function Tle(){return hT||(hT=1,Jy.exports=_le()),Jy.exports}/**
420
- * @license React
421
- * use-sync-external-store-shim/with-selector.production.js
422
- *
423
- * Copyright (c) Meta Platforms, Inc. and affiliates.
424
- *
425
- * This source code is licensed under the MIT license found in the
426
- * LICENSE file in the root directory of this source tree.
427
- */var fT;function Ele(){if(fT)return Ky;fT=1;var e=mc(),t=Tle();function r(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,a=e.useRef,s=e.useEffect,o=e.useMemo,u=e.useDebugValue;return Ky.useSyncExternalStoreWithSelector=function(d,f,p,m,x){var b=a(null);if(b.current===null){var v={hasValue:!1,value:null};b.current=v}else v=b.current;b=o(function(){function w(E){if(!C){if(C=!0,T=E,E=m(E),x!==void 0&&v.hasValue){var M=v.value;if(x(M,E))return j=M}return j=E}if(M=j,n(T,E))return M;var I=m(E);return x!==void 0&&x(M,I)?(T=E,M):(T=E,j=I)}var C=!1,T,j,L=p===void 0?null:p;return[function(){return w(f())},L===null?void 0:function(){return w(L())}]},[f,p,m,x]);var k=i(d,b[0],b[1]);return s(function(){v.hasValue=!0,v.value=k},[k]),u(k),k},Ky}var pT;function Nle(){return pT||(pT=1,Zy.exports=Ele()),Zy.exports}var jle=Nle();const Ale=gc(jle),Mle={},gT=e=>{let t;const r=new Set,n=(f,p)=>{const m=typeof f=="function"?f(t):f;if(!Object.is(m,t)){const x=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),r.forEach(b=>b(t,x))}},i=()=>t,u={setState:n,getState:i,getInitialState:()=>d,subscribe:f=>(r.add(f),()=>r.delete(f)),destroy:()=>{(Mle?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},d=t=e(n,i,u);return u},Lle=e=>e?gT(e):gT,{useDebugValue:Dle}=xn,{useSyncExternalStoreWithSelector:Rle}=Ale,Ole=e=>e;function _R(e,t=Ole,r){const n=Rle(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return Dle(n),n}const mT=(e,t)=>{const r=Lle(e),n=(i,a=t)=>_R(r,i,a);return Object.assign(n,r),n},Ble=(e,t)=>e?mT(e,t):mT;function ar(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(!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}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||!Object.is(e[n],t[n]))return!1;return!0}var nd=lE();const Lg=N.createContext(null),$le=Lg.Provider,TR=ea.error001();function _t(e,t){const r=N.useContext(Lg);if(r===null)throw new Error(TR);return _R(r,e,t)}function sr(){const e=N.useContext(Lg);if(e===null)throw new Error(TR);return N.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const xT={display:"none"},zle={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ER="react-flow__node-desc",NR="react-flow__edge-desc",Ile="react-flow__aria-live",Fle=e=>e.ariaLiveMessage,Ple=e=>e.ariaLabelConfig;function Hle({rfId:e}){const t=_t(Fle);return h.jsx("div",{id:`${Ile}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:zle,children:t})}function qle({rfId:e,disableKeyboardA11y:t}){const r=_t(Ple);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${ER}-${e}`,style:xT,children:t?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${NR}-${e}`,style:xT,children:r["edge.a11yDescription.default"]}),!t&&h.jsx(Hle,{rfId:e})]})}const Dg=N.forwardRef(({position:e="top-left",children:t,className:r,style:n,...i},a)=>{const s=`${e}`.split("-");return h.jsx("div",{className:Tr(["react-flow__panel",r,...s]),style:n,ref:a,...i,children:t})});Dg.displayName="Panel";function Ule({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(Dg,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:h.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Vle=e=>{const t=[],r=[];for(const[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(const[,n]of e.edgeLookup)n.selected&&r.push(n);return{selectedNodes:t,selectedEdges:r}},a0=e=>e.id;function Wle(e,t){return ar(e.selectedNodes.map(a0),t.selectedNodes.map(a0))&&ar(e.selectedEdges.map(a0),t.selectedEdges.map(a0))}function Yle({onSelectionChange:e}){const t=sr(),{selectedNodes:r,selectedEdges:n}=_t(Vle,Wle);return N.useEffect(()=>{const i={nodes:r,edges:n};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[r,n,e]),null}const Gle=e=>!!e.onSelectionChangeHandlers;function Xle({onSelectionChange:e}){const t=_t(Gle);return e||t?h.jsx(Yle,{onSelectionChange:e}):null}const jR=[0,0],Qle={x:0,y:0,zoom:1},Zle=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],yT=[...Zle,"rfId"],Kle=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),bT={translateExtent:qd,nodeOrigin:jR,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Jle(e){const{setNodes:t,setEdges:r,setMinZoom:n,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:s,reset:o,setDefaultNodesAndEdges:u}=_t(Kle,ar),d=sr();N.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{f.current=bT,o()}),[]);const f=N.useRef(bT);return N.useEffect(()=>{for(const p of yT){const m=e[p],x=f.current[p];m!==x&&(typeof e[p]>"u"||(p==="nodes"?t(m):p==="edges"?r(m):p==="minZoom"?n(m):p==="maxZoom"?i(m):p==="translateExtent"?a(m):p==="nodeExtent"?s(m):p==="ariaLabelConfig"?d.setState({ariaLabelConfig:Bse(m)}):p==="fitView"?d.setState({fitViewQueued:m}):p==="fitViewOptions"?d.setState({fitViewOptions:m}):d.setState({[p]:m})))}f.current=e},yT.map(p=>e[p])),null}function vT(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function eoe(e){var n;const[t,r]=N.useState(e==="system"?null:e);return N.useEffect(()=>{if(e!=="system"){r(e);return}const i=vT(),a=()=>r(i!=null&&i.matches?"dark":"light");return a(),i==null||i.addEventListener("change",a),()=>{i==null||i.removeEventListener("change",a)}},[e]),t!==null?t:(n=vT())!=null&&n.matches?"dark":"light"}const wT=typeof document<"u"?document:null;function Yd(e=null,t={target:wT,actInsideInputWithModifier:!0}){const[r,n]=N.useState(!1),i=N.useRef(!1),a=N.useRef(new Set([])),[s,o]=N.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
428
- `).replace(`
429
-
430
- `,`
431
- +`).split(`
432
- `)),f=d.reduce((p,m)=>p.concat(...m),[]);return[d,f]}return[[],[]]},[e]);return N.useEffect(()=>{const u=(t==null?void 0:t.target)??wT,d=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const f=x=>{var k,w;if(i.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!i.current||i.current&&!d)&&oR(x))return!1;const v=ST(x.code,o);if(a.current.add(x[v]),kT(s,a.current,!1)){const C=((w=(k=x.composedPath)==null?void 0:k.call(x))==null?void 0:w[0])||x.target,T=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(i.current||!T)&&x.preventDefault(),n(!0)}},p=x=>{const b=ST(x.code,o);kT(s,a.current,!0)?(n(!1),a.current.clear()):a.current.delete(x[b]),x.key==="Meta"&&a.current.clear(),i.current=!1},m=()=>{a.current.clear(),n(!1)};return u==null||u.addEventListener("keydown",f),u==null||u.addEventListener("keyup",p),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{u==null||u.removeEventListener("keydown",f),u==null||u.removeEventListener("keyup",p),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,n]),r}function kT(e,t,r){return e.filter(n=>r||n.length===t.size).some(n=>n.every(i=>t.has(i)))}function ST(e,t){return t.includes(e)?"code":"key"}const toe=()=>{const e=sr();return N.useMemo(()=>({zoomIn:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,r)=>{const{panZoom:n}=e.getState();return n?n.scaleTo(t,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,r)=>{const{transform:[n,i,a],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??n,y:t.y??i,zoom:t.zoom??a},r),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,r,n]=e.getState().transform;return{x:t,y:r,zoom:n}},setCenter:async(t,r,n)=>e.getState().setCenter(t,r,n),fitBounds:async(t,r)=>{const{width:n,height:i,minZoom:a,maxZoom:s,panZoom:o}=e.getState(),u=R2(t,n,i,a,s,(r==null?void 0:r.padding)??.1);return o?(await o.setViewport(u,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,r={})=>{const{transform:n,snapGrid:i,snapToGrid:a,domNode:s}=e.getState();if(!s)return t;const{x:o,y:u}=s.getBoundingClientRect(),d={x:t.x-o,y:t.y-u},f=r.snapGrid??i,p=r.snapToGrid??a;return bh(d,n,p,f)},flowToScreenPosition:t=>{const{transform:r,domNode:n}=e.getState();if(!n)return t;const{x:i,y:a}=n.getBoundingClientRect(),s=$p(t,r);return{x:s.x+i,y:s.y+a}}}),[])};function AR(e,t){const r=[],n=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")n.set(a.id,[a]);else{const s=n.get(a.id);s?s.push(a):n.set(a.id,[a])}for(const a of t){const s=n.get(a.id);if(!s){r.push(a);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){r.push({...s[0].item});continue}const o={...a};for(const u of s)roe(u,o);r.push(o)}return i.length&&i.forEach(a=>{a.index!==void 0?r.splice(a.index,0,{...a.item}):r.push({...a.item})}),r}function roe(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function MR(e,t){return AR(e,t)}function LR(e,t){return AR(e,t)}function nl(e,t){return{id:e,type:"select",selected:t}}function Ro(e,t=new Set,r=!1){const n=[];for(const[i,a]of e){const s=t.has(i);!(a.selected===void 0&&!s)&&a.selected!==s&&(r&&(a.selected=s),n.push(nl(a.id,s)))}return n}function CT({items:e=[],lookup:t}){var i;const r=[],n=new Map(e.map(a=>[a.id,a]));for(const[a,s]of e.entries()){const o=t.get(s.id),u=((i=o==null?void 0:o.internals)==null?void 0:i.userNode)??o;u!==void 0&&u!==s&&r.push({id:s.id,item:s,type:"replace"}),u===void 0&&r.push({item:s,type:"add",index:a})}for(const[a]of t)n.get(a)===void 0&&r.push({id:a,type:"remove"});return r}function _T(e){return{id:e.id,type:"remove"}}const TT=e=>Tse(e),noe=e=>eR(e);function DR(e){return N.forwardRef(e)}const ioe=typeof window<"u"?N.useLayoutEffect:N.useEffect;function ET(e){const[t,r]=N.useState(BigInt(0)),[n]=N.useState(()=>aoe(()=>r(i=>i+BigInt(1))));return ioe(()=>{const i=n.get();i.length&&(e(i),n.reset())},[t]),n}function aoe(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:r=>{t.push(r),e()}}}const RR=N.createContext(null);function soe({children:e}){const t=sr(),r=N.useCallback(o=>{const{nodes:u=[],setNodes:d,hasDefaultNodes:f,onNodesChange:p,nodeLookup:m,fitViewQueued:x,onNodesChangeMiddlewareMap:b}=t.getState();let v=u;for(const w of o)v=typeof w=="function"?w(v):w;let k=CT({items:v,lookup:m});for(const w of b.values())k=w(k);f&&d(v),k.length>0?p==null||p(k):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:C,setNodes:T}=t.getState();w&&T(C)})},[]),n=ET(r),i=N.useCallback(o=>{const{edges:u=[],setEdges:d,hasDefaultEdges:f,onEdgesChange:p,edgeLookup:m}=t.getState();let x=u;for(const b of o)x=typeof b=="function"?b(x):b;f?d(x):p&&p(CT({items:x,lookup:m}))},[]),a=ET(i),s=N.useMemo(()=>({nodeQueue:n,edgeQueue:a}),[]);return h.jsx(RR.Provider,{value:s,children:e})}function loe(){const e=N.useContext(RR);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const ooe=e=>!!e.panZoom;function P2(){const e=toe(),t=sr(),r=loe(),n=_t(ooe),i=N.useMemo(()=>{const a=p=>t.getState().nodeLookup.get(p),s=p=>{r.nodeQueue.push(p)},o=p=>{r.edgeQueue.push(p)},u=p=>{var w,C;const{nodeLookup:m,nodeOrigin:x}=t.getState(),b=TT(p)?p:m.get(p.id),v=b.parentId?sR(b.position,b.measured,b.parentId,m,x):b.position,k={...b,position:v,width:((w=b.measured)==null?void 0:w.width)??b.width,height:((C=b.measured)==null?void 0:C.height)??b.height};return uc(k)},d=(p,m,x={replace:!1})=>{s(b=>b.map(v=>{if(v.id===p){const k=typeof m=="function"?m(v):m;return x.replace&&TT(k)?k:{...v,...k}}return v}))},f=(p,m,x={replace:!1})=>{o(b=>b.map(v=>{if(v.id===p){const k=typeof m=="function"?m(v):m;return x.replace&&noe(k)?k:{...v,...k}}return v}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var m;return(m=a(p))==null?void 0:m.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(m=>({...m}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:s,setEdges:o,addNodes:p=>{const m=Array.isArray(p)?p:[p];r.nodeQueue.push(x=>[...x,...m])},addEdges:p=>{const m=Array.isArray(p)?p:[p];r.edgeQueue.push(x=>[...x,...m])},toObject:()=>{const{nodes:p=[],edges:m=[],transform:x}=t.getState(),[b,v,k]=x;return{nodes:p.map(w=>({...w})),edges:m.map(w=>({...w})),viewport:{x:b,y:v,zoom:k}}},deleteElements:async({nodes:p=[],edges:m=[]})=>{const{nodes:x,edges:b,onNodesDelete:v,onEdgesDelete:k,triggerNodeChanges:w,triggerEdgeChanges:C,onDelete:T,onBeforeDelete:j}=t.getState(),{nodes:L,edges:E}=await Mse({nodesToRemove:p,edgesToRemove:m,nodes:x,edges:b,onBeforeDelete:j}),M=E.length>0,I=L.length>0;if(M){const P=E.map(_T);k==null||k(E),C(P)}if(I){const P=L.map(_T);v==null||v(L),w(P)}return(I||M)&&(T==null||T({nodes:L,edges:E})),{deletedNodes:L,deletedEdges:E}},getIntersectingNodes:(p,m=!0,x)=>{const b=K4(p),v=b?p:u(p),k=x!==void 0;return v?(x||t.getState().nodes).filter(w=>{const C=t.getState().nodeLookup.get(w.id);if(C&&!b&&(w.id===p.id||!C.internals.positionAbsolute))return!1;const T=uc(k?w:C),j=Vd(T,v);return m&&j>0||j>=T.width*T.height||j>=v.width*v.height}):[]},isNodeIntersecting:(p,m,x=!0)=>{const v=K4(p)?p:u(p);if(!v)return!1;const k=Vd(v,m);return x&&k>0||k>=m.width*m.height||k>=v.width*v.height},updateNode:d,updateNodeData:(p,m,x={replace:!1})=>{d(p,b=>{const v=typeof m=="function"?m(b):m;return x.replace?{...b,data:v}:{...b,data:{...b.data,...v}}},x)},updateEdge:f,updateEdgeData:(p,m,x={replace:!1})=>{f(p,b=>{const v=typeof m=="function"?m(b):m;return x.replace?{...b,data:v}:{...b,data:{...b.data,...v}}},x)},getNodesBounds:p=>{const{nodeLookup:m,nodeOrigin:x}=t.getState();return Ese(p,{nodeLookup:m,nodeOrigin:x})},getHandleConnections:({type:p,id:m,nodeId:x})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${x}-${p}${m?`-${m}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:p,handleId:m,nodeId:x})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${x}${p?m?`-${p}-${m}`:`-${p}`:""}`))==null?void 0:b.values())??[])},fitView:async p=>{const m=t.getState().fitViewResolver??Ose();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:m}),r.nodeQueue.push(x=>[...x]),m.promise}}},[]);return N.useMemo(()=>({...i,...e,viewportInitialized:n}),[n])}const NT=e=>e.selected,coe=typeof window<"u"?window:void 0;function uoe({deleteKeyCode:e,multiSelectionKeyCode:t}){const r=sr(),{deleteElements:n}=P2(),i=Yd(e,{actInsideInputWithModifier:!1}),a=Yd(t,{target:coe});N.useEffect(()=>{if(i){const{edges:s,nodes:o}=r.getState();n({nodes:o.filter(NT),edges:s.filter(NT)}),r.setState({nodesSelectionActive:!1})}},[i]),N.useEffect(()=>{r.setState({multiSelectionActive:a})},[a])}function doe(e){const t=sr();N.useEffect(()=>{const r=()=>{var i,a,s,o;if(!e.current||!(((a=(i=e.current).checkVisibility)==null?void 0:a.call(i))??!0))return!1;const n=O2(e.current);(n.height===0||n.width===0)&&((o=(s=t.getState()).onError)==null||o.call(s,"004",ea.error004())),t.setState({width:n.width||500,height:n.height||500})};if(e.current){r(),window.addEventListener("resize",r);const n=new ResizeObserver(()=>r());return n.observe(e.current),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}}},[])}const Rg={position:"absolute",width:"100%",height:"100%",top:0,left:0},hoe=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function foe({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:r=!0,panOnScroll:n=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=fl.Free,zoomOnDoubleClick:s=!0,panOnDrag:o=!0,defaultViewport:u,translateExtent:d,minZoom:f,maxZoom:p,zoomActivationKeyCode:m,preventScrolling:x=!0,children:b,noWheelClassName:v,noPanClassName:k,onViewportChange:w,isControlledViewport:C,paneClickDistance:T,selectionOnDrag:j}){const L=sr(),E=N.useRef(null),{userSelectionActive:M,lib:I,connectionInProgress:P}=_t(hoe,ar),z=Yd(m),$=N.useRef();doe(E);const W=N.useCallback(Y=>{w==null||w({x:Y[0],y:Y[1],zoom:Y[2]}),C||L.setState({transform:Y})},[w,C]);return N.useEffect(()=>{if(E.current){$.current=yle({domNode:E.current,minZoom:f,maxZoom:p,translateExtent:d,viewport:u,onDraggingChange:R=>L.setState({paneDragging:R}),onPanZoomStart:(R,H)=>{const{onViewportChangeStart:V,onMoveStart:Q}=L.getState();Q==null||Q(R,H),V==null||V(H)},onPanZoom:(R,H)=>{const{onViewportChange:V,onMove:Q}=L.getState();Q==null||Q(R,H),V==null||V(H)},onPanZoomEnd:(R,H)=>{const{onViewportChangeEnd:V,onMoveEnd:Q}=L.getState();Q==null||Q(R,H),V==null||V(H)}});const{x:Y,y:B,zoom:U}=$.current.getViewport();return L.setState({panZoom:$.current,transform:[Y,B,U],domNode:E.current.closest(".react-flow")}),()=>{var R;(R=$.current)==null||R.destroy()}}},[]),N.useEffect(()=>{var Y;(Y=$.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:r,panOnScroll:n,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:s,panOnDrag:o,zoomActivationKeyPressed:z,preventScrolling:x,noPanClassName:k,userSelectionActive:M,noWheelClassName:v,lib:I,onTransformChange:W,connectionInProgress:P,selectionOnDrag:j,paneClickDistance:T})},[e,t,r,n,i,a,s,o,z,x,k,M,v,I,W,P,j,T]),h.jsx("div",{className:"react-flow__renderer",ref:E,style:Rg,children:b})}const poe=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function goe(){const{userSelectionActive:e,userSelectionRect:t}=_t(poe,ar);return e&&t?h.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const tb=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},moe=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function xoe({isSelecting:e,selectionKeyPressed:t,selectionMode:r=Ud.Full,panOnDrag:n,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:s,onSelectionEnd:o,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:b}){const v=sr(),{userSelectionActive:k,elementsSelectable:w,dragging:C,connectionInProgress:T}=_t(moe,ar),j=w&&(e||k),L=N.useRef(null),E=N.useRef(),M=N.useRef(new Set),I=N.useRef(new Set),P=N.useRef(!1),z=V=>{if(P.current||T){P.current=!1;return}u==null||u(V),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},$=V=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){V.preventDefault();return}d==null||d(V)},W=f?V=>f(V):void 0,Y=V=>{P.current&&(V.stopPropagation(),P.current=!1)},B=V=>{var re,J;const{domNode:Q}=v.getState();if(E.current=Q==null?void 0:Q.getBoundingClientRect(),!E.current)return;const A=V.target===L.current;if(!A&&!!V.target.closest(".nokey")||!e||!(a&&A||t)||V.button!==0||!V.isPrimary)return;(J=(re=V.target)==null?void 0:re.setPointerCapture)==null||J.call(re,V.pointerId),P.current=!1;const{x:q,y:Z}=Mi(V.nativeEvent,E.current);v.setState({userSelectionRect:{width:0,height:0,startX:q,startY:Z,x:q,y:Z}}),A||(V.stopPropagation(),V.preventDefault())},U=V=>{const{userSelectionRect:Q,transform:A,nodeLookup:D,edgeLookup:G,connectionLookup:q,triggerNodeChanges:Z,triggerEdgeChanges:re,defaultEdgeOptions:J,resetSelectedElements:ie}=v.getState();if(!E.current||!Q)return;const{x:ne,y:oe}=Mi(V.nativeEvent,E.current),{startX:fe,startY:xe}=Q;if(!P.current){const Ne=t?0:i;if(Math.hypot(ne-fe,oe-xe)<=Ne)return;ie(),s==null||s(V)}P.current=!0;const de={startX:fe,startY:xe,x:ne<fe?ne:fe,y:oe<xe?oe:xe,width:Math.abs(ne-fe),height:Math.abs(oe-xe)},ge=M.current,ke=I.current;M.current=new Set(D2(D,de,A,r===Ud.Partial,!0).map(Ne=>Ne.id)),I.current=new Set;const Te=(J==null?void 0:J.selectable)??!0;for(const Ne of M.current){const Ke=q.get(Ne);if(Ke)for(const{edgeId:ut}of Ke.values()){const tt=G.get(ut);tt&&(tt.selectable??Te)&&I.current.add(ut)}}if(!J4(ge,M.current)){const Ne=Ro(D,M.current,!0);Z(Ne)}if(!J4(ke,I.current)){const Ne=Ro(G,I.current);re(Ne)}v.setState({userSelectionRect:de,userSelectionActive:!0,nodesSelectionActive:!1})},R=V=>{var Q,A;V.button===0&&((A=(Q=V.target)==null?void 0:Q.releasePointerCapture)==null||A.call(Q,V.pointerId),!k&&V.target===L.current&&v.getState().userSelectionRect&&(z==null||z(V)),v.setState({userSelectionActive:!1,userSelectionRect:null}),P.current&&(o==null||o(V),v.setState({nodesSelectionActive:M.current.size>0})))},H=n===!0||Array.isArray(n)&&n.includes(0);return h.jsxs("div",{className:Tr(["react-flow__pane",{draggable:H,dragging:C,selection:e}]),onClick:j?void 0:tb(z,L),onContextMenu:tb($,L),onWheel:tb(W,L),onPointerEnter:j?void 0:p,onPointerMove:j?U:m,onPointerUp:j?R:void 0,onPointerDownCapture:j?B:void 0,onClickCapture:j?Y:void 0,onPointerLeave:x,ref:L,style:Rg,children:[b,h.jsx(goe,{})]})}function Y1({id:e,store:t,unselect:r=!1,nodeRef:n}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:s,nodeLookup:o,onError:u}=t.getState(),d=o.get(e);if(!d){u==null||u("012",ea.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(r||d.selected&&s)&&(a({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var f;return(f=n==null?void 0:n.current)==null?void 0:f.blur()})):i([e])}function OR({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:n,nodeId:i,isSelectable:a,nodeClickDistance:s}){const o=sr(),[u,d]=N.useState(!1),f=N.useRef();return N.useEffect(()=>{f.current=ile({getStoreItems:()=>o.getState(),onNodeMouseDown:p=>{Y1({id:p,store:o,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),N.useEffect(()=>{var p,m;if(t)(p=f.current)==null||p.destroy();else if(e.current)return(m=f.current)==null||m.update({noDragClassName:r,handleSelector:n,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:s}),()=>{var x;(x=f.current)==null||x.destroy()}},[r,n,t,a,e,i]),u}const yoe=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function BR(){const e=sr();return N.useCallback(r=>{const{nodeExtent:n,snapToGrid:i,snapGrid:a,nodesDraggable:s,onError:o,updateNodePositions:u,nodeLookup:d,nodeOrigin:f}=e.getState(),p=new Map,m=yoe(s),x=i?a[0]:5,b=i?a[1]:5,v=r.direction.x*x*r.factor,k=r.direction.y*b*r.factor;for(const[,w]of d){if(!m(w))continue;let C={x:w.internals.positionAbsolute.x+v,y:w.internals.positionAbsolute.y+k};i&&(C=yh(C,a));const{position:T,positionAbsolute:j}=tR({nodeId:w.id,nextPosition:C,nodeLookup:d,nodeExtent:n,nodeOrigin:f,onError:o});w.position=T,w.internals.positionAbsolute=j,p.set(w.id,w)}u(p)},[])}const H2=N.createContext(null),boe=H2.Provider;H2.Consumer;const $R=()=>N.useContext(H2),voe=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),woe=(e,t,r)=>n=>{const{connectionClickStartHandle:i,connectionMode:a,connection:s}=n,{fromHandle:o,toHandle:u,isValid:d}=s,f=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===r;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===r,connectingTo:f,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===r,isPossibleEndHandle:a===lc.Strict?(o==null?void 0:o.type)!==r:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!i,valid:f&&d}};function koe({type:e="source",position:t=qe.Top,isValidConnection:r,isConnectable:n=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:s,onConnect:o,children:u,className:d,onMouseDown:f,onTouchStart:p,...m},x){var U,R;const b=s||null,v=e==="target",k=sr(),w=$R(),{connectOnClick:C,noPanClassName:T,rfId:j}=_t(voe,ar),{connectingFrom:L,connectingTo:E,clickConnecting:M,isPossibleEndHandle:I,connectionInProcess:P,clickConnectionInProcess:z,valid:$}=_t(woe(w,b,e),ar);w||(R=(U=k.getState()).onError)==null||R.call(U,"010",ea.error010());const W=H=>{const{defaultEdgeOptions:V,onConnect:Q,hasDefaultEdges:A}=k.getState(),D={...V,...H};if(A){const{edges:G,setEdges:q}=k.getState();q(Hse(D,G))}Q==null||Q(D),o==null||o(D)},Y=H=>{if(!w)return;const V=cR(H.nativeEvent);if(i&&(V&&H.button===0||!V)){const Q=k.getState();W1.onPointerDown(H.nativeEvent,{handleDomNode:H.currentTarget,autoPanOnConnect:Q.autoPanOnConnect,connectionMode:Q.connectionMode,connectionRadius:Q.connectionRadius,domNode:Q.domNode,nodeLookup:Q.nodeLookup,lib:Q.lib,isTarget:v,handleId:b,nodeId:w,flowId:Q.rfId,panBy:Q.panBy,cancelConnection:Q.cancelConnection,onConnectStart:Q.onConnectStart,onConnectEnd:Q.onConnectEnd,updateConnection:Q.updateConnection,onConnect:W,isValidConnection:r||Q.isValidConnection,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:Q.autoPanSpeed,dragThreshold:Q.connectionDragThreshold})}V?f==null||f(H):p==null||p(H)},B=H=>{const{onClickConnectStart:V,onClickConnectEnd:Q,connectionClickStartHandle:A,connectionMode:D,isValidConnection:G,lib:q,rfId:Z,nodeLookup:re,connection:J}=k.getState();if(!w||!A&&!i)return;if(!A){V==null||V(H.nativeEvent,{nodeId:w,handleId:b,handleType:e}),k.setState({connectionClickStartHandle:{nodeId:w,type:e,id:b}});return}const ie=lR(H.target),ne=r||G,{connection:oe,isValid:fe}=W1.isValid(H.nativeEvent,{handle:{nodeId:w,id:b,type:e},connectionMode:D,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:ne,flowId:Z,doc:ie,lib:q,nodeLookup:re});fe&&oe&&W(oe);const xe=structuredClone(J);delete xe.inProgress,xe.toPosition=xe.toHandle?xe.toHandle.position:null,Q==null||Q(H,xe),k.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":b,"data-nodeid":w,"data-handlepos":t,"data-id":`${j}-${w}-${b}-${e}`,className:Tr(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",T,d,{source:!v,target:v,connectable:n,connectablestart:i,connectableend:a,clickconnecting:M,connectingfrom:L,connectingto:E,valid:$,connectionindicator:n&&(!P||I)&&(P||z?a:i)}]),onMouseDown:Y,onTouchStart:Y,onClick:C?B:void 0,ref:x,...m,children:u})}const fc=N.memo(DR(koe));function Soe({data:e,isConnectable:t,sourcePosition:r=qe.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(fc,{type:"source",position:r,isConnectable:t})]})}function Coe({data:e,isConnectable:t,targetPosition:r=qe.Top,sourcePosition:n=qe.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(fc,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,h.jsx(fc,{type:"source",position:n,isConnectable:t})]})}function _oe(){return null}function Toe({data:e,isConnectable:t,targetPosition:r=qe.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(fc,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label]})}const Ip={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},jT={input:Soe,default:Coe,output:Toe,group:_oe};function Eoe(e){var t,r,n,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((r=e.style)==null?void 0:r.height)}:{width:e.width??((n=e.style)==null?void 0:n.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const Noe=e=>{const{width:t,height:r,x:n,y:i}=xh(e.nodeLookup,{filter:a=>!!a.selected});return{width:Ai(t)?t:null,height:Ai(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${n}px,${i}px)`}};function joe({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const n=sr(),{width:i,height:a,transformString:s,userSelectionActive:o}=_t(Noe,ar),u=BR(),d=N.useRef(null);if(N.useEffect(()=>{var m;r||(m=d.current)==null||m.focus({preventScroll:!0})},[r]),OR({nodeRef:d}),o||!i||!a)return null;const f=e?m=>{const x=n.getState().nodes.filter(b=>b.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(Ip,m.key)&&(m.preventDefault(),u({direction:Ip[m.key],factor:m.shiftKey?4:1}))};return h.jsx("div",{className:Tr(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:h.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:r?void 0:-1,onKeyDown:r?void 0:p,style:{width:i,height:a}})})}const AT=typeof window<"u"?window:void 0,Aoe=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function zR({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:n,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:s,paneClickDistance:o,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:f,selectionMode:p,onSelectionStart:m,onSelectionEnd:x,multiSelectionKeyCode:b,panActivationKeyCode:v,zoomActivationKeyCode:k,elementsSelectable:w,zoomOnScroll:C,zoomOnPinch:T,panOnScroll:j,panOnScrollSpeed:L,panOnScrollMode:E,zoomOnDoubleClick:M,panOnDrag:I,defaultViewport:P,translateExtent:z,minZoom:$,maxZoom:W,preventScrolling:Y,onSelectionContextMenu:B,noWheelClassName:U,noPanClassName:R,disableKeyboardA11y:H,onViewportChange:V,isControlledViewport:Q}){const{nodesSelectionActive:A,userSelectionActive:D}=_t(Aoe,ar),G=Yd(d,{target:AT}),q=Yd(v,{target:AT}),Z=q||I,re=q||j,J=f&&Z!==!0,ie=G||D||J;return uoe({deleteKeyCode:u,multiSelectionKeyCode:b}),h.jsx(foe,{onPaneContextMenu:a,elementsSelectable:w,zoomOnScroll:C,zoomOnPinch:T,panOnScroll:re,panOnScrollSpeed:L,panOnScrollMode:E,zoomOnDoubleClick:M,panOnDrag:!G&&Z,defaultViewport:P,translateExtent:z,minZoom:$,maxZoom:W,zoomActivationKeyCode:k,preventScrolling:Y,noWheelClassName:U,noPanClassName:R,onViewportChange:V,isControlledViewport:Q,paneClickDistance:o,selectionOnDrag:J,children:h.jsxs(xoe,{onSelectionStart:m,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:n,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:s,panOnDrag:Z,isSelecting:!!ie,selectionMode:p,selectionKeyPressed:G,paneClickDistance:o,selectionOnDrag:J,children:[e,A&&h.jsx(joe,{onSelectionContextMenu:B,noPanClassName:R,disableKeyboardA11y:H})]})})}zR.displayName="FlowRenderer";const Moe=N.memo(zR),Loe=e=>t=>e?D2(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(r=>r.id):Array.from(t.nodeLookup.keys());function Doe(e){return _t(N.useCallback(Loe(e),[e]),ar)}const Roe=e=>e.updateNodeInternals;function Ooe(){const e=_t(Roe),[t]=N.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const n=new Map;r.forEach(i=>{const a=i.target.getAttribute("data-id");n.set(a,{id:a,nodeElement:i.target,force:!0})}),e(n)}));return N.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Boe({node:e,nodeType:t,hasDimensions:r,resizeObserver:n}){const i=sr(),a=N.useRef(null),s=N.useRef(null),o=N.useRef(e.sourcePosition),u=N.useRef(e.targetPosition),d=N.useRef(t),f=r&&!!e.internals.handleBounds;return N.useEffect(()=>{a.current&&!e.hidden&&(!f||s.current!==a.current)&&(s.current&&(n==null||n.unobserve(s.current)),n==null||n.observe(a.current),s.current=a.current)},[f,e.hidden]),N.useEffect(()=>()=>{s.current&&(n==null||n.unobserve(s.current),s.current=null)},[]),N.useEffect(()=>{if(a.current){const p=d.current!==t,m=o.current!==e.sourcePosition,x=u.current!==e.targetPosition;(p||m||x)&&(d.current=t,o.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function $oe({id:e,onClick:t,onMouseEnter:r,onMouseMove:n,onMouseLeave:i,onContextMenu:a,onDoubleClick:s,nodesDraggable:o,elementsSelectable:u,nodesConnectable:d,nodesFocusable:f,resizeObserver:p,noDragClassName:m,noPanClassName:x,disableKeyboardA11y:b,rfId:v,nodeTypes:k,nodeClickDistance:w,onError:C}){const{node:T,internals:j,isParent:L}=_t(ne=>{const oe=ne.nodeLookup.get(e),fe=ne.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:fe}},ar);let E=T.type||"default",M=(k==null?void 0:k[E])||jT[E];M===void 0&&(C==null||C("003",ea.error003(E)),E="default",M=(k==null?void 0:k.default)||jT.default);const I=!!(T.draggable||o&&typeof T.draggable>"u"),P=!!(T.selectable||u&&typeof T.selectable>"u"),z=!!(T.connectable||d&&typeof T.connectable>"u"),$=!!(T.focusable||f&&typeof T.focusable>"u"),W=sr(),Y=aR(T),B=Boe({node:T,nodeType:E,hasDimensions:Y,resizeObserver:p}),U=OR({nodeRef:B,disabled:T.hidden||!I,noDragClassName:m,handleSelector:T.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:w}),R=BR();if(T.hidden)return null;const H=Ba(T),V=Eoe(T),Q=P||I||t||r||n||i,A=r?ne=>r(ne,{...j.userNode}):void 0,D=n?ne=>n(ne,{...j.userNode}):void 0,G=i?ne=>i(ne,{...j.userNode}):void 0,q=a?ne=>a(ne,{...j.userNode}):void 0,Z=s?ne=>s(ne,{...j.userNode}):void 0,re=ne=>{const{selectNodesOnDrag:oe,nodeDragThreshold:fe}=W.getState();P&&(!oe||!I||fe>0)&&Y1({id:e,store:W,nodeRef:B}),t&&t(ne,{...j.userNode})},J=ne=>{if(!(oR(ne.nativeEvent)||b)){if(Q6.includes(ne.key)&&P){const oe=ne.key==="Escape";Y1({id:e,store:W,unselect:oe,nodeRef:B})}else if(I&&T.selected&&Object.prototype.hasOwnProperty.call(Ip,ne.key)){ne.preventDefault();const{ariaLabelConfig:oe}=W.getState();W.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:ne.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),R({direction:Ip[ne.key],factor:ne.shiftKey?4:1})}}},ie=()=>{var ke;if(b||!((ke=B.current)!=null&&ke.matches(":focus-visible")))return;const{transform:ne,width:oe,height:fe,autoPanOnNodeFocus:xe,setCenter:de}=W.getState();if(!xe)return;D2(new Map([[e,T]]),{x:0,y:0,width:oe,height:fe},ne,!0).length>0||de(T.position.x+H.width/2,T.position.y+H.height/2,{zoom:ne[2]})};return h.jsx("div",{className:Tr(["react-flow__node",`react-flow__node-${E}`,{[x]:I},T.className,{selected:T.selected,selectable:P,parent:L,draggable:I,dragging:U}]),ref:B,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:Y?"visible":"hidden",...T.style,...V},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:D,onMouseLeave:G,onContextMenu:q,onClick:re,onDoubleClick:Z,onKeyDown:$?J:void 0,tabIndex:$?0:void 0,onFocus:$?ie:void 0,role:T.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${ER}-${v}`,"aria-label":T.ariaLabel,...T.domAttributes,children:h.jsx(boe,{value:e,children:h.jsx(M,{id:e,data:T.data,type:E,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:T.selected??!1,selectable:P,draggable:I,deletable:T.deletable??!0,isConnectable:z,sourcePosition:T.sourcePosition,targetPosition:T.targetPosition,dragging:U,dragHandle:T.dragHandle,zIndex:j.z,parentId:T.parentId,...H})})})}var zoe=N.memo($oe);const Ioe=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function IR(e){const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:n,elementsSelectable:i,onError:a}=_t(Ioe,ar),s=Doe(e.onlyRenderVisibleElements),o=Ooe();return h.jsx("div",{className:"react-flow__nodes",style:Rg,children:s.map(u=>h.jsx(zoe,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:t,nodesConnectable:r,nodesFocusable:n,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},u))})}IR.displayName="NodeRenderer";const Foe=N.memo(IR);function Poe(e){return _t(N.useCallback(r=>{if(!e)return r.edges.map(i=>i.id);const n=[];if(r.width&&r.height)for(const i of r.edges){const a=r.nodeLookup.get(i.source),s=r.nodeLookup.get(i.target);a&&s&&Ise({sourceNode:a,targetNode:s,width:r.width,height:r.height,transform:r.transform})&&n.push(i.id)}return n},[e]),ar)}const Hoe=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},qoe=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},MT={[oc.Arrow]:Hoe,[oc.ArrowClosed]:qoe};function Uoe(e){const t=sr();return N.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(MT,e)?MT[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",ea.error009(e)),null)},[e])}const Voe=({id:e,type:t,color:r,width:n=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:s,orient:o="auto-start-reverse"})=>{const u=Uoe(t);return u?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${n}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:o,refX:"0",refY:"0",children:h.jsx(u,{color:r,strokeWidth:s})}):null},FR=({defaultColor:e,rfId:t})=>{const r=_t(a=>a.edges),n=_t(a=>a.defaultEdgeOptions),i=N.useMemo(()=>Yse(r,{id:t,defaultColor:e,defaultMarkerStart:n==null?void 0:n.markerStart,defaultMarkerEnd:n==null?void 0:n.markerEnd}),[r,n,t,e]);return i.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:i.map(a=>h.jsx(Voe,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};FR.displayName="MarkerDefinitions";var Woe=N.memo(FR);function PR({x:e,y:t,label:r,labelStyle:n,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:s=[2,4],labelBgBorderRadius:o=2,children:u,className:d,...f}){const[p,m]=N.useState({x:1,y:0,width:0,height:0}),x=Tr(["react-flow__edge-textwrapper",d]),b=N.useRef(null);return N.useEffect(()=>{if(b.current){const v=b.current.getBBox();m({x:v.x,y:v.y,width:v.width,height:v.height})}},[r]),r?h.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:x,visibility:p.width?"visible":"hidden",...f,children:[i&&h.jsx("rect",{width:p.width+2*s[0],x:-s[0],y:-s[1],height:p.height+2*s[1],className:"react-flow__edge-textbg",style:a,rx:o,ry:o}),h.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:b,style:n,children:r}),u]}):null}PR.displayName="EdgeText";const Yoe=N.memo(PR);function Og({path:e,labelX:t,labelY:r,label:n,labelStyle:i,labelShowBg:a,labelBgStyle:s,labelBgPadding:o,labelBgBorderRadius:u,interactionWidth:d=20,...f}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...f,d:e,fill:"none",className:Tr(["react-flow__edge-path",f.className])}),d?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,n&&Ai(t)&&Ai(r)?h.jsx(Yoe,{x:t,y:r,label:n,labelStyle:i,labelShowBg:a,labelBgStyle:s,labelBgPadding:o,labelBgBorderRadius:u}):null]})}function LT({pos:e,x1:t,y1:r,x2:n,y2:i}){return e===qe.Left||e===qe.Right?[.5*(t+n),r]:[t,.5*(r+i)]}function HR({sourceX:e,sourceY:t,sourcePosition:r=qe.Bottom,targetX:n,targetY:i,targetPosition:a=qe.Top}){const[s,o]=LT({pos:r,x1:e,y1:t,x2:n,y2:i}),[u,d]=LT({pos:a,x1:n,y1:i,x2:e,y2:t}),[f,p,m,x]=uR({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:s,sourceControlY:o,targetControlX:u,targetControlY:d});return[`M${e},${t} C${s},${o} ${u},${d} ${n},${i}`,f,p,m,x]}function qR(e){return N.memo(({id:t,sourceX:r,sourceY:n,targetX:i,targetY:a,sourcePosition:s,targetPosition:o,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:x,style:b,markerEnd:v,markerStart:k,interactionWidth:w})=>{const[C,T,j]=HR({sourceX:r,sourceY:n,sourcePosition:s,targetX:i,targetY:a,targetPosition:o}),L=e.isInternal?void 0:t;return h.jsx(Og,{id:L,path:C,labelX:T,labelY:j,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:x,style:b,markerEnd:v,markerStart:k,interactionWidth:w})})}const Goe=qR({isInternal:!1}),UR=qR({isInternal:!0});Goe.displayName="SimpleBezierEdge";UR.displayName="SimpleBezierEdgeInternal";function VR(e){return N.memo(({id:t,sourceX:r,sourceY:n,targetX:i,targetY:a,label:s,labelStyle:o,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,sourcePosition:x=qe.Bottom,targetPosition:b=qe.Top,markerEnd:v,markerStart:k,pathOptions:w,interactionWidth:C})=>{const[T,j,L]=zp({sourceX:r,sourceY:n,sourcePosition:x,targetX:i,targetY:a,targetPosition:b,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset,stepPosition:w==null?void 0:w.stepPosition}),E=e.isInternal?void 0:t;return h.jsx(Og,{id:E,path:T,labelX:j,labelY:L,label:s,labelStyle:o,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:k,interactionWidth:C})})}const WR=VR({isInternal:!1}),YR=VR({isInternal:!0});WR.displayName="SmoothStepEdge";YR.displayName="SmoothStepEdgeInternal";function GR(e){return N.memo(({id:t,...r})=>{var i;const n=e.isInternal?void 0:t;return h.jsx(WR,{...r,id:n,pathOptions:N.useMemo(()=>{var a;return{borderRadius:0,offset:(a=r.pathOptions)==null?void 0:a.offset}},[(i=r.pathOptions)==null?void 0:i.offset])})})}const Xoe=GR({isInternal:!1}),XR=GR({isInternal:!0});Xoe.displayName="StepEdge";XR.displayName="StepEdgeInternal";function QR(e){return N.memo(({id:t,sourceX:r,sourceY:n,targetX:i,targetY:a,label:s,labelStyle:o,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:x,markerStart:b,interactionWidth:v})=>{const[k,w,C]=fR({sourceX:r,sourceY:n,targetX:i,targetY:a}),T=e.isInternal?void 0:t;return h.jsx(Og,{id:T,path:k,labelX:w,labelY:C,label:s,labelStyle:o,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:x,markerStart:b,interactionWidth:v})})}const Qoe=QR({isInternal:!1}),ZR=QR({isInternal:!0});Qoe.displayName="StraightEdge";ZR.displayName="StraightEdgeInternal";function KR(e){return N.memo(({id:t,sourceX:r,sourceY:n,targetX:i,targetY:a,sourcePosition:s=qe.Bottom,targetPosition:o=qe.Top,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:x,style:b,markerEnd:v,markerStart:k,pathOptions:w,interactionWidth:C})=>{const[T,j,L]=dR({sourceX:r,sourceY:n,sourcePosition:s,targetX:i,targetY:a,targetPosition:o,curvature:w==null?void 0:w.curvature}),E=e.isInternal?void 0:t;return h.jsx(Og,{id:E,path:T,labelX:j,labelY:L,label:u,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:x,style:b,markerEnd:v,markerStart:k,interactionWidth:C})})}const Zoe=KR({isInternal:!1}),JR=KR({isInternal:!0});Zoe.displayName="BezierEdge";JR.displayName="BezierEdgeInternal";const DT={default:JR,straight:ZR,step:XR,smoothstep:YR,simplebezier:UR},RT={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Koe=(e,t,r)=>r===qe.Left?e-t:r===qe.Right?e+t:e,Joe=(e,t,r)=>r===qe.Top?e-t:r===qe.Bottom?e+t:e,OT="react-flow__edgeupdater";function BT({position:e,centerX:t,centerY:r,radius:n=10,onMouseDown:i,onMouseEnter:a,onMouseOut:s,type:o}){return h.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:s,className:Tr([OT,`${OT}-${o}`]),cx:Koe(t,n,e),cy:Joe(r,n,e),r:n,stroke:"transparent",fill:"transparent"})}function ece({isReconnectable:e,reconnectRadius:t,edge:r,sourceX:n,sourceY:i,targetX:a,targetY:s,sourcePosition:o,targetPosition:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,setReconnecting:m,setUpdateHover:x}){const b=sr(),v=(j,L)=>{if(j.button!==0)return;const{autoPanOnConnect:E,domNode:M,isValidConnection:I,connectionMode:P,connectionRadius:z,lib:$,onConnectStart:W,onConnectEnd:Y,cancelConnection:B,nodeLookup:U,rfId:R,panBy:H,updateConnection:V}=b.getState(),Q=L.type==="target",A=(q,Z)=>{m(!1),p==null||p(q,r,L.type,Z)},D=q=>d==null?void 0:d(r,q),G=(q,Z)=>{m(!0),f==null||f(j,r,L.type),W==null||W(q,Z)};W1.onPointerDown(j.nativeEvent,{autoPanOnConnect:E,connectionMode:P,connectionRadius:z,domNode:M,handleId:L.id,nodeId:L.nodeId,nodeLookup:U,isTarget:Q,edgeUpdaterType:L.type,lib:$,flowId:R,cancelConnection:B,panBy:H,isValidConnection:I,onConnect:D,onConnectStart:G,onConnectEnd:Y,onReconnectEnd:A,updateConnection:V,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:j.currentTarget})},k=j=>v(j,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),w=j=>v(j,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),C=()=>x(!0),T=()=>x(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(BT,{position:o,centerX:n,centerY:i,radius:t,onMouseDown:k,onMouseEnter:C,onMouseOut:T,type:"source"}),(e===!0||e==="target")&&h.jsx(BT,{position:u,centerX:a,centerY:s,radius:t,onMouseDown:w,onMouseEnter:C,onMouseOut:T,type:"target"})]})}function tce({id:e,edgesFocusable:t,edgesReconnectable:r,elementsSelectable:n,onClick:i,onDoubleClick:a,onContextMenu:s,onMouseEnter:o,onMouseMove:u,onMouseLeave:d,reconnectRadius:f,onReconnect:p,onReconnectStart:m,onReconnectEnd:x,rfId:b,edgeTypes:v,noPanClassName:k,onError:w,disableKeyboardA11y:C}){let T=_t(de=>de.edgeLookup.get(e));const j=_t(de=>de.defaultEdgeOptions);T=j?{...j,...T}:T;let L=T.type||"default",E=(v==null?void 0:v[L])||DT[L];E===void 0&&(w==null||w("011",ea.error011(L)),L="default",E=(v==null?void 0:v.default)||DT.default);const M=!!(T.focusable||t&&typeof T.focusable>"u"),I=typeof p<"u"&&(T.reconnectable||r&&typeof T.reconnectable>"u"),P=!!(T.selectable||n&&typeof T.selectable>"u"),z=N.useRef(null),[$,W]=N.useState(!1),[Y,B]=N.useState(!1),U=sr(),{zIndex:R,sourceX:H,sourceY:V,targetX:Q,targetY:A,sourcePosition:D,targetPosition:G}=_t(N.useCallback(de=>{const ge=de.nodeLookup.get(T.source),ke=de.nodeLookup.get(T.target);if(!ge||!ke)return{zIndex:T.zIndex,...RT};const Te=Wse({id:e,sourceNode:ge,targetNode:ke,sourceHandle:T.sourceHandle||null,targetHandle:T.targetHandle||null,connectionMode:de.connectionMode,onError:w});return{zIndex:zse({selected:T.selected,zIndex:T.zIndex,sourceNode:ge,targetNode:ke,elevateOnSelect:de.elevateEdgesOnSelect,zIndexMode:de.zIndexMode}),...Te||RT}},[T.source,T.target,T.sourceHandle,T.targetHandle,T.selected,T.zIndex]),ar),q=N.useMemo(()=>T.markerStart?`url('#${U1(T.markerStart,b)}')`:void 0,[T.markerStart,b]),Z=N.useMemo(()=>T.markerEnd?`url('#${U1(T.markerEnd,b)}')`:void 0,[T.markerEnd,b]);if(T.hidden||H===null||V===null||Q===null||A===null)return null;const re=de=>{var Ne;const{addSelectedEdges:ge,unselectNodesAndEdges:ke,multiSelectionActive:Te}=U.getState();P&&(U.setState({nodesSelectionActive:!1}),T.selected&&Te?(ke({nodes:[],edges:[T]}),(Ne=z.current)==null||Ne.blur()):ge([e])),i&&i(de,T)},J=a?de=>{a(de,{...T})}:void 0,ie=s?de=>{s(de,{...T})}:void 0,ne=o?de=>{o(de,{...T})}:void 0,oe=u?de=>{u(de,{...T})}:void 0,fe=d?de=>{d(de,{...T})}:void 0,xe=de=>{var ge;if(!C&&Q6.includes(de.key)&&P){const{unselectNodesAndEdges:ke,addSelectedEdges:Te}=U.getState();de.key==="Escape"?((ge=z.current)==null||ge.blur(),ke({edges:[T]})):Te([e])}};return h.jsx("svg",{style:{zIndex:R},children:h.jsxs("g",{className:Tr(["react-flow__edge",`react-flow__edge-${L}`,T.className,k,{selected:T.selected,animated:T.animated,inactive:!P&&!i,updating:$,selectable:P}]),onClick:re,onDoubleClick:J,onContextMenu:ie,onMouseEnter:ne,onMouseMove:oe,onMouseLeave:fe,onKeyDown:M?xe:void 0,tabIndex:M?0:void 0,role:T.ariaRole??(M?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":T.ariaLabel===null?void 0:T.ariaLabel||`Edge from ${T.source} to ${T.target}`,"aria-describedby":M?`${NR}-${b}`:void 0,ref:z,...T.domAttributes,children:[!Y&&h.jsx(E,{id:e,source:T.source,target:T.target,type:T.type,selected:T.selected,animated:T.animated,selectable:P,deletable:T.deletable??!0,label:T.label,labelStyle:T.labelStyle,labelShowBg:T.labelShowBg,labelBgStyle:T.labelBgStyle,labelBgPadding:T.labelBgPadding,labelBgBorderRadius:T.labelBgBorderRadius,sourceX:H,sourceY:V,targetX:Q,targetY:A,sourcePosition:D,targetPosition:G,data:T.data,style:T.style,sourceHandleId:T.sourceHandle,targetHandleId:T.targetHandle,markerStart:q,markerEnd:Z,pathOptions:"pathOptions"in T?T.pathOptions:void 0,interactionWidth:T.interactionWidth}),I&&h.jsx(ece,{edge:T,isReconnectable:I,reconnectRadius:f,onReconnect:p,onReconnectStart:m,onReconnectEnd:x,sourceX:H,sourceY:V,targetX:Q,targetY:A,sourcePosition:D,targetPosition:G,setUpdateHover:W,setReconnecting:B})]})})}var rce=N.memo(tce);const nce=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function eO({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:r,edgeTypes:n,noPanClassName:i,onReconnect:a,onEdgeContextMenu:s,onEdgeMouseEnter:o,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:f,reconnectRadius:p,onEdgeDoubleClick:m,onReconnectStart:x,onReconnectEnd:b,disableKeyboardA11y:v}){const{edgesFocusable:k,edgesReconnectable:w,elementsSelectable:C,onError:T}=_t(nce,ar),j=Poe(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(Woe,{defaultColor:e,rfId:r}),j.map(L=>h.jsx(rce,{id:L,edgesFocusable:k,edgesReconnectable:w,elementsSelectable:C,noPanClassName:i,onReconnect:a,onContextMenu:s,onMouseEnter:o,onMouseMove:u,onMouseLeave:d,onClick:f,reconnectRadius:p,onDoubleClick:m,onReconnectStart:x,onReconnectEnd:b,rfId:r,onError:T,edgeTypes:n,disableKeyboardA11y:v},L))]})}eO.displayName="EdgeRenderer";const ice=N.memo(eO),ace=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function sce({children:e}){const t=_t(ace);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function lce(e){const t=P2(),r=N.useRef(!1);N.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const oce=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function cce(e){const t=_t(oce),r=sr();return N.useEffect(()=>{e&&(t==null||t(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function uce(e){return e.connection.inProgress?{...e.connection,to:bh(e.connection.to,e.transform)}:{...e.connection}}function dce(e){return uce}function hce(e){const t=dce();return _t(t,ar)}const fce=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function pce({containerStyle:e,style:t,type:r,component:n}){const{nodesConnectable:i,width:a,height:s,isValid:o,inProgress:u}=_t(fce,ar);return!(a&&i&&u)?null:h.jsx("svg",{style:e,width:a,height:s,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:Tr(["react-flow__connection",J6(o)]),children:h.jsx(tO,{style:t,type:r,CustomComponent:n,isValid:o})})})}const tO=({style:e,type:t=fs.Bezier,CustomComponent:r,isValid:n})=>{const{inProgress:i,from:a,fromNode:s,fromHandle:o,fromPosition:u,to:d,toNode:f,toHandle:p,toPosition:m,pointer:x}=hce();if(!i)return;if(r)return h.jsx(r,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:o,fromX:a.x,fromY:a.y,toX:d.x,toY:d.y,fromPosition:u,toPosition:m,connectionStatus:J6(n),toNode:f,toHandle:p,pointer:x});let b="";const v={sourceX:a.x,sourceY:a.y,sourcePosition:u,targetX:d.x,targetY:d.y,targetPosition:m};switch(t){case fs.Bezier:[b]=dR(v);break;case fs.SimpleBezier:[b]=HR(v);break;case fs.Step:[b]=zp({...v,borderRadius:0});break;case fs.SmoothStep:[b]=zp(v);break;default:[b]=fR(v)}return h.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};tO.displayName="ConnectionLine";const gce={};function $T(e=gce){N.useRef(e),sr(),N.useEffect(()=>{},[e])}function mce(){sr(),N.useRef(!1),N.useEffect(()=>{},[])}function rO({nodeTypes:e,edgeTypes:t,onInit:r,onNodeClick:n,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:s,onNodeMouseEnter:o,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:f,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:x,connectionLineType:b,connectionLineStyle:v,connectionLineComponent:k,connectionLineContainerStyle:w,selectionKeyCode:C,selectionOnDrag:T,selectionMode:j,multiSelectionKeyCode:L,panActivationKeyCode:E,zoomActivationKeyCode:M,deleteKeyCode:I,onlyRenderVisibleElements:P,elementsSelectable:z,defaultViewport:$,translateExtent:W,minZoom:Y,maxZoom:B,preventScrolling:U,defaultMarkerColor:R,zoomOnScroll:H,zoomOnPinch:V,panOnScroll:Q,panOnScrollSpeed:A,panOnScrollMode:D,zoomOnDoubleClick:G,panOnDrag:q,onPaneClick:Z,onPaneMouseEnter:re,onPaneMouseMove:J,onPaneMouseLeave:ie,onPaneScroll:ne,onPaneContextMenu:oe,paneClickDistance:fe,nodeClickDistance:xe,onEdgeContextMenu:de,onEdgeMouseEnter:ge,onEdgeMouseMove:ke,onEdgeMouseLeave:Te,reconnectRadius:Ne,onReconnect:Ke,onReconnectStart:ut,onReconnectEnd:tt,noDragClassName:rt,noWheelClassName:nt,noPanClassName:wt,disableKeyboardA11y:xt,nodeExtent:_e,rfId:je,viewport:le,onViewportChange:be}){return $T(e),$T(t),mce(),lce(r),cce(le),h.jsx(Moe,{onPaneClick:Z,onPaneMouseEnter:re,onPaneMouseMove:J,onPaneMouseLeave:ie,onPaneContextMenu:oe,onPaneScroll:ne,paneClickDistance:fe,deleteKeyCode:I,selectionKeyCode:C,selectionOnDrag:T,selectionMode:j,onSelectionStart:m,onSelectionEnd:x,multiSelectionKeyCode:L,panActivationKeyCode:E,zoomActivationKeyCode:M,elementsSelectable:z,zoomOnScroll:H,zoomOnPinch:V,zoomOnDoubleClick:G,panOnScroll:Q,panOnScrollSpeed:A,panOnScrollMode:D,panOnDrag:q,defaultViewport:$,translateExtent:W,minZoom:Y,maxZoom:B,onSelectionContextMenu:p,preventScrolling:U,noDragClassName:rt,noWheelClassName:nt,noPanClassName:wt,disableKeyboardA11y:xt,onViewportChange:be,isControlledViewport:!!le,children:h.jsxs(sce,{children:[h.jsx(ice,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:s,onReconnect:Ke,onReconnectStart:ut,onReconnectEnd:tt,onlyRenderVisibleElements:P,onEdgeContextMenu:de,onEdgeMouseEnter:ge,onEdgeMouseMove:ke,onEdgeMouseLeave:Te,reconnectRadius:Ne,defaultMarkerColor:R,noPanClassName:wt,disableKeyboardA11y:xt,rfId:je}),h.jsx(pce,{style:v,type:b,component:k,containerStyle:w}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(Foe,{nodeTypes:e,onNodeClick:n,onNodeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:f,nodeClickDistance:xe,onlyRenderVisibleElements:P,noPanClassName:wt,noDragClassName:rt,disableKeyboardA11y:xt,nodeExtent:_e,rfId:je}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}rO.displayName="GraphView";const xce=N.memo(rO),zT=({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,width:i,height:a,fitView:s,fitViewOptions:o,minZoom:u=.5,maxZoom:d=2,nodeOrigin:f,nodeExtent:p,zIndexMode:m="basic"}={})=>{const x=new Map,b=new Map,v=new Map,k=new Map,w=n??t??[],C=r??e??[],T=f??[0,0],j=p??qd;mR(v,k,w);const L=V1(C,x,b,{nodeOrigin:T,nodeExtent:j,zIndexMode:m});let E=[0,0,1];if(s&&i&&a){const M=xh(x,{filter:$=>!!(($.width||$.initialWidth)&&($.height||$.initialHeight))}),{x:I,y:P,zoom:z}=R2(M,i,a,u,d,(o==null?void 0:o.padding)??.1);E=[I,P,z]}return{rfId:"1",width:i??0,height:a??0,transform:E,nodes:C,nodesInitialized:L,nodeLookup:x,parentLookup:b,edges:w,edgeLookup:k,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:n!==void 0,panZoom:null,minZoom:u,maxZoom:d,translateExtent:qd,nodeExtent:j,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:lc.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:T,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:o,fitViewResolver:null,connection:{...K6},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Lse,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Z6,zIndexMode:m,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},yce=({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,width:i,height:a,fitView:s,fitViewOptions:o,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:p,zIndexMode:m})=>Ble((x,b)=>{async function v(){const{nodeLookup:k,panZoom:w,fitViewOptions:C,fitViewResolver:T,width:j,height:L,minZoom:E,maxZoom:M}=b();w&&(await Ase({nodes:k,width:j,height:L,panZoom:w,minZoom:E,maxZoom:M},C),T==null||T.resolve(!0),x({fitViewResolver:null}))}return{...zT({nodes:e,edges:t,width:i,height:a,fitView:s,fitViewOptions:o,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:p,defaultNodes:r,defaultEdges:n,zIndexMode:m}),setNodes:k=>{const{nodeLookup:w,parentLookup:C,nodeOrigin:T,elevateNodesOnSelect:j,fitViewQueued:L,zIndexMode:E}=b(),M=V1(k,w,C,{nodeOrigin:T,nodeExtent:p,elevateNodesOnSelect:j,checkEquality:!0,zIndexMode:E});L&&M?(v(),x({nodes:k,nodesInitialized:M,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:k,nodesInitialized:M})},setEdges:k=>{const{connectionLookup:w,edgeLookup:C}=b();mR(w,C,k),x({edges:k})},setDefaultNodesAndEdges:(k,w)=>{if(k){const{setNodes:C}=b();C(k),x({hasDefaultNodes:!0})}if(w){const{setEdges:C}=b();C(w),x({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:w,nodeLookup:C,parentLookup:T,domNode:j,nodeOrigin:L,nodeExtent:E,debug:M,fitViewQueued:I,zIndexMode:P}=b(),{changes:z,updatedInternals:$}=ele(k,C,T,j,L,E,P);$&&(Qse(C,T,{nodeOrigin:L,nodeExtent:E,zIndexMode:P}),I?(v(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),(z==null?void 0:z.length)>0&&(M&&console.log("React Flow: trigger node changes",z),w==null||w(z)))},updateNodePositions:(k,w=!1)=>{const C=[];let T=[];const{nodeLookup:j,triggerNodeChanges:L,connection:E,updateConnection:M,onNodesChangeMiddlewareMap:I}=b();for(const[P,z]of k){const $=j.get(P),W=!!($!=null&&$.expandParent&&($!=null&&$.parentId)&&(z!=null&&z.position)),Y={id:P,type:"position",position:W?{x:Math.max(0,z.position.x),y:Math.max(0,z.position.y)}:z.position,dragging:w};if($&&E.inProgress&&E.fromNode.id===$.id){const B=_l($,E.fromHandle,qe.Left,!0);M({...E,from:B})}W&&$.parentId&&C.push({id:P,parentId:$.parentId,rect:{...z.internals.positionAbsolute,width:z.measured.width??0,height:z.measured.height??0}}),T.push(Y)}if(C.length>0){const{parentLookup:P,nodeOrigin:z}=b(),$=F2(C,j,P,z);T.push(...$)}for(const P of I.values())T=P(T);L(T)},triggerNodeChanges:k=>{const{onNodesChange:w,setNodes:C,nodes:T,hasDefaultNodes:j,debug:L}=b();if(k!=null&&k.length){if(j){const E=MR(k,T);C(E)}L&&console.log("React Flow: trigger node changes",k),w==null||w(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:w,setEdges:C,edges:T,hasDefaultEdges:j,debug:L}=b();if(k!=null&&k.length){if(j){const E=LR(k,T);C(E)}L&&console.log("React Flow: trigger edge changes",k),w==null||w(k)}},addSelectedNodes:k=>{const{multiSelectionActive:w,edgeLookup:C,nodeLookup:T,triggerNodeChanges:j,triggerEdgeChanges:L}=b();if(w){const E=k.map(M=>nl(M,!0));j(E);return}j(Ro(T,new Set([...k]),!0)),L(Ro(C))},addSelectedEdges:k=>{const{multiSelectionActive:w,edgeLookup:C,nodeLookup:T,triggerNodeChanges:j,triggerEdgeChanges:L}=b();if(w){const E=k.map(M=>nl(M,!0));L(E);return}L(Ro(C,new Set([...k]))),j(Ro(T,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:w}={})=>{const{edges:C,nodes:T,nodeLookup:j,triggerNodeChanges:L,triggerEdgeChanges:E}=b(),M=k||T,I=w||C,P=M.map($=>{const W=j.get($.id);return W&&(W.selected=!1),nl($.id,!1)}),z=I.map($=>nl($.id,!1));L(P),E(z)},setMinZoom:k=>{const{panZoom:w,maxZoom:C}=b();w==null||w.setScaleExtent([k,C]),x({minZoom:k})},setMaxZoom:k=>{const{panZoom:w,minZoom:C}=b();w==null||w.setScaleExtent([C,k]),x({maxZoom:k})},setTranslateExtent:k=>{var w;(w=b().panZoom)==null||w.setTranslateExtent(k),x({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:w,triggerNodeChanges:C,triggerEdgeChanges:T,elementsSelectable:j}=b();if(!j)return;const L=w.reduce((M,I)=>I.selected?[...M,nl(I.id,!1)]:M,[]),E=k.reduce((M,I)=>I.selected?[...M,nl(I.id,!1)]:M,[]);C(L),T(E)},setNodeExtent:k=>{const{nodes:w,nodeLookup:C,parentLookup:T,nodeOrigin:j,elevateNodesOnSelect:L,nodeExtent:E,zIndexMode:M}=b();k[0][0]===E[0][0]&&k[0][1]===E[0][1]&&k[1][0]===E[1][0]&&k[1][1]===E[1][1]||(V1(w,C,T,{nodeOrigin:j,nodeExtent:k,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:M}),x({nodeExtent:k}))},panBy:k=>{const{transform:w,width:C,height:T,panZoom:j,translateExtent:L}=b();return tle({delta:k,panZoom:j,transform:w,translateExtent:L,width:C,height:T})},setCenter:async(k,w,C)=>{const{width:T,height:j,maxZoom:L,panZoom:E}=b();if(!E)return Promise.resolve(!1);const M=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:L;return await E.setViewport({x:T/2-k*M,y:j/2-w*M,zoom:M},{duration:C==null?void 0:C.duration,ease:C==null?void 0:C.ease,interpolate:C==null?void 0:C.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...K6}})},updateConnection:k=>{x({connection:k})},reset:()=>x({...zT()})}},Object.is);function bce({initialNodes:e,initialEdges:t,defaultNodes:r,defaultEdges:n,initialWidth:i,initialHeight:a,initialMinZoom:s,initialMaxZoom:o,initialFitViewOptions:u,fitView:d,nodeOrigin:f,nodeExtent:p,zIndexMode:m,children:x}){const[b]=N.useState(()=>yce({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,width:i,height:a,fitView:d,minZoom:s,maxZoom:o,fitViewOptions:u,nodeOrigin:f,nodeExtent:p,zIndexMode:m}));return h.jsx($le,{value:b,children:h.jsx(soe,{children:x})})}function vce({children:e,nodes:t,edges:r,defaultNodes:n,defaultEdges:i,width:a,height:s,fitView:o,fitViewOptions:u,minZoom:d,maxZoom:f,nodeOrigin:p,nodeExtent:m,zIndexMode:x}){return N.useContext(Lg)?h.jsx(h.Fragment,{children:e}):h.jsx(bce,{initialNodes:t,initialEdges:r,defaultNodes:n,defaultEdges:i,initialWidth:a,initialHeight:s,fitView:o,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:f,nodeOrigin:p,nodeExtent:m,zIndexMode:x,children:e})}const wce={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function kce({nodes:e,edges:t,defaultNodes:r,defaultEdges:n,className:i,nodeTypes:a,edgeTypes:s,onNodeClick:o,onEdgeClick:u,onInit:d,onMove:f,onMoveStart:p,onMoveEnd:m,onConnect:x,onConnectStart:b,onConnectEnd:v,onClickConnectStart:k,onClickConnectEnd:w,onNodeMouseEnter:C,onNodeMouseMove:T,onNodeMouseLeave:j,onNodeContextMenu:L,onNodeDoubleClick:E,onNodeDragStart:M,onNodeDrag:I,onNodeDragStop:P,onNodesDelete:z,onEdgesDelete:$,onDelete:W,onSelectionChange:Y,onSelectionDragStart:B,onSelectionDrag:U,onSelectionDragStop:R,onSelectionContextMenu:H,onSelectionStart:V,onSelectionEnd:Q,onBeforeDelete:A,connectionMode:D,connectionLineType:G=fs.Bezier,connectionLineStyle:q,connectionLineComponent:Z,connectionLineContainerStyle:re,deleteKeyCode:J="Backspace",selectionKeyCode:ie="Shift",selectionOnDrag:ne=!1,selectionMode:oe=Ud.Full,panActivationKeyCode:fe="Space",multiSelectionKeyCode:xe=Wd()?"Meta":"Control",zoomActivationKeyCode:de=Wd()?"Meta":"Control",snapToGrid:ge,snapGrid:ke,onlyRenderVisibleElements:Te=!1,selectNodesOnDrag:Ne,nodesDraggable:Ke,autoPanOnNodeFocus:ut,nodesConnectable:tt,nodesFocusable:rt,nodeOrigin:nt=jR,edgesFocusable:wt,edgesReconnectable:xt,elementsSelectable:_e=!0,defaultViewport:je=Qle,minZoom:le=.5,maxZoom:be=2,translateExtent:Le=qd,preventScrolling:We=!0,nodeExtent:at,defaultMarkerColor:Et="#b1b1b7",zoomOnScroll:Er=!0,zoomOnPinch:Wt=!0,panOnScroll:It=!1,panOnScrollSpeed:Lt=.5,panOnScrollMode:dt=fl.Free,zoomOnDoubleClick:Kr=!0,panOnDrag:xr=!0,onPaneClick:As,onPaneMouseEnter:Hn,onPaneMouseMove:qn,onPaneMouseLeave:Xt,onPaneScroll:Bt,onPaneContextMenu:lr,paneClickDistance:$r=1,nodeClickDistance:yt=0,children:Qt,onReconnect:zr,onReconnectStart:Ur,onReconnectEnd:Zt,onEdgeContextMenu:Jr,onEdgeDoubleClick:Ir,onEdgeMouseEnter:en,onEdgeMouseMove:or,onEdgeMouseLeave:Nr,reconnectRadius:tn=10,onNodesChange:Un,onEdgesChange:Fr,noDragClassName:cr="nodrag",noWheelClassName:Yt="nowheel",noPanClassName:ni="nopan",fitView:aa,fitViewOptions:Ms,connectOnClick:Ol,attributionPosition:Bl,proOptions:Be,defaultEdgeOptions:ee,elevateNodesOnSelect:Se=!0,elevateEdgesOnSelect:Me=!1,disableKeyboardA11y:Tt=!1,autoPanOnConnect:Kt,autoPanOnNodeDrag:lt,autoPanSpeed:jr,connectionRadius:_n,isValidConnection:rn,onError:ii,style:fr,id:$a,nodeDragThreshold:Ls,connectionDragThreshold:Hg,viewport:$l,onViewportChange:zl,width:bi,height:Tn,colorMode:Sh="light",debug:qg,onScroll:za,ariaLabelConfig:Ch,zIndexMode:Ds="basic",...Ug},En){const Rs=$a||"1",_h=eoe(Sh),Oc=N.useCallback(sa=>{sa.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),za==null||za(sa)},[za]);return h.jsx("div",{"data-testid":"rf__wrapper",...Ug,onScroll:Oc,style:{...fr,...wce},ref:En,className:Tr(["react-flow",i,_h]),id:$a,role:"application",children:h.jsxs(vce,{nodes:e,edges:t,width:bi,height:Tn,fitView:aa,fitViewOptions:Ms,minZoom:le,maxZoom:be,nodeOrigin:nt,nodeExtent:at,zIndexMode:Ds,children:[h.jsx(xce,{onInit:d,onNodeClick:o,onEdgeClick:u,onNodeMouseEnter:C,onNodeMouseMove:T,onNodeMouseLeave:j,onNodeContextMenu:L,onNodeDoubleClick:E,nodeTypes:a,edgeTypes:s,connectionLineType:G,connectionLineStyle:q,connectionLineComponent:Z,connectionLineContainerStyle:re,selectionKeyCode:ie,selectionOnDrag:ne,selectionMode:oe,deleteKeyCode:J,multiSelectionKeyCode:xe,panActivationKeyCode:fe,zoomActivationKeyCode:de,onlyRenderVisibleElements:Te,defaultViewport:je,translateExtent:Le,minZoom:le,maxZoom:be,preventScrolling:We,zoomOnScroll:Er,zoomOnPinch:Wt,zoomOnDoubleClick:Kr,panOnScroll:It,panOnScrollSpeed:Lt,panOnScrollMode:dt,panOnDrag:xr,onPaneClick:As,onPaneMouseEnter:Hn,onPaneMouseMove:qn,onPaneMouseLeave:Xt,onPaneScroll:Bt,onPaneContextMenu:lr,paneClickDistance:$r,nodeClickDistance:yt,onSelectionContextMenu:H,onSelectionStart:V,onSelectionEnd:Q,onReconnect:zr,onReconnectStart:Ur,onReconnectEnd:Zt,onEdgeContextMenu:Jr,onEdgeDoubleClick:Ir,onEdgeMouseEnter:en,onEdgeMouseMove:or,onEdgeMouseLeave:Nr,reconnectRadius:tn,defaultMarkerColor:Et,noDragClassName:cr,noWheelClassName:Yt,noPanClassName:ni,rfId:Rs,disableKeyboardA11y:Tt,nodeExtent:at,viewport:$l,onViewportChange:zl}),h.jsx(Jle,{nodes:e,edges:t,defaultNodes:r,defaultEdges:n,onConnect:x,onConnectStart:b,onConnectEnd:v,onClickConnectStart:k,onClickConnectEnd:w,nodesDraggable:Ke,autoPanOnNodeFocus:ut,nodesConnectable:tt,nodesFocusable:rt,edgesFocusable:wt,edgesReconnectable:xt,elementsSelectable:_e,elevateNodesOnSelect:Se,elevateEdgesOnSelect:Me,minZoom:le,maxZoom:be,nodeExtent:at,onNodesChange:Un,onEdgesChange:Fr,snapToGrid:ge,snapGrid:ke,connectionMode:D,translateExtent:Le,connectOnClick:Ol,defaultEdgeOptions:ee,fitView:aa,fitViewOptions:Ms,onNodesDelete:z,onEdgesDelete:$,onDelete:W,onNodeDragStart:M,onNodeDrag:I,onNodeDragStop:P,onSelectionDrag:U,onSelectionDragStart:B,onSelectionDragStop:R,onMove:f,onMoveStart:p,onMoveEnd:m,noPanClassName:ni,nodeOrigin:nt,rfId:Rs,autoPanOnConnect:Kt,autoPanOnNodeDrag:lt,autoPanSpeed:jr,onError:ii,connectionRadius:_n,isValidConnection:rn,selectNodesOnDrag:Ne,nodeDragThreshold:Ls,connectionDragThreshold:Hg,onBeforeDelete:A,debug:qg,ariaLabelConfig:Ch,zIndexMode:Ds}),h.jsx(Xle,{onSelectionChange:Y}),Qt,h.jsx(Ule,{proOptions:Be,position:Bl}),h.jsx(qle,{rfId:Rs,disableKeyboardA11y:Tt})]})})}var Sce=DR(kce);function Cce(e){const[t,r]=N.useState(e),n=N.useCallback(i=>r(a=>MR(i,a)),[]);return[t,r,n]}function _ce(e){const[t,r]=N.useState(e),n=N.useCallback(i=>r(a=>LR(i,a)),[]);return[t,r,n]}function Tce({dimensions:e,lineWidth:t,variant:r,className:n}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Tr(["react-flow__background-pattern",r,n])})}function Ece({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:Tr(["react-flow__background-pattern","dots",t])})}var ys;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ys||(ys={}));const Nce={[ys.Dots]:1,[ys.Lines]:1,[ys.Cross]:6},jce=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function nO({id:e,variant:t=ys.Dots,gap:r=20,size:n,lineWidth:i=1,offset:a=0,color:s,bgColor:o,style:u,className:d,patternClassName:f}){const p=N.useRef(null),{transform:m,patternId:x}=_t(jce,ar),b=n||Nce[t],v=t===ys.Dots,k=t===ys.Cross,w=Array.isArray(r)?r:[r,r],C=[w[0]*m[2]||1,w[1]*m[2]||1],T=b*m[2],j=Array.isArray(a)?a:[a,a],L=k?[T,T]:C,E=[j[0]*m[2]||1+L[0]/2,j[1]*m[2]||1+L[1]/2],M=`${x}${e||""}`;return h.jsxs("svg",{className:Tr(["react-flow__background",d]),style:{...u,...Rg,"--xy-background-color-props":o,"--xy-background-pattern-color-props":s},ref:p,"data-testid":"rf__background",children:[h.jsx("pattern",{id:M,x:m[0]%C[0],y:m[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:v?h.jsx(Ece,{radius:T/2,className:f}):h.jsx(Tce,{dimensions:L,lineWidth:i,variant:t,className:f})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${M})`})]})}nO.displayName="Background";const Ace=N.memo(nO);function Mce(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Lce(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Dce(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Rce(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Oce(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function s0({children:e,className:t,...r}){return h.jsx("button",{type:"button",className:Tr(["react-flow__controls-button",t]),...r,children:e})}const Bce=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function iO({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:n=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:s,onFitView:o,onInteractiveChange:u,className:d,children:f,position:p="bottom-left",orientation:m="vertical","aria-label":x}){const b=sr(),{isInteractive:v,minZoomReached:k,maxZoomReached:w,ariaLabelConfig:C}=_t(Bce,ar),{zoomIn:T,zoomOut:j,fitView:L}=P2(),E=()=>{T(),a==null||a()},M=()=>{j(),s==null||s()},I=()=>{L(i),o==null||o()},P=()=>{b.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),u==null||u(!v)},z=m==="horizontal"?"horizontal":"vertical";return h.jsxs(Dg,{className:Tr(["react-flow__controls",z,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":x??C["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(s0,{onClick:E,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:w,children:h.jsx(Mce,{})}),h.jsx(s0,{onClick:M,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:k,children:h.jsx(Lce,{})})]}),r&&h.jsx(s0,{className:"react-flow__controls-fitview",onClick:I,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:h.jsx(Dce,{})}),n&&h.jsx(s0,{className:"react-flow__controls-interactive",onClick:P,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:v?h.jsx(Oce,{}):h.jsx(Rce,{})}),f]})}iO.displayName="Controls";const $ce=N.memo(iO);function zce({id:e,x:t,y:r,width:n,height:i,style:a,color:s,strokeColor:o,strokeWidth:u,className:d,borderRadius:f,shapeRendering:p,selected:m,onClick:x}){const{background:b,backgroundColor:v}=a||{},k=s||b||v;return h.jsx("rect",{className:Tr(["react-flow__minimap-node",{selected:m},d]),x:t,y:r,rx:f,ry:f,width:n,height:i,style:{fill:k,stroke:o,strokeWidth:u},shapeRendering:p,onClick:x?w=>x(w,e):void 0})}const Ice=N.memo(zce),Fce=e=>e.nodes.map(t=>t.id),rb=e=>e instanceof Function?e:()=>e;function Pce({nodeStrokeColor:e,nodeColor:t,nodeClassName:r="",nodeBorderRadius:n=5,nodeStrokeWidth:i,nodeComponent:a=Ice,onClick:s}){const o=_t(Fce,ar),u=rb(t),d=rb(e),f=rb(r),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:o.map(m=>h.jsx(qce,{id:m,nodeColorFunc:u,nodeStrokeColorFunc:d,nodeClassNameFunc:f,nodeBorderRadius:n,nodeStrokeWidth:i,NodeComponent:a,onClick:s,shapeRendering:p},m))})}function Hce({id:e,nodeColorFunc:t,nodeStrokeColorFunc:r,nodeClassNameFunc:n,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:s,NodeComponent:o,onClick:u}){const{node:d,x:f,y:p,width:m,height:x}=_t(b=>{const{internals:v}=b.nodeLookup.get(e),k=v.userNode,{x:w,y:C}=v.positionAbsolute,{width:T,height:j}=Ba(k);return{node:k,x:w,y:C,width:T,height:j}},ar);return!d||d.hidden||!aR(d)?null:h.jsx(o,{x:f,y:p,width:m,height:x,style:d.style,selected:!!d.selected,className:n(d),color:t(d),borderRadius:i,strokeColor:r(d),strokeWidth:a,shapeRendering:s,onClick:u,id:d.id})}const qce=N.memo(Hce);var Uce=N.memo(Pce);const Vce=200,Wce=150,Yce=e=>!e.hidden,Gce=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?iR(xh(e.nodeLookup,{filter:Yce}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Xce="react-flow__minimap-desc";function aO({style:e,className:t,nodeStrokeColor:r,nodeColor:n,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:s,nodeComponent:o,bgColor:u,maskColor:d,maskStrokeColor:f,maskStrokeWidth:p,position:m="bottom-right",onClick:x,onNodeClick:b,pannable:v=!1,zoomable:k=!1,ariaLabel:w,inversePan:C,zoomStep:T=1,offsetScale:j=5}){const L=sr(),E=N.useRef(null),{boundingRect:M,viewBB:I,rfId:P,panZoom:z,translateExtent:$,flowWidth:W,flowHeight:Y,ariaLabelConfig:B}=_t(Gce,ar),U=(e==null?void 0:e.width)??Vce,R=(e==null?void 0:e.height)??Wce,H=M.width/U,V=M.height/R,Q=Math.max(H,V),A=Q*U,D=Q*R,G=j*Q,q=M.x-(A-M.width)/2-G,Z=M.y-(D-M.height)/2-G,re=A+G*2,J=D+G*2,ie=`${Xce}-${P}`,ne=N.useRef(0),oe=N.useRef();ne.current=Q,N.useEffect(()=>{if(E.current&&z)return oe.current=ule({domNode:E.current,panZoom:z,getTransform:()=>L.getState().transform,getViewScale:()=>ne.current}),()=>{var ge;(ge=oe.current)==null||ge.destroy()}},[z]),N.useEffect(()=>{var ge;(ge=oe.current)==null||ge.update({translateExtent:$,width:W,height:Y,inversePan:C,pannable:v,zoomStep:T,zoomable:k})},[v,k,C,T,$,W,Y]);const fe=x?ge=>{var Ne;const[ke,Te]=((Ne=oe.current)==null?void 0:Ne.pointer(ge))||[0,0];x(ge,{x:ke,y:Te})}:void 0,xe=b?N.useCallback((ge,ke)=>{const Te=L.getState().nodeLookup.get(ke).internals.userNode;b(ge,Te)},[]):void 0,de=w??B["minimap.ariaLabel"];return h.jsx(Dg,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*Q:void 0,"--xy-minimap-node-background-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:Tr(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:U,height:R,viewBox:`${q} ${Z} ${re} ${J}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ie,ref:E,onClick:fe,children:[de&&h.jsx("title",{id:ie,children:de}),h.jsx(Uce,{onClick:xe,nodeColor:n,nodeStrokeColor:r,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:o}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${q-G},${Z-G}h${re+G*2}v${J+G*2}h${-re-G*2}z
433
- M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}aO.displayName="MiniMap";N.memo(aO);const Qce=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Zce={[hc.Line]:"right",[hc.Handle]:"bottom-right"};function Kce({nodeId:e,position:t,variant:r=hc.Handle,className:n,style:i=void 0,children:a,color:s,minWidth:o=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:m,autoScale:x=!0,shouldResize:b,onResizeStart:v,onResize:k,onResizeEnd:w}){const C=$R(),T=typeof e=="string"?e:C,j=sr(),L=N.useRef(null),E=r===hc.Handle,M=_t(N.useCallback(Qce(E&&x),[E,x]),ar),I=N.useRef(null),P=t??Zce[r];N.useEffect(()=>{if(!(!L.current||!T))return I.current||(I.current=Cle({domNode:L.current,nodeId:T,getStoreItems:()=>{const{nodeLookup:$,transform:W,snapGrid:Y,snapToGrid:B,nodeOrigin:U,domNode:R}=j.getState();return{nodeLookup:$,transform:W,snapGrid:Y,snapToGrid:B,nodeOrigin:U,paneDomNode:R}},onChange:($,W)=>{const{triggerNodeChanges:Y,nodeLookup:B,parentLookup:U,nodeOrigin:R}=j.getState(),H=[],V={x:$.x,y:$.y},Q=B.get(T);if(Q&&Q.expandParent&&Q.parentId){const A=Q.origin??R,D=$.width??Q.measured.width??0,G=$.height??Q.measured.height??0,q={id:Q.id,parentId:Q.parentId,rect:{width:D,height:G,...sR({x:$.x??Q.position.x,y:$.y??Q.position.y},{width:D,height:G},Q.parentId,B,A)}},Z=F2([q],B,U,R);H.push(...Z),V.x=$.x?Math.max(A[0]*D,$.x):void 0,V.y=$.y?Math.max(A[1]*G,$.y):void 0}if(V.x!==void 0&&V.y!==void 0){const A={id:T,type:"position",position:{...V}};H.push(A)}if($.width!==void 0&&$.height!==void 0){const D={id:T,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};H.push(D)}for(const A of W){const D={...A,type:"position"};H.push(D)}Y(H)},onEnd:({width:$,height:W})=>{const Y={id:T,type:"dimensions",resizing:!1,dimensions:{width:$,height:W}};j.getState().triggerNodeChanges([Y])}})),I.current.update({controlPosition:P,boundaries:{minWidth:o,minHeight:u,maxWidth:d,maxHeight:f},keepAspectRatio:p,resizeDirection:m,onResizeStart:v,onResize:k,onResizeEnd:w,shouldResize:b}),()=>{var $;($=I.current)==null||$.destroy()}},[P,o,u,d,f,p,v,k,w,b]);const z=P.split("-");return h.jsx("div",{className:Tr(["react-flow__resize-control","nodrag",...z,r,n]),ref:L,style:{...i,scale:M,...s&&{[E?"backgroundColor":"borderColor"]:s}},children:a})}N.memo(Kce);function Jce({id:e,sourceX:t,sourceY:r,targetX:n,targetY:i,sourcePosition:a,targetPosition:s,markerEnd:o,data:u}){const[d]=zp({sourceX:t,sourceY:r,sourcePosition:a,targetX:n,targetY:i,targetPosition:s,borderRadius:16}),f=u==null?void 0:u.isActive,p=u==null?void 0:u.isCompleted,m=(u==null?void 0:u.color)||"#8b5cf6";return h.jsxs(h.Fragment,{children:[h.jsx("path",{id:e,d,fill:"none",stroke:f?m:p?"#10b981":"#475569",strokeWidth:f?3:2,style:{filter:f?`drop-shadow(0 0 8px ${m})`:void 0},markerEnd:typeof o=="string"?o:void 0}),f&&h.jsxs(h.Fragment,{children:[h.jsx("circle",{r:"6",fill:m,filter:`drop-shadow(0 0 6px ${m})`,children:h.jsx("animateMotion",{dur:"1.5s",repeatCount:"indefinite",path:d})}),h.jsx("circle",{r:"4",fill:"white",opacity:"0.8",children:h.jsx("animateMotion",{dur:"1.5s",repeatCount:"indefinite",path:d,begin:"0.5s"})}),h.jsx("circle",{r:"6",fill:m,filter:`drop-shadow(0 0 6px ${m})`,children:h.jsx("animateMotion",{dur:"1.5s",repeatCount:"indefinite",path:d,begin:"1s"})})]})]})}function eue({data:e}){const t=e.isActive||e.isSource||e.isTarget,r=e.color||"#8b5cf6",n=()=>({padding:"12px 20px",borderRadius:e.type==="diamond"?"4px":e.type==="circle"?"50%":"8px",border:`2px solid ${t?r:"#475569"}`,background:t?`linear-gradient(135deg, ${r}20, ${r}40)`:"linear-gradient(135deg, #1e293b, #334155)",color:"#f8fafc",fontWeight:500,fontSize:"14px",cursor:"pointer",transition:"all 0.3s ease",boxShadow:t?`0 0 20px ${r}60, 0 4px 12px rgba(0,0,0,0.3)`:"0 4px 12px rgba(0,0,0,0.2)",transform:e.type==="diamond"?"rotate(45deg)":void 0,minWidth:e.type==="circle"?"60px":void 0,minHeight:e.type==="circle"?"60px":void 0,display:"flex",alignItems:"center",justifyContent:"center"});return h.jsxs("div",{style:n(),children:[h.jsx(fc,{type:"target",position:qe.Left,style:{background:r,border:"none"}}),h.jsx("span",{style:{transform:e.type==="diamond"?"rotate(-45deg)":void 0},children:e.label}),h.jsx(fc,{type:"source",position:qe.Right,style:{background:r,border:"none"}})]})}const tue={custom:eue},rue={animated:Jce};function nue(e){const t=new Map,r=[],n=e.split(`
434
- `).map(i=>i.trim()).filter(i=>i&&!i.startsWith("flowchart"));for(const i of n){const a=i.match(/^(\w+)(\[|\(|\{)(.+?)(\]|\)|\})\s*$/);if(a){const[,o,u,d]=a;let f="default";u==="("?f="circle":u==="{"&&(f="diamond"),t.set(o,{label:d.replace(/^\[|\]$/g,"").replace(/^\(|\)$/g,""),type:f});continue}const s=i.match(/(\w+)\s*-->(|\|[^|]+\|)\s*(\w+)/);if(s){const[,o,u,d]=s,f=u?u.replace(/^\||\|$/g,""):void 0;r.push({from:o,to:d,label:f}),t.has(o)||t.set(o,{label:o,type:"default"}),t.has(d)||t.set(d,{label:d,type:"default"})}}return{nodeDefinitions:t,connections:r}}function iue(e,t,r="LR"){var p;const n=new Map,i=Array.from(e.keys()),a=new Map,s=new Map;for(const m of i)a.set(m,0),s.set(m,[]);for(const m of t)a.set(m.to,(a.get(m.to)||0)+1),(p=s.get(m.from))==null||p.push(m.to);const o=[],u=new Set(i);for(;u.size>0;){const m=[];for(const x of u)(a.get(x)||0)===0&&m.push(x);if(m.length===0)m.push(...u),u.clear();else for(const x of m){u.delete(x);for(const b of s.get(x)||[])a.set(b,(a.get(b)||0)-1)}o.push(m)}const d=r==="LR"?200:0,f=r==="LR"?100:150;for(let m=0;m<o.length;m++){const x=o[m],v=-(x.length*f)/2+f/2;for(let k=0;k<x.length;k++){const w=x[k];r==="LR"?n.set(w,{x:m*d,y:v+k*f}):n.set(w,{x:v+k*200,y:m*f})}}return n}function aue({chart:e,steps:t,currentStep:r,autoPlay:n=!1,stepDuration:i=2e3,onStepChange:a,onNodeClick:s,className:o=""}){const[u,d]=N.useState(0),[f,p]=N.useState(n),m=a?r:u,x=a||d,{initialNodes:b,initialEdges:v}=N.useMemo(()=>{const{nodeDefinitions:W,connections:Y}=nue(e),B=e.includes("flowchart TD")||e.includes("flowchart TB")?"TD":"LR",U=iue(W,Y,B),R=[];for(const[V,Q]of W){const A=U.get(V)||{x:0,y:0};R.push({id:V,type:"custom",position:A,data:{label:Q.label,type:Q.type,isActive:!1,isSource:!1,isTarget:!1,color:"#8b5cf6"}})}const H=Y.map((V,Q)=>({id:`e-${V.from}-${V.to}-${Q}`,source:V.from,target:V.to,type:"animated",data:{isActive:!1,isCompleted:!1,color:"#8b5cf6"},markerEnd:{type:oc.ArrowClosed,color:"#475569"}}));return{initialNodes:R,initialEdges:H}},[e,t]),[k,w,C]=Cce(b),[T,j,L]=_ce(v);N.useEffect(()=>{if(t.length===0)return;const W=t[m];W&&(w(Y=>Y.map(B=>({...B,data:{...B.data,isActive:B.id===W.from||B.id===W.to,isSource:B.id===W.from,isTarget:B.id===W.to,color:W.color||"#8b5cf6"}}))),j(Y=>Y.map(B=>{const U=B.source===W.from&&B.target===W.to,R=t.slice(0,m).some(H=>B.source===H.from&&B.target===H.to);return{...B,data:{...B.data,isActive:U,isCompleted:R,color:W.color||"#8b5cf6"},markerEnd:{type:oc.ArrowClosed,color:U?W.color||"#8b5cf6":R?"#10b981":"#475569"}}})))},[m,t,w,j]),N.useEffect(()=>{if(!f)return;const W=setInterval(()=>{const Y=m+1;Y>=t.length?p(!1):x(Y)},i);return()=>clearInterval(W)},[f,m,t.length,i,x]);const E=N.useCallback((W,Y)=>{const B=t.findIndex(U=>U.from===Y.id||U.to===Y.id);B!==-1&&(p(!1),x(B),s==null||s(Y.id))},[t,x,s]),M=N.useCallback(()=>{m>=t.length-1&&x(0),p(!0)},[m,t.length,x]),I=N.useCallback(()=>{p(!1)},[]),P=N.useCallback(()=>{p(!1),x(0)},[x]),z=N.useCallback(W=>{p(!1),x(W)},[x]),$=t[m];return h.jsxs("div",{className:`animated-flow-diagram-v3 ${o}`,children:[h.jsx("div",{className:"h-[400px] bg-slate-900/50 rounded-lg border border-slate-700 overflow-hidden",children:h.jsxs(Sce,{nodes:k,edges:T,onNodesChange:C,onEdgesChange:L,onNodeClick:E,nodeTypes:tue,edgeTypes:rue,fitView:!0,fitViewOptions:{padding:.3},minZoom:.5,maxZoom:2,proOptions:{hideAttribution:!0},children:[h.jsx(Ace,{color:"#334155",gap:20,size:1}),h.jsx($ce,{className:"!bg-slate-800 !border-slate-600 !rounded-lg",showInteractive:!1})]})}),$&&h.jsx("div",{className:"mt-4 p-4 bg-gradient-to-r from-purple-500/10 to-blue-500/10 rounded-lg border border-purple-500/30",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center text-white font-bold",style:{backgroundColor:$.color||"#8b5cf6",boxShadow:`0 0 20px ${$.color||"#8b5cf6"}60`},children:m+1}),h.jsxs("div",{children:[h.jsxs("div",{className:"text-sm text-slate-400",children:[$.from," → ",$.to]}),h.jsx("div",{className:"text-lg font-medium text-white",children:$.label})]})]})}),h.jsx("div",{className:"mt-4 flex items-center gap-2 overflow-x-auto pb-2",children:t.map((W,Y)=>h.jsxs("button",{onClick:()=>z(Y),className:`
435
- flex-shrink-0 px-3 py-2 rounded-lg text-sm font-medium transition-all
436
- ${Y===m?"bg-purple-500 text-white shadow-lg shadow-purple-500/30":Y<m?"bg-emerald-500/20 text-emerald-300":"bg-slate-700 text-slate-400 hover:bg-slate-600"}
437
- `,children:[h.jsxs("span",{className:"font-bold mr-1",children:[Y+1,"."]}),W.label]},Y))}),h.jsxs("div",{className:"mt-4 flex items-center justify-center gap-3",children:[h.jsx("button",{onClick:P,className:"p-2 rounded-lg bg-slate-700 text-slate-300 hover:bg-slate-600 transition-colors",title:"Reset",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),f?h.jsx("button",{onClick:I,className:"p-3 rounded-full bg-purple-500 text-white shadow-lg shadow-purple-500/30 hover:bg-purple-600 transition-colors",title:"Pause",children:h.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})})}):h.jsx("button",{onClick:M,className:"p-3 rounded-full bg-purple-500 text-white shadow-lg shadow-purple-500/30 hover:bg-purple-600 transition-colors",title:"Play",children:h.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{d:"M8 5v14l11-7z"})})}),h.jsx("button",{onClick:()=>x(Math.min(m+1,t.length-1)),disabled:m>=t.length-1,className:"p-2 rounded-lg bg-slate-700 text-slate-300 hover:bg-slate-600 transition-colors disabled:opacity-40",title:"Next Step",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})]})}function IT(e,t=""){if(!e)return null;const r=e.match(/^(\w+)\s*->\s*(\w+)$/);if(r)return{from:r[1],to:r[2],label:t};const n=e.match(/^(\w+)$/);return n?{from:n[1],to:n[1],label:t}:null}function sue(e,t,r){const n=[];if(t)for(const i of t){const a=IT(i,"");a&&n.push(a)}if(e){const i=IT(e,r||"");i&&n.push(i)}return n}function lue({chart:e,currentPath:t,completedPaths:r,stepTitle:n,height:i=300,onNodeClick:a,className:s=""}){const o=N.useMemo(()=>sue(t,r,n),[t,r,n]),u=o.length>0?o.length-1:0,d=N.useCallback(f=>{a==null||a(f)},[a]);return o.length===0&&!e?null:h.jsx("div",{className:s,style:{height:i},children:h.jsx(aue,{chart:e,steps:o,currentStep:u,onNodeClick:d,className:"h-full"})})}function nb({settings:e,currentPath:t,completedPaths:r,stepTitle:n,isVisible:i=!0,onToggle:a,onNodeClick:s,className:o=""}){const u=e.position||"toggle",d=e.height||300;if(u==="toggle"&&!i)return null;const f=h.jsxs("div",{className:`relative ${o}`,children:[(u==="sticky"||u==="sidebar")&&a&&h.jsx("div",{className:"absolute top-2 right-2 z-10",children:h.jsx("button",{onClick:a,className:"p-1.5 rounded-lg bg-slate-700/80 hover:bg-slate-600 text-slate-300 transition-colors",title:i?"Hide Diagram":"Show Diagram",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})}),h.jsx(lue,{chart:e.chart,currentPath:t,completedPaths:r,stepTitle:n,height:d,onNodeClick:s})]});switch(u){case"sticky":return h.jsx("div",{className:"mb-6 bg-slate-800/50 rounded-xl border border-slate-700/50 p-4 backdrop-blur-sm",children:f});case"sidebar":return h.jsx("div",{className:"bg-slate-800/50 rounded-xl border border-slate-700/50 p-4 backdrop-blur-sm h-full",children:f});case"toggle":default:return h.jsxs("div",{className:"fixed bottom-4 right-4 z-50 w-[500px] max-w-[calc(100vw-2rem)] bg-slate-800/95 rounded-xl border border-slate-700/50 p-4 backdrop-blur-sm shadow-2xl",children:[a&&h.jsx("button",{onClick:a,className:"absolute top-2 right-2 p-1.5 rounded-lg bg-slate-700/80 hover:bg-slate-600 text-slate-300 transition-colors z-10",title:"Close Diagram",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),f]})}}function oue({isVisible:e,onClick:t,disabled:r}){return h.jsxs("button",{onClick:t,disabled:r,className:`
438
- flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-all
439
- ${e?"bg-purple-500/20 text-purple-300 border border-purple-500/30":"bg-slate-700/50 text-slate-400 hover:bg-slate-700 hover:text-slate-300 border border-transparent"}
440
- ${r?"opacity-50 cursor-not-allowed":""}
441
- `,title:e?"Hide Flow Diagram":"Show Flow Diagram",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 17V7m0 10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h2a2 2 0 012 2m0 10a2 2 0 002 2h2a2 2 0 002-2M9 7a2 2 0 012-2h2a2 2 0 012 2m0 10V7m0 10a2 2 0 002 2h2a2 2 0 002-2V7a2 2 0 00-2-2h-2a2 2 0 00-2 2"})}),h.jsx("span",{children:e?"Hide Diagram":"Diagram"})]})}function sO(e,t={}){const{enabled:r=!0,interval:n=1e4}=t,[i,a]=N.useState([]),s=N.useRef(null),o=N.useCallback(async x=>{try{const b=new AbortController,v=setTimeout(()=>b.abort(),5e3),k=await fetch(x.url,{method:x.method||"GET",signal:b.signal,headers:{"ngrok-skip-browser-warning":"true"}});return clearTimeout(v),{name:x.name,url:x.url,healthy:k.ok,lastChecked:new Date}}catch(b){return{name:x.name,url:x.url,healthy:!1,lastChecked:new Date,error:b instanceof Error?b.message:"Unknown error"}}},[]),u=N.useCallback(async()=>{if(!e||e.length===0)return;const x=await Promise.all(e.map(o));a(x)},[e,o]);N.useEffect(()=>{if(!r||!e||e.length===0){a([]);return}return a(e.map(x=>({name:x.name,url:x.url,healthy:null,lastChecked:null}))),u(),s.current=window.setInterval(u,n),()=>{s.current&&clearInterval(s.current)}},[r,e,n,u]);const d=i.filter(x=>x.healthy===!0).length,f=i.length,p=f>0&&d===f,m=d>0;return{statuses:i,healthyCount:d,totalCount:f,allHealthy:p,someHealthy:m,refresh:u}}function cue({statuses:e,compact:t=!1}){return e.length===0?null:t?h.jsx(due,{statuses:e}):h.jsx("div",{className:"flex flex-wrap gap-4",children:e.map(r=>h.jsx(uue,{status:r},r.url))})}function uue({status:e}){const t=e.healthy===null,r=e.healthy===!0;return h.jsxs("div",{className:`
442
- rounded-lg border p-4 transition-all duration-200 max-w-md
443
- ${r?"bg-green-50/50 dark:bg-green-900/10 border-green-200 dark:border-green-500/30":t?"bg-slate-50/50 dark:bg-slate-800/30 border-slate-200 dark:border-slate-600":"bg-red-50/50 dark:bg-red-900/10 border-red-200 dark:border-red-500/30"}
444
- `,children:[h.jsxs("div",{className:"flex items-center justify-between gap-4",children:[h.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[h.jsx(lO,{healthy:e.healthy}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h4",{className:"font-medium text-slate-800 dark:text-slate-200 truncate",title:e.name,children:e.name}),h.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 truncate",title:e.url,children:e.url})]})]}),h.jsx("span",{className:`text-xs font-medium px-2 py-1 rounded-full flex-shrink-0 ${r?"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400":t?"bg-slate-100 dark:bg-slate-700 text-slate-600 dark:text-slate-300":"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400"}`,children:t?"Checking...":r?"Healthy":"Down"})]}),e.error&&h.jsx("p",{className:"mt-2 text-xs text-red-600 dark:text-red-400 truncate",title:e.error,children:e.error})]})}function due({statuses:e}){const t=e.filter(a=>a.healthy===!0).length,r=e.length,n=t===r,i=t>0;return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(lO,{healthy:n?!0:i?null:!1,size:"sm"}),h.jsxs("span",{className:`text-sm font-medium ${n?"text-green-600 dark:text-green-400":i?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400"}`,children:[t,"/",r," Services"]})]})}function lO({healthy:e,size:t="md"}){const r=t==="sm"?"w-2 h-2":"w-3 h-3";return e===null?h.jsx(kd,{color:"slate",size:t}):h.jsx("div",{className:`${r} rounded-full ${e?"bg-green-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]":"bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"}`})}function hue({statuses:e}){if(e.length===0)return null;const t=e.filter(a=>a.healthy===!0).length,r=e.length,n=t===r,i=t>0;return h.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-slate-100 dark:bg-slate-800/50",children:[h.jsx("div",{className:`w-2 h-2 rounded-full ${n?"bg-green-500":i?"bg-yellow-500":"bg-red-500"}`}),h.jsxs("span",{className:"text-xs font-medium text-slate-600 dark:text-slate-300",children:[t,"/",r," Services"]})]})}function fue(){var s,o;const{state:e,dispatch:t,hasDiagram:r,toggleDiagram:n}=rr(),i=(o=(s=e.config)==null?void 0:s.settings)==null?void 0:o.health_checks,{statuses:a}=sO(i,{enabled:!!(i!=null&&i.length)&&e.isLiveAvailable});return e.config?h.jsx("header",{className:"header-themed bg-white/80 dark:bg-slate-900/80 backdrop-blur-md border-b border-gray-200 dark:border-slate-700 shadow-sm dark:shadow-lg relative z-10 transition-colors duration-300",children:h.jsx("div",{className:"container mx-auto px-4 py-4 max-w-5xl",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[e.config.title&&h.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white dark:neon-text-primary",children:e.config.title}),h.jsx("p",{className:"text-gray-600 dark:text-slate-300/70 text-sm mt-1",children:e.config.description})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[a.length>0&&h.jsx(hue,{statuses:a}),e.isLiveAvailable&&h.jsx("button",{onClick:()=>t({type:"SET_MODE",payload:e.mode==="live"?"recorded":"live"}),className:`px-3 py-1.5 rounded-full text-sm font-medium transition-all duration-300 ${e.mode==="live"?"bg-gradient-to-r from-green-500 to-emerald-500 text-white shadow-lg shadow-green-500/30":"bg-gray-200 dark:bg-slate-700 text-gray-700 dark:text-slate-300 hover:bg-gray-300 dark:hover:bg-slate-600"}`,title:e.mode==="live"?"Click to switch to recorded responses":"Click to switch to live API calls",children:e.mode==="live"?"⚡ Live API":"📼 Recorded"}),!e.isLiveAvailable&&h.jsx("span",{className:"px-3 py-1.5 rounded-full text-sm font-medium bg-gradient-to-r from-theme-primary to-theme-accent text-white shadow-lg shadow-[rgba(var(--color-primary-rgb),0.3)]",children:"📼 Recorded"}),r&&h.jsx(oue,{isVisible:e.diagramVisible,onClick:n}),h.jsx(_$,{}),h.jsx(d$,{})]})]})})}):null}const pue=[{key:"→",description:"Next step"},{key:"←",description:"Previous step"},{key:"Space",description:"Next step"},{key:"R",description:"Reset demo"},{key:"?",description:"Toggle this help"},{key:"Esc",description:"Close help"}];function gue(){const[e,t]=N.useState(!1);return N.useEffect(()=>{function r(n){n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||(n.key==="?"?(n.preventDefault(),t(i=>!i)):n.key==="Escape"&&e&&(n.preventDefault(),t(!1)))}return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e]),e?h.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:()=>t(!1),role:"dialog","aria-modal":"true","aria-labelledby":"keyboard-help-title",children:h.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl p-6 max-w-sm w-full mx-4",onClick:r=>r.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsx("h2",{id:"keyboard-help-title",className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Keyboard Shortcuts"}),h.jsx("button",{onClick:()=>t(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200","aria-label":"Close",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsx("div",{className:"space-y-2",children:pue.map(({key:r,description:n})=>h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-gray-600 dark:text-gray-300",children:n}),h.jsx("kbd",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded text-sm font-mono",children:r})]},r))})]})}):h.jsx("button",{onClick:()=>t(!0),className:"fixed bottom-4 right-4 w-8 h-8 rounded-full bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-600 flex items-center justify-center text-sm font-medium shadow-lg z-50","aria-label":"Keyboard shortcuts",children:"?"})}const oO=N.createContext(null),Uu="demoscript-auth-session";async function FT(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(n)).map(a=>a.toString(16).padStart(2,"0")).join("")}function mue({children:e,authSettings:t}){const[r,n]=N.useState(!1),[i,a]=N.useState(null),s=(t==null?void 0:t.enabled)===!0&&(t.password||t.password_hash);N.useEffect(()=>{if(!s){n(!0);return}const d=sessionStorage.getItem(Uu);if(d)try{const{hash:f,timestamp:p}=JSON.parse(d);if(Date.now()-p<1440*60*1e3&&f){const x=(t==null?void 0:t.password_hash)||"";(f===x||!(t!=null&&t.password_hash))&&n(!0)}}catch{sessionStorage.removeItem(Uu)}},[s,t==null?void 0:t.password_hash]);const o=N.useCallback(async d=>{if(a(null),!t)return n(!0),!0;try{const f=await FT(d);if(t.password_hash&&f===t.password_hash)return n(!0),sessionStorage.setItem(Uu,JSON.stringify({hash:f,timestamp:Date.now()})),!0;if(t.password){const p=await FT(t.password);if(f===p)return n(!0),sessionStorage.setItem(Uu,JSON.stringify({hash:f,timestamp:Date.now()})),!0}return a("Incorrect password"),!1}catch(f){return a("Authentication error"),console.error("Auth error:",f),!1}},[t]),u=N.useCallback(()=>{n(!1),sessionStorage.removeItem(Uu)},[]);return h.jsx(oO.Provider,{value:{isAuthenticated:r,isAuthRequired:!!s,authSettings:t||null,authenticate:o,logout:u,error:i},children:e})}function cO(){const e=N.useContext(oO);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function xue(){const{authenticate:e,authSettings:t,error:r}=cO(),{theme:n}=rh(),[i,a]=N.useState(""),[s,o]=N.useState(!1),[u,d]=N.useState(null),f=async b=>{if(b.preventDefault(),!i.trim()){d("Please enter a password");return}o(!0),d(null);const v=await e(i);o(!1),v||(d(r||"Incorrect password"),a(""))},p=b=>{b.key==="Enter"&&f(b)},m=(t==null?void 0:t.title)||"Protected Demo",x=(t==null?void 0:t.message)||"Enter the password to view this demo.";return h.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4 bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:via-[rgba(var(--color-primary-rgb),0.05)] dark:to-slate-900",children:[n==="dark"&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 opacity-20 pointer-events-none z-0",children:h.jsx("div",{className:"absolute inset-0",style:{backgroundImage:`linear-gradient(rgba(var(--color-primary-rgb), 0.3) 1px, transparent 1px),
445
- linear-gradient(90deg, rgba(var(--color-primary-rgb), 0.3) 1px, transparent 1px)`,backgroundSize:"50px 50px"}})}),h.jsx("div",{className:"fixed top-1/4 left-1/4 w-96 h-96 bg-[rgba(var(--color-primary-rgb),0.2)] rounded-full blur-3xl pointer-events-none z-0"}),h.jsx("div",{className:"fixed bottom-1/4 right-1/4 w-96 h-96 bg-[rgba(var(--color-accent-rgb),0.2)] rounded-full blur-3xl pointer-events-none z-0"})]}),h.jsx("div",{className:"relative z-10 w-full max-w-md",children:h.jsxs("div",{className:"bg-white/90 dark:bg-slate-800/90 backdrop-blur-xl rounded-2xl shadow-2xl dark:shadow-[rgba(var(--color-primary-rgb),0.1)] p-8 border border-slate-200 dark:border-[rgba(var(--color-primary-rgb),0.2)]",children:[h.jsx("div",{className:"flex justify-center mb-6",children:h.jsx("div",{className:"w-16 h-16 rounded-full bg-gradient-to-br from-theme-primary to-theme-accent flex items-center justify-center shadow-lg shadow-[rgba(var(--color-primary-rgb),0.3)]",children:h.jsx("svg",{className:"w-8 h-8 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})})}),h.jsx("h1",{className:"text-2xl font-bold text-center mb-2 text-slate-800 dark:text-white",children:m}),h.jsx("p",{className:"text-center text-slate-600 dark:text-slate-300 mb-6",children:x}),h.jsxs("form",{onSubmit:f,className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-1",children:"Password"}),h.jsx("input",{type:"password",id:"password",value:i,onChange:b=>a(b.target.value),onKeyDown:p,placeholder:"Enter password",disabled:s,autoFocus:!0,className:`w-full px-4 py-3 rounded-lg border transition-all duration-200
446
- bg-white dark:bg-slate-700/50
447
- text-slate-800 dark:text-white
448
- placeholder-slate-400 dark:placeholder-slate-500
449
- focus:outline-none focus:ring-2 focus:ring-theme-primary
450
- ${u?"border-red-500 dark:border-red-400":"border-slate-300 dark:border-slate-600 hover:border-theme-primary"}
451
- disabled:opacity-50 disabled:cursor-not-allowed`})]}),u&&h.jsxs("div",{className:"flex items-center gap-2 text-red-600 dark:text-red-400 text-sm",children:[h.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("span",{children:u})]}),h.jsx("button",{type:"submit",disabled:s,className:`w-full py-3 px-4 rounded-lg font-medium transition-all duration-200
452
- bg-gradient-to-r from-theme-primary to-theme-accent
453
- hover:opacity-90
454
- text-white shadow-lg shadow-[rgba(var(--color-primary-rgb),0.3)]
455
- focus:outline-none focus:ring-2 focus:ring-theme-primary focus:ring-offset-2
456
- dark:focus:ring-offset-slate-800
457
- disabled:opacity-50 disabled:cursor-not-allowed
458
- ${s?"animate-pulse":""}`,children:s?h.jsxs("span",{className:"flex items-center justify-center gap-2",children:[h.jsxs("svg",{className:"animate-spin h-5 w-5",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Verifying..."]}):"Enter Demo"})]}),h.jsx("p",{className:"mt-6 text-center text-xs text-slate-500 dark:text-slate-400",children:"Contact the demo author if you don't have the password."})]})})]})}function yue(e,t){return t?e.replace(/\$\{base_url\}/gi,t).replace(/\$base_url/gi,t):e}function uO(e){const{url:t,valuePath:r,itemsPath:n,pollInterval:i=0,enabled:a=!0,baseUrl:s,limit:o}=e,[u,d]=N.useState(null),[f,p]=N.useState(!1),[m,x]=N.useState(null),[b,v]=N.useState(null),k=N.useRef(null),w=N.useRef(null),C=N.useCallback(async()=>{if(!t)return;w.current&&w.current.abort();const T=new AbortController;w.current=T,p(!0),x(null);try{const j=yue(t,s),L=setTimeout(()=>T.abort(),1e4),E=await fetch(j,{signal:T.signal,headers:{Accept:"application/json","ngrok-skip-browser-warning":"true"}});if(clearTimeout(L),!E.ok)throw new Error(`HTTP ${E.status}: ${E.statusText}`);let M=await E.json();r?M=qr(M,r):n?(M=qr(M,n),Array.isArray(M)&&o&&o>0&&(M=M.slice(0,o))):n===""&&Array.isArray(M)&&o&&o>0&&(M=M.slice(0,o)),d(M),v(new Date),x(null)}catch(j){if(j instanceof Error&&j.name==="AbortError")return;x(j instanceof Error?j.message:"Failed to fetch data"),d(null)}finally{p(!1)}},[t,r,n,s,o]);return N.useEffect(()=>{if(!a||!t){d(null),x(null),p(!1);return}return p(!0),C(),i>0&&(k.current=window.setInterval(C,i)),()=>{k.current&&(clearInterval(k.current),k.current=null),w.current&&(w.current.abort(),w.current=null)}},[a,t,i,C]),{data:u,isLoading:f,error:m,lastUpdated:b,refresh:C}}function bue({config:e,baseUrl:t,countersEnabled:r=!0}){const{label:n,url:i,value:a,type:s="text",poll_interval:o}=e,{data:u,isLoading:d,error:f}=uO({url:i&&s!=="link"?i:void 0,valuePath:typeof a=="string"&&i?a:void 0,pollInterval:o,enabled:!!i&&s!=="link",baseUrl:t}),p=i&&s!=="link"?u:a;if(d&&p===null)return h.jsxs("div",{className:"text-center p-4 rounded-lg bg-slate-50 dark:bg-slate-700/30 animate-pulse",children:[h.jsx("div",{className:"h-4 bg-slate-200 dark:bg-slate-600 rounded w-16 mx-auto mb-2"}),h.jsx("div",{className:"h-6 bg-slate-200 dark:bg-slate-600 rounded w-24 mx-auto mb-1"}),h.jsx("div",{className:"h-3 bg-slate-200 dark:bg-slate-600 rounded w-20 mx-auto"})]});if(f&&!p)return h.jsxs("div",{className:"text-center p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800/50",children:[h.jsx("div",{className:"text-red-500 dark:text-red-400 mb-1",children:h.jsx("svg",{className:"w-5 h-5 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),h.jsx("div",{className:"text-xs text-red-600 dark:text-red-400",children:n}),h.jsx("div",{className:"text-xs text-red-500 dark:text-red-500 mt-1",children:"Error"})]});if(s==="link")return h.jsxs("a",{href:i||String(a),target:"_blank",rel:"noopener noreferrer",className:"block text-center p-4 rounded-lg bg-slate-50 dark:bg-slate-700/30 hover:bg-slate-100 dark:hover:bg-slate-700/50 transition-colors group",children:[h.jsx("div",{className:"flex justify-center text-blue-500 dark:text-blue-400 mb-2 group-hover:text-blue-600 dark:group-hover:text-blue-300",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})}),h.jsx("div",{className:"font-medium text-blue-600 dark:text-blue-400 group-hover:text-blue-700 dark:group-hover:text-blue-300",children:n})]});const m=()=>{if(p==null)return h.jsx("span",{className:"text-slate-400 dark:text-slate-500",children:"-"});switch(s){case"number":const b=Number(p);return isNaN(b)?h.jsx("span",{className:"text-slate-700 dark:text-slate-200",children:String(p)}):r?h.jsx(av,{end:b,decimals:Number.isInteger(b)?0:2,duration:1}):h.jsx("span",{children:b.toLocaleString()});case"currency":const v=Number(p);return isNaN(v)?h.jsx("span",{className:"text-slate-700 dark:text-slate-200",children:String(p)}):r?h.jsx(pE,{amount:v,duration:1.5}):h.jsxs("span",{children:["$",v.toLocaleString("en-US",{minimumFractionDigits:2})]});case"text":default:return h.jsx("span",{children:String(p)})}},x=s==="currency"?"text-green-600 dark:text-green-400":s==="number"?"text-cyan-600 dark:text-cyan-400":"text-slate-700 dark:text-slate-200";return h.jsxs("div",{className:"text-center p-4 rounded-lg bg-slate-50 dark:bg-slate-700/30",children:[h.jsxs("div",{className:"flex justify-center text-slate-400 dark:text-slate-500 mb-2",children:[s==="number"&&h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})}),s==="currency"&&h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),s==="text"&&h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})]}),h.jsx("div",{className:`font-bold text-lg ${x}`,children:m()}),h.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:n})]})}function vue({cards:e,baseUrl:t,countersEnabled:r=!0}){return!e||e.length===0?null:h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map((n,i)=>h.jsx(bue,{config:n,baseUrl:t,countersEnabled:r},i))})}function wue({value:e,config:t}){var a;const r=String(e??""),n=((a=t.variants)==null?void 0:a[r])||"default",i={success:"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400",info:"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400",warning:"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-400",error:"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400",default:"bg-slate-100 dark:bg-slate-700/50 text-slate-600 dark:text-slate-400"};return h.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium capitalize ${i[n]}`,children:t.label||r})}function kue({item:e,config:t}){if(typeof e!="object"||e===null)return null;const r=e,n=qr(r,t.title.key),i=t.title.prefix_key?String(qr(r,t.title.prefix_key)??""):"",a=t.title.suffix_key?String(qr(r,t.title.suffix_key)??""):"";let s="";if(i){const o=i.toLowerCase();o==="deposit"||o==="credit"||o==="in"?s="+":(o==="withdrawal"||o==="debit"||o==="out"||o==="payout")&&(s="-")}return h.jsxs("div",{className:"bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg p-4",children:[t.badges&&t.badges.length>0&&h.jsx("div",{className:"flex items-center gap-2 mb-3",children:t.badges.map((o,u)=>{const d=qr(r,o.key);return h.jsx(wue,{value:d,config:o},u)})}),h.jsx("div",{className:"flex items-center justify-between mb-3",children:h.jsxs("div",{className:"text-lg font-semibold text-slate-800 dark:text-slate-200",children:[s&&h.jsx("span",{className:s==="+"?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400",children:s}),t.title.type==="currency"?h.jsx(xs,{value:n,type:"currency"}):t.title.type==="number"?h.jsx(xs,{value:n,type:"text"}):h.jsx("span",{children:String(n??"")}),a&&h.jsx("span",{className:"ml-1 text-slate-500 dark:text-slate-400 text-sm",children:a})]})}),t.fields&&t.fields.length>0&&h.jsx("div",{className:"space-y-2 text-sm",children:t.fields.map((o,u)=>{const d=qr(r,o.key);return d==null?null:h.jsxs("div",{className:"flex items-start gap-2",children:[o.label&&h.jsxs("span",{className:"text-slate-500 dark:text-slate-400 min-w-[80px]",children:[o.label,":"]}),h.jsx("span",{className:"flex-1",children:h.jsx(xs,{value:d,type:o.type||"text",link:o.link,linkKey:o.link_key})})]},u)})})]})}function Sue({items:e,config:t,emptyMessage:r}){return!e||e.length===0?h.jsx("div",{className:"text-center py-8",children:h.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:r||"No items found"})}):h.jsx("div",{className:"space-y-4",children:e.map((n,i)=>h.jsx(kue,{item:n,config:t},i))})}function Cue({items:e,columns:t,emptyMessage:r}){return!e||e.length===0?h.jsx("div",{className:"text-center py-8",children:h.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:r||"No items found"})}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"min-w-full text-sm",children:[h.jsx("thead",{className:"bg-slate-100 dark:bg-slate-800",children:h.jsx("tr",{children:t.map((n,i)=>h.jsx("th",{className:"px-4 py-3 text-left font-medium text-slate-700 dark:text-slate-300 border-b border-slate-200 dark:border-slate-700",children:n.label},i))})}),h.jsx("tbody",{children:e.map((n,i)=>{if(typeof n!="object"||n===null)return null;const a=n;return h.jsx("tr",{className:i%2===0?"bg-white dark:bg-slate-900":"bg-slate-50 dark:bg-slate-800/50",children:t.map((s,o)=>{const u=qr(a,s.key);return h.jsx("td",{className:"px-4 py-3 text-slate-700 dark:text-slate-300 border-b border-slate-200 dark:border-slate-700",children:h.jsx(xs,{value:u,type:s.type||"text",link:s.link,linkKey:s.link_key})},o)})},i)})})]})})}function _ue({config:e,baseUrl:t}){const{label:r,url:n,items:i,layout:a="cards",limit:s,poll_interval:o,empty_message:u,card:d,columns:f}=e,{data:p,isLoading:m,error:x,refresh:b}=uO({url:n,itemsPath:i,pollInterval:o,enabled:!0,baseUrl:t,limit:s}),v=Array.isArray(p)?p:[];return h.jsxs("div",{className:"bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg overflow-hidden",children:[h.jsxs("div",{className:"px-4 py-3 border-b border-slate-200 dark:border-slate-700 flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"font-medium text-slate-800 dark:text-slate-200",children:r}),v.length>0&&h.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-0.5",children:s?`Latest ${v.length}`:`${v.length} items`})]}),h.jsx("button",{onClick:b,className:"p-1.5 rounded hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors text-slate-500 dark:text-slate-400",title:"Refresh",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]}),h.jsxs("div",{className:"p-4",children:[m&&v.length===0&&h.jsx("div",{className:"space-y-3",children:[1,2,3].map(k=>h.jsx("div",{className:"h-20 bg-slate-100 dark:bg-slate-700/50 rounded-lg animate-pulse"},k))}),x&&v.length===0&&h.jsxs("div",{className:"text-center py-8",children:[h.jsx("div",{className:"text-red-500 dark:text-red-400 mb-2",children:h.jsx("svg",{className:"w-8 h-8 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),h.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:x}),h.jsx("button",{onClick:b,className:"mt-3 px-3 py-1.5 text-sm bg-slate-100 dark:bg-slate-700 hover:bg-slate-200 dark:hover:bg-slate-600 rounded transition-colors",children:"Retry"})]}),!m&&!x&&a==="cards"&&d&&h.jsx(Sue,{items:v,config:d,emptyMessage:u}),!m&&!x&&a==="table"&&f&&h.jsx(Cue,{items:v,columns:f,emptyMessage:u}),!m&&!x&&v.length===0&&h.jsx("div",{className:"text-center py-8",children:h.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:u||"No items found"})})]})]})}function Tue({config:e,onStart:t}){var k,w,C,T,j,L,E;const r=(k=e.settings)==null?void 0:k.dashboard,n=(r==null?void 0:r.show_stats)!==!1,i=(r==null?void 0:r.show_health)!==!1,a=(r==null?void 0:r.show_description)!==!1,s=(w=e.settings)==null?void 0:w.health_checks,{statuses:o,healthyCount:u,totalCount:d}=sO(s,{enabled:i&&!!(s!=null&&s.length)}),f=oE(e.steps),p=f.length,m=f.filter(M=>"rest"in M||"step"in M&&M.step==="rest").length,x=f.filter(M=>"shell"in M||"step"in M&&M.step==="shell").length,b=Math.ceil(p*.5),v=((C=e.metadata)==null?void 0:C.duration)||`~${b} min`;return h.jsx("div",{className:"min-h-screen flex items-center justify-center p-4 relative z-10",children:h.jsx("div",{className:"w-full max-w-2xl",children:h.jsxs("div",{className:"bg-white/90 dark:bg-slate-800/90 backdrop-blur-xl rounded-2xl shadow-2xl shadow-[rgba(var(--color-primary-rgb),0.08)] dark:shadow-[rgba(var(--color-primary-rgb),0.1)] p-8 border border-[rgba(var(--color-primary-rgb),0.15)] dark:border-[rgba(var(--color-primary-rgb),0.2)]",children:[h.jsx("div",{className:"flex justify-center mb-6",children:h.jsx("div",{className:"w-16 h-16 rounded-full bg-gradient-to-br from-theme-primary to-theme-accent flex items-center justify-center shadow-lg shadow-[rgba(var(--color-primary-rgb),0.3)]",children:h.jsxs("svg",{className:"w-8 h-8 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]})})}),h.jsx("h1",{className:"text-3xl font-bold text-center mb-2 text-slate-800 dark:text-white",children:e.title}),a&&e.description&&h.jsx("p",{className:"text-center text-slate-600 dark:text-slate-300 mb-6 max-w-lg mx-auto",children:e.description}),n&&h.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-6",children:[h.jsx(ib,{label:"Steps",value:p,icon:"steps"}),h.jsx(ib,{label:"Duration",value:v,icon:"time"}),h.jsx(ib,{label:"Difficulty",value:((T=e.metadata)==null?void 0:T.difficulty)||"beginner",icon:"difficulty"})]}),n&&(m>0||x>0)&&h.jsxs("div",{className:"flex justify-center gap-4 mb-6 text-sm text-slate-500 dark:text-slate-400",children:[m>0&&h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-500"}),m," API calls"]}),x>0&&h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-500"}),x," Commands"]})]}),i&&s&&s.length>0&&h.jsxs("div",{className:"mb-6",children:[h.jsx("h3",{className:"text-sm font-medium text-slate-700 dark:text-slate-300 mb-3",children:"Service Status"}),h.jsx(cue,{statuses:o}),d>0&&u<d&&h.jsx("p",{className:"mt-2 text-xs text-yellow-600 dark:text-yellow-400",children:"Some services are unavailable. The demo may not work correctly."})]}),(r==null?void 0:r.data_cards)&&r.data_cards.length>0&&h.jsx("div",{className:"mb-6",children:h.jsx(vue,{cards:r.data_cards,baseUrl:(j=e.settings)==null?void 0:j.base_url,countersEnabled:((E=(L=e.settings)==null?void 0:L.effects)==null?void 0:E.counters)!==!1})}),(r==null?void 0:r.data_lists)&&r.data_lists.length>0&&h.jsx("div",{className:"mb-6 space-y-4",children:r.data_lists.map((M,I)=>{var P;return h.jsx(_ue,{config:M,baseUrl:(P=e.settings)==null?void 0:P.base_url},I)})}),e.tags&&e.tags.length>0&&h.jsx("div",{className:"flex flex-wrap justify-center gap-2 mb-6",children:e.tags.map(M=>h.jsx("span",{className:"px-3 py-1 text-xs font-medium rounded-full bg-[rgba(var(--color-primary-rgb),0.1)] dark:bg-[rgba(var(--color-primary-rgb),0.2)] text-theme-primary",children:M},M))}),h.jsx("button",{onClick:t,className:`w-full py-4 px-6 rounded-lg font-medium text-lg transition-all duration-200
459
- bg-gradient-to-r from-theme-primary to-theme-accent
460
- hover:opacity-90
461
- text-white shadow-lg shadow-[rgba(var(--color-primary-rgb),0.3)]
462
- focus:outline-none focus:ring-2 focus:ring-[rgba(var(--color-primary-rgb),0.5)] focus:ring-offset-2
463
- dark:focus:ring-offset-slate-800`,children:"Start Demo"}),e.author&&h.jsxs("p",{className:"mt-4 text-center text-xs text-slate-500 dark:text-slate-400",children:["By ",e.author]})]})})})}function ib({label:e,value:t,icon:r}){const n={steps:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})}),time:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),difficulty:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},a=r==="difficulty"&&{beginner:"text-green-600 dark:text-green-400",intermediate:"text-yellow-600 dark:text-yellow-400",advanced:"text-red-600 dark:text-red-400"}[String(t).toLowerCase()]||"text-slate-800 dark:text-slate-200";return h.jsxs("div",{className:"text-center p-3 rounded-lg bg-[rgba(var(--color-primary-rgb),0.04)] dark:bg-slate-700/30 border border-[rgba(var(--color-primary-rgb),0.08)] dark:border-transparent",children:[h.jsx("div",{className:"flex justify-center text-slate-400 dark:text-slate-500 mb-1",children:n[r]}),h.jsx("div",{className:`font-bold capitalize ${a}`,children:t}),h.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:e})]})}const Eue={slide:"📄",rest:"🌐",shell:"💻",browser:"🔗",code:"📝",wait:"⏱️",assert:"✓",graphql:"◈",db:"🗄️",form:"📋",terminal:"🖥️",poll:"🔄",group:"📁"};function Nue(e){const t=Sc(e);return Eue[t]||"•"}function jue({steps:e,onStepClick:t}){var f,p;const{state:r,dispatch:n,totalSteps:i}=rr(),a=(p=(f=r.config)==null?void 0:f.settings)==null?void 0:p.sidebar,s=r.sidebarCollapsed;if(!(a!=null&&a.enabled))return null;const o=()=>{n({type:"TOGGLE_SIDEBAR"})},u=[];let d=0;return e.forEach((m,x)=>{Sr(m)?(u.push({index:x,step:m,isGroup:!0,groupName:m.group,flatIndex:d}),m.steps.forEach(b=>{u.push({index:d,step:b,isGroup:!1,groupName:m.group,flatIndex:d}),d++})):(u.push({index:d,step:m,isGroup:!1,flatIndex:d}),d++)}),h.jsxs("aside",{className:`fixed left-0 top-0 h-full sidebar-themed bg-white dark:bg-slate-900 border-r border-gray-200 dark:border-slate-700 transition-all duration-300 z-40 flex flex-col ${s?"w-14":"w-72"}`,children:[h.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-gray-200 dark:border-slate-700",children:[!s&&h.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-slate-300",children:"Steps"}),h.jsx("button",{onClick:o,className:"p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-slate-800 transition-colors",title:s?"Expand sidebar":"Collapse sidebar",children:h.jsx("svg",{className:`w-4 h-4 text-gray-500 dark:text-slate-400 transition-transform ${s?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"})})})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:u.map((m,x)=>{if(m.isGroup)return h.jsxs("div",{className:`mt-3 mb-1 ${s?"px-1":"px-2"}`,children:[!s&&h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-slate-500",children:m.groupName}),s&&h.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-600",children:"─"})]},`group-${x}`);const b=m.flatIndex,v=b===r.currentStep,k=r.stepStatuses[b],w=k==="complete",C=k==="error",T=El(m.step,b),j=Nue(m.step);return h.jsxs("button",{onClick:()=>t(b),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-lg text-left transition-all ${v?"bg-[rgba(var(--color-primary-rgb),0.15)] dark:bg-[rgba(var(--color-primary-rgb),0.2)] text-theme-primary":"hover:bg-gray-100 dark:hover:bg-slate-800 text-gray-700 dark:text-slate-300"} ${m.groupName?"ml-2":""}`,title:s?T:void 0,children:[h.jsx("span",{className:"flex-shrink-0 w-5 h-5 flex items-center justify-center",children:w?h.jsx("svg",{className:"w-4 h-4 text-green-500",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):C?h.jsx("svg",{className:"w-4 h-4 text-red-500",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})}):h.jsx("span",{className:"text-sm",children:j})}),!s&&h.jsx("span",{className:"flex-1 text-sm truncate",children:T})]},`step-${b}-${x}`)})}),h.jsxs("div",{className:"p-3 border-t border-gray-200 dark:border-slate-700",children:[!s&&h.jsxs("div",{className:"text-xs text-gray-500 dark:text-slate-500",children:["Step ",r.currentStep+1," of ",i]}),s&&h.jsxs("div",{className:"text-xs text-center text-gray-500 dark:text-slate-500",children:[r.currentStep+1,"/",i]})]})]})}function j0(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ").split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function ab(e,t){if(typeof t=="boolean")return"toggle";if(typeof t=="number")return"number";const r=["amount","count","quantity","decimals","limit","size","price"],n=e.toLowerCase();return r.some(i=>n.includes(i))?"number":"text"}function Aue(e){if("name"in e&&typeof e.name=="string"){const r=e;return{...r,label:r.label??j0(r.name),type:r.type??ab(r.name,r.default)}}const t=Object.entries(e);if(t.length===1){const[r,n]=t[0];if(typeof n!="object"||n===null)return{name:r,label:j0(r),type:ab(r,n),default:n};const i=n;return{name:r,label:i.label??j0(r),type:i.type??ab(r,i.default),default:i.default,readonly:i.readonly,required:i.required,hidden:i.hidden,placeholder:i.placeholder}}throw new Error(`Invalid form field format: ${JSON.stringify(e)}`)}function Mue(e,t){const r={...e};if(r.label||(r.label=j0(r.key)),!r.link&&r.type&&(t!=null&&t.links)&&["address","tx","token"].includes(r.type)){const i=Object.keys(t.links);i.length>0&&(r.link=i[0])}return r}function Lue(e,t){const r={...e};return r.form&&(r.form=r.form.map(n=>Aue(n))),r.results&&(r.results=r.results.map(n=>Mue(n,t))),r}function PT(e,t){return Tl(e)?Lue(e,t):e}function Due(e,t){return Sr(e)?{...e,steps:e.steps.map(r=>PT(r,t))}:PT(e,t)}function l0(e){return{...e,steps:e.steps.map(t=>Due(t,e.settings))}}function Rue({effects:e}){const t=(e==null?void 0:e.grid_background)!==!1,r=(e==null?void 0:e.glow_orbs)!==!1;return h.jsxs(h.Fragment,{children:[h.jsx(L$,{enabled:t}),h.jsx(D$,{enabled:r})]})}function Oue(){var L,E,M,I,P,z,$,W;const{state:e,dispatch:t,hasDiagram:r,toggleDiagram:n,currentDiagramPath:i,currentStepConfig:a}=rr(),{isAuthenticated:s,isAuthRequired:o}=cO(),[u,d]=N.useState(!0),f=((M=(E=(L=e.config)==null?void 0:L.settings)==null?void 0:E.dashboard)==null?void 0:M.enabled)===!0,p=(P=(I=e.config)==null?void 0:I.settings)==null?void 0:P.diagram,m=(p==null?void 0:p.position)||"toggle",x=a?El(a,e.currentStep):"",b=N.useCallback(()=>t({type:"NEXT_STEP"}),[t]),v=N.useCallback(()=>t({type:"PREV_STEP"}),[t]),k=N.useCallback(()=>t({type:"RESET"}),[t]);if(nN({onNext:b,onPrev:v,onReset:k,enabled:!(f&&u)}),o&&!s)return h.jsx(xue,{});if(f&&u&&e.config)return h.jsx(Tue,{config:e.config,onStart:()=>d(!1)});const w=((W=($=(z=e.config)==null?void 0:z.settings)==null?void 0:$.sidebar)==null?void 0:W.enabled)===!0,C=e.sidebarCollapsed,T=Y=>{t({type:"SET_STEP",payload:Y})},j=N.useCallback(Y=>{const B=e.flatSteps.findIndex(U=>!("diagram"in U)||!U.diagram?!1:U.diagram.includes(Y));B>=0&&t({type:"SET_STEP",payload:B})},[e.flatSteps,t]);return h.jsxs("div",{className:"min-h-screen flex flex-col relative z-10",children:[e.config&&w&&h.jsx(jue,{steps:e.config.steps,onStepClick:T}),h.jsxs("div",{className:`flex-1 flex flex-col transition-all duration-300 ${w?C?"ml-14":"ml-72":""}`,children:[h.jsx(fue,{}),r&&p&&m==="sidebar"&&e.diagramVisible&&h.jsx("div",{className:"fixed right-0 top-20 bottom-0 w-80 p-4 z-20",children:h.jsx(nb,{settings:p,currentPath:i,completedPaths:e.completedDiagramPaths,stepTitle:x,isVisible:e.diagramVisible,onToggle:n,onNodeClick:j})}),h.jsxs("main",{className:`flex-1 mx-auto px-4 py-6 xl:px-8 max-w-5xl xl:max-w-[85vw] 2xl:max-w-[80vw] ${r&&m==="sidebar"&&e.diagramVisible?"mr-80":""}`,children:[r&&p&&m==="sticky"&&h.jsx(nb,{settings:p,currentPath:i,completedPaths:e.completedDiagramPaths,stepTitle:x,isVisible:e.diagramVisible,onToggle:n,onNodeClick:j}),h.jsx(Z9,{}),h.jsx("div",{className:"mt-6",children:h.jsx(Cse,{})}),h.jsx("div",{className:"mt-6",children:h.jsx(_se,{})})]}),h.jsx(gue,{})]}),r&&p&&m==="toggle"&&h.jsx(nb,{settings:p,currentPath:i,completedPaths:e.completedDiagramPaths,stepTitle:x,isVisible:e.diagramVisible,onToggle:n,onNodeClick:j})]})}function Bue(){var a,s,o;const{state:e,dispatch:t}=rr(),{setTheme:r}=rh(),[n,i]=N.useState(void 0);return N.useEffect(()=>{var u,d;if((d=(u=e.config)==null?void 0:u.settings)!=null&&d.theme){const f=e.config.settings.theme,p=ev(f);tv(p,f.preset),(f.mode==="light"||f.mode==="dark")&&r(f.mode)}},[(s=(a=e.config)==null?void 0:a.settings)==null?void 0:s.theme,r]),N.useEffect(()=>{async function u(){var d,f,p;if(window.DEMO_CONFIG){const m=l0(window.DEMO_CONFIG);t({type:"SET_CONFIG",payload:m}),i((d=m.settings)==null?void 0:d.auth),window.DEMO_RECORDINGS&&t({type:"SET_RECORDINGS",payload:window.DEMO_RECORDINGS});return}try{const m=await fetch("/api/demo",{headers:{"ngrok-skip-browser-warning":"true"}});if(m.ok){const x=await m.json(),b=l0(x.config);t({type:"SET_CONFIG",payload:b}),i((f=b.settings)==null?void 0:f.auth),x.recordings&&t({type:"SET_RECORDINGS",payload:x.recordings}),t({type:"SET_LIVE_AVAILABLE",payload:!0}),t({type:"SET_MODE",payload:"live"});return}}catch{}try{const m=await fetch("/demo.yaml");if(m.ok){const x=await m.text(),b=l0(Q9.load(x));t({type:"SET_CONFIG",payload:b}),i((p=b.settings)==null?void 0:p.auth)}}catch{console.log("No demo loaded")}}u()},[t]),N.useEffect(()=>{if(window.DEMO_CONFIG)return;const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;let f=null,p=null;function m(){f=new WebSocket(d),f.onmessage=x=>{try{const b=JSON.parse(x.data);b.type==="reload"&&(console.log("Demo reloaded via WebSocket"),t({type:"SET_CONFIG",payload:l0(b.config)}),b.recordings&&t({type:"SET_RECORDINGS",payload:b.recordings}))}catch{}},f.onclose=()=>{p=window.setTimeout(m,2e3)},f.onerror=()=>{f==null||f.close()}}return m(),()=>{p&&clearTimeout(p),f==null||f.close()}},[t]),e.config?h.jsxs(mue,{authSettings:n,children:[h.jsx(Rue,{effects:(o=e.config.settings)==null?void 0:o.effects}),h.jsx(Oue,{})]}):h.jsx("div",{className:"min-h-screen flex items-center justify-center relative z-10",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-theme-primary mx-auto mb-4"}),h.jsx("p",{className:"text-theme-primary opacity-70",children:"Loading demo..."})]})})}const $ue=["GET","POST","PUT","DELETE","PATCH"],zue={GET:"bg-blue-500/20 text-blue-400 border-blue-500/30",POST:"bg-green-500/20 text-green-400 border-green-500/30",PUT:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",DELETE:"bg-red-500/20 text-red-400 border-red-500/30",PATCH:"bg-purple-500/20 text-purple-400 border-purple-500/30"};function Iue({baseUrl:e,onBaseUrlChange:t,variables:r,onAddStep:n,onSaveVariable:i,editingStep:a,onCancelEdit:s,onUpdateStep:o}){const[u,d]=N.useState("GET"),[f,p]=N.useState("/"),[m,x]=N.useState(""),[b,v]=N.useState(""),[k,w]=N.useState(""),[C,T]=N.useState(!1),[j,L]=N.useState(null),[E,M]=N.useState(null),[I,P]=N.useState(null),[z,$]=N.useState(!1),[W,Y]=N.useState(""),[B,U]=N.useState("");N.useEffect(()=>{a&&(d(a.method),p(a.endpoint),w(a.title),v(a.body?JSON.stringify(a.body,null,2):""),x(a.headers?JSON.stringify(a.headers,null,2):""))},[a]);const R=A=>A.replace(/\$(\w+)/g,(D,G)=>{const q=r[G];return q!==void 0?String(q):`$${G}`}),H=async()=>{T(!0),P(null),L(null),M(null);try{const A=R(`${e}${f}`);let D={},G;if(m.trim())try{D=JSON.parse(R(m))}catch{throw new Error("Invalid JSON in headers")}if(b.trim()&&u!=="GET")try{G=JSON.parse(R(b))}catch{throw new Error("Invalid JSON in body")}const q=await Rl({method:u,url:A,headers:D,body:G});M(q.status),L(q.data),q.error&&P(q.error)}catch(A){P(A instanceof Error?A.message:"Request failed")}finally{T(!1)}},V=()=>{const A={id:(a==null?void 0:a.id)||`step-${Date.now()}`,method:u,endpoint:f,title:k||`${u} ${f}`,body:b.trim()?JSON.parse(b):void 0,headers:m.trim()?JSON.parse(m):void 0};a?(o(a.id,A),s()):n(A),d("GET"),p("/"),x(""),v(""),w(""),L(null),M(null)},Q=()=>{if(!W||!j)return;let A=j;if(B){const D=B.split(/[.[\]]+/).filter(Boolean);for(const G of D)if(A&&typeof A=="object")A=A[G];else{A=void 0;break}}A!==void 0&&(i(W,A),$(!1),Y(""),U(""))};return h.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-lg overflow-hidden",children:[h.jsxs("div",{className:"bg-slate-800/50 px-4 py-3 border-b border-slate-800",children:[h.jsx("h2",{className:"text-lg font-medium text-slate-200",children:a?"Edit Step":"Custom Endpoint"}),h.jsx("p",{className:"text-sm text-slate-400 mt-0.5",children:"Enter the API endpoint details and execute to test"})]}),h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1.5",children:"Base URL"}),h.jsx("input",{type:"text",value:e,onChange:A=>t(A.target.value),placeholder:"https://api.example.com",className:"w-full px-3 py-2 bg-slate-950 border border-slate-700 rounded-lg text-slate-200 placeholder-slate-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500"})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("select",{value:u,onChange:A=>d(A.target.value),className:`px-3 py-2 border rounded-lg font-medium focus:outline-none focus:ring-1 focus:ring-purple-500 ${zue[u]||"bg-slate-800 text-slate-200 border-slate-700"}`,children:$ue.map(A=>h.jsx("option",{value:A,children:A},A))}),h.jsx("input",{type:"text",value:f,onChange:A=>p(A.target.value),placeholder:"/endpoint",className:"flex-1 px-3 py-2 bg-slate-950 border border-slate-700 rounded-lg text-slate-200 font-mono placeholder-slate-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500"})]}),h.jsxs("div",{children:[h.jsxs("label",{className:"block text-sm font-medium text-slate-300 mb-1.5",children:["Step Title ",h.jsx("span",{className:"text-slate-500",children:"(optional)"})]}),h.jsx("input",{type:"text",value:k,onChange:A=>w(A.target.value),placeholder:`${u} ${f}`,className:"w-full px-3 py-2 bg-slate-950 border border-slate-700 rounded-lg text-slate-200 placeholder-slate-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500"})]}),h.jsxs("div",{children:[h.jsxs("label",{className:"block text-sm font-medium text-slate-300 mb-1.5",children:["Headers ",h.jsx("span",{className:"text-slate-500",children:"(JSON, optional)"})]}),h.jsx("textarea",{value:m,onChange:A=>x(A.target.value),placeholder:'{"Authorization": "Bearer $token"}',rows:2,className:"w-full px-3 py-2 bg-slate-950 border border-slate-700 rounded-lg text-slate-200 font-mono text-sm placeholder-slate-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500 resize-none"})]}),u!=="GET"&&h.jsxs("div",{children:[h.jsxs("label",{className:"block text-sm font-medium text-slate-300 mb-1.5",children:["Request Body ",h.jsx("span",{className:"text-slate-500",children:"(JSON)"})]}),h.jsx("textarea",{value:b,onChange:A=>v(A.target.value),placeholder:'{"name": "John", "email": "john@example.com"}',rows:4,className:"w-full px-3 py-2 bg-slate-950 border border-slate-700 rounded-lg text-slate-200 font-mono text-sm placeholder-slate-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500 resize-none"})]}),h.jsxs("div",{className:"flex gap-2 pt-2",children:[h.jsx("button",{onClick:H,disabled:C||!e||!f,className:"px-4 py-2 bg-purple-600 hover:bg-purple-500 disabled:bg-slate-700 disabled:text-slate-500 text-white font-medium rounded-lg transition-colors",children:C?"Executing...":"Execute"}),j!==null&&h.jsx("button",{onClick:V,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 text-white font-medium rounded-lg transition-colors",children:a?"Update Step":"+ Add to Demo"}),a&&h.jsx("button",{onClick:s,className:"px-4 py-2 text-slate-400 hover:text-slate-200 hover:bg-slate-800 rounded-lg transition-colors",children:"Cancel"})]}),I&&h.jsx("div",{className:"p-3 bg-red-500/10 border border-red-500/30 rounded-lg text-red-400 text-sm",children:I}),j!==null&&h.jsxs("div",{className:"border-t border-slate-800 pt-4 mt-4",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsxs("h3",{className:"text-sm font-medium text-slate-300",children:["Response",E&&h.jsx("span",{className:`ml-2 px-2 py-0.5 text-xs rounded ${E>=200&&E<300?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:E})]}),h.jsx("button",{onClick:()=>$(!z),className:"text-xs text-purple-400 hover:text-purple-300",children:z?"Cancel":"Save Variable"})]}),z&&h.jsxs("div",{className:"mb-3 p-3 bg-slate-800/50 rounded-lg space-y-2",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"text",value:W,onChange:A=>Y(A.target.value),placeholder:"Variable name",className:"flex-1 px-2 py-1.5 bg-slate-950 border border-slate-700 rounded text-sm text-slate-200 placeholder-slate-500 focus:outline-none focus:border-purple-500"}),h.jsx("input",{type:"text",value:B,onChange:A=>U(A.target.value),placeholder:"Path (e.g., data.id)",className:"flex-1 px-2 py-1.5 bg-slate-950 border border-slate-700 rounded text-sm text-slate-200 font-mono placeholder-slate-500 focus:outline-none focus:border-purple-500"}),h.jsx("button",{onClick:Q,disabled:!W,className:"px-3 py-1.5 bg-purple-600 hover:bg-purple-500 disabled:bg-slate-700 text-white text-sm rounded transition-colors",children:"Save"})]}),h.jsx("p",{className:"text-xs text-slate-500",children:"Save a value from the response as a variable to use in later steps (e.g., $userId)"})]}),h.jsx("div",{className:"max-h-80 overflow-auto",children:h.jsx(Ng,{response:j})})]})]})]})}const Fue={GET:"bg-blue-500/20 text-blue-400 border-blue-500/30",POST:"bg-green-500/20 text-green-400 border-green-500/30",PUT:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",DELETE:"bg-red-500/20 text-red-400 border-red-500/30",PATCH:"bg-purple-500/20 text-purple-400 border-purple-500/30"};function Pue({openapiUrl:e,onOpenapiUrlChange:t,onSelectEndpoint:r,selectedEndpoint:n,onSpecLoaded:i}){const[a,s]=N.useState(null),[o,u]=N.useState(!1),[d,f]=N.useState(null),[p,m]=N.useState(""),[x,b]=N.useState(new Set),v=async()=>{if(!e.trim()){f("Please enter an OpenAPI spec URL");return}u(!0),f(null);try{const T=`/api/openapi?url=${encodeURIComponent(e)}`,j=await fetch(T);if(!j.ok){const E=await j.json();throw new Error(E.error||`Failed to fetch: ${j.status}`)}const L=await j.json();if(!L.openapi&&!L.swagger||!L.paths)throw new Error("Invalid OpenAPI spec: missing openapi/swagger or paths");s(L),i==null||i(L)}catch(T){f(T instanceof Error?T.message:"Failed to fetch spec"),s(null)}finally{u(!1)}},k=N.useMemo(()=>{if(!a)return new Map;if(p.trim()){const T=D6(a,p);return new Map([["Search Results",T]])}return z1(a)},[a,p]),w=T=>{b(j=>{const L=new Set(j);return L.has(T)?L.delete(T):L.add(T),L})},C=T=>(n==null?void 0:n.method)===T.method&&(n==null?void 0:n.path)===T.path;return h.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-lg overflow-hidden",children:[h.jsxs("div",{className:"bg-slate-800/50 px-4 py-3 border-b border-slate-800",children:[h.jsx("h2",{className:"text-lg font-medium text-slate-200",children:"OpenAPI Browser"}),h.jsx("p",{className:"text-sm text-slate-400 mt-0.5",children:"Load an OpenAPI spec to browse and test endpoints"})]}),h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"text",value:e,onChange:T=>t(T.target.value),placeholder:"https://api.example.com/openapi.json",className:"flex-1 px-3 py-2 bg-slate-950 border border-slate-700 rounded-lg text-slate-200 placeholder-slate-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500",onKeyDown:T=>T.key==="Enter"&&v()}),h.jsx("button",{onClick:v,disabled:o||!e.trim(),className:"px-4 py-2 bg-purple-600 hover:bg-purple-500 disabled:bg-slate-700 disabled:text-slate-500 text-white font-medium rounded-lg transition-colors whitespace-nowrap",children:o?"Loading...":"Fetch"})]}),d&&h.jsx("div",{className:"p-3 bg-red-500/10 border border-red-500/30 rounded-lg text-red-400 text-sm",children:d}),a&&h.jsx("div",{className:"p-3 bg-slate-800/50 rounded-lg",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"text-sm font-medium text-slate-200",children:a.info.title}),h.jsxs("p",{className:"text-xs text-slate-400",children:["v",a.info.version]})]}),h.jsxs("span",{className:"text-xs text-slate-500",children:[Array.from(k.values()).flat().length," endpoints"]})]})}),a&&h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:"text",value:p,onChange:T=>m(T.target.value),placeholder:"Search endpoints...",className:"w-full px-3 py-2 pl-9 bg-slate-950 border border-slate-700 rounded-lg text-slate-200 placeholder-slate-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500"}),h.jsx("svg",{className:"absolute left-3 top-2.5 h-4 w-4 text-slate-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),a&&h.jsx("div",{className:"max-h-96 overflow-y-auto space-y-1",children:k.size===0?h.jsx("p",{className:"text-sm text-slate-500 text-center py-4",children:"No endpoints found"}):Array.from(k.entries()).map(([T,j])=>h.jsxs("div",{className:"border border-slate-800 rounded-lg overflow-hidden",children:[h.jsxs("button",{onClick:()=>w(T),className:"w-full flex items-center justify-between px-3 py-2 bg-slate-800/30 hover:bg-slate-800/50 transition-colors",children:[h.jsx("span",{className:"text-sm font-medium text-slate-300",children:T}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs text-slate-500",children:j.length}),h.jsx("svg",{className:`h-4 w-4 text-slate-500 transition-transform ${x.has(T)?"":"rotate-180"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),!x.has(T)&&h.jsx("div",{className:"divide-y divide-slate-800/50",children:j.map(L=>h.jsxs("button",{onClick:()=>r(L),className:`w-full flex items-start gap-2 px-3 py-2 text-left transition-colors ${C(L)?"bg-purple-500/20 border-l-2 border-purple-500":"hover:bg-slate-800/30"}`,children:[h.jsx("span",{className:`px-1.5 py-0.5 text-xs font-medium rounded border ${Fue[L.method]||"bg-slate-800 text-slate-400"}`,children:L.method}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-sm text-slate-200 font-mono truncate",children:L.path}),L.summary&&h.jsx("p",{className:"text-xs text-slate-500 truncate",children:L.summary})]})]},`${L.method}-${L.path}`))})]},T))}),!a&&!o&&!d&&h.jsxs("div",{className:"text-center py-8",children:[h.jsx("div",{className:"text-4xl mb-3",children:"📄"}),h.jsx("p",{className:"text-sm text-slate-400",children:"Enter an OpenAPI spec URL and click Fetch to browse endpoints"})]})]})]})}const Hue={GET:"bg-blue-500/20 text-blue-400 border-blue-500/30",POST:"bg-green-500/20 text-green-400 border-green-500/30",PUT:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",DELETE:"bg-red-500/20 text-red-400 border-red-500/30",PATCH:"bg-purple-500/20 text-purple-400 border-purple-500/30"};function que({endpoint:e,spec:t,baseUrl:r,variables:n,onAddStep:i,onSaveVariable:a}){const s=N.useMemo(()=>Dp(t,e.method,e.path),[t,e.method,e.path]),o=N.useMemo(()=>ese(t,e.method,e.path),[t,e.method,e.path]),u=N.useMemo(()=>[...o,...s],[o,s]),[d,f]=N.useState({}),[p,m]=N.useState(""),[x,b]=N.useState(!1),[v,k]=N.useState(null),[w,C]=N.useState(null),[T,j]=N.useState(null),[L,E]=N.useState(!1),[M,I]=N.useState(""),[P,z]=N.useState("");N.useEffect(()=>{const H={};for(const V of u)V.default!==void 0&&(H[V.name]=V.default);f(H),k(null),C(null),j(null)},[u]);const $=N.useCallback(H=>H.replace(/\$([\w.]+)/g,(V,Q)=>{const A=n[Q];return A!==void 0?String(A):`$${Q}`}),[n]),W=N.useCallback(()=>{let H=e.path;H=H.replace(/\{(\w+)\}/g,(A,D)=>{const G=d[D];return G!==void 0?String(G):`{${D}}`}),H=$(H);const V=o.filter(A=>A.paramIn==="query").filter(A=>{const D=d[A.name];return D!==""&&D!==void 0&&D!==null}).map(A=>[A.name,String(d[A.name])]),Q=V.length>0?`?${new URLSearchParams(V).toString()}`:"";return`${r}${H}${Q}`},[e.path,d,r,$,o]),Y=async()=>{b(!0),j(null),k(null),C(null);try{const H=W();let V;if(s.length>0&&e.method!=="GET"){const A={};for(const D of s){const G=d[D.name];if(G!==void 0){let q=G;if(D.type==="textarea"&&typeof G=="string")try{q=JSON.parse($(G))}catch{q=$(G)}else typeof G=="string"&&(q=$(G));A[D.name]=q}}V=A}const Q=await Rl({method:e.method,url:H,body:V});C(Q.status),k(Q.data),Q.error&&j(Q.error)}catch(H){j(H instanceof Error?H.message:"Request failed")}finally{b(!1)}},B=()=>{let H;if(s.length>0&&e.method!=="GET"){const Q={};for(const A of s)d[A.name]!==void 0&&(Q[A.name]=d[A.name]);H=Q}const V={id:`step-${Date.now()}`,method:e.method,endpoint:e.path,title:p||e.summary||`${e.method} ${e.path}`,body:H};i(V),m("")},U=()=>{if(!M||!v)return;let H=v;if(P){const V=P.split(/[.[\]]+/).filter(Boolean);for(const Q of V)if(H&&typeof H=="object")H=H[Q];else{H=void 0;break}}H!==void 0&&(a(M,H),E(!1),I(""),z(""))},R=N.useCallback((H,V)=>{f(Q=>({...Q,[H]:V}))},[]);return h.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-lg overflow-hidden",children:[h.jsxs("div",{className:"bg-slate-800/50 px-4 py-3 border-b border-slate-800",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`px-2 py-0.5 text-sm font-medium rounded border ${Hue[e.method]||"bg-slate-800 text-slate-400"}`,children:e.method}),h.jsx("span",{className:"text-slate-200 font-mono text-sm",children:e.path})]}),e.summary&&h.jsx("p",{className:"text-sm text-slate-400 mt-1",children:e.summary})]}),h.jsxs("div",{className:"p-4 space-y-4",children:[u.length>0&&h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Parameters"}),h.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:u.map(H=>h.jsxs("div",{children:[h.jsxs("label",{className:"block text-sm text-slate-400 mb-1",children:[H.label||H.name,H.required&&h.jsx("span",{className:"text-red-400 ml-1",children:"*"})]}),H.type==="textarea"?h.jsx("textarea",{value:String(d[H.name]??""),onChange:V=>R(H.name,V.target.value),placeholder:H.placeholder,rows:3,className:"w-full px-3 py-2 bg-slate-950 border border-slate-700 rounded-lg text-slate-200 font-mono text-sm placeholder-slate-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500 resize-none"}):H.type==="select"&&H.options?h.jsxs("select",{value:String(d[H.name]??""),onChange:V=>R(H.name,V.target.value),className:"w-full px-3 py-2 bg-slate-950 border border-slate-700 rounded-lg text-slate-200 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500",children:[h.jsx("option",{value:"",children:"Select..."}),H.options.map(V=>h.jsx("option",{value:V.value,children:V.label},V.value))]}):h.jsx("input",{type:H.type==="number"?"number":"text",value:String(d[H.name]??""),onChange:V=>R(H.name,H.type==="number"?Number(V.target.value):V.target.value),placeholder:H.placeholder,className:"w-full px-3 py-2 bg-slate-950 border border-slate-700 rounded-lg text-slate-200 font-mono placeholder-slate-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500"})]},H.name))})]}),h.jsxs("div",{children:[h.jsxs("label",{className:"block text-sm font-medium text-slate-300 mb-1.5",children:["Step Title ",h.jsx("span",{className:"text-slate-500",children:"(optional)"})]}),h.jsx("input",{type:"text",value:p,onChange:H=>m(H.target.value),placeholder:e.summary||`${e.method} ${e.path}`,className:"w-full px-3 py-2 bg-slate-950 border border-slate-700 rounded-lg text-slate-200 placeholder-slate-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500"})]}),h.jsxs("div",{className:"flex gap-2 pt-2",children:[h.jsx("button",{onClick:Y,disabled:x,className:"px-4 py-2 bg-purple-600 hover:bg-purple-500 disabled:bg-slate-700 disabled:text-slate-500 text-white font-medium rounded-lg transition-colors",children:x?"Executing...":"Execute"}),v!==null&&h.jsx("button",{onClick:B,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 text-white font-medium rounded-lg transition-colors",children:"+ Add to Demo"})]}),T&&h.jsx("div",{className:"p-3 bg-red-500/10 border border-red-500/30 rounded-lg text-red-400 text-sm",children:T}),v!==null&&h.jsxs("div",{className:"border-t border-slate-800 pt-4 mt-4",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsxs("h3",{className:"text-sm font-medium text-slate-300",children:["Response",w&&h.jsx("span",{className:`ml-2 px-2 py-0.5 text-xs rounded ${w>=200&&w<300?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:w})]}),h.jsx("button",{onClick:()=>E(!L),className:"text-xs text-purple-400 hover:text-purple-300",children:L?"Cancel":"Save Variable"})]}),L&&h.jsxs("div",{className:"mb-3 p-3 bg-slate-800/50 rounded-lg space-y-2",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"text",value:M,onChange:H=>I(H.target.value),placeholder:"Variable name",className:"flex-1 px-2 py-1.5 bg-slate-950 border border-slate-700 rounded text-sm text-slate-200 placeholder-slate-500 focus:outline-none focus:border-purple-500"}),h.jsx("input",{type:"text",value:P,onChange:H=>z(H.target.value),placeholder:"Path (e.g., data.id)",className:"flex-1 px-2 py-1.5 bg-slate-950 border border-slate-700 rounded text-sm text-slate-200 font-mono placeholder-slate-500 focus:outline-none focus:border-purple-500"}),h.jsx("button",{onClick:U,disabled:!M,className:"px-3 py-1.5 bg-purple-600 hover:bg-purple-500 disabled:bg-slate-700 text-white text-sm rounded transition-colors",children:"Save"})]}),h.jsx("p",{className:"text-xs text-slate-500",children:"Save a value from the response as a variable to use in later steps (e.g., $userId)"})]}),h.jsx("div",{className:"max-h-80 overflow-auto",children:h.jsx(Ng,{response:v})})]})]})]})}const Uue={GET:"bg-blue-500/20 text-blue-400",POST:"bg-green-500/20 text-green-400",PUT:"bg-yellow-500/20 text-yellow-400",DELETE:"bg-red-500/20 text-red-400",PATCH:"bg-purple-500/20 text-purple-400"};function Vue({steps:e,onEdit:t,onDelete:r,onReorder:n}){const[i,a]=N.useState(null),[s,o]=N.useState(null),u=(x,b)=>{a(b),x.dataTransfer.effectAllowed="move",x.dataTransfer.setData("text/plain",String(b))},d=(x,b)=>{x.preventDefault(),x.dataTransfer.dropEffect="move",o(b)},f=()=>{o(null)},p=(x,b)=>{x.preventDefault();const v=i;a(null),o(null),v!==null&&v!==b&&n(v,b)},m=()=>{a(null),o(null)};return h.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-lg overflow-hidden",children:[h.jsxs("div",{className:"bg-slate-800/50 px-4 py-3 border-b border-slate-800",children:[h.jsx("h2",{className:"text-lg font-medium text-slate-200",children:"Demo Steps"}),h.jsx("p",{className:"text-sm text-slate-400 mt-0.5",children:e.length===0?"No steps added yet":`${e.length} step${e.length===1?"":"s"}`})]}),e.length===0?h.jsxs("div",{className:"p-8 text-center",children:[h.jsx("div",{className:"text-4xl mb-3",children:"📝"}),h.jsx("p",{className:"text-slate-400 text-sm",children:'Execute an endpoint and click "Add to Demo" to add steps'})]}):h.jsx("ul",{className:"divide-y divide-slate-800",children:e.map((x,b)=>h.jsxs("li",{draggable:!0,onDragStart:v=>u(v,b),onDragOver:v=>d(v,b),onDragLeave:f,onDrop:v=>p(v,b),onDragEnd:m,className:`
464
- group flex items-center gap-3 px-4 py-3 cursor-move
465
- transition-colors
466
- ${i===b?"opacity-50":""}
467
- ${s===b?"bg-purple-500/10 border-t-2 border-purple-500":"hover:bg-slate-800/50"}
468
- `,children:[h.jsx("div",{className:"text-slate-600 group-hover:text-slate-400",children:h.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm8-12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})})}),h.jsxs("span",{className:"text-slate-500 text-sm font-mono w-6",children:[b+1,"."]}),h.jsx("span",{className:`px-2 py-0.5 text-xs font-medium rounded ${Uue[x.method]||"bg-slate-700 text-slate-300"}`,children:x.method}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-sm text-slate-200 truncate",children:x.title}),x.title!==x.endpoint&&h.jsx("div",{className:"text-xs text-slate-500 font-mono truncate",children:x.endpoint})]}),h.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx("button",{onClick:()=>t(x),className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-700 rounded transition-colors",title:"Edit",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),h.jsx("button",{onClick:()=>r(x.id),className:"p-1.5 text-slate-400 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",title:"Delete",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]},x.id))})]})}function ul(e){return e.includes(":")||e.includes("#")||e.includes(`
469
- `)||e.includes('"')||e.startsWith(" ")||e.endsWith(" ")||e.startsWith("{")||e.startsWith("[")||/^[0-9]/.test(e)||e==="true"||e==="false"||e==="null"||e===""?`"${e.replace(/"/g,'\\"')}"`:e}function G1(e,t=0){if(e==null)return"null";if(typeof e=="string")return ul(e);if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){if(e.length===0)return"[]";const r=" ".repeat(t);return`
470
- `+e.map(n=>`${r}- ${G1(n,t+2)}`).join(`
471
- `)}if(typeof e=="object"){const r=Object.entries(e);if(r.length===0)return"{}";const n=" ".repeat(t);return`
472
- `+r.map(([i,a])=>{const s=G1(a,t+2);return s.startsWith(`
473
- `)?`${n}${i}:${s}`:`${n}${i}: ${s}`}).join(`
474
- `)}return String(e)}function Wue(e){const t=[];if(t.push(` - rest: ${e.method} ${e.endpoint}`),t.push(` title: ${ul(e.title)}`),e.headers&&Object.keys(e.headers).length>0){t.push(" headers:");for(const[r,n]of Object.entries(e.headers))t.push(` ${r}: ${ul(n)}`)}if(e.body&&typeof e.body=="object"){const r=Object.entries(e.body);if(r.length>0){t.push(" defaults:");for(const[n,i]of r){const a=G1(i,6);a.startsWith(`
475
- `)?t.push(` ${n}:${a}`):t.push(` ${n}: ${a}`)}}}if(e.save&&Object.keys(e.save).length>0){t.push(" save:");for(const[r,n]of Object.entries(e.save))t.push(` ${r}: ${n}`)}return t}function Yue(e,t){const r=[];if(r.push(`title: ${ul("My Demo")}`),r.push(`description: ${ul("Generated by DemoScript Builder")}`),r.push(""),(e.baseUrl||e.openapiUrl)&&(r.push("settings:"),e.baseUrl&&r.push(` base_url: ${ul(e.baseUrl)}`),e.openapiUrl&&r.push(` openapi: ${ul(e.openapiUrl)}`),r.push("")),e.steps.length>0){r.push("steps:");for(const n of e.steps)r.push(...Wue(n)),r.push("")}return r.join(`
476
- `)}function Gue({state:e,embedded:t}){const[r,n]=N.useState(!1),[i,a]=N.useState(!1),[s,o]=N.useState(!1),u=Yue(e),d=()=>{window.parent.postMessage({type:"demoscript-builder-export",yaml:u},"*"),o(!0),setTimeout(()=>o(!1),2e3)},f=async()=>{try{await navigator.clipboard.writeText(u),n(!0),setTimeout(()=>n(!1),2e3)}catch{const x=document.createElement("textarea");x.value=u,document.body.appendChild(x),x.select(),document.execCommand("copy"),document.body.removeChild(x),n(!0),setTimeout(()=>n(!1),2e3)}},p=()=>{const x=new Blob([u],{type:"text/yaml"}),b=URL.createObjectURL(x),v=document.createElement("a");v.href=b,v.download="demo.yaml",document.body.appendChild(v),v.click(),document.body.removeChild(v),URL.revokeObjectURL(b)},m=e.steps.length===0;return h.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-lg overflow-hidden",children:[h.jsx("div",{className:"bg-slate-800/50 px-4 py-3 border-b border-slate-800",children:h.jsx("h2",{className:"text-lg font-medium text-slate-200",children:"Export"})}),h.jsxs("div",{className:"p-4 space-y-3",children:[t&&h.jsx("button",{onClick:d,disabled:m,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-cyan-600 hover:bg-cyan-500 disabled:bg-slate-700 disabled:text-slate-500 text-white font-medium rounded-lg transition-colors",children:s?h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Sent!"]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 7l5 5m0 0l-5 5m5-5H6"})}),"Send to Editor"]})}),h.jsx("button",{onClick:f,disabled:m,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-purple-600 hover:bg-purple-500 disabled:bg-slate-700 disabled:text-slate-500 text-white font-medium rounded-lg transition-colors",children:r?h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Copied!"]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),"Copy YAML"]})}),h.jsxs("button",{onClick:p,disabled:m,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-slate-800 hover:bg-slate-700 disabled:bg-slate-800 disabled:text-slate-500 text-slate-200 font-medium rounded-lg transition-colors border border-slate-700",children:[h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download YAML"]}),h.jsx("button",{onClick:()=>a(!i),disabled:m,className:"w-full text-sm text-slate-400 hover:text-slate-200 disabled:text-slate-600 py-1",children:i?"Hide Preview":"Preview YAML"}),i&&!m&&h.jsx("div",{className:"mt-3 p-3 bg-slate-950 rounded-lg overflow-auto max-h-64",children:h.jsx("pre",{className:"text-xs text-slate-300 font-mono whitespace-pre",children:u})}),m&&h.jsx("p",{className:"text-xs text-slate-500 text-center",children:"Add steps to export your demo"})]})]})}const dO="demoscript-builder-state",sb=window.__DEMOSCRIPT_BUILDER_EMBEDDED__;function Xue(){try{const e=localStorage.getItem(dO);if(e)return JSON.parse(e)}catch{}return{mode:"custom",baseUrl:"",steps:[],variables:{}}}function Js(e){try{localStorage.setItem(dO,JSON.stringify(e))}catch{}}function Que(){const[e,t]=N.useState(Xue),[r,n]=N.useState(null),[i,a]=N.useState(null),[s,o]=N.useState(null),u=N.useCallback(k=>{t(w=>{const C={...w,...k};return Js(C),C})},[]),d=N.useCallback(k=>{t(w=>{const C={...w,steps:[...w.steps,k]};return Js(C),C}),n(null)},[]),f=N.useCallback((k,w)=>{t(C=>{const T={...C,steps:C.steps.map(j=>j.id===k?{...j,...w}:j)};return Js(T),T})},[]),p=N.useCallback(k=>{t(w=>{const C={...w,steps:w.steps.filter(T=>T.id!==k)};return Js(C),C})},[]),m=N.useCallback((k,w)=>{t(C=>{const T=[...C.steps],[j]=T.splice(k,1);T.splice(w,0,j);const L={...C,steps:T};return Js(L),L})},[]),x=N.useCallback((k,w)=>{t(C=>{const T={...C,variables:{...C.variables,[k]:w}};return Js(T),T})},[]),b=N.useCallback(()=>{const k={mode:"custom",baseUrl:"",steps:[],variables:{}};t(k),Js(k),n(null)},[]),v=N.useCallback(k=>{o(k)},[]);return h.jsxs("div",{className:"min-h-screen bg-slate-950 text-slate-100",children:[!sb&&h.jsx("header",{className:"border-b border-slate-800 bg-slate-900/50 backdrop-blur-sm sticky top-0 z-50",children:h.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("span",{className:"text-2xl",children:"🎬"}),h.jsx("h1",{className:"text-xl font-semibold bg-gradient-to-r from-purple-400 to-cyan-400 bg-clip-text text-transparent",children:"DemoScript Builder"})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-2 bg-slate-800 rounded-lg p-1",children:[h.jsx("button",{onClick:()=>u({mode:"openapi"}),className:`px-3 py-1.5 text-sm rounded transition-colors ${e.mode==="openapi"?"bg-purple-600 text-white":"text-slate-400 hover:text-slate-200"}`,children:"OpenAPI"}),h.jsx("button",{onClick:()=>u({mode:"custom"}),className:`px-3 py-1.5 text-sm rounded transition-colors ${e.mode==="custom"?"bg-purple-600 text-white":"text-slate-400 hover:text-slate-200"}`,children:"Custom"})]}),h.jsx("button",{onClick:b,className:"px-3 py-1.5 text-sm text-slate-400 hover:text-slate-200 hover:bg-slate-800 rounded transition-colors",children:"Clear All"})]})]})}),sb&&h.jsx("div",{className:"border-b border-slate-800 bg-slate-900/50 backdrop-blur-sm sticky top-0 z-50",children:h.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-2 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2 bg-slate-800 rounded-lg p-1",children:[h.jsx("button",{onClick:()=>u({mode:"openapi"}),className:`px-3 py-1.5 text-sm rounded transition-colors ${e.mode==="openapi"?"bg-purple-600 text-white":"text-slate-400 hover:text-slate-200"}`,children:"OpenAPI"}),h.jsx("button",{onClick:()=>u({mode:"custom"}),className:`px-3 py-1.5 text-sm rounded transition-colors ${e.mode==="custom"?"bg-purple-600 text-white":"text-slate-400 hover:text-slate-200"}`,children:"Custom"})]}),h.jsx("button",{onClick:b,className:"px-3 py-1.5 text-sm text-slate-400 hover:text-slate-200 hover:bg-slate-800 rounded transition-colors",children:"Clear All"})]})}),h.jsx("main",{className:"max-w-7xl mx-auto px-4 py-6",children:h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[h.jsx("div",{className:"lg:col-span-2 space-y-6",children:e.mode==="openapi"?h.jsxs(h.Fragment,{children:[h.jsx(Pue,{openapiUrl:e.openapiUrl||"",onOpenapiUrlChange:k=>u({openapiUrl:k}),onSelectEndpoint:k=>a(k),selectedEndpoint:i,onSpecLoaded:v}),i&&s&&h.jsx(que,{endpoint:i,spec:s,baseUrl:e.baseUrl,variables:e.variables,onAddStep:d,onSaveVariable:x}),h.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-lg p-4",children:[h.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1.5",children:"Base URL"}),h.jsx("input",{type:"text",value:e.baseUrl,onChange:k=>u({baseUrl:k.target.value}),placeholder:"https://api.example.com",className:"w-full px-3 py-2 bg-slate-950 border border-slate-700 rounded-lg text-slate-200 placeholder-slate-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500"}),h.jsx("p",{className:"text-xs text-slate-500 mt-1.5",children:"The base URL to use when executing requests (leave empty if OpenAPI spec includes server URL)"})]})]}):h.jsx(Iue,{baseUrl:e.baseUrl,onBaseUrlChange:k=>u({baseUrl:k}),variables:e.variables,onAddStep:d,onSaveVariable:x,editingStep:r,onCancelEdit:()=>n(null),onUpdateStep:f})}),h.jsxs("div",{className:"space-y-6",children:[h.jsx(Vue,{steps:e.steps,onEdit:n,onDelete:p,onReorder:m}),h.jsx(Gue,{state:e,embedded:sb}),Object.keys(e.variables).length>0&&h.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-lg p-4",children:[h.jsx("h3",{className:"text-sm font-medium text-slate-300 mb-3",children:"Variables"}),h.jsx("div",{className:"space-y-2",children:Object.entries(e.variables).map(([k,w])=>h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsxs("span",{className:"text-purple-400 font-mono",children:["$",k]}),h.jsx("span",{className:"text-slate-400 font-mono text-xs truncate max-w-[150px]",children:typeof w=="string"?w:JSON.stringify(w)})]},k))})]})]})]})})]})}function lb(){return`step-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Zue(e,t){var r,n,i,a,s;switch(t.type){case"SET_TITLE":return{...e,title:t.payload,isDirty:!0};case"SET_DESCRIPTION":return{...e,description:t.payload,isDirty:!0};case"SET_SETTINGS":return{...e,settings:{...e.settings,...t.payload},isDirty:!0};case"SET_METADATA":return{...e,metadata:{...e.metadata,...t.payload},isDirty:!0};case"ADD_STEP":{const o={id:lb(),step:t.payload.step},u=t.payload.afterIndex!==void 0?t.payload.afterIndex+1:e.steps.length,d=[...e.steps];return d.splice(u,0,o),{...e,steps:d,currentStep:u,isDirty:!0}}case"REMOVE_STEP":{const o=e.steps.filter((d,f)=>f!==t.payload),u=Math.min(e.currentStep,o.length-1);return{...e,steps:o,currentStep:Math.max(0,u),isDirty:!0}}case"UPDATE_STEP":{const o=[...e.steps];return o[t.payload.index]&&(o[t.payload.index]={...o[t.payload.index],step:t.payload.step}),{...e,steps:o,isDirty:!0}}case"REORDER_STEPS":{const{fromIndex:o,toIndex:u}=t.payload,d=[...e.steps],[f]=d.splice(o,1);d.splice(u,0,f);let p=e.currentStep;return e.currentStep===o?p=u:o<e.currentStep&&u>=e.currentStep?p--:o>e.currentStep&&u<=e.currentStep&&p++,{...e,steps:d,currentStep:p,isDirty:!0}}case"SET_CURRENT_STEP":return{...e,currentStep:Math.max(0,Math.min(t.payload,e.steps.length-1)),selectedChildIndex:null};case"SET_SELECTED_CHILD":return{...e,selectedChildIndex:t.payload};case"MOVE_INTO_GROUP":{const{stepIndex:o,groupIndex:u}=t.payload;if(o===u||o<0||u<0||o>=e.steps.length||u>=e.steps.length)return e;const d=(r=e.steps[u])==null?void 0:r.step;if(!d||!("group"in d||d.step==="group"))return e;const f=e.steps[o];if(!f||"group"in f.step)return e;const p=e.steps.filter((k,w)=>w!==o),m=o<u?u-1:u,x={...p[m]},b=x.step;x.step={...b,steps:[...b.steps||[],f.step]},p[m]=x;let v=e.currentStep;return e.currentStep===o?v=m:e.currentStep>o&&v--,{...e,steps:p,currentStep:Math.max(0,Math.min(v,p.length-1)),isDirty:!0}}case"MOVE_OUT_OF_GROUP":{const{groupIndex:o,childIndex:u,targetIndex:d}=t.payload;if(o<0||o>=e.steps.length)return e;const f=(n=e.steps[o])==null?void 0:n.step;if(!f||!("group"in f))return e;const p=f,m=p.steps||[];if(u<0||u>=m.length)return e;const x=m[u],b=m.filter((T,j)=>j!==u),v={...e.steps[o],step:{...p,steps:b}},k=d!==void 0?d:o+1,w={id:lb(),step:x},C=[...e.steps];return C[o]=v,C.splice(k,0,w),{...e,steps:C,currentStep:k,isDirty:!0}}case"REORDER_WITHIN_GROUP":{const{groupIndex:o,fromChildIndex:u,toChildIndex:d}=t.payload;if(o<0||o>=e.steps.length)return e;const f=(i=e.steps[o])==null?void 0:i.step;if(!f||!("group"in f))return e;const p=f,m=[...p.steps||[]];if(u<0||u>=m.length||d<0||d>=m.length||u===d)return e;const[x]=m.splice(u,1);m.splice(d,0,x);const b={...e.steps[o],step:{...p,steps:m}},v=[...e.steps];return v[o]=b,{...e,steps:v,isDirty:!0}}case"DELETE_FROM_GROUP":{const{groupIndex:o,childIndex:u}=t.payload;if(o<0||o>=e.steps.length)return e;const d=(a=e.steps[o])==null?void 0:a.step;if(!d||!("group"in d))return e;const f=d,p=f.steps||[];if(u<0||u>=p.length)return e;const m=p.filter((v,k)=>k!==u),x={...e.steps[o],step:{...f,steps:m}},b=[...e.steps];return b[o]=x,{...e,steps:b,isDirty:!0}}case"FLATTEN_GROUP":{const{groupIndex:o}=t.payload;if(o<0||o>=e.steps.length)return e;const u=(s=e.steps[o])==null?void 0:s.step;if(!u||!("group"in u))return e;const f=u.steps||[];if(f.length===0){const x=e.steps.filter((b,v)=>v!==o);return{...e,steps:x,currentStep:Math.min(e.currentStep,x.length-1),isDirty:!0}}const p=[...e.steps],m=f.map(x=>({id:lb(),step:x}));return p.splice(o,1,...m),{...e,steps:p,currentStep:o,isDirty:!0}}case"SET_EXECUTION_RESULT":{const o=[...e.steps];return o[t.payload.index]&&(o[t.payload.index]={...o[t.payload.index],executionResult:t.payload.result}),{...e,steps:o}}case"SET_VARIABLES":return{...e,variables:{...e.variables,...t.payload}};case"LOAD_STATE":return{...t.payload,isDirty:!1};case"MARK_SAVED":return{...e,isDirty:!1,currentFilePath:t.payload??e.currentFilePath,isNewFile:!1};case"SET_FILE_PATH":return{...e,currentFilePath:t.payload,isNewFile:!1};case"NEW_FILE":return{...hO(),isDirty:!1,isNewFile:!0,currentFilePath:null};default:return e}}function hO(){return{title:"Untitled Demo",description:"",settings:{},metadata:{},steps:[],currentStep:0,selectedChildIndex:null,variables:{},isDirty:!1,currentFilePath:null,isNewFile:!0}}const fO=N.createContext(null);function HT(e,t){return{title:e.title||"Untitled Demo",description:e.description||"",settings:e.settings||{},metadata:e.metadata||{},steps:(e.steps||[]).map((r,n)=>({id:`step-${n}`,step:r})),currentStep:0,selectedChildIndex:null,variables:{},isDirty:!1,currentFilePath:t??null,isNewFile:!t}}function Kue(e){return{title:e.title,description:e.description,settings:e.settings,metadata:e.metadata,steps:e.steps.map(t=>t.step)}}function Jue({children:e,initialConfig:t}){const[r,n]=N.useReducer(Zue,t?HT(t):hO()),i=N.useCallback((E,M)=>{n({type:"ADD_STEP",payload:{step:E,afterIndex:M}})},[]),a=N.useCallback(E=>{n({type:"REMOVE_STEP",payload:E})},[]),s=N.useCallback((E,M)=>{n({type:"UPDATE_STEP",payload:{index:E,step:M}})},[]),o=N.useCallback((E,M)=>{n({type:"REORDER_STEPS",payload:{fromIndex:E,toIndex:M}})},[]),u=N.useCallback((E,M)=>{n({type:"MOVE_INTO_GROUP",payload:{stepIndex:E,groupIndex:M}})},[]),d=N.useCallback((E,M,I)=>{n({type:"MOVE_OUT_OF_GROUP",payload:{groupIndex:E,childIndex:M,targetIndex:I}})},[]),f=N.useCallback((E,M,I)=>{n({type:"REORDER_WITHIN_GROUP",payload:{groupIndex:E,fromChildIndex:M,toChildIndex:I}})},[]),p=N.useCallback((E,M)=>{n({type:"DELETE_FROM_GROUP",payload:{groupIndex:E,childIndex:M}})},[]),m=N.useCallback(E=>{n({type:"FLATTEN_GROUP",payload:{groupIndex:E}})},[]),x=N.useCallback(E=>{n({type:"SET_CURRENT_STEP",payload:E})},[]),b=N.useCallback(E=>{n({type:"SET_SELECTED_CHILD",payload:E})},[]),v=N.useCallback((E,M)=>{n({type:"SET_EXECUTION_RESULT",payload:{index:E,result:M}})},[]),k=N.useCallback((E,M)=>{n({type:"LOAD_STATE",payload:HT(E,M)})},[]),w=N.useCallback(()=>Kue(r),[r]),C=N.useCallback(E=>{n({type:"SET_FILE_PATH",payload:E})},[]),T=N.useCallback(()=>{n({type:"NEW_FILE"})},[]),j=N.useCallback(E=>{n({type:"MARK_SAVED",payload:E})},[]),L={state:r,dispatch:n,addStep:i,removeStep:a,updateStep:s,reorderSteps:o,moveIntoGroup:u,moveOutOfGroup:d,reorderWithinGroup:f,deleteFromGroup:p,flattenGroup:m,setCurrentStep:x,setSelectedChild:b,setExecutionResult:v,loadFromConfig:k,toConfig:w,setFilePath:C,newFile:T,markSaved:j};return h.jsx(fO.Provider,{value:L,children:e})}function q2(){const e=N.useContext(fO);if(!e)throw new Error("useEditor must be used within an EditorProvider");return e}function ede(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return N.useMemo(()=>n=>{t.forEach(i=>i(n))},t)}const Bg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Lc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function U2(e){return"nodeType"in e}function Pn(e){var t,r;return e?Lc(e)?e:U2(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function V2(e){const{Document:t}=Pn(e);return e instanceof t}function vh(e){return Lc(e)?!1:e instanceof Pn(e).HTMLElement}function pO(e){return e instanceof Pn(e).SVGElement}function Dc(e){return e?Lc(e)?e.document:U2(e)?V2(e)?e:vh(e)||pO(e)?e.ownerDocument:document:document:document}const ta=Bg?N.useLayoutEffect:N.useEffect;function W2(e){const t=N.useRef(e);return ta(()=>{t.current=e}),N.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.current==null?void 0:t.current(...n)},[])}function tde(){const e=N.useRef(null),t=N.useCallback((n,i)=>{e.current=setInterval(n,i)},[]),r=N.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Gd(e,t){t===void 0&&(t=[e]);const r=N.useRef(e);return ta(()=>{r.current!==e&&(r.current=e)},t),r}function wh(e,t){const r=N.useRef();return N.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Fp(e){const t=W2(e),r=N.useRef(null),n=N.useCallback(i=>{i!==r.current&&(t==null||t(i,r.current)),r.current=i},[]);return[r,n]}function X1(e){const t=N.useRef();return N.useEffect(()=>{t.current=e},[e]),t.current}let ob={};function kh(e,t){return N.useMemo(()=>{if(t)return t;const r=ob[e]==null?0:ob[e]+1;return ob[e]=r,e+"-"+r},[e,t])}function gO(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.reduce((a,s)=>{const o=Object.entries(s);for(const[u,d]of o){const f=a[u];f!=null&&(a[u]=f+e*d)}return a},{...t})}}const Po=gO(1),Xd=gO(-1);function rde(e){return"clientX"in e&&"clientY"in e}function Y2(e){if(!e)return!1;const{KeyboardEvent:t}=Pn(e.target);return t&&e instanceof t}function nde(e){if(!e)return!1;const{TouchEvent:t}=Pn(e.target);return t&&e instanceof t}function Q1(e){if(nde(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return rde(e)?{x:e.clientX,y:e.clientY}:null}const pc=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[pc.Translate.toString(e),pc.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),qT="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ide(e){return e.matches(qT)?e:e.querySelector(qT)}const ade={display:"none"};function sde(e){let{id:t,value:r}=e;return xn.createElement("div",{id:t,style:ade},r)}function lde(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return xn.createElement("div",{id:t,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function ode(){const[e,t]=N.useState("");return{announce:N.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const mO=N.createContext(null);function cde(e){const t=N.useContext(mO);N.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function ude(){const[e]=N.useState(()=>new Set),t=N.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[N.useCallback(n=>{let{type:i,event:a}=n;e.forEach(s=>{var o;return(o=s[i])==null?void 0:o.call(s,a)})},[e]),t]}const dde={draggable:`
477
- To pick up a draggable item, press the space bar.
478
- While dragging, use the arrow keys to move the item.
479
- Press space again to drop the item in its new position, or press escape to cancel.
480
- `},hde={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function fde(e){let{announcements:t=hde,container:r,hiddenTextDescribedById:n,screenReaderInstructions:i=dde}=e;const{announce:a,announcement:s}=ode(),o=kh("DndLiveRegion"),[u,d]=N.useState(!1);if(N.useEffect(()=>{d(!0)},[]),cde(N.useMemo(()=>({onDragStart(p){let{active:m}=p;a(t.onDragStart({active:m}))},onDragMove(p){let{active:m,over:x}=p;t.onDragMove&&a(t.onDragMove({active:m,over:x}))},onDragOver(p){let{active:m,over:x}=p;a(t.onDragOver({active:m,over:x}))},onDragEnd(p){let{active:m,over:x}=p;a(t.onDragEnd({active:m,over:x}))},onDragCancel(p){let{active:m,over:x}=p;a(t.onDragCancel({active:m,over:x}))}}),[a,t])),!u)return null;const f=xn.createElement(xn.Fragment,null,xn.createElement(sde,{id:n,value:i.draggable}),xn.createElement(lde,{id:o,announcement:s}));return r?nd.createPortal(f,r):f}var Lr;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Lr||(Lr={}));function Pp(){}function UT(e,t){return N.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function pde(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return N.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Oi=Object.freeze({x:0,y:0});function xO(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function yO(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function gde(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function VT(e){let{left:t,top:r,height:n,width:i}=e;return[{x:t,y:r},{x:t+i,y:r},{x:t,y:r+n},{x:t+i,y:r+n}]}function bO(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function WT(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const mde=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=WT(t,t.left,t.top),a=[];for(const s of n){const{id:o}=s,u=r.get(o);if(u){const d=xO(WT(u),i);a.push({id:o,data:{droppableContainer:s,value:d}})}}return a.sort(yO)},xde=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=VT(t),a=[];for(const s of n){const{id:o}=s,u=r.get(o);if(u){const d=VT(u),f=i.reduce((m,x,b)=>m+xO(d[b],x),0),p=Number((f/4).toFixed(4));a.push({id:o,data:{droppableContainer:s,value:p}})}}return a.sort(yO)};function yde(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=i-n,o=a-r;if(n<i&&r<a){const u=t.width*t.height,d=e.width*e.height,f=s*o,p=f/(u+d-f);return Number(p.toFixed(4))}return 0}const bde=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=[];for(const a of n){const{id:s}=a,o=r.get(s);if(o){const u=yde(o,t);u>0&&i.push({id:s,data:{droppableContainer:a,value:u}})}}return i.sort(gde)};function vde(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function vO(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Oi}function wde(e){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((s,o)=>({...s,top:s.top+e*o.y,bottom:s.bottom+e*o.y,left:s.left+e*o.x,right:s.right+e*o.x}),{...r})}}const kde=wde(1);function Sde(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Cde(e,t,r){const n=Sde(t);if(!n)return e;const{scaleX:i,scaleY:a,x:s,y:o}=n,u=e.left-s-(1-i)*parseFloat(r),d=e.top-o-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),f=i?e.width/i:e.width,p=a?e.height/a:e.height;return{width:f,height:p,top:d,right:u+f,bottom:d+p,left:u}}const _de={ignoreTransform:!1};function Rc(e,t){t===void 0&&(t=_de);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:f}=Pn(e).getComputedStyle(e);d&&(r=Cde(r,d,f))}const{top:n,left:i,width:a,height:s,bottom:o,right:u}=r;return{top:n,left:i,width:a,height:s,bottom:o,right:u}}function YT(e){return Rc(e,{ignoreTransform:!0})}function Tde(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Ede(e,t){return t===void 0&&(t=Pn(e).getComputedStyle(e)),t.position==="fixed"}function Nde(e,t){t===void 0&&(t=Pn(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const a=t[i];return typeof a=="string"?r.test(a):!1})}function $g(e,t){const r=[];function n(i){if(t!=null&&r.length>=t||!i)return r;if(V2(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!vh(i)||pO(i)||r.includes(i))return r;const a=Pn(e).getComputedStyle(i);return i!==e&&Nde(i,a)&&r.push(i),Ede(i,a)?r:n(i.parentNode)}return e?n(e):r}function wO(e){const[t]=$g(e,1);return t??null}function cb(e){return!Bg||!e?null:Lc(e)?e:U2(e)?V2(e)||e===Dc(e).scrollingElement?window:vh(e)?e:null:null}function kO(e){return Lc(e)?e.scrollX:e.scrollLeft}function SO(e){return Lc(e)?e.scrollY:e.scrollTop}function Z1(e){return{x:kO(e),y:SO(e)}}var Hr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Hr||(Hr={}));function CO(e){return!Bg||!e?!1:e===document.scrollingElement}function _O(e){const t={x:0,y:0},r=CO(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},i=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,o=e.scrollLeft>=n.x;return{isTop:i,isLeft:a,isBottom:s,isRight:o,maxScroll:n,minScroll:t}}const jde={x:.2,y:.2};function Ade(e,t,r,n,i){let{top:a,left:s,right:o,bottom:u}=r;n===void 0&&(n=10),i===void 0&&(i=jde);const{isTop:d,isBottom:f,isLeft:p,isRight:m}=_O(e),x={x:0,y:0},b={x:0,y:0},v={height:t.height*i.y,width:t.width*i.x};return!d&&a<=t.top+v.height?(x.y=Hr.Backward,b.y=n*Math.abs((t.top+v.height-a)/v.height)):!f&&u>=t.bottom-v.height&&(x.y=Hr.Forward,b.y=n*Math.abs((t.bottom-v.height-u)/v.height)),!m&&o>=t.right-v.width?(x.x=Hr.Forward,b.x=n*Math.abs((t.right-v.width-o)/v.width)):!p&&s<=t.left+v.width&&(x.x=Hr.Backward,b.x=n*Math.abs((t.left+v.width-s)/v.width)),{direction:x,speed:b}}function Mde(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:s}=window;return{top:0,left:0,right:a,bottom:s,width:a,height:s}}const{top:t,left:r,right:n,bottom:i}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:i,width:e.clientWidth,height:e.clientHeight}}function TO(e){return e.reduce((t,r)=>Po(t,Z1(r)),Oi)}function Lde(e){return e.reduce((t,r)=>t+kO(r),0)}function Dde(e){return e.reduce((t,r)=>t+SO(r),0)}function Rde(e,t){if(t===void 0&&(t=Rc),!e)return;const{top:r,left:n,bottom:i,right:a}=t(e);wO(e)&&(i<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ode=[["x",["left","right"],Lde],["y",["top","bottom"],Dde]];class G2{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=$g(r),i=TO(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,s,o]of Ode)for(const u of s)Object.defineProperty(this,u,{get:()=>{const d=o(n),f=i[a]-d;return this.rect[u]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xd{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var i;(i=this.target)==null||i.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Bde(e){const{EventTarget:t}=Pn(e);return e instanceof t?e:Dc(e)}function ub(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var pi;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(pi||(pi={}));function GT(e){e.preventDefault()}function $de(e){e.stopPropagation()}var St;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(St||(St={}));const EO={start:[St.Space,St.Enter],cancel:[St.Esc],end:[St.Space,St.Enter,St.Tab]},zde=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case St.Right:return{...r,x:r.x+25};case St.Left:return{...r,x:r.x-25};case St.Down:return{...r,y:r.y+25};case St.Up:return{...r,y:r.y-25}}};class X2{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new xd(Dc(r)),this.windowListeners=new xd(Pn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pi.Resize,this.handleCancel),this.windowListeners.add(pi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Rde(n),r(Oi)}handleKeyDown(t){if(Y2(t)){const{active:r,context:n,options:i}=this.props,{keyboardCodes:a=EO,coordinateGetter:s=zde,scrollBehavior:o="smooth"}=i,{code:u}=t;if(a.end.includes(u)){this.handleEnd(t);return}if(a.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:d}=n.current,f=d?{x:d.left,y:d.top}:Oi;this.referenceCoordinates||(this.referenceCoordinates=f);const p=s(t,{active:r,context:n.current,currentCoordinates:f});if(p){const m=Xd(p,f),x={x:0,y:0},{scrollableAncestors:b}=n.current;for(const v of b){const k=t.code,{isTop:w,isRight:C,isLeft:T,isBottom:j,maxScroll:L,minScroll:E}=_O(v),M=Mde(v),I={x:Math.min(k===St.Right?M.right-M.width/2:M.right,Math.max(k===St.Right?M.left:M.left+M.width/2,p.x)),y:Math.min(k===St.Down?M.bottom-M.height/2:M.bottom,Math.max(k===St.Down?M.top:M.top+M.height/2,p.y))},P=k===St.Right&&!C||k===St.Left&&!T,z=k===St.Down&&!j||k===St.Up&&!w;if(P&&I.x!==p.x){const $=v.scrollLeft+m.x,W=k===St.Right&&$<=L.x||k===St.Left&&$>=E.x;if(W&&!m.y){v.scrollTo({left:$,behavior:o});return}W?x.x=v.scrollLeft-$:x.x=k===St.Right?v.scrollLeft-L.x:v.scrollLeft-E.x,x.x&&v.scrollBy({left:-x.x,behavior:o});break}else if(z&&I.y!==p.y){const $=v.scrollTop+m.y,W=k===St.Down&&$<=L.y||k===St.Up&&$>=E.y;if(W&&!m.x){v.scrollTo({top:$,behavior:o});return}W?x.y=v.scrollTop-$:x.y=k===St.Down?v.scrollTop-L.y:v.scrollTop-E.y,x.y&&v.scrollBy({top:-x.y,behavior:o});break}}this.handleMove(t,Po(Xd(p,this.referenceCoordinates),x))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}X2.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=EO,onActivation:i}=t,{active:a}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const o=a.activatorNode.current;return o&&e.target!==o?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function XT(e){return!!(e&&"distance"in e)}function QT(e){return!!(e&&"delay"in e)}class Q2{constructor(t,r,n){var i;n===void 0&&(n=Bde(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:s}=a;this.props=t,this.events=r,this.document=Dc(s),this.documentListeners=new xd(this.document),this.listeners=new xd(n),this.windowListeners=new xd(Pn(s)),this.initialCoordinates=(i=Q1(a))!=null?i:Oi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(pi.Resize,this.handleCancel),this.windowListeners.add(pi.DragStart,GT),this.windowListeners.add(pi.VisibilityChange,this.handleCancel),this.windowListeners.add(pi.ContextMenu,GT),this.documentListeners.add(pi.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(QT(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(XT(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:i}=this.props;i(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(pi.Click,$de,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pi.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:i,props:a}=this,{onMove:s,options:{activationConstraint:o}}=a;if(!i)return;const u=(r=Q1(t))!=null?r:Oi,d=Xd(i,u);if(!n&&o){if(XT(o)){if(o.tolerance!=null&&ub(d,o.tolerance))return this.handleCancel();if(ub(d,o.distance))return this.handleStart()}if(QT(o)&&ub(d,o.tolerance))return this.handleCancel();this.handlePending(o,d);return}t.cancelable&&t.preventDefault(),s(u)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===St.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ide={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Z2 extends Q2{constructor(t){const{event:r}=t,n=Dc(r.target);super(t,Ide,n)}}Z2.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Fde={move:{name:"mousemove"},end:{name:"mouseup"}};var K1;(function(e){e[e.RightClick=2]="RightClick"})(K1||(K1={}));class Pde extends Q2{constructor(t){super(t,Fde,Dc(t.event.target))}}Pde.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===K1.RightClick?!1:(n==null||n({event:r}),!0)}}];const db={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Hde extends Q2{constructor(t){super(t,db)}static setup(){return window.addEventListener(db.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(db.move.name,t)};function t(){}}}Hde.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:i}=r;return i.length>1?!1:(n==null||n({event:r}),!0)}}];var yd;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(yd||(yd={}));var Hp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Hp||(Hp={}));function qde(e){let{acceleration:t,activator:r=yd.Pointer,canScroll:n,draggingRect:i,enabled:a,interval:s=5,order:o=Hp.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:f,delta:p,threshold:m}=e;const x=Vde({delta:p,disabled:!a}),[b,v]=tde(),k=N.useRef({x:0,y:0}),w=N.useRef({x:0,y:0}),C=N.useMemo(()=>{switch(r){case yd.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case yd.DraggableRect:return i}},[r,i,u]),T=N.useRef(null),j=N.useCallback(()=>{const E=T.current;if(!E)return;const M=k.current.x*w.current.x,I=k.current.y*w.current.y;E.scrollBy(M,I)},[]),L=N.useMemo(()=>o===Hp.TreeOrder?[...d].reverse():d,[o,d]);N.useEffect(()=>{if(!a||!d.length||!C){v();return}for(const E of L){if((n==null?void 0:n(E))===!1)continue;const M=d.indexOf(E),I=f[M];if(!I)continue;const{direction:P,speed:z}=Ade(E,I,C,t,m);for(const $ of["x","y"])x[$][P[$]]||(z[$]=0,P[$]=0);if(z.x>0||z.y>0){v(),T.current=E,b(j,s),k.current=z,w.current=P;return}}k.current={x:0,y:0},w.current={x:0,y:0},v()},[t,j,n,v,a,s,JSON.stringify(C),JSON.stringify(x),b,d,L,f,JSON.stringify(m)])}const Ude={x:{[Hr.Backward]:!1,[Hr.Forward]:!1},y:{[Hr.Backward]:!1,[Hr.Forward]:!1}};function Vde(e){let{delta:t,disabled:r}=e;const n=X1(t);return wh(i=>{if(r||!n||!i)return Ude;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Hr.Backward]:i.x[Hr.Backward]||a.x===-1,[Hr.Forward]:i.x[Hr.Forward]||a.x===1},y:{[Hr.Backward]:i.y[Hr.Backward]||a.y===-1,[Hr.Forward]:i.y[Hr.Forward]||a.y===1}}},[r,t,n])}function Wde(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return wh(i=>{var a;return t==null?null:(a=n??i)!=null?a:null},[n,t])}function Yde(e,t){return N.useMemo(()=>e.reduce((r,n)=>{const{sensor:i}=n,a=i.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...a]},[]),[e,t])}var Qd;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Qd||(Qd={}));var J1;(function(e){e.Optimized="optimized"})(J1||(J1={}));const ZT=new Map;function Gde(e,t){let{dragging:r,dependencies:n,config:i}=t;const[a,s]=N.useState(null),{frequency:o,measure:u,strategy:d}=i,f=N.useRef(e),p=k(),m=Gd(p),x=N.useCallback(function(w){w===void 0&&(w=[]),!m.current&&s(C=>C===null?w:C.concat(w.filter(T=>!C.includes(T))))},[m]),b=N.useRef(null),v=wh(w=>{if(p&&!r)return ZT;if(!w||w===ZT||f.current!==e||a!=null){const C=new Map;for(let T of e){if(!T)continue;if(a&&a.length>0&&!a.includes(T.id)&&T.rect.current){C.set(T.id,T.rect.current);continue}const j=T.node.current,L=j?new G2(u(j),j):null;T.rect.current=L,L&&C.set(T.id,L)}return C}return w},[e,a,r,p,u]);return N.useEffect(()=>{f.current=e},[e]),N.useEffect(()=>{p||x()},[r,p]),N.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),N.useEffect(()=>{p||typeof o!="number"||b.current!==null||(b.current=setTimeout(()=>{x(),b.current=null},o))},[o,p,x,...n]),{droppableRects:v,measureDroppableContainers:x,measuringScheduled:a!=null};function k(){switch(d){case Qd.Always:return!1;case Qd.BeforeDragging:return r;default:return!r}}}function NO(e,t){return wh(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Xde(e,t){return NO(e,t)}function Qde(e){let{callback:t,disabled:r}=e;const n=W2(t),i=N.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return N.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function zg(e){let{callback:t,disabled:r}=e;const n=W2(t),i=N.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return N.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Zde(e){return new G2(Rc(e),e)}function KT(e,t,r){t===void 0&&(t=Zde);const[n,i]=N.useState(null);function a(){i(u=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=u??r)!=null?d:null}const f=t(e);return JSON.stringify(u)===JSON.stringify(f)?u:f})}const s=Qde({callback(u){if(e)for(const d of u){const{type:f,target:p}=d;if(f==="childList"&&p instanceof HTMLElement&&p.contains(e)){a();break}}}}),o=zg({callback:a});return ta(()=>{a(),e?(o==null||o.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(o==null||o.disconnect(),s==null||s.disconnect())},[e]),n}function Kde(e){const t=NO(e);return vO(e,t)}const JT=[];function Jde(e){const t=N.useRef(e),r=wh(n=>e?n&&n!==JT&&e&&t.current&&e.parentNode===t.current.parentNode?n:$g(e):JT,[e]);return N.useEffect(()=>{t.current=e},[e]),r}function ehe(e){const[t,r]=N.useState(null),n=N.useRef(e),i=N.useCallback(a=>{const s=cb(a.target);s&&r(o=>o?(o.set(s,Z1(s)),new Map(o)):null)},[]);return N.useEffect(()=>{const a=n.current;if(e!==a){s(a);const o=e.map(u=>{const d=cb(u);return d?(d.addEventListener("scroll",i,{passive:!0}),[d,Z1(d)]):null}).filter(u=>u!=null);r(o.length?new Map(o):null),n.current=e}return()=>{s(e),s(a)};function s(o){o.forEach(u=>{const d=cb(u);d==null||d.removeEventListener("scroll",i)})}},[i,e]),N.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,s)=>Po(a,s),Oi):TO(e):Oi,[e,t])}function eE(e,t){t===void 0&&(t=[]);const r=N.useRef(null);return N.useEffect(()=>{r.current=null},t),N.useEffect(()=>{const n=e!==Oi;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Xd(e,r.current):Oi}function the(e){N.useEffect(()=>{if(!Bg)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function rhe(e,t){return N.useMemo(()=>e.reduce((r,n)=>{let{eventName:i,handler:a}=n;return r[i]=s=>{a(s,t)},r},{}),[e,t])}function jO(e){return N.useMemo(()=>e?Tde(e):null,[e])}const tE=[];function nhe(e,t){t===void 0&&(t=Rc);const[r]=e,n=jO(r?Pn(r):null),[i,a]=N.useState(tE);function s(){a(()=>e.length?e.map(u=>CO(u)?n:new G2(t(u),u)):tE)}const o=zg({callback:s});return ta(()=>{o==null||o.disconnect(),s(),e.forEach(u=>o==null?void 0:o.observe(u))},[e]),i}function ihe(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return vh(t)?t:e}function ahe(e){let{measure:t}=e;const[r,n]=N.useState(null),i=N.useCallback(d=>{for(const{target:f}of d)if(vh(f)){n(p=>{const m=t(f);return p?{...p,width:m.width,height:m.height}:m});break}},[t]),a=zg({callback:i}),s=N.useCallback(d=>{const f=ihe(d);a==null||a.disconnect(),f&&(a==null||a.observe(f)),n(f?t(f):null)},[t,a]),[o,u]=Fp(s);return N.useMemo(()=>({nodeRef:o,rect:r,setRef:u}),[r,o,u])}const she=[{sensor:Z2,options:{}},{sensor:X2,options:{}}],lhe={current:{}},A0={draggable:{measure:YT},droppable:{measure:YT,strategy:Qd.WhileDragging,frequency:J1.Optimized},dragOverlay:{measure:Rc}};class bd extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const ohe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new bd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Pp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:A0,measureDroppableContainers:Pp,windowRect:null,measuringScheduled:!1},che={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Pp,draggableNodes:new Map,over:null,measureDroppableContainers:Pp},Ig=N.createContext(che),AO=N.createContext(ohe);function uhe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new bd}}}function dhe(e,t){switch(t.type){case Lr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Lr.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Lr.DragEnd:case Lr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Lr.RegisterDroppable:{const{element:r}=t,{id:n}=r,i=new bd(e.droppable.containers);return i.set(n,r),{...e,droppable:{...e.droppable,containers:i}}}case Lr.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const s=new bd(e.droppable.containers);return s.set(r,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case Lr.UnregisterDroppable:{const{id:r,key:n}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const a=new bd(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function hhe(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:i}=N.useContext(Ig),a=X1(n),s=X1(r==null?void 0:r.id);return N.useEffect(()=>{if(!t&&!n&&a&&s!=null){if(!Y2(a)||document.activeElement===a.target)return;const o=i.get(s);if(!o)return;const{activatorNode:u,node:d}=o;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[u.current,d.current]){if(!f)continue;const p=ide(f);if(p){p.focus();break}}})}},[n,t,i,s,a]),null}function fhe(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((i,a)=>a({transform:i,...n}),r):r}function phe(e){return N.useMemo(()=>({draggable:{...A0.draggable,...e==null?void 0:e.draggable},droppable:{...A0.droppable,...e==null?void 0:e.droppable},dragOverlay:{...A0.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function ghe(e){let{activeNode:t,measure:r,initialRect:n,config:i=!0}=e;const a=N.useRef(!1),{x:s,y:o}=typeof i=="boolean"?{x:i,y:i}:i;ta(()=>{if(!s&&!o||!t){a.current=!1;return}if(a.current||!n)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const f=r(d),p=vO(f,n);if(s||(p.x=0),o||(p.y=0),a.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const m=wO(d);m&&m.scrollBy({top:p.y,left:p.x})}},[t,s,o,n,r])}const MO=N.createContext({...Oi,scaleX:1,scaleY:1});var hs;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(hs||(hs={}));const mhe=N.memo(function(t){var r,n,i,a;let{id:s,accessibility:o,autoScroll:u=!0,children:d,sensors:f=she,collisionDetection:p=bde,measuring:m,modifiers:x,...b}=t;const v=N.useReducer(dhe,void 0,uhe),[k,w]=v,[C,T]=ude(),[j,L]=N.useState(hs.Uninitialized),E=j===hs.Initialized,{draggable:{active:M,nodes:I,translate:P},droppable:{containers:z}}=k,$=M!=null?I.get(M):null,W=N.useRef({initial:null,translated:null}),Y=N.useMemo(()=>{var Xt;return M!=null?{id:M,data:(Xt=$==null?void 0:$.data)!=null?Xt:lhe,rect:W}:null},[M,$]),B=N.useRef(null),[U,R]=N.useState(null),[H,V]=N.useState(null),Q=Gd(b,Object.values(b)),A=kh("DndDescribedBy",s),D=N.useMemo(()=>z.getEnabled(),[z]),G=phe(m),{droppableRects:q,measureDroppableContainers:Z,measuringScheduled:re}=Gde(D,{dragging:E,dependencies:[P.x,P.y],config:G.droppable}),J=Wde(I,M),ie=N.useMemo(()=>H?Q1(H):null,[H]),ne=qn(),oe=Xde(J,G.draggable.measure);ghe({activeNode:M!=null?I.get(M):null,config:ne.layoutShiftCompensation,initialRect:oe,measure:G.draggable.measure});const fe=KT(J,G.draggable.measure,oe),xe=KT(J?J.parentElement:null),de=N.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=z.getNodeFor((r=de.current.over)==null?void 0:r.id),ke=ahe({measure:G.dragOverlay.measure}),Te=(n=ke.nodeRef.current)!=null?n:J,Ne=E?(i=ke.rect)!=null?i:fe:null,Ke=!!(ke.nodeRef.current&&ke.rect),ut=Kde(Ke?null:fe),tt=jO(Te?Pn(Te):null),rt=Jde(E?ge??J:null),nt=nhe(rt),wt=fhe(x,{transform:{x:P.x-ut.x,y:P.y-ut.y,scaleX:1,scaleY:1},activatorEvent:H,active:Y,activeNodeRect:fe,containerNodeRect:xe,draggingNodeRect:Ne,over:de.current.over,overlayNodeRect:ke.rect,scrollableAncestors:rt,scrollableAncestorRects:nt,windowRect:tt}),xt=ie?Po(ie,P):null,_e=ehe(rt),je=eE(_e),le=eE(_e,[fe]),be=Po(wt,je),Le=Ne?kde(Ne,wt):null,We=Y&&Le?p({active:Y,collisionRect:Le,droppableRects:q,droppableContainers:D,pointerCoordinates:xt}):null,at=bO(We,"id"),[Et,Er]=N.useState(null),Wt=Ke?wt:Po(wt,le),It=vde(Wt,(a=Et==null?void 0:Et.rect)!=null?a:null,fe),Lt=N.useRef(null),dt=N.useCallback((Xt,Bt)=>{let{sensor:lr,options:$r}=Bt;if(B.current==null)return;const yt=I.get(B.current);if(!yt)return;const Qt=Xt.nativeEvent,zr=new lr({active:B.current,activeNode:yt,event:Qt,options:$r,context:de,onAbort(Zt){if(!I.get(Zt))return;const{onDragAbort:Ir}=Q.current,en={id:Zt};Ir==null||Ir(en),C({type:"onDragAbort",event:en})},onPending(Zt,Jr,Ir,en){if(!I.get(Zt))return;const{onDragPending:Nr}=Q.current,tn={id:Zt,constraint:Jr,initialCoordinates:Ir,offset:en};Nr==null||Nr(tn),C({type:"onDragPending",event:tn})},onStart(Zt){const Jr=B.current;if(Jr==null)return;const Ir=I.get(Jr);if(!Ir)return;const{onDragStart:en}=Q.current,or={activatorEvent:Qt,active:{id:Jr,data:Ir.data,rect:W}};nd.unstable_batchedUpdates(()=>{en==null||en(or),L(hs.Initializing),w({type:Lr.DragStart,initialCoordinates:Zt,active:Jr}),C({type:"onDragStart",event:or}),R(Lt.current),V(Qt)})},onMove(Zt){w({type:Lr.DragMove,coordinates:Zt})},onEnd:Ur(Lr.DragEnd),onCancel:Ur(Lr.DragCancel)});Lt.current=zr;function Ur(Zt){return async function(){const{active:Ir,collisions:en,over:or,scrollAdjustedTranslate:Nr}=de.current;let tn=null;if(Ir&&Nr){const{cancelDrop:Un}=Q.current;tn={activatorEvent:Qt,active:Ir,collisions:en,delta:Nr,over:or},Zt===Lr.DragEnd&&typeof Un=="function"&&await Promise.resolve(Un(tn))&&(Zt=Lr.DragCancel)}B.current=null,nd.unstable_batchedUpdates(()=>{w({type:Zt}),L(hs.Uninitialized),Er(null),R(null),V(null),Lt.current=null;const Un=Zt===Lr.DragEnd?"onDragEnd":"onDragCancel";if(tn){const Fr=Q.current[Un];Fr==null||Fr(tn),C({type:Un,event:tn})}})}}},[I]),Kr=N.useCallback((Xt,Bt)=>(lr,$r)=>{const yt=lr.nativeEvent,Qt=I.get($r);if(B.current!==null||!Qt||yt.dndKit||yt.defaultPrevented)return;const zr={active:Qt};Xt(lr,Bt.options,zr)===!0&&(yt.dndKit={capturedBy:Bt.sensor},B.current=$r,dt(lr,Bt))},[I,dt]),xr=Yde(f,Kr);the(f),ta(()=>{fe&&j===hs.Initializing&&L(hs.Initialized)},[fe,j]),N.useEffect(()=>{const{onDragMove:Xt}=Q.current,{active:Bt,activatorEvent:lr,collisions:$r,over:yt}=de.current;if(!Bt||!lr)return;const Qt={active:Bt,activatorEvent:lr,collisions:$r,delta:{x:be.x,y:be.y},over:yt};nd.unstable_batchedUpdates(()=>{Xt==null||Xt(Qt),C({type:"onDragMove",event:Qt})})},[be.x,be.y]),N.useEffect(()=>{const{active:Xt,activatorEvent:Bt,collisions:lr,droppableContainers:$r,scrollAdjustedTranslate:yt}=de.current;if(!Xt||B.current==null||!Bt||!yt)return;const{onDragOver:Qt}=Q.current,zr=$r.get(at),Ur=zr&&zr.rect.current?{id:zr.id,rect:zr.rect.current,data:zr.data,disabled:zr.disabled}:null,Zt={active:Xt,activatorEvent:Bt,collisions:lr,delta:{x:yt.x,y:yt.y},over:Ur};nd.unstable_batchedUpdates(()=>{Er(Ur),Qt==null||Qt(Zt),C({type:"onDragOver",event:Zt})})},[at]),ta(()=>{de.current={activatorEvent:H,active:Y,activeNode:J,collisionRect:Le,collisions:We,droppableRects:q,draggableNodes:I,draggingNode:Te,draggingNodeRect:Ne,droppableContainers:z,over:Et,scrollableAncestors:rt,scrollAdjustedTranslate:be},W.current={initial:Ne,translated:Le}},[Y,J,We,Le,I,Te,Ne,q,z,Et,rt,be]),qde({...ne,delta:P,draggingRect:Le,pointerCoordinates:xt,scrollableAncestors:rt,scrollableAncestorRects:nt});const As=N.useMemo(()=>({active:Y,activeNode:J,activeNodeRect:fe,activatorEvent:H,collisions:We,containerNodeRect:xe,dragOverlay:ke,draggableNodes:I,droppableContainers:z,droppableRects:q,over:Et,measureDroppableContainers:Z,scrollableAncestors:rt,scrollableAncestorRects:nt,measuringConfiguration:G,measuringScheduled:re,windowRect:tt}),[Y,J,fe,H,We,xe,ke,I,z,q,Et,Z,rt,nt,G,re,tt]),Hn=N.useMemo(()=>({activatorEvent:H,activators:xr,active:Y,activeNodeRect:fe,ariaDescribedById:{draggable:A},dispatch:w,draggableNodes:I,over:Et,measureDroppableContainers:Z}),[H,xr,Y,fe,w,A,I,Et,Z]);return xn.createElement(mO.Provider,{value:T},xn.createElement(Ig.Provider,{value:Hn},xn.createElement(AO.Provider,{value:As},xn.createElement(MO.Provider,{value:It},d)),xn.createElement(hhe,{disabled:(o==null?void 0:o.restoreFocus)===!1})),xn.createElement(fde,{...o,hiddenTextDescribedById:A}));function qn(){const Xt=(U==null?void 0:U.autoScrollEnabled)===!1,Bt=typeof u=="object"?u.enabled===!1:u===!1,lr=E&&!Xt&&!Bt;return typeof u=="object"?{...u,enabled:lr}:{enabled:lr}}}),xhe=N.createContext(null),rE="button",yhe="Draggable";function bhe(e){let{id:t,data:r,disabled:n=!1,attributes:i}=e;const a=kh(yhe),{activators:s,activatorEvent:o,active:u,activeNodeRect:d,ariaDescribedById:f,draggableNodes:p,over:m}=N.useContext(Ig),{role:x=rE,roleDescription:b="draggable",tabIndex:v=0}=i??{},k=(u==null?void 0:u.id)===t,w=N.useContext(k?MO:xhe),[C,T]=Fp(),[j,L]=Fp(),E=rhe(s,t),M=Gd(r);ta(()=>(p.set(t,{id:t,key:a,node:C,activatorNode:j,data:M}),()=>{const P=p.get(t);P&&P.key===a&&p.delete(t)}),[p,t]);const I=N.useMemo(()=>({role:x,tabIndex:v,"aria-disabled":n,"aria-pressed":k&&x===rE?!0:void 0,"aria-roledescription":b,"aria-describedby":f.draggable}),[n,x,v,k,b,f.draggable]);return{active:u,activatorEvent:o,activeNodeRect:d,attributes:I,isDragging:k,listeners:n?void 0:E,node:C,over:m,setNodeRef:T,setActivatorNodeRef:L,transform:w}}function vhe(){return N.useContext(AO)}const whe="Droppable",khe={timeout:25};function She(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:i}=e;const a=kh(whe),{active:s,dispatch:o,over:u,measureDroppableContainers:d}=N.useContext(Ig),f=N.useRef({disabled:r}),p=N.useRef(!1),m=N.useRef(null),x=N.useRef(null),{disabled:b,updateMeasurementsFor:v,timeout:k}={...khe,...i},w=Gd(v??n),C=N.useCallback(()=>{if(!p.current){p.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{d(Array.isArray(w.current)?w.current:[w.current]),x.current=null},k)},[k]),T=zg({callback:C,disabled:b||!s}),j=N.useCallback((I,P)=>{T&&(P&&(T.unobserve(P),p.current=!1),I&&T.observe(I))},[T]),[L,E]=Fp(j),M=Gd(t);return N.useEffect(()=>{!T||!L.current||(T.disconnect(),p.current=!1,T.observe(L.current))},[L,T]),N.useEffect(()=>(o({type:Lr.RegisterDroppable,element:{id:n,key:a,disabled:r,node:L,rect:m,data:M}}),()=>o({type:Lr.UnregisterDroppable,key:a,id:n})),[n]),N.useEffect(()=>{r!==f.current.disabled&&(o({type:Lr.SetDroppableDisabled,id:n,key:a,disabled:r}),f.current.disabled=r)},[n,a,r,o]),{active:s,rect:m,isOver:(u==null?void 0:u.id)===n,node:L,over:u,setNodeRef:E}}function LO(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Che(e,t){return e.reduce((r,n,i)=>{const a=t.get(n);return a&&(r[i]=a),r},Array(e.length))}function o0(e){return e!==null&&e>=0}function _he(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function The(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const DO=e=>{let{rects:t,activeIndex:r,overIndex:n,index:i}=e;const a=LO(t,n,r),s=t[i],o=a[i];return!o||!s?null:{x:o.left-s.left,y:o.top-s.top,scaleX:o.width/s.width,scaleY:o.height/s.height}},c0={scaleX:1,scaleY:1},Ehe=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:i,rects:a,overIndex:s}=e;const o=(t=a[r])!=null?t:n;if(!o)return null;if(i===r){const d=a[s];return d?{x:0,y:r<s?d.top+d.height-(o.top+o.height):d.top-o.top,...c0}:null}const u=Nhe(a,i,r);return i>r&&i<=s?{x:0,y:-o.height-u,...c0}:i<r&&i>=s?{x:0,y:o.height+u,...c0}:{x:0,y:0,...c0}};function Nhe(e,t,r){const n=e[t],i=e[t-1],a=e[t+1];return n?r<t?i?n.top-(i.top+i.height):a?a.top-(n.top+n.height):0:a?a.top-(n.top+n.height):i?n.top-(i.top+i.height):0:0}const RO="Sortable",OO=xn.createContext({activeIndex:-1,containerId:RO,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:DO,disabled:{draggable:!1,droppable:!1}});function jhe(e){let{children:t,id:r,items:n,strategy:i=DO,disabled:a=!1}=e;const{active:s,dragOverlay:o,droppableRects:u,over:d,measureDroppableContainers:f}=vhe(),p=kh(RO,r),m=o.rect!==null,x=N.useMemo(()=>n.map(E=>typeof E=="object"&&"id"in E?E.id:E),[n]),b=s!=null,v=s?x.indexOf(s.id):-1,k=d?x.indexOf(d.id):-1,w=N.useRef(x),C=!_he(x,w.current),T=k!==-1&&v===-1||C,j=The(a);ta(()=>{C&&b&&f(x)},[C,x,b,f]),N.useEffect(()=>{w.current=x},[x]);const L=N.useMemo(()=>({activeIndex:v,containerId:p,disabled:j,disableTransforms:T,items:x,overIndex:k,useDragOverlay:m,sortedRects:Che(x,u),strategy:i}),[v,p,j.draggable,j.droppable,T,x,k,u,m,i]);return xn.createElement(OO.Provider,{value:L},t)}const Ahe=e=>{let{id:t,items:r,activeIndex:n,overIndex:i}=e;return LO(r,n,i).indexOf(t)},Mhe=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:i,items:a,newIndex:s,previousItems:o,previousContainerId:u,transition:d}=e;return!d||!n||o!==a&&i===s?!1:r?!0:s!==i&&t===u},Lhe={duration:200,easing:"ease"},BO="transform",Dhe=pc.Transition.toString({property:BO,duration:0,easing:"linear"}),Rhe={roleDescription:"sortable"};function Ohe(e){let{disabled:t,index:r,node:n,rect:i}=e;const[a,s]=N.useState(null),o=N.useRef(r);return ta(()=>{if(!t&&r!==o.current&&n.current){const u=i.current;if(u){const d=Rc(n.current,{ignoreTransform:!0}),f={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(f.x||f.y)&&s(f)}}r!==o.current&&(o.current=r)},[t,r,n,i]),N.useEffect(()=>{a&&s(null)},[a]),a}function $O(e){let{animateLayoutChanges:t=Mhe,attributes:r,disabled:n,data:i,getNewIndex:a=Ahe,id:s,strategy:o,resizeObserverConfig:u,transition:d=Lhe}=e;const{items:f,containerId:p,activeIndex:m,disabled:x,disableTransforms:b,sortedRects:v,overIndex:k,useDragOverlay:w,strategy:C}=N.useContext(OO),T=Bhe(n,x),j=f.indexOf(s),L=N.useMemo(()=>({sortable:{containerId:p,index:j,items:f},...i}),[p,i,j,f]),E=N.useMemo(()=>f.slice(f.indexOf(s)),[f,s]),{rect:M,node:I,isOver:P,setNodeRef:z}=She({id:s,data:L,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...u}}),{active:$,activatorEvent:W,activeNodeRect:Y,attributes:B,setNodeRef:U,listeners:R,isDragging:H,over:V,setActivatorNodeRef:Q,transform:A}=bhe({id:s,data:L,attributes:{...Rhe,...r},disabled:T.draggable}),D=ede(z,U),G=!!$,q=G&&!b&&o0(m)&&o0(k),Z=!w&&H,re=Z&&q?A:null,ie=q?re??(o??C)({rects:v,activeNodeRect:Y,activeIndex:m,overIndex:k,index:j}):null,ne=o0(m)&&o0(k)?a({id:s,items:f,activeIndex:m,overIndex:k}):j,oe=$==null?void 0:$.id,fe=N.useRef({activeId:oe,items:f,newIndex:ne,containerId:p}),xe=f!==fe.current.items,de=t({active:$,containerId:p,isDragging:H,isSorting:G,id:s,index:j,items:f,newIndex:fe.current.newIndex,previousItems:fe.current.items,previousContainerId:fe.current.containerId,transition:d,wasDragging:fe.current.activeId!=null}),ge=Ohe({disabled:!de,index:j,node:I,rect:M});return N.useEffect(()=>{G&&fe.current.newIndex!==ne&&(fe.current.newIndex=ne),p!==fe.current.containerId&&(fe.current.containerId=p),f!==fe.current.items&&(fe.current.items=f)},[G,ne,p,f]),N.useEffect(()=>{if(oe===fe.current.activeId)return;if(oe!=null&&fe.current.activeId==null){fe.current.activeId=oe;return}const Te=setTimeout(()=>{fe.current.activeId=oe},50);return()=>clearTimeout(Te)},[oe]),{active:$,activeIndex:m,attributes:B,data:L,rect:M,index:j,newIndex:ne,items:f,isOver:P,isSorting:G,isDragging:H,listeners:R,node:I,overIndex:k,over:V,setNodeRef:D,setActivatorNodeRef:Q,setDroppableNodeRef:z,setDraggableNodeRef:U,transform:ge??ie,transition:ke()};function ke(){if(ge||xe&&fe.current.newIndex===j)return Dhe;if(!(Z&&!Y2(W)||!d)&&(G||de))return pc.Transition.toString({...d,property:BO})}}function Bhe(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function qp(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const $he=[St.Down,St.Right,St.Up,St.Left],zhe=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:i,droppableContainers:a,over:s,scrollableAncestors:o}}=t;if($he.includes(e.code)){if(e.preventDefault(),!r||!n)return;const u=[];a.getEnabled().forEach(p=>{if(!p||p!=null&&p.disabled)return;const m=i.get(p.id);if(m)switch(e.code){case St.Down:n.top<m.top&&u.push(p);break;case St.Up:n.top>m.top&&u.push(p);break;case St.Left:n.left>m.left&&u.push(p);break;case St.Right:n.left<m.left&&u.push(p);break}});const d=xde({collisionRect:n,droppableRects:i,droppableContainers:u});let f=bO(d,"id");if(f===(s==null?void 0:s.id)&&d.length>1&&(f=d[1].id),f!=null){const p=a.get(r.id),m=a.get(f),x=m?i.get(m.id):null,b=m==null?void 0:m.node.current;if(b&&x&&p&&m){const k=$g(b).some((E,M)=>o[M]!==E),w=zO(p,m),C=Ihe(p,m),T=k||!w?{x:0,y:0}:{x:C?n.width-x.width:0,y:C?n.height-x.height:0},j={x:x.left,y:x.top};return T.x&&T.y?j:Xd(j,T)}}}};function zO(e,t){return!qp(e)||!qp(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Ihe(e,t){return!qp(e)||!qp(t)||!zO(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const Fg={rest:"bg-blue-100 text-blue-800 dark:bg-blue-500/20 dark:text-blue-300",slide:"bg-purple-100 text-purple-800 dark:bg-purple-500/20 dark:text-purple-300",shell:"bg-orange-100 text-orange-800 dark:bg-orange-500/20 dark:text-orange-300",browser:"bg-green-100 text-green-800 dark:bg-green-500/20 dark:text-green-300",code:"bg-gray-100 text-gray-800 dark:bg-gray-500/20 dark:text-gray-300",wait:"bg-yellow-100 text-yellow-800 dark:bg-yellow-500/20 dark:text-yellow-300",assert:"bg-red-100 text-red-800 dark:bg-red-500/20 dark:text-red-300",graphql:"bg-pink-100 text-pink-800 dark:bg-pink-500/20 dark:text-pink-300",db:"bg-indigo-100 text-indigo-800 dark:bg-indigo-500/20 dark:text-indigo-300",form:"bg-indigo-100 text-indigo-800 dark:bg-indigo-500/20 dark:text-indigo-300",terminal:"bg-emerald-100 text-emerald-800 dark:bg-emerald-500/20 dark:text-emerald-300",poll:"bg-amber-100 text-amber-800 dark:bg-amber-500/20 dark:text-amber-300",group:"bg-slate-100 text-slate-800 dark:bg-slate-500/20 dark:text-slate-300"};function IO({step:e,index:t,actions:r,isExpanded:n,onToggle:i,showPreview:a=!1}){const s=Sc(e),o=El(e,t);return h.jsxs("div",{className:"border border-gray-200 dark:border-slate-700 rounded-lg mb-2 overflow-hidden",children:[h.jsxs("div",{className:`flex items-center gap-2 p-2 bg-gray-50 dark:bg-slate-800/50 ${i?"cursor-pointer hover:bg-gray-100 dark:hover:bg-slate-800":""}`,onClick:i,children:[i&&h.jsx("svg",{className:`w-4 h-4 text-gray-400 dark:text-slate-500 transition-transform flex-shrink-0 ${n?"rotate-90":""}`,fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),h.jsx("span",{className:"w-5 h-5 text-[10px] font-medium rounded-full bg-gray-200 dark:bg-slate-700 text-gray-600 dark:text-slate-300 flex items-center justify-center flex-shrink-0",children:t+1}),h.jsx("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded flex-shrink-0 ${Fg[s]}`,children:s.toUpperCase()}),h.jsx("span",{className:"flex-1 truncate text-sm text-gray-700 dark:text-slate-300",children:o}),r&&h.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",onClick:u=>u.stopPropagation(),children:[h.jsx("button",{onClick:r.onMoveUp,disabled:r.isFirst,className:"p-1 text-gray-400 hover:text-gray-600 dark:text-slate-500 dark:hover:text-slate-300 disabled:opacity-30 transition-colors",title:"Move up",children:h.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})})}),h.jsx("button",{onClick:r.onMoveDown,disabled:r.isLast,className:"p-1 text-gray-400 hover:text-gray-600 dark:text-slate-500 dark:hover:text-slate-300 disabled:opacity-30 transition-colors",title:"Move down",children:h.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})}),h.jsx("button",{onClick:r.onDelete,className:"p-1 text-gray-400 hover:text-red-500 dark:text-slate-500 dark:hover:text-red-400 transition-colors",title:"Remove from group",children:h.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),a&&n&&h.jsx("div",{className:"p-3 border-t border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-900/50",children:h.jsx(Fhe,{step:e})})]})}function Fhe({step:e}){var t;if(Tl(e)){const{method:r,endpoint:n}=L0(e);return h.jsxs("pre",{className:"text-xs bg-gray-100 dark:bg-slate-800 p-2 rounded font-mono text-gray-700 dark:text-slate-300 overflow-x-auto",children:[r," ",n]})}if(xc(e)){const r=D0(e),n=r.length>150?r.substring(0,150)+"...":r;return h.jsx("p",{className:"text-xs text-gray-600 dark:text-slate-400 whitespace-pre-wrap line-clamp-3",children:n})}if(yc(e)){const r=hb(e);return h.jsxs("pre",{className:"text-xs bg-gray-100 dark:bg-slate-800 p-2 rounded font-mono text-gray-700 dark:text-slate-300 overflow-x-auto",children:["$ ",r]})}if(bc(e)){const r=wd(e),n=r.length>100?r.substring(0,100)+"...":r;return h.jsx("pre",{className:"text-xs bg-gray-100 dark:bg-slate-800 p-2 rounded font-mono text-pink-600 dark:text-pink-400 overflow-x-auto",children:n})}if(wc(e)){const r=B0(e),n=r.length>100?r.substring(0,100)+"...":r;return h.jsx("pre",{className:"text-xs bg-slate-900 p-2 rounded font-mono text-green-400 overflow-x-auto",children:n})}if(kc(e)){const r=$0(e);return h.jsxs("pre",{className:"text-xs bg-gray-100 dark:bg-slate-800 p-2 rounded font-mono text-amber-600 dark:text-amber-400",children:["Poll: ",r]})}if(vc(e)){const r=O0(e),n=((t=e.fields)==null?void 0:t.length)||0;return h.jsxs("p",{className:"text-xs text-gray-600 dark:text-slate-400",children:["Form: ",r," (",n," field",n!==1?"s":"",")"]})}return h.jsx("p",{className:"text-xs text-gray-400 dark:text-slate-500 italic",children:"No preview available"})}function Phe({steps:e}){const t=N.useMemo(()=>{const r={};return e.forEach(n=>{const i=Sc(n);r[i]=(r[i]||0)+1}),r},[e]);return Object.keys(t).length===0?h.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-500 italic",children:"No steps"}):h.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(t).map(([r,n])=>h.jsxs("span",{className:`px-2 py-0.5 text-xs font-medium rounded ${Fg[r]}`,children:[n," ",r.toUpperCase()]},r))})}function Hhe({groupName:e,description:t,steps:r}){const[n,i]=N.useState(new Set),a=s=>{i(o=>{const u=new Set(o);return u.has(s)?u.delete(s):u.add(s),u})};return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"p-6 border-b border-gray-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 to-gray-50 dark:from-slate-900 dark:to-slate-800",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[h.jsx("svg",{className:"w-5 h-5 text-slate-500 dark:text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),h.jsx("span",{className:"text-xs font-medium text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:"Group"})]}),h.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-slate-100",children:e}),t&&h.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mt-2",children:t})]}),h.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-800/50",children:[h.jsx(Phe,{steps:r}),h.jsxs("p",{className:"text-sm text-gray-500 dark:text-slate-400 mt-2",children:[r.length," step",r.length!==1?"s":""," in this group"]})]}),h.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-slate-300 mb-3",children:"Contents"}),r.length===0?h.jsx("p",{className:"text-sm text-gray-400 dark:text-slate-500 italic",children:"This group is empty. Drag steps here to add them."}):r.map((s,o)=>h.jsx(IO,{step:s,index:o,isExpanded:n.has(o),onToggle:()=>a(o),showPreview:!0},o))]})]})}function nE({step:e,index:t,isActive:r,onSelect:n,onDelete:i,isChild:a,childIndex:s,parentGroupIndex:o,isExpanded:u,onToggleExpand:d,isGroup:f,childCount:p=0,isDropTarget:m}){const{attributes:x,listeners:b,setNodeRef:v,transform:k,transition:w,isDragging:C}=$O({id:e.id,data:{isChild:a,childIndex:s,parentGroupIndex:o}}),T={transform:pc.Transform.toString(k),transition:w,opacity:C?.5:1},j=Sc(e.step),L=El(e.step,t),E=a&&s!==void 0?`${t+1}.${s+1}`:`${t+1}`;return h.jsxs("div",{ref:v,style:T,className:`
481
- group flex items-center gap-1.5 p-2 rounded border cursor-pointer
482
- transition-all duration-150
483
- ${a?"ml-4 border-l-2 border-l-slate-300 dark:border-l-slate-600":""}
484
- ${r?"bg-primary-50 dark:bg-primary-500/10 border-primary-300 dark:border-primary-500/30 shadow-sm":"bg-white dark:bg-slate-800/50 border-gray-200 dark:border-slate-700 hover:border-gray-300 dark:hover:border-slate-600"}
485
- ${C?"shadow-lg ring-2 ring-primary-400 z-10":""}
486
- ${m?"ring-2 ring-primary-400 border-primary-400":""}
487
- `,onClick:n,children:[h.jsx("button",{...x,...b,className:"p-0.5 rounded text-gray-400 hover:text-gray-600 dark:text-slate-500 dark:hover:text-slate-300 cursor-grab active:cursor-grabbing",onClick:M=>M.stopPropagation(),title:a?"Drag to reorder or move out of group":"Drag to reorder",children:h.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{d:"M7 2a2 2 0 10.001 4.001A2 2 0 007 2zm0 6a2 2 0 10.001 4.001A2 2 0 007 8zm0 6a2 2 0 10.001 4.001A2 2 0 007 14zm6-8a2 2 0 10-.001-4.001A2 2 0 0013 6zm0 2a2 2 0 10.001 4.001A2 2 0 0013 8zm0 6a2 2 0 10.001 4.001A2 2 0 0013 14z"})})}),h.jsx("span",{className:`flex items-center justify-center text-[10px] font-medium rounded-full bg-gray-100 dark:bg-slate-700 text-gray-600 dark:text-slate-300 ${a?"px-1.5 h-5":"w-5 h-5"}`,children:E}),h.jsx("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded ${Fg[j]}`,children:j.toUpperCase()}),h.jsx("span",{className:"flex-1 truncate text-xs text-gray-700 dark:text-slate-200",children:L}),f&&h.jsx("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded ${p>0?"bg-slate-200 dark:bg-slate-600 text-slate-600 dark:text-slate-300":"bg-slate-100 dark:bg-slate-700 text-slate-400 dark:text-slate-500"}`,children:p}),f&&h.jsx("button",{onClick:M=>{M.stopPropagation(),d==null||d()},className:`p-0.5 rounded text-gray-400 hover:text-gray-600 dark:text-slate-500 dark:hover:text-slate-300 ${p===0?"opacity-50":""}`,title:p===0?"Empty group - drag steps here":u?"Collapse group":"Expand group",children:h.jsx("svg",{className:`w-3.5 h-3.5 transition-transform ${u?"rotate-90":""}`,fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})}),!a&&h.jsx("button",{onClick:M=>{M.stopPropagation(),i()},className:"p-0.5 rounded text-gray-400 hover:text-red-500 dark:text-slate-500 dark:hover:text-red-400 opacity-0 group-hover:opacity-100 transition-opacity",title:"Delete step",children:h.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})}function qhe({step:e,index:t,isActive:r,isDropTarget:n,onSelect:i,onDelete:a,isExpanded:s,onToggleExpand:o,childCount:u}){const{attributes:d,listeners:f,setNodeRef:p,transform:m,transition:x,isDragging:b}=$O({id:e.id,data:{isChild:!1,isGroup:!0}}),v={transform:pc.Transform.toString(m),transition:x,opacity:b?.5:1},k=Sc(e.step),w=El(e.step,t);return h.jsxs("div",{ref:p,style:v,className:`
488
- group flex items-center gap-1.5 p-2 rounded border cursor-pointer
489
- transition-all duration-150
490
- ${r?"bg-primary-50 dark:bg-primary-500/10 border-primary-300 dark:border-primary-500/30 shadow-sm":"bg-white dark:bg-slate-800/50 border-gray-200 dark:border-slate-700 hover:border-gray-300 dark:hover:border-slate-600"}
491
- ${b?"shadow-lg ring-2 ring-primary-400 z-10":""}
492
- ${n?"ring-2 ring-green-400 border-green-400 bg-green-50 dark:bg-green-900/20":""}
493
- `,onClick:i,children:[h.jsx("button",{...d,...f,className:"p-0.5 rounded text-gray-400 hover:text-gray-600 dark:text-slate-500 dark:hover:text-slate-300 cursor-grab active:cursor-grabbing",onClick:C=>C.stopPropagation(),title:"Drag to reorder",children:h.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{d:"M7 2a2 2 0 10.001 4.001A2 2 0 007 2zm0 6a2 2 0 10.001 4.001A2 2 0 007 8zm0 6a2 2 0 10.001 4.001A2 2 0 007 14zm6-8a2 2 0 10-.001-4.001A2 2 0 0013 6zm0 2a2 2 0 10.001 4.001A2 2 0 0013 8zm0 6a2 2 0 10.001 4.001A2 2 0 0013 14z"})})}),h.jsx("span",{className:"flex items-center justify-center w-5 h-5 text-[10px] font-medium rounded-full bg-gray-100 dark:bg-slate-700 text-gray-600 dark:text-slate-300",children:t+1}),h.jsx("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded ${Fg[k]}`,children:k.toUpperCase()}),h.jsx("span",{className:"flex-1 truncate text-xs text-gray-700 dark:text-slate-200",children:w}),h.jsx("span",{className:`px-1.5 py-0.5 text-[10px] font-medium rounded ${u>0?"bg-slate-200 dark:bg-slate-600 text-slate-600 dark:text-slate-300":"bg-slate-100 dark:bg-slate-700 text-slate-400 dark:text-slate-500"}`,children:u}),h.jsx("button",{onClick:C=>{C.stopPropagation(),o()},className:`p-0.5 rounded text-gray-400 hover:text-gray-600 dark:text-slate-500 dark:hover:text-slate-300 ${u===0?"opacity-50":""}`,title:u===0?"Empty group - drag steps here":s?"Collapse group":"Expand group",children:h.jsx("svg",{className:`w-3.5 h-3.5 transition-transform ${s?"rotate-90":""}`,fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})}),h.jsx("button",{onClick:C=>{C.stopPropagation(),a()},className:"p-0.5 rounded text-gray-400 hover:text-red-500 dark:text-slate-500 dark:hover:text-red-400 opacity-0 group-hover:opacity-100 transition-opacity",title:"Delete step",children:h.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})}function Uhe({steps:e,currentStep:t,selectedChildIndex:r,onReorder:n,onMoveIntoGroup:i,onMoveOutOfGroup:a,onReorderWithinGroup:s,onSelect:o,onSelectChild:u,onDelete:d}){const[f,p]=N.useState(()=>{const M=new Set;return e.forEach(I=>{Sr(I.step)&&M.add(I.id)}),M}),[m,x]=N.useState(null),[b,v]=N.useState(!1),k=pde(UT(Z2,{activationConstraint:{distance:5}}),UT(X2,{coordinateGetter:zhe})),w=N.useMemo(()=>{const M=[];return e.forEach(I=>{const P=Sr(I.step);(!b||!P)&&M.push(I.id),P&&(I.step.steps||[]).forEach(($,W)=>{M.push(`${I.id}-child-${W}`)})}),M},[e,b]);function C(M){var V,Q;const{active:I,over:P}=M;if(!P)return;const z=(V=I.data)==null?void 0:V.current,$=(Q=P.data)==null?void 0:Q.current,W=(z==null?void 0:z.isChild)===!0,Y=z==null?void 0:z.parentGroupIndex,B=z==null?void 0:z.childIndex,U=($==null?void 0:$.type)==="group-dropzone",R=String(P.id);let H;if(U)H=$.groupIndex;else if(!W&&i){const A=e.findIndex(D=>D.id===R);if(A!==-1&&Sr(e[A].step)){const D=e.findIndex(G=>G.id===I.id);D!==-1&&!Sr(e[D].step)&&(H=A)}}if(H!==void 0&&i){if(W&&a&&Y!==void 0&&B!==void 0)Y!==H&&a(Y,B,H);else{const A=e.findIndex(D=>D.id===I.id);A!==H&&A!==-1&&i(A,H)}return}if(($==null?void 0:$.type)==="top-level-dropzone"&&W&&a){if(Y!==void 0&&B!==void 0){const A=$.targetIndex;a(Y,B,A)}return}if(W&&($==null?void 0:$.isChild)===!0&&s){const A=$.parentGroupIndex,D=$.childIndex;if(Y===A&&Y!==void 0&&B!==void 0&&D!==void 0){s(Y,B,D);return}}if(W&&!($!=null&&$.isChild)&&a&&Y!==void 0&&B!==void 0){const A=e.findIndex(D=>D.id===P.id);A!==-1&&a(Y,B,A);return}if(!W&&I.id!==P.id){const A=e.findIndex(G=>G.id===I.id),D=e.findIndex(G=>G.id===P.id);A!==-1&&D!==-1&&n(A,D)}x(null),v(!1)}function T(M){var $;const I=($=M.active.data)==null?void 0:$.current,P=e.findIndex(W=>W.id===M.active.id),z=(I==null?void 0:I.isChild)===!0;if(!z&&P!==-1){const W=e[P];v(!Sr(W.step))}else z&&v(!0)}function j(M){const{over:I}=M;if(!I||!b){x(null);return}const P=String(I.id),z=e.findIndex($=>$.id===P);z!==-1&&Sr(e[z].step)?x(z):x(null)}function L(){x(null),v(!1)}function E(M){p(I=>{const P=new Set(I);return P.has(M)?P.delete(M):P.add(M),P})}return e.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center text-gray-500 dark:text-slate-400",children:[h.jsx("svg",{className:"w-10 h-10 mb-2 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),h.jsx("p",{className:"text-xs font-medium",children:"No steps yet"}),h.jsx("p",{className:"text-[10px] mt-0.5 text-gray-400 dark:text-slate-500",children:"Add steps to start building your demo"})]}):h.jsx(mhe,{sensors:k,collisionDetection:mde,onDragStart:T,onDragOver:j,onDragEnd:C,onDragCancel:L,children:h.jsx(jhe,{items:w,strategy:Ehe,children:h.jsx("div",{className:"flex flex-col gap-2",children:e.map((M,I)=>{const P=M.step,z=Sr(P),$=f.has(M.id),W=z?P.steps||[]:[],Y=I===t;return h.jsxs("div",{children:[z?h.jsx(qhe,{step:M,index:I,isActive:Y&&r===null,isDropTarget:m===I,onSelect:()=>{o(I),u(null)},onDelete:()=>d(I),childCount:W.length,isExpanded:$,onToggleExpand:()=>E(M.id)}):h.jsx(nE,{step:M,index:I,isActive:Y,onSelect:()=>o(I),onDelete:()=>d(I),isGroup:!1,childCount:0,isExpanded:!1}),z&&$&&W.length>0&&h.jsx("div",{className:"flex flex-col gap-1 mt-1",children:W.map((B,U)=>{const R={id:`${M.id}-child-${U}`,step:B},H=Y&&r===U;return h.jsx(nE,{step:R,index:I,childIndex:U,parentGroupIndex:I,isActive:H,onSelect:()=>{o(I),u(U)},onDelete:()=>{},isChild:!0},R.id)})})]},M.id)})})})})}function Vhe({left:e,right:t,defaultLeftWidth:r=40,minLeftWidth:n=20,maxLeftWidth:i=80,showDivider:a=!0}){const[s,o]=N.useState(r),[u,d]=N.useState(!1),f=N.useRef(null),p=N.useCallback(b=>{b.preventDefault(),d(!0)},[]),m=N.useCallback(b=>{if(!u||!f.current)return;const k=f.current.getBoundingClientRect(),w=(b.clientX-k.left)/k.width*100,C=Math.min(Math.max(w,n),i);o(C)},[u,n,i]),x=N.useCallback(()=>{d(!1)},[]);return N.useState(()=>{if(u)return document.addEventListener("mousemove",m),document.addEventListener("mouseup",x),()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",x)}}),h.jsxs("div",{ref:f,className:"flex h-full w-full overflow-hidden",onMouseMove:u?b=>m(b.nativeEvent):void 0,onMouseUp:u?x:void 0,onMouseLeave:u?x:void 0,children:[h.jsx("div",{className:"h-full overflow-auto flex-shrink-0",style:{width:`${s}%`},children:e}),a&&h.jsx("div",{className:`
494
- w-1 flex-shrink-0 cursor-col-resize
495
- bg-gray-200 dark:bg-slate-700
496
- hover:bg-primary-400 dark:hover:bg-primary-500
497
- transition-colors duration-150
498
- ${u?"bg-primary-500 dark:bg-primary-400":""}
499
- `,onMouseDown:p,children:h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx("div",{className:"w-0.5 h-8 bg-gray-400 dark:bg-slate-500 rounded-full opacity-50"})})}),h.jsx("div",{className:"flex-1 h-full overflow-auto",children:t})]})}function Pg(e={}){const{initialPosition:t,boundToWindow:r=!0}=e,n=(t==null?void 0:t.x)??0,i=(t==null?void 0:t.y)??0,[a,s]=N.useState({x:n,y:i}),[o,u]=N.useState(!1),d=N.useRef({x:0,y:0}),f=N.useRef({width:0,height:0}),p=N.useCallback(x=>{if(x.button!==0)return;x.preventDefault(),u(!0),d.current={x:x.clientX-a.x,y:x.clientY-a.y};const b=x.target.closest("[data-draggable-modal]");if(b){const v=b.getBoundingClientRect();f.current={width:v.width,height:v.height}}},[a]);N.useEffect(()=>{if(!o)return;const x=v=>{let k=v.clientX-d.current.x,w=v.clientY-d.current.y;if(r){const C=window.innerWidth-f.current.width/2,T=window.innerHeight-f.current.height/2,j=-f.current.width/2,L=-f.current.height/2;k=Math.max(j,Math.min(C,k)),w=Math.max(L,Math.min(T,w))}s({x:k,y:w})},b=()=>{u(!1)};return document.addEventListener("mousemove",x),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",b)}},[o,r]);const m=N.useCallback(()=>{s({x:n,y:i})},[n,i]);return{position:a,isDragging:o,handleMouseDown:p,resetPosition:m}}const Whe={GET:"bg-green-500/20 text-green-400 border-green-500/30",POST:"bg-blue-500/20 text-blue-400 border-blue-500/30",PUT:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",DELETE:"bg-red-500/20 text-red-400 border-red-500/30",PATCH:"bg-purple-500/20 text-purple-400 border-purple-500/30"};function Yhe({isOpen:e,onClose:t,onAddEndpoint:r,openapiUrl:n}){const[i,a]=N.useState(null),[s,o]=N.useState(!1),[u,d]=N.useState(null),[f,p]=N.useState(""),[m,x]=N.useState(null),[b,v]=N.useState(null),{position:k,isDragging:w,handleMouseDown:C,resetPosition:T}=Pg();N.useEffect(()=>{if(!e||!n||i)return;(async()=>{o(!0),d(null);try{const $=n.startsWith("/")?n:`/api/openapi?url=${encodeURIComponent(n)}`,W=await fetch($);if(!W.ok){const B=await W.json();throw new Error(B.error||`Failed to fetch: ${W.status}`)}const Y=await W.json();if(!Y.openapi&&!Y.swagger||!Y.paths)throw new Error("Invalid OpenAPI spec: missing openapi/swagger or paths");a(Y)}catch(z){d(z instanceof Error?z.message:"Failed to fetch spec"),a(null)}finally{o(!1)}})()},[e,n,i]);const j=N.useMemo(()=>{if(!i)return[];const P=z1(i);return Array.from(P.keys()).filter(z=>z!=="Other")},[i]),L=N.useMemo(()=>{if(!i)return[];let P;if(f.trim())P=D6(i,f);else{const z=z1(i);m?P=z.get(m)||[]:P=Array.from(z.values()).flat()}return P},[i,f,m]),E=N.useCallback(P=>{if(!i)return;const{method:z,path:$,summary:W}=P,Y=Dp(i,z,$),B=q4(i,z,$),U={rest:`${z} ${$}`,title:W||`${z} ${$}`,...Y.length>0&&{form:Y},...B.length>0&&{results:B}};r(U),t()},[i,r,t]),M=P=>{v(z=>z===P?null:P)},I=P=>`${P.method}-${P.path}`;return N.useEffect(()=>{e||(p(""),x(null),v(null),T())},[e,T]),e?h.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:h.jsxs("div",{"data-draggable-modal":!0,className:"bg-white dark:bg-slate-900 rounded-xl shadow-xl w-full max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",style:{transform:`translate(${k.x}px, ${k.y}px)`},children:[h.jsxs("div",{onMouseDown:C,className:`flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-slate-700 flex-shrink-0 ${w?"cursor-grabbing":"cursor-grab"}`,children:[h.jsxs("div",{children:[h.jsx("h3",{className:"font-medium text-gray-900 dark:text-slate-100 select-none",children:"Browse API Endpoints"}),i&&h.jsxs("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-0.5 select-none",children:[i.info.title," v",i.info.version," - ",L.length," endpoints"]})]}),h.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-700 dark:text-slate-400 dark:hover:text-slate-200",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),i&&h.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-slate-700 flex-shrink-0",children:h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:"text",value:f,onChange:P=>p(P.target.value),placeholder:"Search endpoints...",className:"w-full px-3 py-2 pl-9 bg-gray-50 dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500",autoFocus:!0}),h.jsx("svg",{className:"absolute left-3 top-2.5 h-4 w-4 text-gray-400 dark:text-slate-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]})}),i&&j.length>0&&!f&&h.jsx("div",{className:"px-4 py-2 border-b border-gray-200 dark:border-slate-700 flex-shrink-0 overflow-x-auto",children:h.jsxs("div",{className:"flex gap-1.5",children:[h.jsx("button",{onClick:()=>x(null),className:`px-2.5 py-1 text-xs font-medium rounded-full transition-colors whitespace-nowrap ${m===null?"bg-primary-600 text-white":"bg-gray-100 dark:bg-slate-800 text-gray-600 dark:text-slate-400 hover:bg-gray-200 dark:hover:bg-slate-700"}`,children:"All"}),j.map(P=>h.jsx("button",{onClick:()=>x(P),className:`px-2.5 py-1 text-xs font-medium rounded-full transition-colors whitespace-nowrap ${m===P?"bg-primary-600 text-white":"bg-gray-100 dark:bg-slate-800 text-gray-600 dark:text-slate-400 hover:bg-gray-200 dark:hover:bg-slate-700"}`,children:P},P))]})}),h.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[s&&h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsxs("div",{className:"flex items-center gap-3 text-gray-500 dark:text-slate-400",children:[h.jsxs("svg",{className:"animate-spin h-5 w-5",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),h.jsx("span",{children:"Loading OpenAPI spec..."})]})}),u&&h.jsxs("div",{className:"p-4 bg-red-50 dark:bg-red-500/10 border border-red-200 dark:border-red-500/30 rounded-lg",children:[h.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:u}),h.jsx("button",{onClick:()=>{d(null),a(null)},className:"mt-2 text-xs text-red-500 hover:text-red-700 dark:hover:text-red-300 underline",children:"Retry"})]}),i&&L.length===0&&h.jsx("div",{className:"text-center py-12",children:h.jsx("p",{className:"text-gray-500 dark:text-slate-400",children:f?"No endpoints match your search":"No endpoints found"})}),i&&L.length>0&&h.jsx("div",{className:"space-y-2",children:L.map(P=>{const z=I(P),$=b===z;return h.jsxs("div",{className:"border border-gray-200 dark:border-slate-700 rounded-lg overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-2 p-3 bg-gray-50 dark:bg-slate-800/50",children:[h.jsx("span",{className:`px-2 py-0.5 text-xs font-bold rounded border flex-shrink-0 ${Whe[P.method]||"bg-gray-500/20 text-gray-400"}`,children:P.method}),h.jsxs("button",{onClick:()=>M(z),className:"flex-1 text-left min-w-0",children:[h.jsx("span",{className:"text-sm font-mono text-gray-900 dark:text-slate-200 truncate block",children:P.path}),P.summary&&h.jsx("span",{className:"text-xs text-gray-500 dark:text-slate-400 truncate block",children:P.summary})]}),P.deprecated&&h.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-yellow-100 dark:bg-yellow-500/20 text-yellow-700 dark:text-yellow-400 rounded flex-shrink-0",children:"Deprecated"}),h.jsx("button",{onClick:()=>E(P),className:"px-3 py-1.5 text-xs font-medium bg-primary-600 hover:bg-primary-700 text-white rounded transition-colors flex-shrink-0",children:"+ Add"})]}),$&&h.jsxs("div",{className:"p-3 border-t border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-900 text-sm",children:[P.description&&h.jsx("p",{className:"text-gray-600 dark:text-slate-400 mb-3",children:P.description}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-xs font-medium text-gray-500 dark:text-slate-500 uppercase",children:"Request Fields"}),h.jsx("div",{className:"mt-1 text-xs font-mono text-gray-600 dark:text-slate-400",children:(()=>{const W=Dp(i,P.method,P.path);return W.length===0?h.jsx("span",{className:"italic",children:"No request body"}):W.map(Y=>Y.name).join(", ")})()})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-xs font-medium text-gray-500 dark:text-slate-500 uppercase",children:"Response Fields"}),h.jsx("div",{className:"mt-1 text-xs font-mono text-gray-600 dark:text-slate-400",children:(()=>{const W=q4(i,P.method,P.path);return W.length===0?h.jsx("span",{className:"italic",children:"No response schema"}):W.map(Y=>Y.key).join(", ")})()})]})]})]})]},z)})})]}),h.jsx("div",{className:"flex items-center justify-end px-4 py-3 border-t border-gray-200 dark:border-slate-700 flex-shrink-0 bg-gray-50 dark:bg-slate-800/50",children:h.jsx("button",{onClick:t,className:"px-4 py-2 text-sm text-gray-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-slate-700 rounded-lg transition-colors",children:"Close"})})]})}):null}const vd={async listDirectory(e){const t=new URL("/api/files",window.location.origin);e&&t.searchParams.set("dir",e);const r=await fetch(t.toString());if(!r.ok){const n=await r.json();throw new Error(n.error||"Failed to list directory")}return r.json()},async readFile(e){const t=new URL("/api/file",window.location.origin);t.searchParams.set("path",e);const r=await fetch(t.toString());if(!r.ok){const n=await r.json();throw new Error(n.error||"Failed to read file")}return r.json()},async saveFile(e,t){const r=await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,content:t})});if(!r.ok){const n=await r.json();throw new Error(n.error||"Failed to save file")}return r.json()},async getInitialDemo(){const e=await fetch("/api/editor/demo");return e.ok?e.json():{path:null,config:null}}};function Ghe(){return!!window.__DEMOSCRIPT_CLI_MODE__}function FO(){return!!window.__DEMOSCRIPT_CLOUD_ENABLED__}function iE(e){var t;try{const r=Wp(e);if(!r||typeof r!="object")throw new Error("Invalid YAML: expected an object");return{title:String(r.title||"Untitled Demo"),description:r.description?String(r.description):void 0,version:r.version?String(r.version):void 0,author:r.author?String(r.author):void 0,tags:Array.isArray(r.tags)?r.tags.map(String):void 0,metadata:r.metadata||{},settings:r.settings||{},steps:Array.isArray(r.steps)?r.steps:[]}}catch(r){if(r instanceof hv){const n=(t=r.mark)!=null&&t.line?` at line ${r.mark.line+1}`:"";throw new Error(`YAML parse error${n}: ${r.reason}`)}throw r}}function Vu(e){return e.includes(":")||e.includes("#")||e.includes(`
500
- `)||e.includes('"')||e.startsWith(" ")||e.endsWith(" ")||e.startsWith("{")||e.startsWith("[")||/^[0-9]/.test(e)||e==="true"||e==="false"||e==="null"||e===""?`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:e}function Xhe(e,t=2){const r=" ".repeat(t);return Ed([e],{indent:2,lineWidth:-1,noRefs:!0,quotingType:'"',forceQuotes:!1}).trim().split(`
501
- `).map((a,s)=>s===0?`${r}${a}`:`${r}${a}`).join(`
502
- `)}function Up(e){const t=[];if(t.push(`title: ${Vu(e.title)}`),e.description&&t.push(`description: ${Vu(e.description)}`),e.version&&t.push(`version: ${Vu(e.version)}`),e.author&&t.push(`author: ${Vu(e.author)}`),e.tags&&e.tags.length>0){t.push("tags:");for(const r of e.tags)t.push(` - ${Vu(r)}`)}if(e.metadata&&Object.keys(e.metadata).length>0){t.push(""),t.push("metadata:");const r=Ed(e.metadata,{indent:2,noRefs:!0}).trim();for(const n of r.split(`
503
- `))t.push(` ${n}`)}if(e.settings&&Object.keys(e.settings).length>0){t.push(""),t.push("settings:");const r=Ed(e.settings,{indent:2,noRefs:!0}).trim();for(const n of r.split(`
504
- `))t.push(` ${n}`)}if(e.steps&&e.steps.length>0){t.push(""),t.push("steps:");for(const r of e.steps)t.push(Xhe(r))}return t.join(`
505
- `)+`
506
- `}function Qhe(e){var t;try{const r=Wp(e);if(!r||typeof r!="object")return"Invalid YAML: expected an object with title and steps";const n=r;return n.title?n.steps&&!Array.isArray(n.steps)?"Invalid field: steps must be an array":null:"Missing required field: title"}catch(r){return r instanceof hv?`YAML syntax error${(t=r.mark)!=null&&t.line?` at line ${r.mark.line+1}`:""}: ${r.reason}`:r instanceof Error?r.message:"Unknown error"}}function Zhe({onOpenFilePicker:e,onPushToCloud:t}){const{state:r,toConfig:n,newFile:i,markSaved:a}=q2(),[s,o]=N.useState(!1),[u,d]=N.useState(!1),f=N.useRef(null),p=FO();N.useEffect(()=>{function w(C){f.current&&!f.current.contains(C.target)&&o(!1)}return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[]);const m=N.useCallback(()=>{r.isDirty&&!window.confirm("You have unsaved changes. Discard them?")||(i(),o(!1))},[r.isDirty,i]),x=N.useCallback(()=>{r.isDirty&&!window.confirm("You have unsaved changes. Discard them?")||(e("open"),o(!1))},[r.isDirty,e]),b=N.useCallback(async()=>{if(r.currentFilePath&&!r.isNewFile){d(!0);try{const w=n(),C=Up(w);await vd.saveFile(r.currentFilePath,C),a()}catch(w){alert(`Failed to save: ${w instanceof Error?w.message:"Unknown error"}`)}finally{d(!1)}}else e("save");o(!1)},[r.currentFilePath,r.isNewFile,n,a,e]),v=N.useCallback(()=>{e("save"),o(!1)},[e]),k=N.useCallback(()=>{t==null||t(),o(!1)},[t]);return N.useEffect(()=>{function w(C){if(C.ctrlKey||C.metaKey)switch(C.key.toLowerCase()){case"n":C.shiftKey||(C.preventDefault(),m());break;case"o":C.shiftKey||(C.preventDefault(),x());break;case"s":C.preventDefault(),C.shiftKey?v():b();break}}return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[m,x,b,v]),h.jsxs("div",{ref:f,className:"relative",children:[h.jsxs("button",{onClick:()=>o(!s),className:"flex items-center gap-1 px-2 py-1 text-sm text-gray-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-slate-700 rounded transition-colors",children:["File",h.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),s&&h.jsxs("div",{className:"absolute left-0 top-full mt-1 w-52 bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg shadow-lg z-50 py-1",children:[h.jsx(Wu,{onClick:m,shortcut:"Ctrl+N",children:"New"}),h.jsx(Wu,{onClick:x,shortcut:"Ctrl+O",children:"Open..."}),h.jsx(aE,{}),h.jsx(Wu,{onClick:b,shortcut:"Ctrl+S",disabled:u,children:u?"Saving...":"Save"}),h.jsx(Wu,{onClick:v,shortcut:"Ctrl+Shift+S",children:"Save As..."}),p&&t&&h.jsxs(h.Fragment,{children:[h.jsx(aE,{}),h.jsx(Wu,{onClick:k,children:"Push to Cloud..."})]})]})]})}function Wu({onClick:e,shortcut:t,disabled:r,children:n}){return h.jsxs("button",{onClick:e,disabled:r,className:`w-full flex items-center justify-between px-3 py-1.5 text-sm text-left ${r?"text-gray-400 dark:text-slate-500 cursor-not-allowed":"text-gray-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-slate-700"}`,children:[h.jsx("span",{children:n}),t&&h.jsx("span",{className:"text-xs text-gray-400 dark:text-slate-500",children:t})]})}function aE(){return h.jsx("div",{className:"my-1 border-t border-gray-200 dark:border-slate-700"})}function Khe({mode:e,isOpen:t,initialPath:r,defaultFileName:n="demo.yaml",onSelect:i,onClose:a}){const[s,o]=N.useState(""),[u,d]=N.useState(""),[f,p]=N.useState([]),[m,x]=N.useState(!0),[b,v]=N.useState(null),[k,w]=N.useState(n),[C,T]=N.useState(null),{position:j,isDragging:L,handleMouseDown:E,resetPosition:M}=Pg(),I=N.useCallback(async B=>{x(!0),v(null),T(null);try{const U=await vd.listDirectory(B);o(U.path),d(U.parent),p(U.items)}catch(U){v(U instanceof Error?U.message:"Failed to load directory")}finally{x(!1)}},[]);N.useEffect(()=>{if(t){const B=r!=null&&r.endsWith(".yaml")||r!=null&&r.endsWith(".yml")?r.substring(0,r.lastIndexOf("/")):r;I(B||void 0)}},[t,r,I]),N.useEffect(()=>{t||(w(n),T(null),M())},[t,n,M]);const P=B=>{B.isDirectory?I(B.path):(T(B),e==="save"&&w(B.name))},z=B=>{B.isDirectory?I(B.path):e==="open"&&B.isYaml&&i(B.path)},$=()=>{u&&u!==s&&I(u)},W=()=>{if(e==="open")C&&C.isYaml&&i(C.path);else if(k){const B=k.endsWith(".yaml")||k.endsWith(".yml")?k:`${k}.yaml`,U=`${s}/${B}`;i(U)}};if(!t)return null;const Y=e==="open"?C==null?void 0:C.isYaml:k.trim().length>0;return h.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:h.jsxs("div",{"data-draggable-modal":!0,className:"bg-white dark:bg-slate-900 rounded-xl shadow-xl w-full max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",style:{transform:`translate(${j.x}px, ${j.y}px)`},children:[h.jsxs("div",{onMouseDown:E,className:`flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-slate-700 ${L?"cursor-grabbing":"cursor-grab"}`,children:[h.jsx("h3",{className:"font-medium text-gray-900 dark:text-slate-100 select-none",children:e==="open"?"Open Demo":"Save Demo"}),h.jsx("button",{onClick:a,className:"text-gray-500 hover:text-gray-700 dark:text-slate-400 dark:hover:text-slate-200",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsxs("div",{className:"px-4 py-2 bg-gray-50 dark:bg-slate-800 border-b border-gray-200 dark:border-slate-700 flex items-center gap-2",children:[h.jsx("button",{onClick:$,disabled:!u||u===s,className:"p-1 text-gray-500 hover:text-gray-700 dark:text-slate-400 dark:hover:text-slate-200 disabled:opacity-50 disabled:cursor-not-allowed rounded hover:bg-gray-200 dark:hover:bg-slate-700",title:"Go up",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 10l7-7m0 0l7 7m-7-7v18"})})}),h.jsx("span",{className:"text-sm text-gray-600 dark:text-slate-400 truncate flex-1",title:s,children:s})]}),h.jsx("div",{className:"flex-1 overflow-auto p-2 min-h-[300px]",children:m?h.jsxs("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-slate-400",children:[h.jsxs("svg",{className:"animate-spin h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading..."]}):b?h.jsx("div",{className:"flex items-center justify-center h-full text-red-500",children:b}):f.length===0?h.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-slate-400",children:"Empty directory"}):h.jsx("div",{className:"space-y-0.5",children:f.map(B=>h.jsxs("button",{onClick:()=>P(B),onDoubleClick:()=>z(B),className:`w-full flex items-center gap-3 px-3 py-2 rounded text-left transition-colors ${(C==null?void 0:C.path)===B.path?"bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300":"hover:bg-gray-100 dark:hover:bg-slate-800"}`,children:[B.isDirectory?h.jsx("svg",{className:"w-5 h-5 text-yellow-500",fill:"currentColor",viewBox:"0 0 20 20",children:h.jsx("path",{d:"M2 6a2 2 0 012-2h5l2 2h5a2 2 0 012 2v6a2 2 0 01-2 2H4a2 2 0 01-2-2V6z"})}):B.isYaml?h.jsx("svg",{className:"w-5 h-5 text-primary-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}):h.jsx("svg",{className:"w-5 h-5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),h.jsx("span",{className:`text-sm ${B.isYaml?"text-gray-900 dark:text-slate-100 font-medium":"text-gray-700 dark:text-slate-300"}`,children:B.name})]},B.path))})}),h.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 dark:border-slate-700 bg-gray-50 dark:bg-slate-800/50",children:[e==="save"&&h.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[h.jsx("label",{className:"text-sm text-gray-600 dark:text-slate-400 whitespace-nowrap",children:"File name:"}),h.jsx("input",{type:"text",value:k,onChange:B=>w(B.target.value),className:"flex-1 px-3 py-1.5 text-sm bg-white dark:bg-slate-900 border border-gray-300 dark:border-slate-600 rounded focus:outline-none focus:ring-2 focus:ring-primary-500",placeholder:"demo.yaml"})]}),h.jsxs("div",{className:"flex items-center justify-end gap-2",children:[h.jsx("button",{onClick:a,className:"px-4 py-2 text-sm text-gray-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-slate-700 rounded-lg transition-colors",children:"Cancel"}),h.jsx("button",{onClick:W,disabled:!Y,className:"px-4 py-2 text-sm bg-primary-600 text-white rounded-lg hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:e==="open"?"Open":"Save"})]})]})]})})}function Jhe(e,t=50){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,t)}function efe({isOpen:e,onClose:t}){const{state:r,toConfig:n}=q2(),[i,a]=N.useState(null),[s,o]=N.useState(""),[u,d]=N.useState(!0),[f,p]=N.useState(!1),[m,x]=N.useState(null),[b,v]=N.useState(null),{position:k,isDragging:w,handleMouseDown:C,resetPosition:T}=Pg();N.useEffect(()=>{e&&!s&&o(Jhe(r.title||"my-demo"))},[e,r.title,s]),N.useEffect(()=>{e&&fetch("/api/auth/status").then(E=>E.json()).then(E=>a(E)).catch(()=>a({isLoggedIn:!1}))},[e]),N.useEffect(()=>{e||(x(null),v(null),T())},[e,T]);const j=N.useCallback(async()=>{p(!0),x(null);try{const E=n(),M=Up(E),I=await fetch("/api/push",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:s,title:E.title,yaml_content:M,is_public:u})}),P=await I.json();if(!I.ok)throw new Error(P.error||"Push failed");v(P)}catch(E){x(E instanceof Error?E.message:"Push failed")}finally{p(!1)}},[n,s,u]),L=E=>{const M=E.toLowerCase().replace(/[^a-z0-9-]/g,"-");o(M)};return e?h.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:h.jsxs("div",{"data-draggable-modal":!0,className:"bg-white dark:bg-slate-900 rounded-xl shadow-xl w-full max-w-md overflow-hidden",style:{transform:`translate(${k.x}px, ${k.y}px)`},children:[h.jsxs("div",{onMouseDown:C,className:`flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-slate-700 ${w?"cursor-grabbing":"cursor-grab"}`,children:[h.jsx("h3",{className:"font-medium text-gray-900 dark:text-slate-100 select-none",children:"Push to Cloud"}),h.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-700 dark:text-slate-400 dark:hover:text-slate-200",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsxs("div",{className:"p-4",children:[i&&!i.isLoggedIn&&h.jsxs("div",{className:"text-center py-6",children:[h.jsx("svg",{className:"w-12 h-12 mx-auto mb-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),h.jsx("p",{className:"text-gray-600 dark:text-slate-400 mb-4",children:"You need to log in first to push demos to the cloud."}),h.jsxs("p",{className:"text-sm text-gray-500 dark:text-slate-500",children:["Run ",h.jsx("code",{className:"bg-gray-100 dark:bg-slate-800 px-1.5 py-0.5 rounded font-mono text-xs",children:"demoscript login"})," in your terminal"]})]}),b&&h.jsxs("div",{className:"text-center py-6",children:[h.jsx("svg",{className:"w-12 h-12 mx-auto mb-4 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),h.jsx("p",{className:"text-lg font-medium text-gray-900 dark:text-slate-100 mb-2",children:b.updated?"Demo Updated!":"Demo Published!"}),h.jsx("p",{className:"text-gray-600 dark:text-slate-400 mb-4",children:"Your demo is now live at:"}),h.jsx("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300 underline break-all",children:b.url})]}),(i==null?void 0:i.isLoggedIn)&&!b&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1",children:"Demo Slug"}),h.jsx("input",{type:"text",value:s,onChange:E=>L(E.target.value),placeholder:"my-demo",maxLength:50,className:"w-full px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"}),h.jsxs("p",{className:"mt-1 text-xs text-gray-500 dark:text-slate-400",children:["URL: demoscript.app/u/",i.username,"/",s||"my-demo"]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"checkbox",id:"isPublic",checked:u,onChange:E=>d(E.target.checked),className:"w-4 h-4 rounded border-gray-300 text-primary-600 focus:ring-primary-500"}),h.jsx("label",{htmlFor:"isPublic",className:"text-sm text-gray-700 dark:text-slate-300",children:"Make demo public"})]}),m&&h.jsx("div",{className:"p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",children:h.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:m})}),h.jsx("button",{onClick:j,disabled:f||!s.trim(),className:"w-full px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",children:f?h.jsxs(h.Fragment,{children:[h.jsxs("svg",{className:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Pushing..."]}):h.jsxs(h.Fragment,{children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),"Push to Cloud"]})})]})]}),h.jsx("div",{className:"flex items-center justify-end px-4 py-3 border-t border-gray-200 dark:border-slate-700 bg-gray-50 dark:bg-slate-800/50",children:h.jsx("button",{onClick:t,className:"px-4 py-2 text-sm text-gray-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-slate-700 rounded-lg transition-colors",children:b?"Close":"Cancel"})})]})}):null}const tfe=["GET","POST","PUT","PATCH","DELETE"];function rfe({step:e,onChange:t,onDelete:r,groupIndex:n,onDeleteFromGroup:i,onReorderWithinGroup:a,onFlattenGroup:s}){return Sr(e)?h.jsx(sfe,{step:e,onChange:t,onDelete:r,groupIndex:n,onDeleteFromGroup:i,onReorderWithinGroup:a,onFlattenGroup:s}):Tl(e)?h.jsx(nfe,{step:e,onChange:t,onDelete:r}):xc(e)?h.jsx(ife,{step:e,onChange:t,onDelete:r}):yc(e)?h.jsx(afe,{step:e,onChange:t,onDelete:r}):bc(e)?h.jsx(lfe,{step:e,onChange:t,onDelete:r}):Kd(e)?h.jsx(ofe,{step:e,onChange:t,onDelete:r}):Jd(e)?h.jsx(cfe,{step:e,onChange:t,onDelete:r}):Zd(e)?h.jsx(ufe,{step:e,onChange:t,onDelete:r}):eh(e)?h.jsx(dfe,{step:e,onChange:t,onDelete:r}):th(e)?h.jsx(hfe,{step:e,onChange:t,onDelete:r}):vc(e)?h.jsx(ffe,{step:e,onChange:t,onDelete:r}):wc(e)?h.jsx(pfe,{step:e,onChange:t,onDelete:r}):kc(e)?h.jsx(gfe,{step:e,onChange:t,onDelete:r}):h.jsx("div",{className:"p-4 text-gray-500",children:"Unsupported step type"})}function nfe({step:e,onChange:t,onDelete:r}){var G,q,Z,re,J,ie,ne,oe,fe,xe;const{state:n}=rr(),{method:i,endpoint:a}=L0(e),[s,o]=N.useState(i),[u,d]=N.useState(a),[f,p]=N.useState(e.title||""),[m,x]=N.useState(e.description||""),[b,v]=N.useState(e.base_url||""),[k,w]=N.useState(!1),[C,T]=N.useState(null),[j,L]=N.useState(null),E=e.base_url||((q=(G=n.config)==null?void 0:G.settings)==null?void 0:q.base_url)||"",M=e.openapi||((re=(Z=n.config)==null?void 0:Z.settings)==null?void 0:re.openapi),{formFields:I,isLoading:P}=R6({openapiUrl:M,method:s,path:u,defaults:e.defaults,manualForm:e.form}),z=I||e.form||[],{formValues:$,setFormValues:W,isFieldModified:Y}=L6({form:z,variables:n.variables}),B=N.useCallback((de,ge,ke,Te,Ne)=>({rest:`${de} ${ge}`,title:ke||void 0,description:Te||void 0,defaults:Ne??e.defaults,form:"form"in e?e.form:void 0,save:"save"in e?e.save:void 0,results:"results"in e?e.results:void 0,headers:"headers"in e?e.headers:void 0,base_url:"base_url"in e?e.base_url:void 0,openapi:"openapi"in e?e.openapi:void 0}),[e]),U=N.useCallback(de=>{o(de),t(B(de,u,f,m))},[u,f,m,B,t]),R=N.useCallback(de=>{d(de),t(B(s,de,f,m))},[s,f,m,B,t]),H=N.useCallback(de=>{p(de),t(B(s,u,de,m))},[s,u,m,B,t]),V=N.useCallback(de=>{x(de),t(B(s,u,f,de))},[s,u,f,B,t]),Q=N.useCallback(de=>{v(de),t({...B(s,u,f,m),base_url:de||void 0})},[s,u,f,m,B,t]),A=N.useCallback((de,ge)=>{W(Te=>({...Te,[de]:ge}));const ke={...e.defaults||{},[de]:ge};t(B(s,u,f,m,ke))},[s,u,f,m,e.defaults,B,W,t]),D=N.useCallback(async()=>{w(!0),L(null),T(null);try{const de=hr(u,n.variables),ge=`${E}${de}`,ke=z.filter(tt=>tt.paramIn==="body"||!tt.paramIn),Te=z.filter(tt=>tt.paramIn==="query");let Ne=ge;if(Te.length>0){const tt=D1(Te,$);tt&&(Ne+=(ge.includes("?")?"&":"?")+tt)}const Ke=["POST","PUT","PATCH"].includes(s)?Lp(ke,$):void 0,ut=await Rl({method:s,url:Ne,headers:e.headers,body:Ke});T(ut.data)}catch(de){L(de instanceof Error?de.message:"Request failed")}finally{w(!1)}},[u,E,s,z,$,n.variables,e.headers]);return N.useEffect(()=>{const{method:de,endpoint:ge}=L0(e);o(de),d(ge),p(e.title||""),x(e.description||""),v(e.base_url||"")},[e]),h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[h.jsx("select",{value:s,onChange:de=>U(de.target.value),className:"px-2 py-1.5 bg-white dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm font-medium focus:outline-none focus:ring-2 focus:ring-primary-500",children:tfe.map(de=>h.jsx("option",{value:de,children:de},de))}),h.jsx("input",{type:"text",value:u,onChange:de=>R(de.target.value),placeholder:"/api/endpoint",className:"flex-1 px-3 py-1.5 bg-white dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500"}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 dark:text-slate-500 dark:hover:text-red-400 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsxs("div",{className:"mb-2",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Title"}),h.jsx("input",{type:"text",value:f,onChange:de=>H(de.target.value),placeholder:"Step title (optional)",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{className:"mb-3",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Description"}),h.jsx("input",{type:"text",value:m,onChange:de=>V(de.target.value),placeholder:"Optional description",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{className:"mb-2",children:[h.jsxs("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:["URL ",((ie=(J=n.config)==null?void 0:J.settings)==null?void 0:ie.base_url)&&!b&&h.jsx("span",{className:"font-normal",children:"(from settings)"})]}),h.jsx("input",{type:"text",value:b||((oe=(ne=n.config)==null?void 0:ne.settings)==null?void 0:oe.base_url)||"",onChange:de=>Q(de.target.value),placeholder:"https://api.example.com",disabled:u.startsWith("http://")||u.startsWith("https://"),className:`w-full px-3 py-1.5 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500 ${u.startsWith("http://")||u.startsWith("https://")?"bg-gray-200 dark:bg-slate-700 text-gray-400 dark:text-slate-500":"bg-gray-50 dark:bg-slate-800/50"}`})]}),h.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400",children:[h.jsx("span",{children:"→"}),h.jsx("span",{className:"font-mono truncate",children:hr(u.startsWith("http://")||u.startsWith("https://")?u:(b||((xe=(fe=n.config)==null?void 0:fe.settings)==null?void 0:xe.base_url)||"")+u,n.variables)||"Enter URL and endpoint"})]})]}),h.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[P?h.jsxs("div",{className:"flex items-center justify-center py-8",children:[h.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary-500"}),h.jsx("span",{className:"ml-2 text-sm text-gray-500",children:"Loading form fields..."})]}):z.length>0?h.jsxs("div",{className:"space-y-4",children:[h.jsx("h4",{className:"text-xs font-medium text-gray-500 dark:text-slate-400 uppercase tracking-wider",children:"Request Parameters"}),h.jsx(B6,{fields:z,values:$,onChange:A,isFieldModified:Y,disabled:k})]}):h.jsxs("div",{className:"text-center py-8 text-gray-400 dark:text-slate-500",children:[h.jsx("p",{className:"text-sm",children:"No form fields"}),h.jsx("p",{className:"text-xs mt-1",children:"Configure an OpenAPI spec to auto-generate fields"})]}),h.jsx("div",{className:"mt-4 pt-4 border-t border-gray-200 dark:border-slate-700",children:h.jsx("button",{onClick:D,disabled:k,className:"w-full flex items-center justify-center gap-2 px-4 py-2 bg-primary-600 hover:bg-primary-700 disabled:opacity-50 text-white rounded-lg font-medium transition-colors",children:k?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),"Executing..."]}):h.jsxs(h.Fragment,{children:[h.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),"Execute"]})})}),j&&h.jsx("div",{className:"mt-4 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",children:h.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:String(j)})}),C&&h.jsxs("div",{className:"mt-4",children:[h.jsx("h4",{className:"text-xs font-medium text-gray-500 dark:text-slate-400 uppercase tracking-wider mb-2",children:"Response"}),h.jsx(Ng,{response:C,results:e.results})]})]})]})}function ife({step:e,onChange:t,onDelete:r}){const n=D0(e),[i,a]=N.useState(n),[s,o]=N.useState(e.title||""),u=N.useCallback(f=>{a(f);const p={slide:f};s&&(p.title=s),t(p)},[s,t]),d=N.useCallback(f=>{o(f);const p={slide:i};f&&(p.title=f),t(p)},[i,t]);return N.useEffect(()=>{a(D0(e)),o(e.title||"")},[e]),h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"px-2 py-0.5 bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300 text-xs font-medium rounded",children:"SLIDE"}),h.jsx("span",{className:"text-sm text-gray-600 dark:text-slate-400",children:"Markdown Content"})]}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 dark:text-slate-500 dark:hover:text-red-400 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsx("input",{type:"text",value:s,onChange:f=>d(f.target.value),placeholder:"Step title (optional)",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsx("div",{className:"flex-1 p-4",children:h.jsx("textarea",{value:i,onChange:f=>u(f.target.value),placeholder:`# Slide Title
507
-
508
- Write your markdown content here...`,className:"w-full h-full min-h-[200px] px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono resize-none focus:outline-none focus:ring-2 focus:ring-primary-500"})})]})}function afe({step:e,onChange:t,onDelete:r}){const n=hb(e),[i,a]=N.useState(n),[s,o]=N.useState(e.title||""),u=N.useCallback(f=>{a(f);const p={shell:f};s&&(p.title=s),t(p)},[s,t]),d=N.useCallback(f=>{o(f);const p={shell:i};f&&(p.title=f),t(p)},[i,t]);return N.useEffect(()=>{a(hb(e)),o(e.title||"")},[e]),h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 flex items-center justify-between p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"px-2 py-0.5 bg-gray-100 dark:bg-slate-700 text-gray-700 dark:text-slate-300 text-xs font-medium rounded",children:"SHELL"}),h.jsx("span",{className:"text-sm text-gray-600 dark:text-slate-400",children:"Command"})]}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 dark:text-slate-500 dark:hover:text-red-400 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsxs("div",{className:"flex-1 p-4 space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Title (optional)"}),h.jsx("input",{type:"text",value:s,onChange:f=>d(f.target.value),placeholder:"Step title",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Command"}),h.jsx("textarea",{value:i,onChange:f=>u(f.target.value),placeholder:"echo 'Hello World'",rows:3,className:"w-full px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono resize-none focus:outline-none focus:ring-2 focus:ring-primary-500"})]})]})]})}function sfe({step:e,onChange:t,onDelete:r,groupIndex:n,onDeleteFromGroup:i,onReorderWithinGroup:a,onFlattenGroup:s}){const[o,u]=N.useState(e.group),[d,f]=N.useState(e.description||""),[p,m]=N.useState(e.collapsed||!1),x=N.useCallback(j=>{u(j),t({...e,group:j})},[e,t]),b=N.useCallback(j=>{f(j);const L={...e,description:j||void 0};j||delete L.description,t(L)},[e,t]),v=N.useCallback(j=>{m(j);const L={...e,collapsed:j||void 0};j||delete L.collapsed,t(L)},[e,t]),k=N.useCallback(j=>{n!==void 0&&a&&j>0&&a(n,j,j-1)},[n,a]),w=N.useCallback(j=>{n!==void 0&&a&&j<e.steps.length-1&&a(n,j,j+1)},[n,a,e.steps.length]),C=N.useCallback(j=>{n!==void 0&&i&&i(n,j)},[n,i]),T=N.useCallback(()=>{n!==void 0&&s&&s(n)},[n,s]);return N.useEffect(()=>{u(e.group),f(e.description||""),m(e.collapsed||!1)},[e]),h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-slate-700 bg-gray-50 dark:bg-slate-900/50",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"px-2 py-0.5 bg-slate-200 dark:bg-slate-700 text-slate-700 dark:text-slate-300 text-xs font-medium rounded",children:"GROUP"})}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 dark:text-slate-500 dark:hover:text-red-400 transition-colors",title:"Delete group",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsxs("div",{className:"flex-1 overflow-auto",children:[h.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Group Name"}),h.jsx("input",{type:"text",value:o,onChange:j=>x(j.target.value),placeholder:"Group name",className:"w-full px-3 py-1.5 bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Description (optional)"}),h.jsx("textarea",{value:d,onChange:j=>b(j.target.value),placeholder:"Describe what steps are in this group...",rows:2,className:"w-full px-3 py-1.5 bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 resize-none"})]}),h.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-slate-700 flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-sm text-gray-700 dark:text-slate-300",children:"Collapsed by default"}),h.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:"Start this group collapsed in the sidebar"})]}),h.jsx("button",{type:"button",onClick:()=>v(!p),className:`relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out ${p?"bg-primary-600":"bg-gray-200 dark:bg-slate-600"}`,children:h.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${p?"translate-x-4":"translate-x-0"}`})})]}),h.jsxs("div",{className:"p-4",children:[h.jsx("div",{className:"flex items-center justify-between mb-3",children:h.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:["Steps (",e.steps.length,")"]})}),e.steps.length===0?h.jsx("p",{className:"text-sm text-gray-400 dark:text-slate-500 italic py-4 text-center",children:"This group is empty. Drag steps here to add them."}):h.jsx("div",{className:"space-y-1",children:e.steps.map((j,L)=>h.jsx(IO,{step:j,index:L,actions:{onMoveUp:()=>k(L),onMoveDown:()=>w(L),onDelete:()=>C(L),isFirst:L===0,isLast:L===e.steps.length-1}},L))})]})]}),e.steps.length>0&&s&&n!==void 0&&h.jsxs("div",{className:"flex-shrink-0 p-4 border-t border-gray-200 dark:border-slate-700 bg-gray-50 dark:bg-slate-900/50",children:[h.jsx("button",{onClick:T,className:"w-full px-4 py-2 bg-gray-200 dark:bg-slate-700 text-gray-700 dark:text-slate-300 text-sm font-medium rounded-lg hover:bg-gray-300 dark:hover:bg-slate-600 transition-colors",children:"Flatten Group"}),h.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2 text-center",children:"Move all steps to top level and remove group"})]})]})}function lfe({step:e,onChange:t,onDelete:r}){var M,I,P,z,$,W;const{state:n}=rr(),i=wd(e),[a,s]=N.useState(i),[o,u]=N.useState(e.title||""),[d,f]=N.useState(e.description||""),[p,m]=N.useState(e.endpoint||"/graphql"),[x,b]=N.useState(e.base_url||""),v=p.startsWith("http://")||p.startsWith("https://"),k=hr(v?p:(x||((I=(M=n.config)==null?void 0:M.settings)==null?void 0:I.base_url)||"")+p,n.variables),w=N.useCallback((Y,B,U,R,H)=>{const V={graphql:Y};return B&&(V.title=B),U&&(V.description=U),R&&(V.endpoint=R),H&&(V.base_url=H),V},[]),C=N.useCallback(Y=>{s(Y),t(w(Y,o,d,p,x))},[o,d,p,x,w,t]),T=N.useCallback(Y=>{u(Y),t(w(a,Y,d,p,x))},[a,d,p,x,w,t]),j=N.useCallback(Y=>{f(Y),t(w(a,o,Y,p,x))},[a,o,p,x,w,t]),L=N.useCallback(Y=>{m(Y),t(w(a,o,d,Y,x))},[a,o,d,x,w,t]),E=N.useCallback(Y=>{b(Y),t(w(a,o,d,p,Y))},[a,o,d,p,w,t]);return N.useEffect(()=>{s(wd(e)),u(e.title||""),f(e.description||""),m(e.endpoint||"/graphql"),b(e.base_url||"")},[e]),h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"px-2 py-0.5 bg-pink-100 dark:bg-pink-900/30 text-pink-700 dark:text-pink-300 text-xs font-medium rounded",children:"GRAPHQL"})}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsxs("div",{className:"mb-2",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Title"}),h.jsx("input",{type:"text",value:o,onChange:Y=>T(Y.target.value),placeholder:"Step title (optional)",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{className:"mb-3",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Description"}),h.jsx("input",{type:"text",value:d,onChange:Y=>j(Y.target.value),placeholder:"Optional description",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{className:"mb-2",children:[h.jsxs("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:["URL ",((z=(P=n.config)==null?void 0:P.settings)==null?void 0:z.base_url)&&!x&&h.jsx("span",{className:"font-normal",children:"(from settings)"})]}),h.jsx("input",{type:"text",value:x||((W=($=n.config)==null?void 0:$.settings)==null?void 0:W.base_url)||"",onChange:Y=>E(Y.target.value),placeholder:"https://api.example.com",disabled:v,className:`w-full px-3 py-1.5 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500 ${v?"bg-gray-200 dark:bg-slate-700 text-gray-400 dark:text-slate-500":"bg-gray-50 dark:bg-slate-800/50"}`})]}),h.jsxs("div",{className:"mb-2",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Endpoint"}),h.jsx("input",{type:"text",value:p,onChange:Y=>L(Y.target.value),placeholder:"/graphql",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400",children:[h.jsx("span",{children:"→"}),h.jsx("span",{className:"font-mono truncate",children:k||"Enter URL and endpoint"})]})]}),h.jsxs("div",{className:"flex-1 p-4",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Query"}),h.jsx("textarea",{value:a,onChange:Y=>C(Y.target.value),placeholder:"query { ... }",rows:10,className:"w-full h-full min-h-[200px] px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono resize-none focus:outline-none focus:ring-2 focus:ring-primary-500"})]})]})}function ofe({step:e,onChange:t,onDelete:r}){const n=pb(e),[i,a]=N.useState(n),[s,o]=N.useState(e.title||""),[u,d]=N.useState(e.language||"javascript"),[f,p]=N.useState(e.filename||""),m=N.useCallback((x,b,v,k)=>{const w={code:x};return b&&(w.title=b),v&&(w.language=v),k&&(w.filename=k),w},[]);return N.useEffect(()=>{a(pb(e)),o(e.title||""),d(e.language||"javascript"),p(e.filename||"")},[e]),h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"px-2 py-0.5 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 text-xs font-medium rounded",children:"CODE"})}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-2",children:[h.jsx("input",{type:"text",value:s,onChange:x=>{o(x.target.value),t(m(i,x.target.value,u,f))},placeholder:"Title (optional)",className:"px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"}),h.jsx("input",{type:"text",value:u,onChange:x=>{d(x.target.value),t(m(i,s,x.target.value,f))},placeholder:"Language",className:"px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsx("input",{type:"text",value:f,onChange:x=>{p(x.target.value),t(m(i,s,u,x.target.value))},placeholder:"Filename (optional)",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsx("div",{className:"flex-1 p-4",children:h.jsx("textarea",{value:i,onChange:x=>{a(x.target.value),t(m(x.target.value,s,u,f))},placeholder:"// Your code here",className:"w-full h-full min-h-[200px] px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono resize-none focus:outline-none focus:ring-2 focus:ring-primary-500"})})]})}function cfe({step:e,onChange:t,onDelete:r}){const n=gb(e),[i,a]=N.useState(n),[s,o]=N.useState(e.title||""),[u,d]=N.useState(e.message||""),f=N.useCallback((p,m,x)=>{const b={wait:p};return m&&(b.title=m),x&&(b.message=x),b},[]);return N.useEffect(()=>{a(gb(e)),o(e.title||""),d(e.message||"")},[e]),h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"px-2 py-0.5 bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300 text-xs font-medium rounded",children:"WAIT"})}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsx("input",{type:"text",value:s,onChange:p=>{o(p.target.value),t(f(i,p.target.value,u))},placeholder:"Title (optional)",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{className:"flex-1 p-4 space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Duration (ms)"}),h.jsx("input",{type:"number",value:i,onChange:p=>{const m=parseInt(p.target.value)||0;a(m),t(f(m,s,u))},min:0,className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Message (optional)"}),h.jsx("input",{type:"text",value:u,onChange:p=>{d(p.target.value),t(f(i,s,p.target.value))},placeholder:"Waiting...",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]})]})]})}function ufe({step:e,onChange:t,onDelete:r}){const n=fb(e),[i,a]=N.useState(n),[s,o]=N.useState(e.title||""),[u,d]=N.useState(e.description||""),f=N.useCallback((p,m,x)=>{const b={browser:p};return m&&(b.title=m),x&&(b.description=x),b},[]);return N.useEffect(()=>{a(fb(e)),o(e.title||""),d(e.description||"")},[e]),h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"px-2 py-0.5 bg-cyan-100 dark:bg-cyan-900/30 text-cyan-700 dark:text-cyan-300 text-xs font-medium rounded",children:"BROWSER"})}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsx("input",{type:"text",value:s,onChange:p=>{o(p.target.value),t(f(i,p.target.value,u))},placeholder:"Title (optional)",className:"w-full px-3 py-1.5 mb-2 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{className:"flex-1 p-4 space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"URL"}),h.jsx("input",{type:"text",value:i,onChange:p=>{a(p.target.value),t(f(p.target.value,s,u))},placeholder:"https://example.com",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Description (optional)"}),h.jsx("input",{type:"text",value:u,onChange:p=>{d(p.target.value),t(f(i,s,p.target.value))},placeholder:"Navigate to...",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]})]})]})}function dfe({step:e,onChange:t,onDelete:r}){const n=R0(e),[i,a]=N.useState(n),[s,o]=N.useState(e.title||""),[u,d]=N.useState(e.message||""),f=N.useCallback((p,m,x)=>{const b={assert:p};return m&&(b.title=m),x&&(b.message=x),b},[]);return N.useEffect(()=>{a(R0(e)),o(e.title||""),d(e.message||"")},[e]),h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"px-2 py-0.5 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300 text-xs font-medium rounded",children:"ASSERT"})}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsx("input",{type:"text",value:s,onChange:p=>{o(p.target.value),t(f(i,p.target.value,u))},placeholder:"Title (optional)",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{className:"flex-1 p-4 space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Condition"}),h.jsx("input",{type:"text",value:i,onChange:p=>{a(p.target.value),t(f(p.target.value,s,u))},placeholder:"$variable == 'expected'",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Message (optional)"}),h.jsx("input",{type:"text",value:u,onChange:p=>{d(p.target.value),t(f(i,s,p.target.value))},placeholder:"Assertion message",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]})]})]})}function hfe({step:e,onChange:t,onDelete:r}){const n=id(e),[i,a]=N.useState(n),[s,o]=N.useState(e.title||""),[u,d]=N.useState(e.type||"mongodb"),[f,p]=N.useState(e.collection||e.table||""),m=N.useCallback((x,b,v,k)=>{const w={db:x};return b&&(w.title=b),v&&(w.type=v),k&&(v==="mongodb"?w.collection=k:w.table=k),w},[]);return N.useEffect(()=>{a(id(e)),o(e.title||""),d(e.type||"mongodb"),p(e.collection||e.table||"")},[e]),h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"px-2 py-0.5 bg-orange-100 dark:bg-orange-900/30 text-orange-700 dark:text-orange-300 text-xs font-medium rounded",children:"DATABASE"})}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsx("input",{type:"text",value:s,onChange:x=>{o(x.target.value),t(m(i,x.target.value,u,f))},placeholder:"Title (optional)",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{className:"flex-1 p-4 space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Operation"}),h.jsx("input",{type:"text",value:i,onChange:x=>{a(x.target.value),t(m(x.target.value,s,u,f))},placeholder:"find, insert, update, delete",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Type"}),h.jsxs("select",{value:u,onChange:x=>{const b=x.target.value;d(b),t(m(i,s,b,f))},className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500",children:[h.jsx("option",{value:"mongodb",children:"MongoDB"}),h.jsx("option",{value:"postgres",children:"PostgreSQL"}),h.jsx("option",{value:"mysql",children:"MySQL"})]})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:u==="mongodb"?"Collection":"Table"}),h.jsx("input",{type:"text",value:f,onChange:x=>{p(x.target.value),t(m(i,s,u,x.target.value))},placeholder:u==="mongodb"?"users":"users_table",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"})]})]})]})]})}function ffe({step:e,onChange:t,onDelete:r}){const[n,i]=N.useState(O0(e)),[a,s]=N.useState(e.description||""),[o,u]=N.useState(e.submit_label||"Continue"),[d,f]=N.useState(e.fields||[]),p=N.useCallback((v,k,w,C)=>{const T={form:v,fields:C};return k&&(T.description=k),w&&w!=="Continue"&&(T.submit_label=w),T},[]);N.useEffect(()=>{i(O0(e)),s(e.description||""),u(e.submit_label||"Continue"),f(e.fields||[])},[e]);const m=()=>{const v={name:`field${d.length+1}`,label:`Field ${d.length+1}`,type:"text"},k=[...d,v];f(k),t(p(n,a,o,k))},x=(v,k)=>{const w=[...d];w[v]=k,f(w),t(p(n,a,o,w))},b=v=>{const k=d.filter((w,C)=>C!==v);f(k),t(p(n,a,o,k))};return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"px-2 py-0.5 bg-indigo-100 dark:bg-indigo-900/30 text-indigo-700 dark:text-indigo-300 text-xs font-medium rounded",children:"FORM"})}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsx("input",{type:"text",value:n,onChange:v=>{i(v.target.value),t(p(v.target.value,a,o,d))},placeholder:"Form Title",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"})]}),h.jsxs("div",{className:"flex-1 p-4 space-y-4 overflow-y-auto",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Description (optional)"}),h.jsx("input",{type:"text",value:a,onChange:v=>{s(v.target.value),t(p(n,v.target.value,o,d))},placeholder:"Instructions for the user",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Submit Button Label"}),h.jsx("input",{type:"text",value:o,onChange:v=>{u(v.target.value),t(p(n,a,v.target.value,d))},placeholder:"Continue",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400",children:"Fields"}),h.jsx("button",{onClick:m,className:"px-2 py-1 text-xs bg-indigo-100 dark:bg-indigo-900/30 text-indigo-700 dark:text-indigo-300 rounded hover:bg-indigo-200 dark:hover:bg-indigo-900/50",children:"+ Add Field"})]}),h.jsx("div",{className:"space-y-2",children:d.map((v,k)=>h.jsxs("div",{className:"p-2 bg-gray-50 dark:bg-slate-800/50 rounded border border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[h.jsx("input",{type:"text",value:v.name,onChange:w=>x(k,{...v,name:w.target.value}),placeholder:"name",className:"flex-1 px-2 py-1 bg-white dark:bg-slate-700 border border-gray-200 dark:border-slate-600 rounded text-xs font-mono"}),h.jsxs("select",{value:v.type||"text",onChange:w=>x(k,{...v,type:w.target.value}),className:"px-2 py-1 bg-white dark:bg-slate-700 border border-gray-200 dark:border-slate-600 rounded text-xs",children:[h.jsx("option",{value:"text",children:"Text"}),h.jsx("option",{value:"number",children:"Number"}),h.jsx("option",{value:"textarea",children:"Textarea"}),h.jsx("option",{value:"select",children:"Select"}),h.jsx("option",{value:"toggle",children:"Toggle"}),h.jsx("option",{value:"slider",children:"Slider"})]}),h.jsx("button",{onClick:()=>b(k),className:"p-1 text-gray-400 hover:text-red-500",children:h.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsx("input",{type:"text",value:v.label||"",onChange:w=>x(k,{...v,label:w.target.value}),placeholder:"Label",className:"w-full px-2 py-1 bg-white dark:bg-slate-700 border border-gray-200 dark:border-slate-600 rounded text-xs"})]},k))})]})]})]})}function pfe({step:e,onChange:t,onDelete:r}){const[n,i]=N.useState(B0(e)),[a,s]=N.useState(e.title||""),[o,u]=N.useState(e.typing_speed||30),[d,f]=N.useState(e.prompt||"$"),p=N.useCallback((m,x,b,v)=>{const k={terminal:m};return x&&(k.title=x),b!==30&&(k.typing_speed=b),v!=="$"&&(k.prompt=v),k},[]);return N.useEffect(()=>{i(B0(e)),s(e.title||""),u(e.typing_speed||30),f(e.prompt||"$")},[e]),h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"px-2 py-0.5 bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-300 text-xs font-medium rounded",children:"TERMINAL"})}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsx("input",{type:"text",value:a,onChange:m=>{s(m.target.value),t(p(n,m.target.value,o,d))},placeholder:"Title (optional)",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-emerald-500"})]}),h.jsxs("div",{className:"flex-1 p-4 space-y-4 overflow-y-auto",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Terminal Content"}),h.jsx("textarea",{value:n,onChange:m=>{i(m.target.value),t(p(m.target.value,a,o,d))},placeholder:`$ npm install
509
- added 42 packages
510
- $ npm run build`,rows:8,className:"w-full px-3 py-2 bg-slate-900 border border-slate-700 rounded-lg text-sm font-mono text-green-400 focus:outline-none focus:ring-2 focus:ring-emerald-500 resize-y"}),h.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Lines starting with prompt ($ by default) are typed. Other lines appear as output."})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Typing Speed (ms)"}),h.jsx("input",{type:"number",value:o,onChange:m=>{const x=parseInt(m.target.value)||30;u(x),t(p(n,a,x,d))},min:1,max:500,className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-emerald-500"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Prompt"}),h.jsx("input",{type:"text",value:d,onChange:m=>{f(m.target.value),t(p(n,a,o,m.target.value))},placeholder:"$",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-emerald-500"})]})]})]})]})}function gfe({step:e,onChange:t,onDelete:r}){const[n,i]=N.useState($0(e)),[a,s]=N.useState(e.title||""),[o,u]=N.useState(e.success_when||""),[d,f]=N.useState(e.failure_when||""),[p,m]=N.useState(e.interval||2e3),[x,b]=N.useState(e.max_attempts||30),v=N.useCallback((k,w,C,T,j,L)=>{const E={poll:k,success_when:C};return w&&(E.title=w),T&&(E.failure_when=T),j!==2e3&&(E.interval=j),L!==30&&(E.max_attempts=L),E},[]);return N.useEffect(()=>{i($0(e)),s(e.title||""),u(e.success_when||""),f(e.failure_when||""),m(e.interval||2e3),b(e.max_attempts||30)},[e]),h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex-shrink-0 p-4 border-b border-gray-200 dark:border-slate-700",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("span",{className:"px-2 py-0.5 bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 text-xs font-medium rounded",children:"POLL"})}),r&&h.jsx("button",{onClick:r,className:"p-1.5 text-gray-400 hover:text-red-500 transition-colors",title:"Delete step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),h.jsx("input",{type:"text",value:a,onChange:k=>{s(k.target.value),t(v(n,k.target.value,o,d,p,x))},placeholder:"Title (optional)",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800/50 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-amber-500"})]}),h.jsxs("div",{className:"flex-1 p-4 space-y-4 overflow-y-auto",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Endpoint"}),h.jsx("input",{type:"text",value:n,onChange:k=>{i(k.target.value),t(v(k.target.value,a,o,d,p,x))},placeholder:"/jobs/$jobId/status",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-amber-500"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Success Condition"}),h.jsx("input",{type:"text",value:o,onChange:k=>{u(k.target.value),t(v(n,a,k.target.value,d,p,x))},placeholder:"status == 'complete'",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-amber-500"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Failure Condition (optional)"}),h.jsx("input",{type:"text",value:d,onChange:k=>{f(k.target.value),t(v(n,a,o,k.target.value,p,x))},placeholder:"status == 'failed'",className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-amber-500"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Interval (ms)"}),h.jsx("input",{type:"number",value:p,onChange:k=>{const w=parseInt(k.target.value)||2e3;m(w),t(v(n,a,o,d,w,x))},min:100,className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-amber-500"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 dark:text-slate-400 mb-1",children:"Max Attempts"}),h.jsx("input",{type:"number",value:x,onChange:k=>{const w=parseInt(k.target.value)||30;b(w),t(v(n,a,o,d,p,w))},min:1,className:"w-full px-3 py-1.5 bg-gray-50 dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-amber-500"})]})]})]})]})}function mfe({totalSteps:e,onStepChange:t,onStepExecute:r,defaultSpeed:n=1,autoAdvanceDelay:i=1500}){const[a,s]=N.useState({isPlaying:!1,currentStep:0,speed:n}),o=N.useRef(!1),u=N.useRef(!1),d=N.useCallback(async()=>{if(!(o.current||u.current)){if(a.currentStep>=e){s(C=>({...C,isPlaying:!1}));return}o.current=!0;try{r&&await r(a.currentStep);const C=i/a.speed;await new Promise(T=>setTimeout(T,C)),u.current||s(T=>{if(!T.isPlaying)return T;const j=T.currentStep+1;return j>=e?{...T,isPlaying:!1}:(t==null||t(j),{...T,currentStep:j})})}finally{o.current=!1}}},[a.currentStep,a.speed,e,t,r,i]);N.useEffect(()=>{a.isPlaying&&!o.current&&d()},[a.isPlaying,a.currentStep,d]);const f=N.useCallback(()=>{u.current=!1,s(C=>({...C,isPlaying:!0}))},[]),p=N.useCallback(()=>{u.current=!0,s(C=>({...C,isPlaying:!1}))},[]),m=N.useCallback(()=>{a.isPlaying?p():f()},[a.isPlaying,f,p]),x=N.useCallback(C=>{const T=Math.max(0,Math.min(C,e-1));s(j=>({...j,currentStep:T})),t==null||t(T)},[e,t]),b=N.useCallback(()=>{x(a.currentStep+1)},[a.currentStep,x]),v=N.useCallback(()=>{x(a.currentStep-1)},[a.currentStep,x]),k=N.useCallback(C=>{s(T=>({...T,speed:C}))},[]),w=N.useCallback(()=>{u.current=!0,s({isPlaying:!1,currentStep:0,speed:n}),t==null||t(0)},[n,t]);return{playbackState:a,play:f,pause:p,toggle:m,goToStep:x,nextStep:b,prevStep:v,setSpeed:k,reset:w}}function sE(e){try{return Ed([e],{indent:2,lineWidth:-1}).trim()}catch{return"# Error generating YAML"}}const PO="demoscript-editor-state",M0=window.__DEMOSCRIPT_EDITOR_EMBEDDED__,xfe={title:"Untitled Demo",description:"",settings:{base_url:"https://demoscript.app/api/sandbox",openapi:"https://demoscript.app/api/sandbox/openapi.json"},steps:[]};function yfe(){try{const e=localStorage.getItem(PO);if(e)return JSON.parse(e)}catch{}return null}function bfe(e){try{localStorage.setItem(PO,JSON.stringify(e))}catch{}}function vfe({onAddStep:e}){const[t,r]=N.useState(!1),n=N.useRef(null),[i,a]=N.useState({top:0,left:0});return N.useEffect(()=>{if(t&&n.current){const s=n.current.getBoundingClientRect(),o=192,u=window.innerWidth;let d=s.left;d+o>u-8&&(d=s.right-o),d=Math.max(8,d),a({top:s.bottom+4,left:d})}},[t]),h.jsxs("div",{className:"relative",children:[h.jsxs("button",{ref:n,onClick:()=>r(!t),className:"flex items-center gap-1.5 px-2.5 py-1.5 bg-primary-600 hover:bg-primary-700 text-white rounded font-medium transition-colors text-sm",title:"Add Step",children:[h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),h.jsx("span",{className:"hidden sm:inline",children:"Add"})]}),t&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-[100]",onClick:()=>r(!1)}),h.jsxs("div",{className:"fixed w-48 bg-white dark:bg-slate-800 rounded-lg shadow-lg border border-gray-200 dark:border-slate-700 py-1 z-[101]",style:{top:i.top,left:i.left},children:[h.jsxs("button",{onClick:()=>{e("rest"),r(!1)},className:"w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-slate-200 hover:bg-gray-100 dark:hover:bg-slate-700 flex items-center gap-2",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-500"}),"REST Request"]}),h.jsxs("button",{onClick:()=>{e("slide"),r(!1)},className:"w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-slate-200 hover:bg-gray-100 dark:hover:bg-slate-700 flex items-center gap-2",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-purple-500"}),"Slide"]}),h.jsxs("button",{onClick:()=>{e("shell"),r(!1)},className:"w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-slate-200 hover:bg-gray-100 dark:hover:bg-slate-700 flex items-center gap-2",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-orange-500"}),"Shell Command"]}),h.jsxs("button",{onClick:()=>{e("graphql"),r(!1)},className:"w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-slate-200 hover:bg-gray-100 dark:hover:bg-slate-700 flex items-center gap-2",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-pink-500"}),"GraphQL"]}),h.jsxs("button",{onClick:()=>{e("form"),r(!1)},className:"w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-slate-200 hover:bg-gray-100 dark:hover:bg-slate-700 flex items-center gap-2",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-indigo-500"}),"Form"]}),h.jsxs("button",{onClick:()=>{e("terminal"),r(!1)},className:"w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-slate-200 hover:bg-gray-100 dark:hover:bg-slate-700 flex items-center gap-2",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500"}),"Terminal"]}),h.jsxs("button",{onClick:()=>{e("poll"),r(!1)},className:"w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-slate-200 hover:bg-gray-100 dark:hover:bg-slate-700 flex items-center gap-2",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-500"}),"Poll"]}),h.jsx("div",{className:"border-t border-gray-200 dark:border-slate-700 my-1"}),h.jsxs("button",{onClick:()=>{e("code"),r(!1)},className:"w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-slate-200 hover:bg-gray-100 dark:hover:bg-slate-700 flex items-center gap-2",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500"}),"Code Block"]}),h.jsxs("button",{onClick:()=>{e("wait"),r(!1)},className:"w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-slate-200 hover:bg-gray-100 dark:hover:bg-slate-700 flex items-center gap-2",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-500"}),"Wait/Delay"]}),h.jsxs("button",{onClick:()=>{e("group"),r(!1)},className:"w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-slate-200 hover:bg-gray-100 dark:hover:bg-slate-700 flex items-center gap-2",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-slate-500"}),"Step Group"]})]})]})]})}function wfe({isPlaying:e,currentStep:t,totalSteps:r,speed:n,onPlay:i,onPause:a,onPrev:s,onNext:o,onReset:u,onSpeedChange:d}){return h.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 bg-gray-100 dark:bg-slate-800 rounded",children:[h.jsx("button",{onClick:u,className:"p-1.5 text-gray-500 hover:text-gray-700 dark:text-slate-400 dark:hover:text-slate-200",title:"Reset",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),h.jsx("button",{onClick:s,disabled:t===0,className:"p-1.5 text-gray-500 hover:text-gray-700 dark:text-slate-400 dark:hover:text-slate-200 disabled:opacity-50",title:"Previous step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),h.jsx("button",{onClick:e?a:i,className:"p-1.5 bg-primary-600 text-white rounded-full hover:bg-primary-700",title:e?"Pause":"Play",children:e?h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}):h.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{d:"M8 5v14l11-7z"})})}),h.jsx("button",{onClick:o,disabled:t>=r-1,className:"p-1.5 text-gray-500 hover:text-gray-700 dark:text-slate-400 dark:hover:text-slate-200 disabled:opacity-50",title:"Next step",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),h.jsxs("span",{className:"text-xs text-gray-600 dark:text-slate-400 ml-1 tabular-nums",children:[t+1,"/",r]}),h.jsxs("select",{value:n,onChange:f=>d(Number(f.target.value)),className:"ml-1 px-1 py-0.5 text-xs bg-white dark:bg-slate-700 border border-gray-300 dark:border-slate-600 rounded",children:[h.jsx("option",{value:.5,children:"0.5x"}),h.jsx("option",{value:1,children:"1x"}),h.jsx("option",{value:1.5,children:"1.5x"}),h.jsx("option",{value:2,children:"2x"})]})]})}function kfe({onImport:e,onExport:t}){const[r,n]=N.useState(!1),[i,a]=N.useState(""),[s,o]=N.useState(null),u=()=>{const f=Qhe(i);if(f){o(f);return}o(null),e(i),n(!1),a("")},d=()=>{const f=t();a(f),o(null)};return r?h.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:h.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-xl shadow-xl w-full max-w-2xl max-h-[80vh] overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-slate-700",children:[h.jsx("h3",{className:"font-medium text-gray-900 dark:text-slate-100",children:"Import / Export YAML"}),h.jsx("button",{onClick:()=>{n(!1),o(null)},className:"text-gray-500 hover:text-gray-700 dark:text-slate-400 dark:hover:text-slate-200",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsxs("div",{className:"p-4",children:[h.jsx("textarea",{value:i,onChange:f=>a(f.target.value),placeholder:"Paste YAML here to import, or click Export to get current demo YAML",className:"w-full h-64 px-3 py-2 font-mono text-sm bg-gray-50 dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg resize-none focus:outline-none focus:ring-2 focus:ring-primary-500"}),s&&h.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:s})]}),h.jsxs("div",{className:"flex items-center justify-end gap-3 px-4 py-3 border-t border-gray-200 dark:border-slate-700",children:[h.jsx("button",{onClick:d,className:"px-4 py-2 text-sm text-gray-700 dark:text-slate-300 border border-gray-300 dark:border-slate-600 rounded-lg hover:bg-gray-50 dark:hover:bg-slate-800",children:"Export"}),h.jsx("button",{onClick:u,disabled:!i.trim(),className:"px-4 py-2 text-sm bg-primary-600 text-white rounded-lg hover:bg-primary-700 disabled:opacity-50",children:"Import"})]})]})}):h.jsxs("button",{onClick:()=>n(!0),className:"px-2.5 py-1.5 text-xs bg-slate-600 hover:bg-slate-700 text-white rounded font-medium transition-colors whitespace-nowrap flex items-center gap-1",title:"Import or export YAML manually",children:[h.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),"YAML"]})}function Co({title:e,defaultOpen:t=!0,children:r}){const[n,i]=N.useState(t);return h.jsxs("div",{className:"border border-gray-200 dark:border-slate-700 rounded-lg overflow-hidden",children:[h.jsxs("button",{onClick:()=>i(!n),className:"w-full flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-slate-800 text-sm font-medium text-gray-700 dark:text-slate-300",children:[e,h.jsx("svg",{className:`w-4 h-4 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),n&&h.jsx("div",{className:"p-3 space-y-3",children:r})]})}function Si({label:e,checked:t,onChange:r,description:n}){return h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-sm text-gray-700 dark:text-slate-300",children:e}),n&&h.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400",children:n})]}),h.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out ${t?"bg-primary-600":"bg-gray-200 dark:bg-slate-600"}`,children:h.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${t?"translate-x-4":"translate-x-0"}`})})]})}function Sfe({settings:e,metadata:t,title:r,description:n,onSettingsChange:i,onMetadataChange:a,onTitleChange:s,onDescriptionChange:o}){var C,T,j,L,E,M,I,P,z,$,W,Y,B,U;const[u,d]=N.useState(!1),{position:f,isDragging:p,handleMouseDown:m,resetPosition:x}=Pg(),b=(R,H)=>{i({effects:{...e==null?void 0:e.effects,[R]:H}})},v=(R,H)=>{i({theme:{...e==null?void 0:e.theme,[R]:H}})},k=(R,H)=>{i({dashboard:{...e==null?void 0:e.dashboard,[R]:H}})};if(!u)return h.jsx("button",{onClick:()=>d(!0),className:"p-1.5 text-gray-500 hover:text-gray-700 dark:text-slate-400 dark:hover:text-slate-200 rounded transition-colors",title:"Demo Settings",children:h.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})});const w=()=>{d(!1),x()};return h.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:h.jsxs("div",{"data-draggable-modal":!0,className:"bg-white dark:bg-slate-900 rounded-xl shadow-xl w-full max-w-lg max-h-[85vh] overflow-hidden flex flex-col",style:{transform:`translate(${f.x}px, ${f.y}px)`},children:[h.jsxs("div",{onMouseDown:m,className:`flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-slate-700 flex-shrink-0 ${p?"cursor-grabbing":"cursor-grab"}`,children:[h.jsx("h3",{className:"font-medium text-gray-900 dark:text-slate-100 select-none",children:"Demo Settings"}),h.jsx("button",{onClick:w,className:"text-gray-500 hover:text-gray-700 dark:text-slate-400 dark:hover:text-slate-200",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsxs("div",{className:"p-4 space-y-4 overflow-y-auto flex-1",children:[h.jsxs(Co,{title:"General",defaultOpen:!0,children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1",children:"Title"}),h.jsx("input",{type:"text",value:r,onChange:R=>s(R.target.value),className:"w-full px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500",placeholder:"My API Demo"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1",children:"Description"}),h.jsx("textarea",{value:n,onChange:R=>o(R.target.value),rows:2,className:"w-full px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 resize-none",placeholder:"A brief description of your demo"})]})]}),h.jsxs(Co,{title:"Metadata",defaultOpen:!1,children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1",children:"Duration"}),h.jsx("input",{type:"text",value:(t==null?void 0:t.duration)||"",onChange:R=>a({duration:R.target.value}),className:"w-full px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500",placeholder:"e.g., 5 minutes"}),h.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-slate-400",children:"Estimated time to complete the demo"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1",children:"Difficulty"}),h.jsxs("select",{value:(t==null?void 0:t.difficulty)||"",onChange:R=>a({difficulty:R.target.value}),className:"w-full px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500",children:[h.jsx("option",{value:"",children:"Not set"}),h.jsx("option",{value:"beginner",children:"Beginner"}),h.jsx("option",{value:"intermediate",children:"Intermediate"}),h.jsx("option",{value:"advanced",children:"Advanced"})]}),h.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-slate-400",children:"Skill level required for this demo"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1",children:"Category"}),h.jsx("input",{type:"text",value:(t==null?void 0:t.category)||"",onChange:R=>a({category:R.target.value}),className:"w-full px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500",placeholder:"e.g., Tutorial, API, Authentication"}),h.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-slate-400",children:"Category for gallery organization"})]})]}),h.jsxs(Co,{title:"API Configuration",defaultOpen:!0,children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1",children:"Base URL"}),h.jsx("input",{type:"text",value:(e==null?void 0:e.base_url)||"",onChange:R=>i({base_url:R.target.value}),className:"w-full px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500",placeholder:"https://api.example.com"}),h.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-slate-400",children:"Base URL prepended to all REST endpoints"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1",children:"OpenAPI Spec URL"}),h.jsx("input",{type:"text",value:(e==null?void 0:e.openapi)||"",onChange:R=>i({openapi:R.target.value}),className:"w-full px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary-500",placeholder:"https://api.example.com/openapi.json"}),h.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-slate-400",children:"Auto-generate form fields from OpenAPI/Swagger spec"})]})]}),h.jsxs(Co,{title:"Theme",defaultOpen:!1,children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1",children:"Color Preset"}),h.jsxs("select",{value:((C=e==null?void 0:e.theme)==null?void 0:C.preset)||"purple",onChange:R=>v("preset",R.target.value),className:"w-full px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500",children:[h.jsx("option",{value:"purple",children:"Purple (Default)"}),h.jsx("option",{value:"blue",children:"Blue"}),h.jsx("option",{value:"green",children:"Green"}),h.jsx("option",{value:"teal",children:"Teal"}),h.jsx("option",{value:"orange",children:"Orange"}),h.jsx("option",{value:"rose",children:"Rose"})]})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-slate-300 mb-1",children:"Color Mode"}),h.jsxs("select",{value:((T=e==null?void 0:e.theme)==null?void 0:T.mode)||"auto",onChange:R=>v("mode",R.target.value),className:"w-full px-3 py-2 bg-gray-50 dark:bg-slate-800 border border-gray-300 dark:border-slate-600 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-500",children:[h.jsx("option",{value:"auto",children:"Auto (System)"}),h.jsx("option",{value:"light",children:"Light"}),h.jsx("option",{value:"dark",children:"Dark"})]})]})]}),h.jsxs(Co,{title:"Visual Effects",defaultOpen:!1,children:[h.jsx(Si,{label:"Confetti",checked:((j=e==null?void 0:e.effects)==null?void 0:j.confetti)!==!1,onChange:R=>b("confetti",R),description:"Fire confetti on step completion"}),h.jsx(Si,{label:"Sounds",checked:((L=e==null?void 0:e.effects)==null?void 0:L.sounds)!==!1,onChange:R=>b("sounds",R),description:"Play success/error sounds"}),h.jsx(Si,{label:"Transitions",checked:((E=e==null?void 0:e.effects)==null?void 0:E.transitions)!==!1,onChange:R=>b("transitions",R),description:"Animate step changes"}),h.jsx(Si,{label:"Neon Glow",checked:((M=e==null?void 0:e.effects)==null?void 0:M.neon_glow)!==!1,onChange:R=>b("neon_glow",R),description:"Neon text effects (dark mode)"}),h.jsx(Si,{label:"Grid Background",checked:((I=e==null?void 0:e.effects)==null?void 0:I.grid_background)!==!1,onChange:R=>b("grid_background",R),description:"Animated grid background"}),h.jsx(Si,{label:"Glow Orbs",checked:((P=e==null?void 0:e.effects)==null?void 0:P.glow_orbs)!==!1,onChange:R=>b("glow_orbs",R),description:"Floating glow orbs (dark mode)"})]}),h.jsxs(Co,{title:"Display Options",defaultOpen:!1,children:[h.jsx(Si,{label:"Dashboard",checked:((z=e==null?void 0:e.dashboard)==null?void 0:z.enabled)===!0,onChange:R=>k("enabled",R),description:"Show overview dashboard on load"}),(($=e==null?void 0:e.dashboard)==null?void 0:$.enabled)&&h.jsxs("div",{className:"ml-4 pl-3 border-l-2 border-gray-200 dark:border-slate-700 space-y-3",children:[h.jsx(Si,{label:"Show Stats",checked:((W=e==null?void 0:e.dashboard)==null?void 0:W.show_stats)!==!1,onChange:R=>k("show_stats",R),description:"Display step count and duration"}),h.jsx(Si,{label:"Show Health",checked:((Y=e==null?void 0:e.dashboard)==null?void 0:Y.show_health)!==!1,onChange:R=>k("show_health",R),description:"Display service health status"}),h.jsx(Si,{label:"Show Description",checked:((B=e==null?void 0:e.dashboard)==null?void 0:B.show_description)!==!1,onChange:R=>k("show_description",R),description:"Display demo description"})]}),h.jsx(Si,{label:"Sidebar",checked:((U=e==null?void 0:e.sidebar)==null?void 0:U.enabled)===!0,onChange:R=>i({sidebar:{...e==null?void 0:e.sidebar,enabled:R}}),description:"Show step navigation sidebar"})]})]}),h.jsx("div",{className:"flex items-center justify-end px-4 py-3 border-t border-gray-200 dark:border-slate-700 flex-shrink-0",children:h.jsx("button",{onClick:w,className:"px-4 py-2 text-sm bg-primary-600 text-white rounded-lg hover:bg-primary-700",children:"Done"})})]})})}function Cfe({step:e}){const t=e.step;return Sr(t)?h.jsx(Hhe,{groupName:t.group,description:t.description,steps:t.steps||[]}):Tl(t)?h.jsx(z6,{step:t,mode:"view"}):xc(t)?h.jsx(M6,{step:t,mode:"view"}):yc(t)?h.jsx(I6,{step:t,mode:"view"}):bc(t)?h.jsx(U6,{step:t}):Kd(t)?h.jsx(P6,{step:t}):Jd(t)?h.jsx(H6,{step:t}):Zd(t)?h.jsx(F6,{step:t}):eh(t)?h.jsx(q6,{step:t}):th(t)?h.jsx(V6,{step:t}):vc(t)?h.jsx(W6,{step:t}):wc(t)?h.jsx(Y6,{step:t}):kc(t)?h.jsx(G6,{step:t}):h.jsx("div",{className:"p-4 text-gray-500",children:"Unsupported step type"})}function _fe({step:e,stepIndex:t,onUpdate:r}){const n=sE(e.step),[i,a]=N.useState(n),[s,o]=N.useState(null),u=N.useRef(!1);N.useEffect(()=>{const f=sE(e.step);f!==i&&!u.current&&(a(f),o(null)),u.current=!1},[e.step]);const d=f=>{a(f);try{const p=Wp(f);Array.isArray(p)&&p.length>0?(u.current=!0,r(p[0]),o(null)):o("Invalid step format")}catch{o(null)}};return h.jsxs("div",{className:"h-full bg-slate-900 flex flex-col",children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-slate-700 flex-shrink-0",children:[h.jsxs("span",{className:"text-xs font-medium text-slate-400",children:["Step ",t+1," YAML",s&&h.jsxs("span",{className:"text-red-400 ml-2",children:["(",s,")"]})]}),h.jsx("button",{onClick:()=>navigator.clipboard.writeText(i),className:"p-1 text-slate-500 hover:text-slate-300 transition-colors",title:"Copy to clipboard",children:h.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),h.jsx("textarea",{value:i,onChange:f=>d(f.target.value),className:`flex-1 p-3 text-xs font-mono bg-slate-900 text-slate-300 resize-none focus:outline-none focus:ring-1 focus:ring-inset ${s?"focus:ring-red-500":"focus:ring-primary-500"}`,spellCheck:!1})]})}function Tfe(){var rt,nt,wt,xt;const{state:e,addStep:t,removeStep:r,updateStep:n,reorderSteps:i,moveIntoGroup:a,moveOutOfGroup:s,reorderWithinGroup:o,deleteFromGroup:u,flattenGroup:d,setCurrentStep:f,setSelectedChild:p,loadFromConfig:m,toConfig:x,dispatch:b,markSaved:v}=q2(),{dispatch:k}=rr(),w=N.useRef(""),[C,T]=N.useState(!1),[j,L]=N.useState(180),[E,M]=N.useState(!1),I=N.useRef(null),[P,z]=N.useState(null),[$,W]=N.useState(!1),Y=Ghe(),B=FO(),U=N.useRef(!1),[R,H]=N.useState(!0);N.useEffect(()=>{if(!M0)return;function _e(je){(je.ctrlKey||je.metaKey)&&je.key.toLowerCase()==="s"&&(je.preventDefault(),window.parent.postMessage({type:"demoscript:save"},"*"))}return window.addEventListener("keydown",_e),()=>window.removeEventListener("keydown",_e)},[]),N.useEffect(()=>{!Y||U.current||(U.current=!0,vd.getInitialDemo().then(_e=>{_e.config&&m(_e.config,_e.path??void 0)}).catch(()=>{}))},[Y,m]),N.useEffect(()=>{if(!Y||!e.isDirty)return;const _e=je=>{je.preventDefault(),je.returnValue=""};return window.addEventListener("beforeunload",_e),()=>window.removeEventListener("beforeunload",_e)},[Y,e.isDirty]);const V=N.useCallback(async _e=>{try{const{content:je}=await vd.readFile(_e),le=iE(je);m(le,_e),z(null)}catch(je){alert(`Failed to open file: ${je instanceof Error?je.message:"Unknown error"}`)}},[m]),Q=N.useCallback(async _e=>{try{const je=x(),le=Up(je);await vd.saveFile(_e,le),v(_e),z(null)}catch(je){alert(`Failed to save file: ${je instanceof Error?je.message:"Unknown error"}`)}},[x,v]);N.useEffect(()=>{if(!E)return;const _e=le=>{if(!I.current)return;const Le=I.current.getBoundingClientRect().bottom-le.clientY;L(Math.max(80,Math.min(400,Le)))},je=()=>{M(!1)};return document.addEventListener("mousemove",_e),document.addEventListener("mouseup",je),()=>{document.removeEventListener("mousemove",_e),document.removeEventListener("mouseup",je)}},[E]),X6();const{playbackState:A,play:D,pause:G,nextStep:q,prevStep:Z,setSpeed:re,reset:J}=mfe({totalSteps:e.steps.length,onStepChange:f,autoAdvanceDelay:2e3});nN({onNext:q,onPrev:Z}),N.useEffect(()=>{const _e=x(),je=JSON.stringify(_e);je!==w.current&&(w.current=je,k({type:"SET_CONFIG",payload:_e}),k({type:"SET_MODE",payload:"live"}))},[e.steps,e.settings,e.metadata,e.title,x,k]),N.useEffect(()=>{k({type:"SET_STEP",payload:e.currentStep})},[e.currentStep,k]),N.useEffect(()=>{if(e.isDirty){const _e=x();bfe(_e)}},[e,x]);const ie=(rt=e.settings.theme)==null?void 0:rt.mode;N.useEffect(()=>{const _e=document.documentElement;console.log("[DemoEditor] Applying theme mode:",ie),ie==="dark"?(_e.classList.add("dark"),console.log("[DemoEditor] Added dark class")):ie==="light"?(_e.classList.remove("dark"),console.log("[DemoEditor] Removed dark class")):window.matchMedia("(prefers-color-scheme: dark)").matches?(_e.classList.add("dark"),console.log("[DemoEditor] Auto: added dark class (system prefers dark)")):(_e.classList.remove("dark"),console.log("[DemoEditor] Auto: removed dark class (system prefers light)"))},[ie]);const ne=e.settings.theme;N.useEffect(()=>{const _e=ev(ne);tv(_e,ne==null?void 0:ne.preset),console.log("[DemoEditor] Applied theme colors:",(ne==null?void 0:ne.preset)||"purple")},[ne]);const oe=N.useCallback(_e=>{let je;switch(_e){case"rest":je={rest:"GET /health",title:"New Request"};break;case"slide":je={slide:`# New Slide
511
-
512
- Add your content here.`};break;case"shell":je={shell:'echo "Hello, World!"',title:"New Command"};break;case"graphql":je={graphql:`query {
513
- hello
514
- }`,title:"GraphQL Query"};break;case"code":je={code:`// Your code here
515
- console.log("Hello");`,language:"javascript",title:"Code Example"};break;case"wait":je={wait:2e3,message:"Waiting...",title:"Pause"};break;case"form":je={form:"New Form",fields:[{name:"field1",label:"Field 1",type:"text"}]};break;case"terminal":je={terminal:`$ echo "Hello, World!"
516
- Hello, World!`,title:"Terminal Demo"};break;case"poll":je={poll:"/status",success_when:"status == 'complete'",title:"Wait for Completion"};break;case"group":je={group:"New Group",steps:[]};break}t(je,e.currentStep)},[t,e.currentStep]),fe=N.useCallback(_e=>{t(_e,e.currentStep)},[t,e.currentStep]),xe=N.useCallback(_e=>{try{const je=iE(_e);m(je)}catch(je){console.error("Failed to import YAML:",je)}},[m]),de=N.useCallback(()=>{const _e=x();return Up(_e)},[x]);N.useEffect(()=>{if(!M0)return;const _e=je=>{if(je.data&&je.data.type==="demoscript-yaml-import"&&je.data.yaml&&xe(je.data.yaml),je.data&&je.data.type==="demoscript-request-yaml"){const le=de();window.parent.postMessage({type:"demoscript-builder-export",yaml:le,title:e.title||"",description:e.description||""},"*")}};return window.addEventListener("message",_e),()=>window.removeEventListener("message",_e)},[xe,de,e.title,e.description]);const ge=e.steps[e.currentStep],Te=N.useCallback(()=>{if(ge)return e.selectedChildIndex!==null&&Sr(ge.step)?(ge.step.steps||[])[e.selectedChildIndex]:ge.step},[ge,e.selectedChildIndex])(),Ne=N.useCallback(_e=>{if(ge)if(e.selectedChildIndex!==null&&Sr(ge.step)){const je=ge.step,le=[...je.steps||[]];le[e.selectedChildIndex]=_e,n(e.currentStep,{...je,steps:le})}else n(e.currentStep,_e)},[ge,e.currentStep,e.selectedChildIndex,n]),Ke=N.useCallback(()=>{ge&&(e.selectedChildIndex!==null&&Sr(ge.step)?(u(e.currentStep,e.selectedChildIndex),p(null)):r(e.currentStep))},[ge,e.currentStep,e.selectedChildIndex,r,u,p]),ut=h.jsxs("div",{ref:I,className:"h-full flex flex-col bg-gray-50 dark:bg-slate-900",children:[h.jsxs("div",{className:"flex flex-col gap-2 px-3 py-2 border-b border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-800",children:[h.jsxs("div",{className:"flex items-center justify-between min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[Y&&h.jsx(Zhe,{onOpenFilePicker:_e=>z(_e),onPushToCloud:B?()=>W(!0):void 0}),h.jsxs("div",{className:"flex items-center min-w-0 overflow-hidden",children:[h.jsx("h2",{className:"text-sm font-semibold text-gray-900 dark:text-slate-100 truncate",title:e.currentFilePath||e.title,children:e.currentFilePath?e.currentFilePath.split("/").pop():e.title||"Untitled Demo"}),e.isDirty&&h.jsx("span",{className:"ml-1 text-xs text-orange-400 flex-shrink-0",title:"Unsaved changes",children:"*"})]})]}),h.jsx(Sfe,{settings:e.settings,metadata:e.metadata,title:e.title,description:e.description,onSettingsChange:_e=>b({type:"SET_SETTINGS",payload:_e}),onMetadataChange:_e=>b({type:"SET_METADATA",payload:_e}),onTitleChange:_e=>b({type:"SET_TITLE",payload:_e}),onDescriptionChange:_e=>b({type:"SET_DESCRIPTION",payload:_e})})]}),h.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[!M0&&h.jsx(kfe,{onImport:xe,onExport:de}),h.jsx(vfe,{onAddStep:oe}),((nt=e.settings)==null?void 0:nt.openapi)&&h.jsxs("button",{onClick:()=>T(!0),className:"px-2.5 py-1.5 text-xs bg-purple-600 hover:bg-purple-700 text-white rounded font-medium transition-colors whitespace-nowrap flex items-center gap-1",title:"Browse API endpoints from OpenAPI spec",children:[h.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})}),"Browse API"]})]})]}),h.jsx("div",{className:"flex-1 overflow-auto p-2 min-h-0",children:h.jsx(Uhe,{steps:e.steps,currentStep:e.currentStep,selectedChildIndex:e.selectedChildIndex,onReorder:i,onMoveIntoGroup:a,onMoveOutOfGroup:s,onReorderWithinGroup:o,onSelect:f,onSelectChild:p,onDelete:r})}),ge&&h.jsx("div",{className:"h-1.5 bg-gray-200 dark:bg-slate-700 hover:bg-primary-400 dark:hover:bg-primary-500 cursor-ns-resize transition-colors flex-shrink-0",onMouseDown:()=>M(!0)}),ge&&Te&&h.jsx("div",{style:{height:j},className:"flex-shrink-0",children:h.jsx(_fe,{step:{id:ge.id,step:Te},stepIndex:e.selectedChildIndex!==null?e.selectedChildIndex:e.currentStep,onUpdate:Ne})})]}),tt=h.jsxs("div",{className:"h-full flex flex-col bg-white dark:bg-slate-950",children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-gray-200 dark:border-slate-800",children:[h.jsxs("div",{className:"flex items-center gap-1 bg-gray-100 dark:bg-slate-800 rounded-lg p-0.5",children:[h.jsx("button",{onClick:()=>H(!0),className:`px-2 py-1 text-xs font-medium rounded transition-colors ${R?"bg-white dark:bg-slate-700 text-gray-900 dark:text-slate-100 shadow-sm":"text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300"}`,children:"Edit"}),h.jsx("button",{onClick:()=>H(!1),className:`px-2 py-1 text-xs font-medium rounded transition-colors ${R?"text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300":"bg-white dark:bg-slate-700 text-gray-900 dark:text-slate-100 shadow-sm"}`,children:"Preview"})]}),!R&&e.steps.length>0&&h.jsx(wfe,{isPlaying:A.isPlaying,currentStep:A.currentStep,totalSteps:e.steps.length,speed:A.speed,onPlay:D,onPause:G,onPrev:Z,onNext:q,onReset:J,onSpeedChange:re}),R&&e.steps.length>0&&h.jsxs("span",{className:"text-xs text-gray-500 dark:text-slate-400",children:[e.currentStep+1,"/",e.steps.length]})]}),h.jsx("div",{className:"flex-1 overflow-auto",children:ge&&Te?R?h.jsx(rfe,{step:Te,onChange:Ne,onDelete:Ke,groupIndex:e.selectedChildIndex===null&&Sr(ge.step)?e.currentStep:void 0,onDeleteFromGroup:e.selectedChildIndex===null?u:void 0,onReorderWithinGroup:e.selectedChildIndex===null?o:void 0,onFlattenGroup:e.selectedChildIndex===null?d:void 0}):h.jsx("div",{className:"p-4",children:h.jsx(Cfe,{step:{id:ge.id,step:Te}})}):h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 dark:text-slate-500",children:[h.jsx("svg",{className:"w-12 h-12 mb-3 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})}),h.jsx("p",{className:"text-sm font-medium",children:"No steps yet"}),h.jsx("p",{className:"text-xs mt-1",children:"Add a step to start building your demo"})]})})]});return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"h-screen",children:h.jsx(Vhe,{left:ut,right:tt,defaultLeftWidth:35,minLeftWidth:25,maxLeftWidth:60})}),((wt=e.settings)==null?void 0:wt.openapi)&&h.jsx(Yhe,{isOpen:C,onClose:()=>T(!1),onAddEndpoint:fe,openapiUrl:e.settings.openapi}),Y&&h.jsx(Khe,{mode:P||"open",isOpen:P!==null,initialPath:e.currentFilePath||void 0,defaultFileName:((xt=e.currentFilePath)==null?void 0:xt.split("/").pop())||"demo.yaml",onSelect:P==="save"?Q:V,onClose:()=>z(null)}),Y&&B&&h.jsx(efe,{isOpen:$,onClose:()=>W(!1)})]})}function Efe(){const t=yfe()||(M0?xfe:void 0);return h.jsx(Jue,{initialConfig:t,children:h.jsx(Tfe,{})})}function Nfe(){const e=window.location.pathname==="/builder"||window.__DEMOSCRIPT_BUILDER__;return window.location.pathname==="/editor"||window.__DEMOSCRIPT_EDITOR__?h.jsx(WC,{defaultTheme:"light",children:h.jsx(YC,{children:h.jsx(UC,{children:h.jsx(Efe,{})})})}):e?h.jsx(Que,{}):h.jsx(WC,{defaultTheme:"dark",children:h.jsx(YC,{children:h.jsx(UC,{children:h.jsx("div",{className:"min-h-screen relative light-mode-gradient dark:bg-transparent transition-colors duration-300",children:h.jsx(Bue,{})})})})})}n$.createRoot(document.getElementById("root")).render(h.jsx(N.StrictMode,{children:h.jsx(Nfe,{})}));export{j3 as $,cd as A,LU as B,JV as C,f2 as D,cn as E,v3 as F,GJ as G,QX as H,r5 as I,rZ as J,pV as K,ec as L,Mfe as M,xg as N,DV as O,Dv as P,p5 as Q,OX as R,w0 as S,YJ as T,lh as U,PV as V,sh as W,Re as X,Ve as Y,IJ as Z,O as _,YV as a,jc as a$,MX as a0,R5 as a1,D5 as a2,Hfe as a3,$fe as a4,Ffe as a5,Ife as a6,Ofe as a7,wo as a8,Vv as a9,ote as aA,LX as aB,Afe as aC,mg as aD,vp as aE,_M as aF,gc as aG,ph as aH,ste as aI,ate as aJ,Xi as aK,hd as aL,fJ as aM,SM as aN,mM as aO,xK as aP,xp as aQ,yK as aR,hh as aS,rl as aT,oJ as aU,t4 as aV,jl as aW,bK as aX,s2 as aY,mK as aZ,kK as a_,Pfe as aa,Bfe as ab,Ufe as ac,qfe as ad,zfe as ae,Dte as af,DD as ag,e0e as ah,iZ as ai,Br as aj,Es as ak,n2 as al,aL as am,Ll as an,MM as ao,Je as ap,Ki as aq,Cre as ar,Jfe as as,t0e as at,Zfe as au,Ie as av,Kfe as aw,sre as ax,tre as ay,ere as az,WV as b,hJ as b0,OJ as b1,EK as b2,NJ as b3,i2 as b4,R4 as b5,ze as b6,dM as b7,In as b8,KY as b9,Pv as ba,V3 as bb,ch as bc,G3 as bd,Rfe as be,MU as bf,RJ as bg,EJ as bh,BJ as bi,hg as bj,pK as bk,a2 as bl,kM as bm,zJ as bn,Nc as bo,bJ as bp,Yre as bq,dh as br,bp as bs,Ts as bt,Q5 as bu,l2 as bv,yM as bw,N1 as bx,Ot as by,Dt as c,et as d,N3 as e,Rr as f,XV as g,Da as h,xi as i,uZ as j,Tc as k,we as l,DM as m,Lfe as n,n0e as o,QV as p,ZV as q,r0e as r,GV as s,nZ as t,ji as u,Zte as v,ZJ as w,Vfe as x,VV as y,Dfe as z};
517
- //# sourceMappingURL=index.js.map